X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fofp-parse.c;h=24f6876bc8ab5203f8f54a1c83ee6cf82c44fc29;hb=0e553d9c1063be047824c6f1afce9ffc6db6c671;hp=f96f8170a0c377813b09809a493503f893b2d9b2;hpb=12113c394a9873aa4f54da750d9fb4ff89ccb254;p=sliver-openvswitch.git diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index f96f8170a..24f6876bc 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -249,6 +249,24 @@ parse_note(struct ofpbuf *b, const char *arg) nan->len = htons(b->size - start_ofs); } +static void +parse_fin_timeout(struct ofpbuf *b, char *arg) +{ + struct nx_action_fin_timeout *naft; + char *key, *value; + + naft = ofputil_put_NXAST_FIN_TIMEOUT(b); + while (ofputil_parse_key_value(&arg, &key, &value)) { + if (!strcmp(key, "idle_timeout")) { + naft->fin_idle_timeout = htons(str_to_u16(value, key)); + } else if (!strcmp(key, "hard_timeout")) { + naft->fin_hard_timeout = htons(str_to_u16(value, key)); + } else { + ovs_fatal(0, "invalid key '%s' in 'fin_timeout' argument", key); + } + } +} + static void parse_named_action(enum ofputil_action_code code, const struct flow *flow, struct ofpbuf *b, char *arg) @@ -367,6 +385,10 @@ parse_named_action(enum ofputil_action_code code, const struct flow *flow, case OFPUTIL_NXAST_DEC_TTL: ofputil_put_NXAST_DEC_TTL(b); break; + + case OFPUTIL_NXAST_FIN_TIMEOUT: + parse_fin_timeout(b, arg); + break; } }