Lines Matching +full:protocol +full:- +full:id
27 /* \summary: Cisco Discovery Protocol (CDP) printer */
31 #include "netdissect-stdinc.h"
141 * appear to be a 1-byte application type followed by a
142 * 2-byte VLAN ID; the 2 bytes of value are unknown
144 * is not a valid VLAN ID, as VLAN IDs are 12 bits).
179 (void)nd_printn(ndo, cp + 1, len - 1, NULL);
193 [ T_DEV_ID ] = { "Device-ID", cdp_print_string, -1, -1 },
194 [ 0x02 ] = { "Address", cdp_print_addr, -1, -1 },
195 [ 0x03 ] = { "Port-ID", cdp_print_string, -1, -1 },
197 [ 0x05 ] = { "Version String", cdp_print_version, -1, -1 },
198 [ 0x06 ] = { "Platform", cdp_print_string, -1, -1 },
199 [ 0x07 ] = { "Prefixes", cdp_print_prefixes, -1, -1 },
201 [ 0x08 ] = { "Protocol-Hello option", NULL, -1, -1 },
203 [ 0x09 ] = { "VTP Management Domain", cdp_print_string, -1, -1 },
205 [ 0x0a ] = { "Native VLAN ID", cdp_print_uint16, 2, 2 },
211 [ 0x0e ] = { "ATA-186 VoIP VLAN assignment", cdp_print_ata186, 3, 3 },
213 [ 0x0f ] = { "ATA-186 VoIP VLAN request", cdp_print_ata186, 2, 3 },
223 [ 0x14 ] = { "System Name", cdp_print_string, -1, -1 },
225 [ 0x15 ] = { "System Object ID (not decoded)", NULL, -1, -1 },
226 [ 0x16 ] = { "Management Addresses", cdp_print_addr, 4, -1 },
228 [ 0x17 ] = { "Physical Location", cdp_print_phys_loc, 1, -1 },
238 ndo->ndo_protocol = "cdp";
248 if (ndo->ndo_vflag)
252 length -= CDP_HEADER_LEN;
268 name = (info && info->name) ? info->name : "unknown field type";
270 if (ndo->ndo_vflag)
283 length -= CDP_TLV_HEADER_LEN;
284 len -= CDP_TLV_HEADER_LEN;
286 /* In non-verbose mode just print Device-ID. */
287 if (!ndo->ndo_vflag && type == T_DEV_ID)
288 ND_PRINT(", Device-ID ");
289 else if (ndo->ndo_vflag)
294 if ((info->min_len > 0 && len < (unsigned)info->min_len) ||
295 (info->max_len > 0 && len > (unsigned)info->max_len))
297 else if (ndo->ndo_vflag || type == T_DEV_ID) {
298 if (info->printer)
299 info->printer(ndo, tptr, len);
310 if (ndo->ndo_vflag && !covered) {
315 length -= len;
317 if (ndo->ndo_vflag < 1)
327 * Protocol type values.
329 * PT_NLPID means that the protocol type field contains an OSI NLPID.
331 * PT_IEEE_802_2 means that the protocol type field contains an IEEE 802.2
332 * LLC header that specifies that the payload is for that protocol.
352 l -= 4;
361 pt = GET_U_1(p); /* type of "protocol" field */
362 pl = GET_U_1(p + 1); /* length of "protocol" field */
364 l -= 2;
370 /* Skip the protocol for now. */
376 * IPv4: protocol type = NLPID, protocol length = 1
377 * (1-byte NLPID), protocol = 0xcc (NLPID for IPv4),
381 l -= pl + 2;
389 l -= al;
393 * IPv6: protocol type = IEEE 802.2 header,
394 * protocol length = 8 (size of LLC+SNAP header),
395 * protocol = LLC+SNAP header with the IPv6
399 l -= pl + 2;
407 l -= al;
416 l--;
417 pl--;
421 l -= 2;
430 l--;
431 al--;
434 num--;
461 l -= 5;