Skip to content

Commit

Permalink
ofp-util: Encoding and decoding of (draft) OpenFlow 1.5 group messages.
Browse files Browse the repository at this point in the history
This provides the bulk of the ofproto side of support for
OpenFlow 1.5 group messages. It provides for encoding and decoding
of updated group mod and group desc reply messages. This includes
a new bucket format and their properties.

Open Flow 1.5 Groups also have properties but as no non-experimenter
properties are defined this patch does not provide parsing or encoding
of group properties.

ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <[email protected]>
[[email protected] fixed minor bugs and style issues]
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
shorman-netronome authored and blp committed Nov 11, 2014
1 parent a80164c commit 18ac06d
Show file tree
Hide file tree
Showing 5 changed files with 470 additions and 9 deletions.
6 changes: 4 additions & 2 deletions lib/id-pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ id_pool_create(uint32_t base, uint32_t n_ids)
void
id_pool_destroy(struct id_pool *pool)
{
id_pool_uninit(pool);
free(pool);
if (pool) {
id_pool_uninit(pool);
free(pool);
}
}

static void
Expand Down
7 changes: 5 additions & 2 deletions lib/ofp-msgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,10 @@ enum ofpraw {
/* NXT 1.0+ (13): struct nx_flow_mod, uint8_t[8][]. */
OFPRAW_NXT_FLOW_MOD,

/* OFPT 1.1+ (15): struct ofp11_group_mod, uint8_t[8][]. */
/* OFPT 1.1-1.4 (15): struct ofp11_group_mod, uint8_t[8][]. */
OFPRAW_OFPT11_GROUP_MOD,
/* OFPT 1.5+ (15): struct ofp15_group_mod, uint8_t[8][]. */
OFPRAW_OFPT15_GROUP_MOD,

/* OFPT 1.0 (15): struct ofp10_port_mod. */
OFPRAW_OFPT10_PORT_MOD,
Expand Down Expand Up @@ -495,7 +497,8 @@ enum ofptype {
OFPTYPE_FLOW_MOD, /* OFPRAW_OFPT10_FLOW_MOD.
* OFPRAW_OFPT11_FLOW_MOD.
* OFPRAW_NXT_FLOW_MOD. */
OFPTYPE_GROUP_MOD, /* OFPRAW_OFPT11_GROUP_MOD. */
OFPTYPE_GROUP_MOD, /* OFPRAW_OFPT11_GROUP_MOD.
* OFPRAW_OFPT15_GROUP_MOD. */
OFPTYPE_PORT_MOD, /* OFPRAW_OFPT10_PORT_MOD.
* OFPRAW_OFPT11_PORT_MOD.
* OFPRAW_OFPT14_PORT_MOD. */
Expand Down
2 changes: 2 additions & 0 deletions lib/ofp-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,7 @@ parse_bucket_str(struct ofputil_bucket *bucket, char *str_,
char *error;

bucket->weight = 1;
bucket->bucket_id = OFPG15_BUCKET_ALL;
bucket->watch_port = OFPP_ANY;
bucket->watch_group = OFPG11_ANY;

Expand Down Expand Up @@ -1187,6 +1188,7 @@ parse_ofp_group_mod_str__(struct ofputil_group_mod *gm, uint16_t command,
memset(gm, 0, sizeof *gm);
gm->command = command;
gm->group_id = OFPG_ANY;
gm->command_bucket_id = OFPG15_BUCKET_ALL;
list_init(&gm->buckets);
if (command == OFPGC11_DELETE && string[0] == '\0') {
gm->group_id = OFPG_ALL;
Expand Down
Loading

0 comments on commit 18ac06d

Please sign in to comment.