+
+ if (ndo->ndo_eflag)
+ ND_PRINT((ndo, ", proto %s (0x%04x)",
+ tok2str(ethertype_values,"unknown",prot),
+ prot));
+
+ ND_PRINT((ndo, ", length %u",length));
+
+ if (ndo->ndo_vflag < 1)
+ ND_PRINT((ndo, ": ")); /* put in a colon as protocol demarc */
+ else
+ ND_PRINT((ndo, "\n\t")); /* if verbose go multiline */
+
+ switch (prot) {
+ case ETHERTYPE_IP:
+ ip_print(ndo, bp, len);
+ break;
+ case ETHERTYPE_IPV6:
+ ip6_print(ndo, bp, len);
+ break;
+ case ETHERTYPE_MPLS:
+ mpls_print(ndo, bp, len);
+ break;
+ case ETHERTYPE_IPX:
+ ipx_print(ndo, bp, len);
+ break;
+ case ETHERTYPE_ATALK:
+ atalk_print(ndo, bp, len);
+ break;
+ case ETHERTYPE_GRE_ISO:
+ isoclns_print(ndo, bp, len);
+ break;
+ case ETHERTYPE_TEB:
+ ether_print(ndo, bp, len, ndo->ndo_snapend - bp, NULL, NULL);
+ break;
+ default:
+ ND_PRINT((ndo, "gre-proto-0x%x", prot));
+ }
+ return;
+
+trunc:
+ ND_PRINT((ndo, "%s", tstr));
+}
+
+static void
+gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length)
+{
+ u_int len = length;
+ uint16_t flags, prot;
+
+ /* 16 bits ND_TCHECKed in gre_print() */
+ flags = EXTRACT_BE_U_2(bp);
+ len -= 2;
+ bp += 2;
+
+ if (ndo->ndo_vflag)
+ ND_PRINT((ndo, ", Flags [%s]",
+ bittok2str(gre_flag_values,"none",flags)));
+
+ ND_TCHECK_2(bp);
+ if (len < 2)
+ goto trunc;
+ prot = EXTRACT_BE_U_2(bp);
+ len -= 2;
+ bp += 2;
+
+
+ if (flags & GRE_KP) {
+ uint32_t k;
+
+ ND_TCHECK_4(bp);
+ if (len < 4)
+ goto trunc;
+ k = EXTRACT_BE_U_4(bp);
+ ND_PRINT((ndo, ", call %d", k & 0xffff));
+ len -= 4;
+ bp += 4;
+ }
+