diff --git a/usr.sbin/tcpdump/interface.h b/usr.sbin/tcpdump/interface.h index c8be586538e6..fa9cd5b43e4d 100644 --- a/usr.sbin/tcpdump/interface.h +++ b/usr.sbin/tcpdump/interface.h @@ -1,4 +1,4 @@ -/* $NetBSD: interface.h,v 1.19 2001/04/14 12:31:34 martin Exp $ */ +/* $NetBSD: interface.h,v 1.20 2001/05/06 07:57:08 tron Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -240,7 +240,9 @@ extern void ospf_print(const u_char *, u_int, const u_char *); extern void igmp_pim_print(const u_char *, u_int); extern void pim_print(const u_char *, u_int); extern void ppp_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); -extern void pppoe_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); +extern void pppoe_if_print(u_char *, const struct pcap_pkthdr *, + const u_char *); +extern void pppoe_encap_print(const u_char *, u_int, u_int); extern void ppp_bsdos_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); extern void ppp_netbsd_serial_if_print(u_char *, const struct pcap_pkthdr *, diff --git a/usr.sbin/tcpdump/print-ether.c b/usr.sbin/tcpdump/print-ether.c index 4d746740933c..76ab89677be8 100644 --- a/usr.sbin/tcpdump/print-ether.c +++ b/usr.sbin/tcpdump/print-ether.c @@ -1,4 +1,4 @@ -/* $NetBSD: print-ether.c,v 1.8 2000/07/26 10:48:15 ad Exp $ */ +/* $NetBSD: print-ether.c,v 1.9 2001/05/06 07:57:08 tron Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -26,7 +26,7 @@ static const char rcsid[] = "@(#) Header: print-ether.c,v 1.44 97/05/26 17:18:13 leres Exp (LBL)"; #else -__RCSID("$NetBSD: print-ether.c,v 1.8 2000/07/26 10:48:15 ad Exp $"); +__RCSID("$NetBSD: print-ether.c,v 1.9 2001/05/06 07:57:08 tron Exp $"); #endif #endif @@ -229,7 +229,11 @@ ether_encap_print(u_short ethertype, const u_char *p, default_print(p - 18, caplen + 4); } return (1); - + + case ETHERTYPE_PPPOE: + pppoe_encap_print(p, length, caplen); + return (1); + case ETHERTYPE_LAT: case ETHERTYPE_SCA: case ETHERTYPE_MOPRC: diff --git a/usr.sbin/tcpdump/print-pppoe.c b/usr.sbin/tcpdump/print-pppoe.c index 7ab339673ed5..a9bdba1de074 100644 --- a/usr.sbin/tcpdump/print-pppoe.c +++ b/usr.sbin/tcpdump/print-pppoe.c @@ -1,4 +1,4 @@ -/* $NetBSD: print-pppoe.c,v 1.2 2001/04/29 10:27:03 martin Exp $ */ +/* $NetBSD: print-pppoe.c,v 1.3 2001/05/06 07:57:08 tron Exp $ */ /* * Copied from print-ppp.c, slightly modified to work with the temporary @@ -32,7 +32,7 @@ static const char rcsid[] = "@(#) Header: print-ppp.c,v 1.26 97/06/12 14:21:29 leres Exp (LBL)"; #else -__RCSID("$NetBSD: print-pppoe.c,v 1.2 2001/04/29 10:27:03 martin Exp $"); +__RCSID("$NetBSD: print-pppoe.c,v 1.3 2001/05/06 07:57:08 tron Exp $"); #endif #endif @@ -73,16 +73,23 @@ struct rtentry; #define PPP_SHORT_HDRLEN 2 /* PPPoE printer */ + void pppoe_if_print(u_char *user, const struct pcap_pkthdr *h, register const u_char *p) { register u_int length = h->len; register u_int caplen = h->caplen; - const struct ip *ip; - u_int proto; ts_print(&h->ts); + pppoe_encap_print(p, length, caplen); +} + +void +pppoe_encap_print(const u_char *p, u_int length, u_int caplen) +{ + const struct ip *ip; + u_int proto; if (caplen < PPPOE_HDRLEN+PPP_SHORT_HDRLEN) { printf("[|pppoe]");