ofpbuf_use_const(&buf, data, len);
flow_extract(&buf, 0, 0, 0, &flow);
flow_format(&ds, &flow);
+
+ if (buf.l7) {
+ if (flow.nw_proto == IPPROTO_TCP) {
+ struct tcp_header *th = buf.l4;
+ ds_put_format(&ds, " tcp_csum:%"PRIx16,
+ ntohs(th->tcp_csum));
+ } else if (flow.nw_proto == IPPROTO_UDP) {
+ struct udp_header *uh = buf.l4;
+ ds_put_format(&ds, " udp_csum:%"PRIx16,
+ ntohs(uh->udp_csum));
+ }
+ }
+
ds_put_char(&ds, '\n');
return ds_cstr(&ds);
50 00 02 00 26 e8 00 00 00 00 00 00 00 00 \
"], [0], [dnl
OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=3 data_len=60 buffer=0x00000111
-priority:0,tunnel:0,in_port:0000,tci(0) mac(50:54:00:00:00:05->50:54:00:00:00:06) type:0800 proto:6 tos:0 ttl:64 ip(192.168.0.1->192.168.0.2) port(10031->0)
+priority:0,tunnel:0,in_port:0000,tci(0) mac(50:54:00:00:00:05->50:54:00:00:00:06) type:0800 proto:6 tos:0 ttl:64 ip(192.168.0.1->192.168.0.2) port(10031->0) tcp_csum:26e8
])
AT_CLEANUP