{ 0, NULL }
};
+#define OFPC_FLOW_STATS (1U <<0)
+#define OFPC_TABLE_STATS (1U <<1)
+#define OFPC_PORT_STATS (1U <<2)
+#define OFPC_GROUP_STATS (1U <<3)
+#define OFPC_IP_REASM (1U <<5)
+#define OFPC_QUEUE_STATS (1U <<6)
+#define OFPC_PORT_BLOCKED (1U <<8)
+static const struct tok ofp_capabilities_bm[] = {
+ { OFPC_FLOW_STATS, "FLOW_STATS" },
+ { OFPC_TABLE_STATS, "TABLE_STATS" },
+ { OFPC_PORT_STATS, "PORT_STATS" },
+ { OFPC_GROUP_STATS, "GROUP_STATS" },
+ { OFPC_IP_REASM, "IP_REASM" },
+ { OFPC_QUEUE_STATS, "QUEUE_STATS" },
+ { OFPC_PORT_BLOCKED, "PORT_BLOCKED" },
+ { 0, NULL }
+};
+#define OFPCAP_U (~(OFPC_FLOW_STATS | OFPC_TABLE_STATS | OFPC_PORT_STATS | \
+ OFPC_GROUP_STATS | OFPC_IP_REASM | OFPC_QUEUE_STATS | \
+ OFPC_PORT_BLOCKED))
+
#define OFPHET_VERSIONBITMAP 1U
static const struct tok ofphet_str[] = {
{ OFPHET_VERSIONBITMAP, "VERSIONBITMAP" },
/* lengths (fixed or minimal) of particular protocol structures */
#define OF_HELLO_ELEM_MINSIZE 4U
#define OF_ERROR_MSG_MINLEN 12U
+#define OF_FEATURES_REPLY_FIXLEN 32U
#define OF_QUEUE_GET_CONFIG_REQUEST_FIXLEN 16U
/* [OF13] Section A.1 */
return tok2str(ofpt_str, "invalid (0x%02x)", type);
}
+/* [OF13] Section 7.3.1 */
+static void
+of13_features_reply_print(netdissect_options *ndo,
+ const u_char *cp, u_int len)
+{
+ /* datapath_id */
+ ND_PRINT("\n\t dpid 0x%016" PRIx64, GET_BE_U_8(cp));
+ OF_FWD(8);
+ /* n_buffers */
+ ND_PRINT(", n_buffers %u", GET_BE_U_4(cp));
+ OF_FWD(4);
+ /* n_tables */
+ ND_PRINT(", n_tables %u", GET_U_1(cp));
+ OF_FWD(1);
+ /* auxiliary_id */
+ ND_PRINT(", auxiliary_id %u", GET_U_1(cp));
+ OF_FWD(1);
+ /* pad */
+ OF_FWD(2);
+ /* capabilities */
+ ND_PRINT("\n\t capabilities 0x%08x", GET_BE_U_4(cp));
+ of_bitmap_print(ndo, ofp_capabilities_bm, GET_BE_U_4(cp), OFPCAP_U);
+ OF_FWD(4);
+ /* reserved */
+ ND_TCHECK_4(cp);
+}
+
/* [OF13] Section 7.5.1 */
static void
of13_hello_elements_print(netdissect_options *ndo,
return;
/* OpenFlow header and fixed-size message body. */
+ case OFPT_FEATURES_REPLY:
+ if (len != OF_FEATURES_REPLY_FIXLEN - OF_HEADER_FIXLEN)
+ goto invalid;
+ if (ndo->ndo_vflag < 1)
+ break;
+ of13_features_reply_print(ndo, cp, len);
+ return;
case OFPT_QUEUE_GET_CONFIG_REQUEST: /* [OF13] Section A.3.6 */
if (len != OF_QUEUE_GET_CONFIG_REQUEST_FIXLEN - OF_HEADER_FIXLEN)
goto invalid;
51 15:47:18.962238 IP (tos 0x0, ttl 64, id 51478, offset 0, flags [DF], proto TCP (6), length 84)
127.0.0.1.58445 > 127.0.0.1.6633: Flags [P.], cksum 0xfe48 (incorrect -> 0xbbc3), seq 698:730, ack 657, win 86, options [nop,nop,TS val 267876 ecr 267876], length 32: OpenFlow
version 1.3, type FEATURES_REPLY, length 32, xid 0x0000008e
+ dpid 0x000026a2b46fd9ba, n_buffers 256, n_tables 64, auxiliary_id 0
+ capabilities 0x0000004f (FLOW_STATS, TABLE_STATS, PORT_STATS, GROUP_STATS, QUEUE_STATS)
52 15:47:18.962333 IP (tos 0x0, ttl 64, id 14609, offset 0, flags [DF], proto TCP (6), length 52)
127.0.0.1.6633 > 127.0.0.1.58445: Flags [.], cksum 0xfe28 (incorrect -> 0xb693), ack 730, win 94, options [nop,nop,TS val 267876 ecr 267876], length 0
53 16:32:34.623939 IP (tos 0x0, ttl 64, id 44797, offset 0, flags [DF], proto TCP (6), length 60)
51 15:47:18.962238 IP (tos 0x0, ttl 64, id 51478, offset 0, flags [DF], proto TCP (6), length 84)
127.0.0.1.58445 > 127.0.0.1.6633: Flags [P.], cksum 0xfe48 (incorrect -> 0xbbc3), seq 698:730, ack 657, win 86, options [nop,nop,TS val 267876 ecr 267876], length 32: OpenFlow
version 1.3, type FEATURES_REPLY, length 32, xid 0x0000008e
+ dpid 0x000026a2b46fd9ba, n_buffers 256, n_tables 64, auxiliary_id 0
+ capabilities 0x0000004f (FLOW_STATS, TABLE_STATS, PORT_STATS, GROUP_STATS, QUEUE_STATS)
52 15:47:18.962333 IP (tos 0x0, ttl 64, id 14609, offset 0, flags [DF], proto TCP (6), length 52)
127.0.0.1.6633 > 127.0.0.1.58445: Flags [.], cksum 0xfe28 (incorrect -> 0xb693), seq 657, ack 730, win 94, options [nop,nop,TS val 267876 ecr 267876], length 0
53 16:32:34.623939 IP (tos 0x0, ttl 64, id 44797, offset 0, flags [DF], proto TCP (6), length 60)