- proto = EXTRACT_16BITS(&p[2]);
- if (eflag) {
- switch (p[0]) {
- case CHDLC_UNICAST:
- printf("unicast ");
- break;
- case CHDLC_BCAST:
- printf("bcast ");
- break;
- default:
- printf("0x%02x ", p[0]);
- break;
- }
- printf("%d %04x: ", length, proto);
+ ndo->ndo_protocol = "chdlc";
+ ND_ICHECK_U(length, <, CHDLC_HDRLEN);
+ proto = GET_BE_U_2(p + 2);
+ if (ndo->ndo_eflag) {
+ ND_PRINT("%s, ethertype %s (0x%04x), length %u: ",
+ tok2str(chdlc_cast_values, "0x%02x", GET_U_1(p)),
+ tok2str(ethertype_values, "Unknown", proto),
+ proto,
+ length);