/* Parses 'arg' as a set of arguments to the "learn" action and appends a * matching OFPACT_LEARN action to 'ofpacts'. ovs-ofctl(8) describes the * format parsed. * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. * * If 'flow' is nonnull, then it should be the flow from a struct match that is * the matching rule for the learning action. This helps to better validate * the action's arguments. * * Modifies 'arg'. */ char * OVS_WARN_UNUSED_RESULT learn_parse(char *arg, struct ofpbuf *ofpacts) { char *orig = xstrdup(arg); char *error = learn_parse__(orig, arg, ofpacts); free(orig); return error; }
/* Parses 'arg' as a set of arguments to the "learn" action and appends a * matching OFPACT_LEARN action to 'ofpacts'. ovs-ofctl(8) describes the * format parsed. * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. * * If 'flow' is nonnull, then it should be the flow from a struct match that is * the matching rule for the learning action. This helps to better validate * the action's arguments. * * Modifies 'arg'. */ char * OVS_WARN_UNUSED_RESULT learn_parse(char *arg, const struct ofputil_port_map *port_map, struct ofpbuf *ofpacts) { char *orig = xstrdup(arg); char *error = learn_parse__(orig, arg, port_map, ofpacts); free(orig); return error; }