+ case 0x01: /* Device-ID */
+ if (!ndo->ndo_vflag)
+ ND_PRINT(", Device-ID ");
+ ND_PRINT("'");
+ (void)nd_printn(ndo, tptr, len, NULL);
+ ND_PRINT("'");
+ break;
+ case 0x02: /* Address */
+ if (cdp_print_addr(ndo, tptr, len) < 0)
+ goto trunc;
+ break;
+ case 0x03: /* Port-ID */
+ ND_PRINT("'");
+ (void)nd_printn(ndo, tptr, len, NULL);
+ ND_PRINT("'");
+ break;
+ case 0x04: /* Capabilities */
+ if (len < 4)
+ goto trunc;
+ ND_PRINT("(0x%08x): %s",
+ EXTRACT_BE_U_4(tptr),
+ bittok2str(cdp_capability_values, "none", EXTRACT_BE_U_4(tptr)));
+ break;
+ case 0x05: /* Version */
+ ND_PRINT("\n\t ");
+ for (i=0;i<len;i++) {
+ j = EXTRACT_U_1(tptr + i);
+ if (j == '\n') /* lets rework the version string to
+ get a nice indentation */
+ ND_PRINT("\n\t ");
+ else
+ fn_print_char(ndo, j);
+ }
+ break;
+ case 0x06: /* Platform */
+ ND_PRINT("'");
+ (void)nd_printn(ndo, tptr, len, NULL);
+ ND_PRINT("'");
+ break;
+ case 0x07: /* Prefixes */
+ if (cdp_print_prefixes(ndo, tptr, len) < 0)
+ goto trunc;
+ break;
+ case 0x08: /* Protocol Hello Option - not documented */
+ break;
+ case 0x09: /* VTP Mgmt Domain - CDPv2 */
+ ND_PRINT("'");
+ (void)nd_printn(ndo, tptr, len, NULL);
+ ND_PRINT("'");
+ break;
+ case 0x0a: /* Native VLAN ID - CDPv2 */
+ if (len < 2)
+ goto trunc;
+ ND_PRINT("%u", EXTRACT_BE_U_2(tptr));
+ break;
+ case 0x0b: /* Duplex - CDPv2 */
+ if (len < 1)
+ goto trunc;
+ ND_PRINT("%s", EXTRACT_U_1(tptr) ? "full": "half");
+ break;
+
+ /* http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cata/186/2_12_m/english/release/notes/186rn21m.html
+ * plus more details from other sources
+ *
+ * There are apparently versions of the request with both
+ * 2 bytes and 3 bytes of value. The 3 bytes of value
+ * appear to be a 1-byte application type followed by a
+ * 2-byte VLAN ID; the 2 bytes of value are unknown
+ * (they're 0x20 0x00 in some captures I've seen; that
+ * is not a valid VLAN ID, as VLAN IDs are 12 bits).
+ *
+ * The replies all appear to be 3 bytes long.
+ */
+ case 0x0e: /* ATA-186 VoIP VLAN assignment - incomplete doc. */
+ if (len < 3)
+ goto trunc;
+ ND_PRINT("app %u, vlan %u", EXTRACT_U_1(tptr), EXTRACT_BE_U_2(tptr + 1));
+ break;
+ case 0x0f: /* ATA-186 VoIP VLAN request - incomplete doc. */
+ if (len < 2)
+ goto trunc;
+ if (len == 2)
+ ND_PRINT("unknown 0x%04x", EXTRACT_BE_U_2(tptr));
+ else
+ ND_PRINT("app %u, vlan %u", EXTRACT_U_1(tptr), EXTRACT_BE_U_2(tptr + 1));
+ break;
+ case 0x10: /* Power - not documented */
+ ND_PRINT("%1.2fW", cdp_get_number(tptr, len) / 1000.0);
+ break;
+ case 0x11: /* MTU - not documented */
+ if (len < 4)
+ goto trunc;
+ ND_PRINT("%u bytes", EXTRACT_BE_U_4(tptr));
+ break;
+ case 0x12: /* AVVID trust bitmap - not documented */
+ if (len < 1)
+ goto trunc;
+ ND_PRINT("0x%02x", EXTRACT_U_1(tptr));
+ break;
+ case 0x13: /* AVVID untrusted port CoS - not documented */
+ if (len < 1)
+ goto trunc;
+ ND_PRINT("0x%02x", EXTRACT_U_1(tptr));
+ break;
+ case 0x14: /* System Name - not documented */
+ ND_PRINT("'");
+ (void)nd_printn(ndo, tptr, len, NULL);
+ ND_PRINT("'");
+ break;
+ case 0x16: /* System Object ID - not documented */
+ if (cdp_print_addr(ndo, tptr, len) < 0)
+ goto trunc;
+ break;
+ case 0x17: /* Physical Location - not documented */
+ if (len < 1)
+ goto trunc;
+ ND_PRINT("0x%02x", EXTRACT_U_1(tptr));
+ if (len > 1) {
+ ND_PRINT("/");
+ (void)nd_printn(ndo, tptr + 1, len - 1, NULL);
+ }
+ break;
+ default:
+ print_unknown_data(ndo, tptr, "\n\t ", len);
+ break;
+ }
+ }
+ tptr = tptr+len;