X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/2c5e14ceac8b545c869906f4d81c1e95a0c548a0..refs/pull/482/head:/print-juniper.c diff --git a/print-juniper.c b/print-juniper.c index 8fc8eee2..94151c81 100644 --- a/print-juniper.c +++ b/print-juniper.c @@ -24,9 +24,9 @@ __RCSID("NetBSD: print-juniper.c,v 1.3 2007/07/25 06:31:32 dogcow Exp "); #include "config.h" #endif -#include +#include -#include "interface.h" +#include "netdissect.h" #include "addrtoname.h" #include "extract.h" #include "ppp.h" @@ -513,7 +513,7 @@ juniper_es_print(netdissect_options *ndo, return l2info.header_len; p+=l2info.header_len; - ih = (struct juniper_ipsec_header *)p; + ih = (const struct juniper_ipsec_header *)p; switch (ih->type) { case JUNIPER_IPSEC_O_ESP_ENCRYPT_ESP_AUTHEN_TYPE: @@ -582,7 +582,7 @@ juniper_monitor_print(netdissect_options *ndo, return l2info.header_len; p+=l2info.header_len; - mh = (struct juniper_monitor_header *)p; + mh = (const struct juniper_monitor_header *)p; if (ndo->ndo_eflag) ND_PRINT((ndo, "service-id %u, iif %u, pkt-type %u: ", @@ -616,7 +616,7 @@ juniper_services_print(netdissect_options *ndo, return l2info.header_len; p+=l2info.header_len; - sh = (struct juniper_services_header *)p; + sh = (const struct juniper_services_header *)p; if (ndo->ndo_eflag) ND_PRINT((ndo, "service-id %u flags 0x%02x service-set-id 0x%04x iif %u: ", @@ -919,6 +919,8 @@ u_int juniper_atm1_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register const u_char *p) { + int llc_hdrlen; + struct juniper_l2info_t l2info; l2info.pictype = DLT_JUNIPER_ATM1; @@ -935,7 +937,8 @@ juniper_atm1_print(netdissect_options *ndo, if (EXTRACT_24BITS(p) == 0xfefe03 || /* NLPID encaps ? */ EXTRACT_24BITS(p) == 0xaaaa03) { /* SNAP encaps ? */ - if (llc_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL) != 0) + llc_hdrlen = llc_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL); + if (llc_hdrlen > 0) return l2info.header_len; } @@ -965,6 +968,8 @@ u_int juniper_atm2_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register const u_char *p) { + int llc_hdrlen; + struct juniper_l2info_t l2info; l2info.pictype = DLT_JUNIPER_ATM2; @@ -981,7 +986,8 @@ juniper_atm2_print(netdissect_options *ndo, if (EXTRACT_24BITS(p) == 0xfefe03 || /* NLPID encaps ? */ EXTRACT_24BITS(p) == 0xaaaa03) { /* SNAP encaps ? */ - if (llc_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL) != 0) + llc_hdrlen = llc_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL); + if (llc_hdrlen > 0) return l2info.header_len; } @@ -1026,10 +1032,8 @@ juniper_ppp_heuristic_guess(netdissect_options *ndo, case PPP_PAP : case PPP_CHAP : case PPP_ML : -#ifdef INET6 case PPP_IPV6 : case PPP_IPV6CP : -#endif ppp_print(ndo, p, length); break;