From: hannes Date: Thu, 27 Jan 2005 10:13:51 +0000 (+0000) Subject: -export the q933 printer and call it from the OSI printer X-Git-Tag: tcpdump-3.9.1~198 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/efd5520f66399aaaaa3fde9a9737db2e5021b732 -export the q933 printer and call it from the OSI printer -display cosmetics: make the comma settings eflag compatible place a colon after printing the OSI proto-ID to indicate that we are crossing a layer boundary --- diff --git a/interface.h b/interface.h index df86e184..a72a8eb4 100644 --- a/interface.h +++ b/interface.h @@ -18,7 +18,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.240 2005-01-12 11:19:08 hannes Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.241 2005-01-27 10:13:51 hannes Exp $ (LBL) */ #ifndef tcpdump_interface_h @@ -236,6 +236,7 @@ extern u_int ppp_hdlc_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int ppp_bsdos_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int pppoe_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int prism_if_print(const struct pcap_pkthdr *, const u_char *); +extern void q933_print(const u_char *, u_int); extern int vjc_print(register const char *, u_short); extern u_int raw_if_print(const struct pcap_pkthdr *, const u_char *); extern void rip_print(const u_char *, u_int); @@ -247,6 +248,7 @@ extern u_int sl_bsdos_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int chdlc_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_atm1_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_atm2_print(const struct pcap_pkthdr *, const u_char *); +extern u_int juniper_mlfr_print(const struct pcap_pkthdr *, const u_char *); extern u_int sll_if_print(const struct pcap_pkthdr *, const u_char *); extern void snmp_print(const u_char *, u_int); extern void sunrpcrequest_print(const u_char *, u_int, const u_char *); diff --git a/print-fr.c b/print-fr.c index 685464aa..fd00202a 100644 --- a/print-fr.c +++ b/print-fr.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#)$Header: /tcpdump/master/tcpdump/print-fr.c,v 1.28 2005-01-25 15:02:59 hannes Exp $ (LBL)"; + "@(#)$Header: /tcpdump/master/tcpdump/print-fr.c,v 1.29 2005-01-27 10:13:51 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -40,7 +40,6 @@ static const char rcsid[] _U_ = #include "nlpid.h" #include "extract.h" -static void q933_print(const u_char *, u_int); static void frf15_print(const u_char *, u_int); /* @@ -457,7 +456,7 @@ struct common_ie_header { u_int8_t ie_len; }; -static void +void q933_print(const u_char *p, u_int length) { const u_char *ptemp = p; @@ -474,8 +473,7 @@ q933_print(const u_char *p, u_int length) if (p[2] == MSG_ANSI_LOCKING_SHIFT) is_ansi = 1; - if (!eflag) - printf("Q.933, "); + printf("%s", eflag ? "" : "Q.933, "); /* printing out header part */ printf(is_ansi ? "ANSI" : "CCITT "); diff --git a/print-isoclns.c b/print-isoclns.c index 989d0158..9554ec0f 100644 --- a/print-isoclns.c +++ b/print-isoclns.c @@ -26,7 +26,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.125 2005-01-25 15:35:11 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.126 2005-01-27 10:13:52 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -494,7 +494,7 @@ void isoclns_print(const u_int8_t *p, u_int length, u_int caplen) } if (eflag) - printf("OSI NLPID %s (0x%02x)", + printf("OSI NLPID %s (0x%02x): ", tok2str(nlpid_values,"Unknown",*p), *p); @@ -518,6 +518,10 @@ void isoclns_print(const u_int8_t *p, u_int length, u_int caplen) (void)printf(", length: %u", length); break; + case NLPID_Q933: + q933_print(p+1, length-1); + break; + case NLPID_IP: ip_print(p+1, length-1); break; @@ -604,13 +608,14 @@ static int clnp_print (const u_int8_t *pptr, u_int length) pptr += (1 + source_address_length); if (vflag < 1) { - printf(", %s > %s, length %u", + printf("%s%s > %s, length %u", + eflag ? "" : ", ", print_nsap(source_address, source_address_length), print_nsap(dest_address, dest_address_length), length); return (1); } - printf(", length %u", length); + printf("%slength %u",eflag ? "" : ", ",length); printf("\n\t%s PDU, hlen: %u, v: %u, lifetime: %u.%us, PDU length: %u, checksum: 0x%04x ", tok2str(clnp_pdu_values, @@ -729,12 +734,14 @@ esis_print(const u_int8_t *pptr, u_int length) esis_pdu_type = esis_header->type & ESIS_PDU_TYPE_MASK; if (vflag < 1) { - printf(", %s, length %u", + printf("%s%s, length %u", + eflag ? "" : ", ", tok2str(esis_pdu_values,"unknown type (%u)",esis_pdu_type), length); return; } else - printf(", length %u\n\t%s (%u)", + printf("%slength %u\n\t%s (%u)", + eflag ? "" : ", ", length, tok2str(esis_pdu_values,"unknown type: %u", esis_pdu_type), esis_pdu_type); @@ -1446,7 +1453,9 @@ static int isis_print (const u_int8_t *p, u_int length) /* in non-verbose mode print the basic PDU Type plus PDU specific brief information*/ if (vflag < 1) { - printf(", %s", tok2str(isis_pdu_values,"unknown PDU-Type %u",pdu_type)); + printf("%s%s", + eflag ? "" : ", ", + tok2str(isis_pdu_values,"unknown PDU-Type %u",pdu_type)); switch (pdu_type) { @@ -1484,7 +1493,7 @@ static int isis_print (const u_int8_t *p, u_int length) } /* ok they seem to want to know everything - lets fully decode it */ - printf(", length: %u",length); + printf("%slength %u", eflag ? "" : ", ",length); printf("\n\t%s, hlen: %u, v: %u, pdu-v: %u, sys-id-len: %u (%u), max-area: %u (%u)", tok2str(isis_pdu_values,