mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 22:35:15 +00:00
ofp-actions: Return action size
Modify ofpacts_put_openflow11_actions() to return the length of actions appended. This will be used when encoding Packet Out messages for Open Flow 1.1 and 1.2. The motivation for this is to avoid open coding the size calculation which may end up being needed elsewhere too. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -1384,15 +1384,18 @@ ofpact_to_openflow11(const struct ofpact *a, struct ofpbuf *out)
|
||||
/* Converts the ofpacts in 'ofpacts' (terminated by OFPACT_END) into OpenFlow
|
||||
* 1.1 actions in 'openflow', appending the actions to any existing data in
|
||||
* 'openflow'. */
|
||||
void
|
||||
size_t
|
||||
ofpacts_put_openflow11_actions(const struct ofpact ofpacts[],
|
||||
size_t ofpacts_len, struct ofpbuf *openflow)
|
||||
{
|
||||
const struct ofpact *a;
|
||||
size_t start_size = openflow->size;
|
||||
|
||||
OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) {
|
||||
ofpact_to_openflow11(a, openflow);
|
||||
}
|
||||
|
||||
return openflow->size - start_size;
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user