X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/41f87a79787f53df8a36796b7029e6c642cb1e23..4feed5c7ec01c904059f5caa14827c1d61d7d3ac:/print-juniper.c diff --git a/print-juniper.c b/print-juniper.c index fc0fd904..92ef4534 100644 --- a/print-juniper.c +++ b/print-juniper.c @@ -15,7 +15,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-juniper.c,v 1.8.2.10 2005-06-03 22:03:48 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-juniper.c,v 1.8.2.13 2005-06-20 07:45:05 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -34,6 +34,7 @@ static const char rcsid[] _U_ = #include "llc.h" #include "nlpid.h" #include "ethertype.h" +#include "atm.h" #define JUNIPER_BPF_OUT 0 /* Outgoing packet */ #define JUNIPER_BPF_IN 1 /* Incoming packet */ @@ -403,9 +404,11 @@ juniper_mlppp_print(const struct pcap_pkthdr *h, register const u_char *p) case JUNIPER_LSQ_L3_PROTO_IPV4: ip_print(gndo, p, l2info.length); return l2info.header_len; +#ifdef INET6 case JUNIPER_LSQ_L3_PROTO_IPV6: ip6_print(p,l2info.length); return l2info.header_len; +#endif case JUNIPER_LSQ_L3_PROTO_MPLS: mpls_print(p,l2info.length); return l2info.header_len; @@ -519,7 +522,7 @@ juniper_atm1_print(const struct pcap_pkthdr *h, register const u_char *p) p+=l2info.header_len; if (l2info.cookie[0] == 0x80) { /* OAM cell ? */ - oam_print(p,l2info.length); + oam_print(p,l2info.length,ATM_OAM_NOHEC); return l2info.header_len; } @@ -557,6 +560,7 @@ u_int juniper_atm2_print(const struct pcap_pkthdr *h, register const u_char *p) { u_int16_t extracted_ethertype; + u_int32_t control_word; struct juniper_l2info_t l2info; @@ -567,7 +571,13 @@ juniper_atm2_print(const struct pcap_pkthdr *h, register const u_char *p) p+=l2info.header_len; if (l2info.cookie[7] & ATM2_PKT_TYPE_MASK) { /* OAM cell ? */ - oam_print(p,l2info.length); + control_word = EXTRACT_32BITS(p); + if(control_word == 0 || control_word == 0x08000000) { + l2info.header_len += 4; + l2info.length -= 4; + p += 4; + } + oam_print(p,l2info.length,ATM_OAM_NOHEC); return l2info.header_len; }