- if (etype <= ETHERMTU)
- ND_PRINT((ndo, "invalid ethertype %u", etype));
+ if (etype <= MAX_ETHERNET_LENGTH_VAL)
+ ND_PRINT("invalid ethertype %u", etype);
tok2str(ethertype_values,"Unknown", etype),
tok2str(ethertype_values,"Unknown", etype),
- if (etype <= ETHERMTU)
- ND_PRINT((ndo, "invalid ethertype %u", etype));
+ if (etype <= MAX_ETHERNET_LENGTH_VAL)
+ ND_PRINT("invalid ethertype %u", etype);
- ND_PRINT((ndo, "%s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", etype)));
+ ND_PRINT("%s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", etype));
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
symantec_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
{
u_int length = h->len;
u_int caplen = h->caplen;
symantec_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
{
u_int length = h->len;
u_int caplen = h->caplen;
- if (caplen < sizeof (struct symantec_header)) {
- ND_PRINT((ndo, "[|symantec]"));
- return caplen;
- }
+ ndo->ndo_protocol = "symantec";
+ ND_TCHECK_LEN(p, sizeof(struct symantec_header));
if (ndo->ndo_eflag)
symantec_hdr_print(ndo, p, length);
length -= sizeof (struct symantec_header);
caplen -= sizeof (struct symantec_header);
if (ndo->ndo_eflag)
symantec_hdr_print(ndo, p, length);
length -= sizeof (struct symantec_header);
caplen -= sizeof (struct symantec_header);
if (!ndo->ndo_suppress_default_print)
ND_DEFAULTPRINT(p, caplen);
if (!ndo->ndo_suppress_default_print)
ND_DEFAULTPRINT(p, caplen);
- } else if (ethertype_print(ndo, ether_type, p, length, caplen) == 0) {
+ } else if (ethertype_print(ndo, ether_type, p, length, caplen, NULL, NULL) == 0) {
if (!ndo->ndo_suppress_default_print)
ND_DEFAULTPRINT(p, caplen);
}
if (!ndo->ndo_suppress_default_print)
ND_DEFAULTPRINT(p, caplen);
}