mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
userspace: Introduce packet_type in OF 1.5 packet-out
Introducing packet_type in OF 1.5 packet-out. Partly based on Jean Tourrilhes's work. Add test cases for OF1.5 packet-out Add negative test case for OF1.5 packet-out Signed-off-by: Jean Tourrilhes <jt@labs.hpe.com> Signed-off-by: Zoltan Balogh <zoltan.balogh@ericsson.com> Co-authored-by: Jan Scheurich <jan.scheurich@ericsson.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -667,6 +667,19 @@ parse_ofp_packet_out_str__(struct ofputil_packet_out *po, char *string,
|
||||
goto out;
|
||||
}
|
||||
match_set_in_port(&po->flow_metadata, in_port);
|
||||
} else if (!strcmp(name, "packet_type")) {
|
||||
char *ns = value;
|
||||
char *ns_type = strstr(value, ",");
|
||||
if (ns_type) {
|
||||
ovs_be32 packet_type;
|
||||
*ns_type = '\0';
|
||||
packet_type = PACKET_TYPE_BE(strtoul(ns, NULL, 0),
|
||||
strtoul(++ns_type, NULL, 0));
|
||||
match_set_packet_type(&po->flow_metadata, packet_type);
|
||||
} else {
|
||||
error = xasprintf("%s(%s) can't be interpreted", name, value);
|
||||
goto out;
|
||||
}
|
||||
} else if (!strcmp(name, "packet")) {
|
||||
const char *error_msg = eth_from_hex(value, &packet);
|
||||
if (error_msg) {
|
||||
|
Reference in New Issue
Block a user