+/* [OF13] Section 7.2.1 */
+static void
+of13_port_print(netdissect_options *ndo,
+ const u_char *cp)
+{
+ /* port_no */
+ ND_PRINT("\n\t port_no %s",
+ tok2str(ofpp_str, "%u", GET_BE_U_4(cp)));
+ cp += 4;
+ /* pad */
+ cp += 4;
+ /* hw_addr */
+ ND_PRINT(", hw_addr %s", GET_ETHERADDR_STRING(cp));
+ cp += MAC_ADDR_LEN;
+ /* pad2 */
+ cp += 2;
+ /* name */
+ ND_PRINT(", name '");
+ (void)nd_print(ndo, cp, cp + OFP_MAX_PORT_NAME_LEN);
+ ND_PRINT("'");
+ cp += OFP_MAX_PORT_NAME_LEN;
+
+ if (ndo->ndo_vflag < 2) {
+ ND_TCHECK_LEN(cp, 32);
+ return;
+ }
+
+ /* config */
+ ND_PRINT("\n\t config 0x%08x", GET_BE_U_4(cp));
+ of_bitmap_print(ndo, ofppc_bm, GET_BE_U_4(cp), OFPPC_U);
+ cp += 4;
+ /* state */
+ ND_PRINT("\n\t state 0x%08x", GET_BE_U_4(cp));
+ of_bitmap_print(ndo, ofpps_bm, GET_BE_U_4(cp), OFPPS_U);;
+ cp += 4;
+ /* curr */
+ ND_PRINT("\n\t curr 0x%08x", GET_BE_U_4(cp));
+ of_bitmap_print(ndo, ofppf_bm, GET_BE_U_4(cp), OFPPF_U);
+ cp += 4;
+ /* advertised */
+ ND_PRINT("\n\t advertised 0x%08x", GET_BE_U_4(cp));
+ of_bitmap_print(ndo, ofppf_bm, GET_BE_U_4(cp), OFPPF_U);
+ cp += 4;
+ /* supported */
+ ND_PRINT("\n\t supported 0x%08x", GET_BE_U_4(cp));
+ of_bitmap_print(ndo, ofppf_bm, GET_BE_U_4(cp), OFPPF_U);
+ cp += 4;
+ /* peer */
+ ND_PRINT("\n\t peer 0x%08x", GET_BE_U_4(cp));
+ of_bitmap_print(ndo, ofppf_bm, GET_BE_U_4(cp), OFPPF_U);
+ cp += 4;
+ /* curr_speed */
+ ND_PRINT("\n\t curr_speed %ukbps", GET_BE_U_4(cp));
+ cp += 4;
+ /* max_speed */
+ ND_PRINT("\n\t max_speed %ukbps", GET_BE_U_4(cp));
+}
+