1996-08-19 20:34:12 +00:00
|
|
|
/*
|
2002-06-21 00:49:02 +00:00
|
|
|
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000
|
1996-08-19 20:34:12 +00:00
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that: (1) source code distributions
|
|
|
|
* retain the above copyright notice and this paragraph in its entirety, (2)
|
|
|
|
* distributions including binary code include the above copyright notice and
|
|
|
|
* this paragraph in its entirety in the documentation or other materials
|
|
|
|
* provided with the distribution, and (3) all advertising materials mentioning
|
|
|
|
* features or use of this software display the following acknowledgement:
|
|
|
|
* ``This product includes software developed by the University of California,
|
|
|
|
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
|
|
|
* the University nor the names of its contributors may be used to endorse
|
|
|
|
* or promote products derived from this software without specific prior
|
|
|
|
* written permission.
|
|
|
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
|
|
|
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
1999-11-14 11:28:11 +00:00
|
|
|
*
|
|
|
|
* $FreeBSD$
|
1996-08-19 20:34:12 +00:00
|
|
|
*/
|
|
|
|
#ifndef lint
|
2004-03-31 14:57:24 +00:00
|
|
|
static const char rcsid[] _U_ =
|
2010-10-28 16:23:25 +00:00
|
|
|
"@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.106 2008-02-06 10:47:53 guy Exp $ (LBL)";
|
2000-01-30 01:05:24 +00:00
|
|
|
#endif
|
|
|
|
|
2012-05-14 08:01:48 +00:00
|
|
|
#define NETDISSECT_REWORKED
|
2000-01-30 01:05:24 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
1996-08-19 20:34:12 +00:00
|
|
|
#endif
|
|
|
|
|
2004-03-31 14:57:24 +00:00
|
|
|
#include <tcpdump-stdinc.h>
|
1996-08-19 20:34:12 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <pcap.h>
|
|
|
|
|
|
|
|
#include "interface.h"
|
2010-10-28 16:23:25 +00:00
|
|
|
#include "extract.h"
|
1996-08-19 20:34:12 +00:00
|
|
|
#include "addrtoname.h"
|
|
|
|
#include "ethertype.h"
|
2001-04-03 07:50:46 +00:00
|
|
|
#include "ether.h"
|
1996-08-19 20:34:12 +00:00
|
|
|
|
2004-03-31 14:57:24 +00:00
|
|
|
const struct tok ethertype_values[] = {
|
|
|
|
{ ETHERTYPE_IP, "IPv4" },
|
|
|
|
{ ETHERTYPE_MPLS, "MPLS unicast" },
|
|
|
|
{ ETHERTYPE_MPLS_MULTI, "MPLS multicast" },
|
|
|
|
{ ETHERTYPE_IPV6, "IPv6" },
|
|
|
|
{ ETHERTYPE_8021Q, "802.1Q" },
|
2012-05-14 08:01:48 +00:00
|
|
|
{ ETHERTYPE_8021Q9100, "802.1Q-9100" },
|
|
|
|
{ ETHERTYPE_8021QinQ, "802.1Q-QinQ" },
|
|
|
|
{ ETHERTYPE_8021Q9200, "802.1Q-9200" },
|
2004-03-31 14:57:24 +00:00
|
|
|
{ ETHERTYPE_VMAN, "VMAN" },
|
|
|
|
{ ETHERTYPE_PUP, "PUP" },
|
|
|
|
{ ETHERTYPE_ARP, "ARP"},
|
2007-10-16 02:31:48 +00:00
|
|
|
{ ETHERTYPE_REVARP, "Reverse ARP"},
|
2004-03-31 14:57:24 +00:00
|
|
|
{ ETHERTYPE_NS, "NS" },
|
|
|
|
{ ETHERTYPE_SPRITE, "Sprite" },
|
|
|
|
{ ETHERTYPE_TRAIL, "Trail" },
|
|
|
|
{ ETHERTYPE_MOPDL, "MOP DL" },
|
|
|
|
{ ETHERTYPE_MOPRC, "MOP RC" },
|
|
|
|
{ ETHERTYPE_DN, "DN" },
|
|
|
|
{ ETHERTYPE_LAT, "LAT" },
|
|
|
|
{ ETHERTYPE_SCA, "SCA" },
|
2010-10-28 16:23:25 +00:00
|
|
|
{ ETHERTYPE_TEB, "TEB" },
|
2004-03-31 14:57:24 +00:00
|
|
|
{ ETHERTYPE_LANBRIDGE, "Lanbridge" },
|
|
|
|
{ ETHERTYPE_DECDNS, "DEC DNS" },
|
|
|
|
{ ETHERTYPE_DECDTS, "DEC DTS" },
|
|
|
|
{ ETHERTYPE_VEXP, "VEXP" },
|
|
|
|
{ ETHERTYPE_VPROD, "VPROD" },
|
|
|
|
{ ETHERTYPE_ATALK, "Appletalk" },
|
|
|
|
{ ETHERTYPE_AARP, "Appletalk ARP" },
|
|
|
|
{ ETHERTYPE_IPX, "IPX" },
|
|
|
|
{ ETHERTYPE_PPP, "PPP" },
|
2009-03-21 16:23:46 +00:00
|
|
|
{ ETHERTYPE_MPCP, "MPCP" },
|
2006-09-04 20:25:04 +00:00
|
|
|
{ ETHERTYPE_SLOW, "Slow Protocols" },
|
2004-03-31 14:57:24 +00:00
|
|
|
{ ETHERTYPE_PPPOED, "PPPoE D" },
|
|
|
|
{ ETHERTYPE_PPPOES, "PPPoE S" },
|
2005-05-29 19:09:28 +00:00
|
|
|
{ ETHERTYPE_EAPOL, "EAPOL" },
|
2009-03-21 16:23:46 +00:00
|
|
|
{ ETHERTYPE_RRCP, "RRCP" },
|
2013-05-30 06:46:26 +00:00
|
|
|
{ ETHERTYPE_MS_NLB_HB, "MS NLB heartbeat" },
|
2005-05-29 19:09:28 +00:00
|
|
|
{ ETHERTYPE_JUMBO, "Jumbo" },
|
2004-03-31 14:57:24 +00:00
|
|
|
{ ETHERTYPE_LOOPBACK, "Loopback" },
|
2005-05-29 19:09:28 +00:00
|
|
|
{ ETHERTYPE_ISO, "OSI" },
|
|
|
|
{ ETHERTYPE_GRE_ISO, "GRE-OSI" },
|
2009-03-21 16:23:46 +00:00
|
|
|
{ ETHERTYPE_CFM_OLD, "CFM (old)" },
|
|
|
|
{ ETHERTYPE_CFM, "CFM" },
|
|
|
|
{ ETHERTYPE_LLDP, "LLDP" },
|
2012-10-04 22:40:22 +00:00
|
|
|
{ ETHERTYPE_TIPC, "TIPC"},
|
2004-03-31 14:57:24 +00:00
|
|
|
{ 0, NULL}
|
|
|
|
};
|
|
|
|
|
1996-08-19 20:34:12 +00:00
|
|
|
static inline void
|
2012-05-14 08:01:48 +00:00
|
|
|
ether_hdr_print(netdissect_options *ndo,
|
|
|
|
const u_char *bp, u_int length)
|
1996-08-19 20:34:12 +00:00
|
|
|
{
|
|
|
|
register const struct ether_header *ep;
|
2010-10-28 16:23:25 +00:00
|
|
|
u_int16_t ether_type;
|
|
|
|
|
1996-08-19 20:34:12 +00:00
|
|
|
ep = (const struct ether_header *)bp;
|
2004-03-31 14:57:24 +00:00
|
|
|
|
2012-05-14 08:01:48 +00:00
|
|
|
(void)ND_PRINT((ndo, "%s > %s",
|
2004-03-31 14:57:24 +00:00
|
|
|
etheraddr_string(ESRC(ep)),
|
2012-05-14 08:01:48 +00:00
|
|
|
etheraddr_string(EDST(ep))));
|
2004-03-31 14:57:24 +00:00
|
|
|
|
2010-10-28 16:23:25 +00:00
|
|
|
ether_type = EXTRACT_16BITS(&ep->ether_type);
|
2012-05-14 08:01:48 +00:00
|
|
|
if (!ndo->ndo_qflag) {
|
2010-10-28 16:23:25 +00:00
|
|
|
if (ether_type <= ETHERMTU)
|
2012-05-14 08:01:48 +00:00
|
|
|
(void)ND_PRINT((ndo, ", 802.3"));
|
2004-03-31 14:57:24 +00:00
|
|
|
else
|
2012-05-14 08:01:48 +00:00
|
|
|
(void)ND_PRINT((ndo, ", ethertype %s (0x%04x)",
|
2010-10-28 16:23:25 +00:00
|
|
|
tok2str(ethertype_values,"Unknown", ether_type),
|
2012-05-14 08:01:48 +00:00
|
|
|
ether_type));
|
2004-03-31 14:57:24 +00:00
|
|
|
} else {
|
2010-10-28 16:23:25 +00:00
|
|
|
if (ether_type <= ETHERMTU)
|
2012-05-14 08:01:48 +00:00
|
|
|
(void)ND_PRINT((ndo, ", 802.3"));
|
2004-03-31 14:57:24 +00:00
|
|
|
else
|
2012-05-14 08:01:48 +00:00
|
|
|
(void)ND_PRINT((ndo, ", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", ether_type)));
|
2004-03-31 14:57:24 +00:00
|
|
|
}
|
|
|
|
|
2012-05-14 08:01:48 +00:00
|
|
|
(void)ND_PRINT((ndo, ", length %u: ", length));
|
1996-08-19 20:34:12 +00:00
|
|
|
}
|
|
|
|
|
2010-10-28 16:23:25 +00:00
|
|
|
/*
|
|
|
|
* Print an Ethernet frame.
|
|
|
|
* This might be encapsulated within another frame; we might be passed
|
|
|
|
* a pointer to a function that can print header information for that
|
|
|
|
* frame's protocol, and an argument to pass to that function.
|
|
|
|
*/
|
1996-08-19 20:34:12 +00:00
|
|
|
void
|
2012-05-14 08:01:48 +00:00
|
|
|
ether_print(netdissect_options *ndo,
|
|
|
|
const u_char *p, u_int length, u_int caplen,
|
|
|
|
void (*print_encap_header)(netdissect_options *ndo, const u_char *), const u_char *encap_header_arg)
|
1996-08-19 20:34:12 +00:00
|
|
|
{
|
|
|
|
struct ether_header *ep;
|
2010-10-28 16:23:25 +00:00
|
|
|
u_int orig_length;
|
1996-08-19 20:34:12 +00:00
|
|
|
u_short ether_type;
|
2004-03-31 14:57:24 +00:00
|
|
|
u_short extracted_ether_type;
|
1996-08-19 20:34:12 +00:00
|
|
|
|
2010-10-28 16:23:25 +00:00
|
|
|
if (caplen < ETHER_HDRLEN || length < ETHER_HDRLEN) {
|
2012-05-14 08:01:48 +00:00
|
|
|
ND_PRINT((ndo, "[|ether]"));
|
2004-03-31 14:57:24 +00:00
|
|
|
return;
|
1996-08-19 20:34:12 +00:00
|
|
|
}
|
|
|
|
|
2012-05-14 08:01:48 +00:00
|
|
|
if (ndo->ndo_eflag) {
|
2010-10-28 16:23:25 +00:00
|
|
|
if (print_encap_header != NULL)
|
2012-05-14 08:01:48 +00:00
|
|
|
(*print_encap_header)(ndo, encap_header_arg);
|
|
|
|
ether_hdr_print(ndo, p, length);
|
2010-10-28 16:23:25 +00:00
|
|
|
}
|
|
|
|
orig_length = length;
|
1996-08-19 20:34:12 +00:00
|
|
|
|
2001-04-03 07:50:46 +00:00
|
|
|
length -= ETHER_HDRLEN;
|
|
|
|
caplen -= ETHER_HDRLEN;
|
1996-08-19 20:34:12 +00:00
|
|
|
ep = (struct ether_header *)p;
|
2001-04-03 07:50:46 +00:00
|
|
|
p += ETHER_HDRLEN;
|
1996-08-19 20:34:12 +00:00
|
|
|
|
2010-10-28 16:23:25 +00:00
|
|
|
ether_type = EXTRACT_16BITS(&ep->ether_type);
|
1996-08-19 20:34:12 +00:00
|
|
|
|
2010-10-28 16:23:25 +00:00
|
|
|
recurse:
|
1996-08-19 20:34:12 +00:00
|
|
|
/*
|
|
|
|
* Is it (gag) an 802.3 encapsulation?
|
|
|
|
*/
|
1996-08-19 21:35:13 +00:00
|
|
|
if (ether_type <= ETHERMTU) {
|
1996-08-19 20:34:12 +00:00
|
|
|
/* Try to print the LLC-layer header & higher layers */
|
2001-04-03 07:50:46 +00:00
|
|
|
if (llc_print(p, length, caplen, ESRC(ep), EDST(ep),
|
2004-03-31 14:57:24 +00:00
|
|
|
&extracted_ether_type) == 0) {
|
1996-08-19 20:34:12 +00:00
|
|
|
/* ether_type not known, print raw packet */
|
2012-05-14 08:01:48 +00:00
|
|
|
if (!ndo->ndo_eflag) {
|
2010-10-28 16:23:25 +00:00
|
|
|
if (print_encap_header != NULL)
|
2012-05-14 08:01:48 +00:00
|
|
|
(*print_encap_header)(ndo, encap_header_arg);
|
|
|
|
ether_hdr_print(ndo, (u_char *)ep, orig_length);
|
2010-10-28 16:23:25 +00:00
|
|
|
}
|
|
|
|
|
2012-05-14 08:01:48 +00:00
|
|
|
if (!ndo->ndo_suppress_default_print)
|
|
|
|
ndo->ndo_default_print(ndo, p, caplen);
|
2010-10-28 16:23:25 +00:00
|
|
|
}
|
2012-05-14 08:01:48 +00:00
|
|
|
} else if (ether_type == ETHERTYPE_8021Q ||
|
|
|
|
ether_type == ETHERTYPE_8021Q9100 ||
|
|
|
|
ether_type == ETHERTYPE_8021Q9200 ||
|
|
|
|
ether_type == ETHERTYPE_8021QinQ) {
|
2010-10-28 16:23:25 +00:00
|
|
|
/*
|
|
|
|
* Print VLAN information, and then go back and process
|
|
|
|
* the enclosed type field.
|
|
|
|
*/
|
|
|
|
if (caplen < 4 || length < 4) {
|
2012-05-14 08:01:48 +00:00
|
|
|
ND_PRINT((ndo, "[|vlan]"));
|
2010-10-28 16:23:25 +00:00
|
|
|
return;
|
|
|
|
}
|
2012-05-14 08:01:48 +00:00
|
|
|
if (ndo->ndo_eflag) {
|
2010-10-28 16:23:25 +00:00
|
|
|
u_int16_t tag = EXTRACT_16BITS(p);
|
|
|
|
|
2012-05-14 08:01:48 +00:00
|
|
|
ND_PRINT((ndo, "vlan %u, p %u%s, ",
|
2010-10-28 16:23:25 +00:00
|
|
|
tag & 0xfff,
|
|
|
|
tag >> 13,
|
2012-05-14 08:01:48 +00:00
|
|
|
(tag & 0x1000) ? ", CFI" : ""));
|
2010-10-28 16:23:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ether_type = EXTRACT_16BITS(p + 2);
|
2012-05-14 08:01:48 +00:00
|
|
|
if (ndo->ndo_eflag && ether_type > ETHERMTU)
|
|
|
|
ND_PRINT((ndo, "ethertype %s, ", tok2str(ethertype_values,"0x%04x", ether_type)));
|
2010-10-28 16:23:25 +00:00
|
|
|
p += 4;
|
|
|
|
length -= 4;
|
|
|
|
caplen -= 4;
|
|
|
|
goto recurse;
|
|
|
|
} else if (ether_type == ETHERTYPE_JUMBO) {
|
|
|
|
/*
|
|
|
|
* Alteon jumbo frames.
|
|
|
|
* See
|
|
|
|
*
|
|
|
|
* http://tools.ietf.org/html/draft-ietf-isis-ext-eth-01
|
|
|
|
*
|
|
|
|
* which indicates that, following the type field,
|
|
|
|
* there's an LLC header and payload.
|
|
|
|
*/
|
|
|
|
/* Try to print the LLC-layer header & higher layers */
|
|
|
|
if (llc_print(p, length, caplen, ESRC(ep), EDST(ep),
|
|
|
|
&extracted_ether_type) == 0) {
|
|
|
|
/* ether_type not known, print raw packet */
|
2012-05-14 08:01:48 +00:00
|
|
|
if (!ndo->ndo_eflag) {
|
2010-10-28 16:23:25 +00:00
|
|
|
if (print_encap_header != NULL)
|
2012-05-14 08:01:48 +00:00
|
|
|
(*print_encap_header)(ndo, encap_header_arg);
|
|
|
|
ether_hdr_print(ndo, (u_char *)ep, orig_length);
|
2010-10-28 16:23:25 +00:00
|
|
|
}
|
|
|
|
|
2012-05-14 08:01:48 +00:00
|
|
|
if (!ndo->ndo_suppress_default_print)
|
|
|
|
ndo->ndo_default_print(ndo, p, caplen);
|
2010-10-28 16:23:25 +00:00
|
|
|
}
|
|
|
|
} else {
|
2012-05-14 08:01:48 +00:00
|
|
|
if (ethertype_print(ndo, ether_type, p, length, caplen) == 0) {
|
2010-10-28 16:23:25 +00:00
|
|
|
/* ether_type not known, print raw packet */
|
2012-05-14 08:01:48 +00:00
|
|
|
if (!ndo->ndo_eflag) {
|
2010-10-28 16:23:25 +00:00
|
|
|
if (print_encap_header != NULL)
|
2012-05-14 08:01:48 +00:00
|
|
|
(*print_encap_header)(ndo, encap_header_arg);
|
|
|
|
ether_hdr_print(ndo, (u_char *)ep, orig_length);
|
2010-10-28 16:23:25 +00:00
|
|
|
}
|
2004-03-31 14:57:24 +00:00
|
|
|
|
2012-05-14 08:01:48 +00:00
|
|
|
if (!ndo->ndo_suppress_default_print)
|
|
|
|
ndo->ndo_default_print(ndo, p, caplen);
|
1996-08-19 20:34:12 +00:00
|
|
|
}
|
2010-10-28 16:23:25 +00:00
|
|
|
}
|
2004-03-31 14:57:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the top level routine of the printer. 'p' points
|
|
|
|
* to the ether header of the packet, 'h->ts' is the timestamp,
|
2005-05-29 19:09:28 +00:00
|
|
|
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
|
2004-03-31 14:57:24 +00:00
|
|
|
* is the number of bytes actually captured.
|
|
|
|
*/
|
|
|
|
u_int
|
2012-05-14 08:01:48 +00:00
|
|
|
ether_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
|
|
|
|
const u_char *p)
|
2004-03-31 14:57:24 +00:00
|
|
|
{
|
2012-05-14 08:01:48 +00:00
|
|
|
ether_print(ndo, p, h->len, h->caplen, NULL, NULL);
|
2004-03-31 14:57:24 +00:00
|
|
|
|
|
|
|
return (ETHER_HDRLEN);
|
1996-08-19 20:34:12 +00:00
|
|
|
}
|
|
|
|
|
2012-05-14 08:01:48 +00:00
|
|
|
/*
|
|
|
|
* This is the top level routine of the printer. 'p' points
|
|
|
|
* to the ether header of the packet, 'h->ts' is the timestamp,
|
|
|
|
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
|
|
|
|
* is the number of bytes actually captured.
|
|
|
|
*
|
|
|
|
* This is for DLT_NETANALYZER, which has a 4-byte pseudo-header
|
|
|
|
* before the Ethernet header.
|
|
|
|
*/
|
|
|
|
u_int
|
|
|
|
netanalyzer_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
|
|
|
|
const u_char *p)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Fail if we don't have enough data for the Hilscher pseudo-header.
|
|
|
|
*/
|
|
|
|
if (h->len < 4 || h->caplen < 4) {
|
|
|
|
printf("[|netanalyzer]");
|
|
|
|
return (h->caplen);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Skip the pseudo-header. */
|
|
|
|
ether_print(ndo, p + 4, h->len - 4, h->caplen - 4, NULL, NULL);
|
|
|
|
|
|
|
|
return (4 + ETHER_HDRLEN);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the top level routine of the printer. 'p' points
|
|
|
|
* to the ether header of the packet, 'h->ts' is the timestamp,
|
|
|
|
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
|
|
|
|
* is the number of bytes actually captured.
|
|
|
|
*
|
|
|
|
* This is for DLT_NETANALYZER_TRANSPARENT, which has a 4-byte
|
|
|
|
* pseudo-header, a 7-byte Ethernet preamble, and a 1-byte Ethernet SOF
|
|
|
|
* before the Ethernet header.
|
|
|
|
*/
|
|
|
|
u_int
|
|
|
|
netanalyzer_transparent_if_print(netdissect_options *ndo,
|
|
|
|
const struct pcap_pkthdr *h,
|
|
|
|
const u_char *p)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Fail if we don't have enough data for the Hilscher pseudo-header,
|
|
|
|
* preamble, and SOF.
|
|
|
|
*/
|
|
|
|
if (h->len < 12 || h->caplen < 12) {
|
|
|
|
printf("[|netanalyzer-transparent]");
|
|
|
|
return (h->caplen);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Skip the pseudo-header, preamble, and SOF. */
|
|
|
|
ether_print(ndo, p + 12, h->len - 12, h->caplen - 12, NULL, NULL);
|
|
|
|
|
|
|
|
return (12 + ETHER_HDRLEN);
|
|
|
|
}
|
|
|
|
|
1996-08-19 20:34:12 +00:00
|
|
|
/*
|
2010-10-28 16:23:25 +00:00
|
|
|
* Prints the packet payload, given an Ethernet type code for the payload's
|
|
|
|
* protocol.
|
1996-08-19 20:34:12 +00:00
|
|
|
*
|
|
|
|
* Returns non-zero if it can do so, zero if the ethertype is unknown.
|
|
|
|
*/
|
|
|
|
|
|
|
|
int
|
2012-05-14 08:01:48 +00:00
|
|
|
ethertype_print(netdissect_options *ndo,
|
|
|
|
u_short ether_type, const u_char *p,
|
|
|
|
u_int length, u_int caplen)
|
1996-08-19 20:34:12 +00:00
|
|
|
{
|
2004-03-31 14:57:24 +00:00
|
|
|
switch (ether_type) {
|
1996-08-19 20:34:12 +00:00
|
|
|
|
|
|
|
case ETHERTYPE_IP:
|
2012-05-14 08:01:48 +00:00
|
|
|
ip_print(ndo, p, length);
|
1996-08-19 20:34:12 +00:00
|
|
|
return (1);
|
|
|
|
|
2000-01-30 01:05:24 +00:00
|
|
|
#ifdef INET6
|
|
|
|
case ETHERTYPE_IPV6:
|
2012-05-14 08:01:48 +00:00
|
|
|
ip6_print(ndo, p, length);
|
2000-01-30 01:05:24 +00:00
|
|
|
return (1);
|
|
|
|
#endif /*INET6*/
|
|
|
|
|
1996-08-19 20:34:12 +00:00
|
|
|
case ETHERTYPE_ARP:
|
|
|
|
case ETHERTYPE_REVARP:
|
2012-05-14 08:01:48 +00:00
|
|
|
arp_print(ndo, p, length, caplen);
|
1996-08-19 20:34:12 +00:00
|
|
|
return (1);
|
|
|
|
|
|
|
|
case ETHERTYPE_DN:
|
2012-05-14 08:01:48 +00:00
|
|
|
decnet_print(/*ndo,*/p, length, caplen);
|
1996-08-19 20:34:12 +00:00
|
|
|
return (1);
|
|
|
|
|
|
|
|
case ETHERTYPE_ATALK:
|
2012-05-14 08:01:48 +00:00
|
|
|
if (ndo->ndo_vflag)
|
1996-08-19 20:34:12 +00:00
|
|
|
fputs("et1 ", stdout);
|
2012-05-14 08:01:48 +00:00
|
|
|
atalk_print(/*ndo,*/p, length);
|
1996-08-19 20:34:12 +00:00
|
|
|
return (1);
|
|
|
|
|
|
|
|
case ETHERTYPE_AARP:
|
2012-05-14 08:01:48 +00:00
|
|
|
aarp_print(/*ndo,*/p, length);
|
1996-08-19 20:34:12 +00:00
|
|
|
return (1);
|
|
|
|
|
1996-09-15 17:55:09 +00:00
|
|
|
case ETHERTYPE_IPX:
|
2012-05-14 08:01:48 +00:00
|
|
|
ND_PRINT((ndo, "(NOV-ETHII) "));
|
|
|
|
ipx_print(/*ndo,*/p, length);
|
1996-09-15 17:55:09 +00:00
|
|
|
return (1);
|
|
|
|
|
2005-05-29 19:09:28 +00:00
|
|
|
case ETHERTYPE_ISO:
|
2012-05-14 08:01:48 +00:00
|
|
|
isoclns_print(/*ndo,*/p+1, length-1, length-1);
|
2005-05-29 19:09:28 +00:00
|
|
|
return(1);
|
|
|
|
|
2000-01-30 01:05:24 +00:00
|
|
|
case ETHERTYPE_PPPOED:
|
|
|
|
case ETHERTYPE_PPPOES:
|
2001-09-27 08:02:27 +00:00
|
|
|
case ETHERTYPE_PPPOED2:
|
|
|
|
case ETHERTYPE_PPPOES2:
|
2012-05-14 08:01:48 +00:00
|
|
|
pppoe_print(/*ndo,*/p, length);
|
2004-03-31 14:57:24 +00:00
|
|
|
return (1);
|
|
|
|
|
2005-05-29 19:09:28 +00:00
|
|
|
case ETHERTYPE_EAPOL:
|
2012-05-14 08:01:48 +00:00
|
|
|
eap_print(ndo, p, length);
|
2005-05-29 19:09:28 +00:00
|
|
|
return (1);
|
|
|
|
|
2009-03-21 16:23:46 +00:00
|
|
|
case ETHERTYPE_RRCP:
|
2012-05-14 08:01:48 +00:00
|
|
|
rrcp_print(ndo, p - 14 , length + 14);
|
2009-03-21 16:23:46 +00:00
|
|
|
return (1);
|
|
|
|
|
2002-06-21 00:49:02 +00:00
|
|
|
case ETHERTYPE_PPP:
|
|
|
|
if (length) {
|
|
|
|
printf(": ");
|
2012-05-14 08:01:48 +00:00
|
|
|
ppp_print(/*ndo,*/p, length);
|
2002-06-21 00:49:02 +00:00
|
|
|
}
|
|
|
|
return (1);
|
|
|
|
|
2009-03-21 16:23:46 +00:00
|
|
|
case ETHERTYPE_MPCP:
|
2012-05-14 08:01:48 +00:00
|
|
|
mpcp_print(/*ndo,*/p, length);
|
2009-03-21 16:23:46 +00:00
|
|
|
return (1);
|
|
|
|
|
2006-09-04 20:25:04 +00:00
|
|
|
case ETHERTYPE_SLOW:
|
2012-05-14 08:01:48 +00:00
|
|
|
slow_print(/*ndo,*/p, length);
|
2006-09-04 20:25:04 +00:00
|
|
|
return (1);
|
|
|
|
|
2009-03-21 16:23:46 +00:00
|
|
|
case ETHERTYPE_CFM:
|
|
|
|
case ETHERTYPE_CFM_OLD:
|
2012-05-14 08:01:48 +00:00
|
|
|
cfm_print(/*ndo,*/p, length);
|
2009-03-21 16:23:46 +00:00
|
|
|
return (1);
|
|
|
|
|
|
|
|
case ETHERTYPE_LLDP:
|
2012-05-14 08:01:48 +00:00
|
|
|
lldp_print(/*ndo,*/p, length);
|
2009-03-21 16:23:46 +00:00
|
|
|
return (1);
|
|
|
|
|
2004-03-31 14:57:24 +00:00
|
|
|
case ETHERTYPE_LOOPBACK:
|
2005-07-11 04:14:02 +00:00
|
|
|
return (1);
|
2004-03-31 14:57:24 +00:00
|
|
|
|
2002-06-21 00:49:02 +00:00
|
|
|
case ETHERTYPE_MPLS:
|
|
|
|
case ETHERTYPE_MPLS_MULTI:
|
2012-05-14 08:01:48 +00:00
|
|
|
mpls_print(/*ndo,*/p, length);
|
2002-06-21 00:49:02 +00:00
|
|
|
return (1);
|
|
|
|
|
2012-10-04 22:40:22 +00:00
|
|
|
case ETHERTYPE_TIPC:
|
|
|
|
tipc_print(ndo, p, length, caplen);
|
|
|
|
return (1);
|
|
|
|
|
2013-05-30 06:46:26 +00:00
|
|
|
case ETHERTYPE_MS_NLB_HB:
|
|
|
|
msnlb_print(ndo, p, length);
|
|
|
|
return (1);
|
|
|
|
|
1996-08-19 20:34:12 +00:00
|
|
|
case ETHERTYPE_LAT:
|
|
|
|
case ETHERTYPE_SCA:
|
|
|
|
case ETHERTYPE_MOPRC:
|
|
|
|
case ETHERTYPE_MOPDL:
|
|
|
|
/* default_print for now */
|
|
|
|
default:
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
}
|
2005-05-29 19:09:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Local Variables:
|
|
|
|
* c-style: whitesmith
|
|
|
|
* c-basic-offset: 8
|
|
|
|
* End:
|
|
|
|
*/
|
|
|
|
|