OFPRAW_OFPT11_PACKET_IN,
/* OFPT 1.2 (10): struct ofp12_packet_in, uint8_t[]. */
OFPRAW_OFPT12_PACKET_IN,
- /* OFPT 1.3 (10): struct ofp13_packet_in, uint8_t[]. */
+ /* OFPT 1.3+ (10): struct ofp13_packet_in, uint8_t[]. */
OFPRAW_OFPT13_PACKET_IN,
/* NXT 1.0+ (17): struct nx_packet_in, uint8_t[]. */
OFPRAW_NXT_PACKET_IN,
packet_in_size = sizeof (struct ofp12_packet_in);
} else {
packet_in_raw = OFPRAW_OFPT13_PACKET_IN;
- packet_in_version = OFP13_VERSION;
+ packet_in_version = ofputil_protocol_to_ofp_version(protocol);
packet_in_size = sizeof (struct ofp13_packet_in);
}
opi->pi.total_len = htons(pin->total_len);
opi->pi.reason = pin->reason;
opi->pi.table_id = pin->table_id;
- if (protocol == OFPUTIL_P_OF13_OXM) {
+ if (protocol != OFPUTIL_P_OF12_OXM) {
opi->cookie = pin->cookie;
}
])
AT_CLEANUP
+AT_SETUP([OFPT_PACKET_IN - OF1.4])
+AT_KEYWORDS([ofp-print])
+AT_CHECK([ovs-ofctl ofp-print "\
+05 0a 00 54 00 00 00 00 ff ff ff 00 00 2a 00 00 \
+01 02 03 04 05 06 07 08 00 01 00 0c 80 00 00 04 \
+ff ff ff fe 00 00 00 00 00 00 ff ff ff ff ff ff \
+00 23 20 83 c1 5f 80 35 00 01 08 00 06 04 00 03 \
+00 23 20 83 c1 5f 00 00 00 00 00 23 20 83 c1 5f \
+00 00 00 00 \
+"], [0], [dnl
+OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x102030405060708 total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00
+rarp,in_port=0,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=3,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f
+])
+AT_CLEANUP
+
+AT_SETUP([OFPT_PACKET_IN - OF1.5])
+AT_KEYWORDS([ofp-print])
+AT_CHECK([ovs-ofctl ofp-print "\
+06 0a 00 54 00 00 00 00 ff ff ff 00 00 2a 00 00 \
+01 02 03 04 05 06 07 08 00 01 00 0c 80 00 00 04 \
+ff ff ff fe 00 00 00 00 00 00 ff ff ff ff ff ff \
+00 23 20 83 c1 5f 80 35 00 01 08 00 06 04 00 03 \
+00 23 20 83 c1 5f 00 00 00 00 00 23 20 83 c1 5f \
+00 00 00 00 \
+"], [0], [dnl
+OFPT_PACKET_IN (OF1.5) (xid=0x0): cookie=0x102030405060708 total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00
+rarp,in_port=0,vlan_tci=0x0000,dl_src=00:23:20:83:c1:5f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=3,arp_sha=00:23:20:83:c1:5f,arp_tha=00:23:20:83:c1:5f
+])
+AT_CLEANUP
+
AT_SETUP([OFPT_PACKET_IN - OF1.3, with hex output of packet data])
AT_KEYWORDS([ofp-print])
AT_CHECK([ovs-ofctl ofp-print "\