aboutsummaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-04-05 12:37:52 -0700
committerEthan Jackson <ethan@nicira.com>2011-04-11 15:56:20 -0700
commit3b6a2571f07e153e850a9bf2044699d8d4434ef0 (patch)
treef7d918e850be52bafff360cceddcd683971ec8c1 /ofproto
parent141d9ce465b9722fb9321c3d102238dd33507d79 (diff)
autopath: Create the autopath action.
The newly created autopath action will be the way OpenFlow interacts with the existing bonding infrastructure.
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto.c14
-rw-r--r--ofproto/ofproto.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 18652771..0b85e618 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -24,6 +24,7 @@
#include <netinet/in.h>
#include <stdbool.h>
#include <stdlib.h>
+#include "autopath.h"
#include "byte-order.h"
#include "cfm.h"
#include "classifier.h"
@@ -2222,8 +2223,11 @@ xlate_nicira_action(struct action_xlate_ctx *ctx,
const struct nx_action_set_tunnel *nast;
const struct nx_action_set_queue *nasq;
const struct nx_action_multipath *nam;
+ const struct nx_action_autopath *naa;
enum nx_action_subtype subtype = ntohs(nah->subtype);
+ const struct ofhooks *ofhooks = ctx->ofproto->ofhooks;
struct xlate_reg_state state;
+ uint16_t autopath_port;
ovs_be64 tun_id;
assert(nah->vendor == htonl(NX_VENDOR_ID));
@@ -2285,6 +2289,15 @@ xlate_nicira_action(struct action_xlate_ctx *ctx,
multipath_execute(nam, &ctx->flow);
break;
+ case NXAST_AUTOPATH:
+ naa = (const struct nx_action_autopath *) nah;
+ autopath_port = (ofhooks->autopath_cb
+ ? ofhooks->autopath_cb(&ctx->flow, ntohl(naa->id),
+ &ctx->tags, ctx->ofproto->aux)
+ : OFPP_NONE);
+ autopath_execute(naa, &ctx->flow, autopath_port);
+ break;
+
/* If you add a new action here that modifies flow data, don't forget to
* update the flow key in ctx->flow at the same time. */
@@ -4415,5 +4428,6 @@ static const struct ofhooks default_ofhooks = {
default_normal_ofhook_cb,
NULL,
NULL,
+ NULL,
NULL
};
diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h
index 96f00988..9a56beec 100644
--- a/ofproto/ofproto.h
+++ b/ofproto/ofproto.h
@@ -161,6 +161,9 @@ struct ofhooks {
size_t actions_len,
uint64_t n_bytes, void *aux);
void (*account_checkpoint_cb)(void *aux);
+
+ uint16_t (*autopath_cb)(const struct flow *, uint32_t id,
+ tag_type *, void *aux);
};
void ofproto_revalidate(struct ofproto *, tag_type);
struct tag_set *ofproto_get_revalidate_set(struct ofproto *);