diff options
author | pst <pst@FreeBSD.org> | 1998-01-01 04:13:54 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1998-01-01 04:13:54 +0000 |
commit | a472b7fd712916a6d641014da562aa2202fc7274 (patch) | |
tree | ee89a92456a9462ab40fd8216dd362a230989469 /contrib/tcpdump/print-ppp.c | |
parent | d64dcc2cd693787a6f46d14e269cf94afb3b0eb2 (diff) | |
download | FreeBSD-src-a472b7fd712916a6d641014da562aa2202fc7274.zip FreeBSD-src-a472b7fd712916a6d641014da562aa2202fc7274.tar.gz |
Handle frame relay, decode ATM VP/VC info, and handle ISO over FR.
Diffstat (limited to 'contrib/tcpdump/print-ppp.c')
-rw-r--r-- | contrib/tcpdump/print-ppp.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/contrib/tcpdump/print-ppp.c b/contrib/tcpdump/print-ppp.c index f615810..daae3ae 100644 --- a/contrib/tcpdump/print-ppp.c +++ b/contrib/tcpdump/print-ppp.c @@ -64,6 +64,10 @@ static struct protonames protonames[] = { * Protocol field values. */ PPP_IP, "IP", /* Internet Protocol */ +#ifndef PPP_ISO +#define PPP_ISO 0x23 +#endif + PPP_ISO, "ISO", /* ISO 8473 */ PPP_XNS, "XNS", /* Xerox NS */ PPP_IPX, "IPX", /* IPX Datagram (RFC1552) */ PPP_VJC_COMP, "VJC_UNCOMP", /* VJ compressed TCP */ @@ -103,6 +107,24 @@ ppp_if_print(u_char *user, const struct pcap_pkthdr *h, register u_int length = h->len; register u_int caplen = h->caplen; + int frame_relay = 0; + int proto = PPP_CONTROL(p); + + if(caplen > length) caplen = length; + + /* + * Check to see if this is a frame-relay, we have to do this + * because BPF could not differentiate between PPP and Framerelay + * link types. + */ + + frame_relay = (fr_addr_len(p) >= 2); + + if(frame_relay) { + fr_if_print(user, h, p); + return; + } + ts_print(&h->ts); if (caplen < PPP_HDRLEN) { @@ -132,10 +154,18 @@ ppp_if_print(u_char *user, const struct pcap_pkthdr *h, case ETHERTYPE_IPX: ipx_print((const u_char *)(p + PPP_HDRLEN), length); break; - + + case PPP_ISO: + isoclns_print((const u_char *)(p + PPP_HDRLEN), length, + caplen, "000000", "000000"); + break; default: - if(!eflag) - ppp_hdlc_print(p, length); + if(!eflag) { + if (frame_relay) + fr_hdlc_print(p, length); + else + ppp_hdlc_print(p, length); + } if(!xflag) default_print((const u_char *)(p + PPP_HDRLEN), caplen - PPP_HDRLEN); |