X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fofp-parse.c;h=f96f8170a0c377813b09809a493503f893b2d9b2;hb=0c3d5fc89a341d31774f24ddaf7360a5ba4a641f;hp=d5502fabb32622e4f335ea3687571c80eeb8cb6d;hpb=a993007bee69e581b0b0a5c6abb2ad0e6ef24881;p=sliver-openvswitch.git diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index d5502fabb..f96f8170a 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -625,6 +625,19 @@ parse_ofp_str(struct ofputil_flow_mod *fm, int command, const char *str_, free(string); } +/* Parses 's' as a set of OpenFlow actions and appends the actions to + * 'actions'. + * + * Prints an error on stderr and aborts the program if 's' syntax is + * invalid. */ +void +parse_ofp_actions(const char *s_, struct ofpbuf *actions) +{ + char *s = xstrdup(s_); + str_to_action(NULL, s, actions); + free(s); +} + /* Parses 'string' as an OFPT_FLOW_MOD or NXT_FLOW_MOD with command 'command' * (one of OFPFC_*) and appends the parsed OpenFlow message to 'packets'. * '*cur_format' should initially contain the flow format currently configured