diff options
author | Michael Richardson <mcr@sandelman.ca> | 2014-01-01 21:27:54 -0500 |
---|---|---|
committer | Michael Richardson <mcr@sandelman.ca> | 2014-01-01 21:31:18 -0500 |
commit | a97fb2f3ae9731dd13e6854742c090ca9ef454cf (patch) | |
tree | f0eecb0f7bbc0d6f32f9ef310bdd19cab32d1345 | |
parent | 35c5cd9911f3fcc385e4a04c31016c253ee7a426 (diff) | |
download | tcpdump-a97fb2f3ae9731dd13e6854742c090ca9ef454cf.tar.gz |
whitespace changes
-rw-r--r-- | bgp.h | 2 | ||||
-rw-r--r-- | checksum.c | 10 | ||||
-rw-r--r-- | enc.h | 6 | ||||
-rw-r--r-- | ethertype.h | 2 | ||||
-rw-r--r-- | gmpls.c | 20 | ||||
-rw-r--r-- | gmpls.h | 2 | ||||
-rw-r--r-- | interface.h | 48 | ||||
-rw-r--r-- | ipproto.c | 2 | ||||
-rw-r--r-- | l2vpn.c | 24 | ||||
-rw-r--r-- | l2vpn.h | 2 | ||||
-rw-r--r-- | nlpid.c | 2 | ||||
-rw-r--r-- | nlpid.h | 2 | ||||
-rw-r--r-- | ospf.h | 2 | ||||
-rw-r--r-- | oui.c | 2 | ||||
-rw-r--r-- | oui.h | 2 | ||||
-rw-r--r-- | print-802_11.c | 2 | ||||
-rw-r--r-- | print-ap1394.c | 2 | ||||
-rw-r--r-- | print-arp.c | 8 | ||||
-rw-r--r-- | print-atm.c | 6 | ||||
-rw-r--r-- | print-bfd.c | 10 | ||||
-rw-r--r-- | print-bgp.c | 72 | ||||
-rw-r--r-- | print-bootp.c | 2 | ||||
-rw-r--r-- | print-bt.c | 4 | ||||
-rw-r--r-- | print-cfm.c | 8 | ||||
-rw-r--r-- | print-chdlc.c | 2 | ||||
-rw-r--r-- | print-dccp.c | 54 | ||||
-rw-r--r-- | print-dhcp6.c | 2 | ||||
-rw-r--r-- | print-dtp.c | 16 | ||||
-rw-r--r-- | print-dvmrp.c | 2 | ||||
-rw-r--r-- | print-eap.c | 24 | ||||
-rw-r--r-- | print-egp.c | 2 | ||||
-rw-r--r-- | print-eigrp.c | 10 | ||||
-rw-r--r-- | print-enc.c | 2 | ||||
-rw-r--r-- | print-esp.c | 48 | ||||
-rw-r--r-- | print-ether.c | 8 | ||||
-rw-r--r-- | print-forces.c | 2 | ||||
-rw-r--r-- | print-fr.c | 34 | ||||
-rw-r--r-- | print-gre.c | 6 | ||||
-rw-r--r-- | print-icmp.c | 8 | ||||
-rw-r--r-- | print-icmp6.c | 14 | ||||
-rw-r--r-- | print-isakmp.c | 104 | ||||
-rw-r--r-- | print-isoclns.c | 118 | ||||
-rw-r--r-- | print-juniper.c | 64 | ||||
-rw-r--r-- | print-ldp.c | 24 | ||||
-rw-r--r-- | print-llc.c | 14 | ||||
-rw-r--r-- | print-lldp.c | 46 | ||||
-rw-r--r-- | print-lmp.c | 142 | ||||
-rw-r--r-- | print-lspping.c | 32 | ||||
-rw-r--r-- | print-lwapp.c | 14 | ||||
-rw-r--r-- | print-mobility.c | 4 | ||||
-rw-r--r-- | print-mpcp.c | 12 | ||||
-rw-r--r-- | print-mpls.c | 2 | ||||
-rw-r--r-- | print-ntp.c | 6 | ||||
-rw-r--r-- | print-ospf.c | 34 | ||||
-rw-r--r-- | print-ospf6.c | 4 | ||||
-rw-r--r-- | print-otv.c | 2 | ||||
-rw-r--r-- | print-pflog.c | 4 | ||||
-rw-r--r-- | print-pgm.c | 8 | ||||
-rw-r--r-- | print-pim.c | 2 | ||||
-rw-r--r-- | print-ppp.c | 12 | ||||
-rw-r--r-- | print-pppoe.c | 6 | ||||
-rw-r--r-- | print-radius.c | 2 | ||||
-rw-r--r-- | print-rip.c | 2 | ||||
-rw-r--r-- | print-rpki-rtr.c | 4 | ||||
-rw-r--r-- | print-rsvp.c | 70 | ||||
-rw-r--r-- | print-rx.c | 2 | ||||
-rw-r--r-- | print-sflow.c | 62 | ||||
-rw-r--r-- | print-sll.c | 2 | ||||
-rw-r--r-- | print-slow.c | 32 | ||||
-rw-r--r-- | print-smb.c | 2 | ||||
-rw-r--r-- | print-stp.c | 22 | ||||
-rw-r--r-- | print-sunatm.c | 4 | ||||
-rw-r--r-- | print-symantec.c | 8 | ||||
-rw-r--r-- | print-tcp.c | 2 | ||||
-rw-r--r-- | print-tftp.c | 2 | ||||
-rw-r--r-- | print-tipc.c | 4 | ||||
-rw-r--r-- | print-udld.c | 40 | ||||
-rw-r--r-- | print-vqp.c | 8 | ||||
-rw-r--r-- | print-vtp.c | 26 | ||||
-rw-r--r-- | print-vxlan.c | 4 | ||||
-rw-r--r-- | signature.c | 4 | ||||
-rw-r--r-- | signature.h | 2 | ||||
-rw-r--r-- | tcpdump-stdinc.h | 2 | ||||
-rw-r--r-- | tcpdump.c | 20 | ||||
-rw-r--r-- | util.c | 4 |
85 files changed, 730 insertions, 730 deletions
@@ -1,5 +1,5 @@ /* @(#) $Header: /tcpdump/master/tcpdump/bgp.h,v 1.3 2004-06-16 08:45:15 hannes Exp $ (LBL) */ -/* +/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph @@ -93,12 +93,12 @@ static const u_int16_t crc10_table[256] = static void init_crc10_table(void) -{ +{ #define CRC10_POLYNOMIAL 0x633 register int i, j; register u_int16_t accum; u_int16_t verify_crc10_table[256]; - + for ( i = 0; i < 256; i++ ) { accum = ((unsigned short) i << 2); @@ -166,14 +166,14 @@ create_osi_cksum (const u_int8_t *pptr, int checksum_offset, int length) } else { c0 = c0 + *(pptr++); c1 += c0; - } + } } c0 = c0 % 255; c1 = c1 % 255; mul = (length - checksum_offset)*(c0); - + x = mul - c0 - c1; y = c1 - mul - 1; @@ -189,6 +189,6 @@ create_osi_cksum (const u_int8_t *pptr, int checksum_offset, int length) y &= 0x00FF; checksum = ((x << 8) | y); - + return checksum; } @@ -2,10 +2,10 @@ /* From $OpenBSD: if_enc.h,v 1.8 2001/06/25 05:14:00 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), - * Angelos D. Keromytis (kermit@csd.uch.gr) and + * Angelos D. Keromytis (kermit@csd.uch.gr) and * Niels Provos (provos@physnet.uni-hamburg.de). * - * This code was written by John Ioannidis for BSD/OS in Athens, Greece, + * This code was written by John Ioannidis for BSD/OS in Athens, Greece, * in November 1995. * * Ported to OpenBSD and NetBSD, with additional transforms, in December 1996, @@ -21,7 +21,7 @@ * Permission to use, copy, and modify this software with or without fee * is hereby granted, provided that this entire notice is included in * all copies of any software which is or includes a copy or - * modification of this software. + * modification of this software. * You may use this code under the GNU public license if you so wish. Please * contribute changes back to the authors under this freer than GPL license * so that we may further the use of strong encryption without limitations to diff --git a/ethertype.h b/ethertype.h index a74c3a8f..c98cff9d 100644 --- a/ethertype.h +++ b/ethertype.h @@ -172,7 +172,7 @@ #define ETHERTYPE_LOOPBACK 0x9000 #endif #ifndef ETHERTYPE_VMAN -#define ETHERTYPE_VMAN 0x9100 /* Extreme VMAN Protocol */ +#define ETHERTYPE_VMAN 0x9100 /* Extreme VMAN Protocol */ #endif #ifndef ETHERTYPE_CFM_OLD #define ETHERTYPE_CFM_OLD 0xabcd /* 802.1ag depreciated */ @@ -1,4 +1,4 @@ -/* +/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph @@ -141,8 +141,8 @@ const struct tok gmpls_payload_values[] = { { 0, NULL } }; -/* - * Link Type values used by LMP Service Discovery (specifically, the Client +/* + * Link Type values used by LMP Service Discovery (specifically, the Client * Port Service Attributes Object). See UNI 1.0 section 9.4.2 for details. */ const struct tok lmp_sd_service_config_cpsa_link_type_values[] = { @@ -151,9 +151,9 @@ const struct tok lmp_sd_service_config_cpsa_link_type_values[] = { { 0, NULL} }; -/* - * Signal Type values for SDH links used by LMP Service Discovery (specifically, - * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for +/* + * Signal Type values for SDH links used by LMP Service Discovery (specifically, + * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for * details. */ const struct tok lmp_sd_service_config_cpsa_signal_type_sdh_values[] = { @@ -168,9 +168,9 @@ const struct tok lmp_sd_service_config_cpsa_signal_type_sdh_values[] = { { 0, NULL} }; -/* - * Signal Type values for SONET links used by LMP Service Discovery (specifically, - * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for +/* + * Signal Type values for SONET links used by LMP Service Discovery (specifically, + * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for * details. */ const struct tok lmp_sd_service_config_cpsa_signal_type_sonet_values[] = { @@ -186,7 +186,7 @@ const struct tok lmp_sd_service_config_cpsa_signal_type_sonet_values[] = { }; #define DIFFSERV_BC_MODEL_RDM 0 /* draft-ietf-tewg-diff-te-proto-07 */ -#define DIFFSERV_BC_MODEL_MAM 1 /* draft-ietf-tewg-diff-te-proto-07 */ +#define DIFFSERV_BC_MODEL_MAM 1 /* draft-ietf-tewg-diff-te-proto-07 */ #define DIFFSERV_BC_MODEL_EXTD_MAM 254 /* experimental */ const struct tok diffserv_te_bc_values[] = { @@ -1,5 +1,5 @@ /* @(#) $Header: /tcpdump/master/tcpdump/gmpls.h,v 1.5 2006-04-14 07:11:59 hannes Exp $ (LBL) */ -/* +/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph diff --git a/interface.h b/interface.h index a0fb7ba7..7bc2c84d 100644 --- a/interface.h +++ b/interface.h @@ -383,30 +383,30 @@ extern void bpf_dump(const struct bpf_program *, int); #ifndef NETDISSECT_REWORKED extern netdissect_options *gndo; -#define bflag gndo->ndo_bflag -#define eflag gndo->ndo_eflag -#define fflag gndo->ndo_fflag +#define bflag gndo->ndo_bflag +#define eflag gndo->ndo_eflag +#define fflag gndo->ndo_fflag #define jflag gndo->ndo_jflag -#define Kflag gndo->ndo_Kflag -#define nflag gndo->ndo_nflag -#define Nflag gndo->ndo_Nflag -#define Oflag gndo->ndo_Oflag -#define pflag gndo->ndo_pflag -#define qflag gndo->ndo_qflag -#define Rflag gndo->ndo_Rflag -#define sflag gndo->ndo_sflag -#define Sflag gndo->ndo_Sflag -#define tflag gndo->ndo_tflag -#define Uflag gndo->ndo_Uflag -#define uflag gndo->ndo_uflag -#define vflag gndo->ndo_vflag -#define xflag gndo->ndo_xflag -#define Xflag gndo->ndo_Xflag -#define Cflag gndo->ndo_Cflag -#define Gflag gndo->ndo_Gflag -#define Aflag gndo->ndo_Aflag -#define Bflag gndo->ndo_Bflag -#define Iflag gndo->ndo_Iflag +#define Kflag gndo->ndo_Kflag +#define nflag gndo->ndo_nflag +#define Nflag gndo->ndo_Nflag +#define Oflag gndo->ndo_Oflag +#define pflag gndo->ndo_pflag +#define qflag gndo->ndo_qflag +#define Rflag gndo->ndo_Rflag +#define sflag gndo->ndo_sflag +#define Sflag gndo->ndo_Sflag +#define tflag gndo->ndo_tflag +#define Uflag gndo->ndo_Uflag +#define uflag gndo->ndo_uflag +#define vflag gndo->ndo_vflag +#define xflag gndo->ndo_xflag +#define Xflag gndo->ndo_Xflag +#define Cflag gndo->ndo_Cflag +#define Gflag gndo->ndo_Gflag +#define Aflag gndo->ndo_Aflag +#define Bflag gndo->ndo_Bflag +#define Iflag gndo->ndo_Iflag #define suppress_default_print gndo->ndo_suppress_default_print #define packettype gndo->ndo_packettype #define sigsecret gndo->ndo_sigsecret @@ -414,7 +414,7 @@ extern netdissect_options *gndo; #define WflagChars gndo->ndo_WflagChars #define Cflag_count gndo->ndo_Cflag_count #define Gflag_count gndo->ndo_Gflag_count -#define Gflag_time gndo->ndo_Gflag_time +#define Gflag_time gndo->ndo_Gflag_time #define Hflag gndo->ndo_Hflag #define snaplen gndo->ndo_snaplen #define snapend gndo->ndo_snapend @@ -1,4 +1,4 @@ -/* +/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph @@ -1,4 +1,4 @@ -/* +/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph @@ -31,16 +31,16 @@ const struct tok l2vpn_encaps_values[] = { { 0x00, "Reserved"}, { 0x01, "Frame Relay"}, { 0x02, "ATM AAL5 VCC transport"}, - { 0x03, "ATM transparent cell transport"}, - { 0x04, "Ethernet VLAN"}, - { 0x05, "Ethernet"}, - { 0x06, "Cisco-HDLC"}, - { 0x07, "PPP"}, - { 0x08, "SONET/SDH Circuit Emulation Service over MPLS"}, - { 0x09, "ATM n-to-one VCC cell transport"}, - { 0x0a, "ATM n-to-one VPC cell transport"}, - { 0x0b, "IP Layer2 Transport"}, - { 0x0c, "ATM one-to-one VCC Cell Mode"}, + { 0x03, "ATM transparent cell transport"}, + { 0x04, "Ethernet VLAN"}, + { 0x05, "Ethernet"}, + { 0x06, "Cisco-HDLC"}, + { 0x07, "PPP"}, + { 0x08, "SONET/SDH Circuit Emulation Service over MPLS"}, + { 0x09, "ATM n-to-one VCC cell transport"}, + { 0x0a, "ATM n-to-one VPC cell transport"}, + { 0x0b, "IP Layer2 Transport"}, + { 0x0c, "ATM one-to-one VCC Cell Mode"}, { 0x0d, "ATM one-to-one VPC Cell Mode"}, { 0x0e, "ATM AAL5 PDU VCC transport"}, { 0x0f, "Frame-Relay Port mode"}, @@ -53,6 +53,6 @@ const struct tok l2vpn_encaps_values[] = { { 0x16, "TDMoIP basic mode"}, { 0x17, "CESoPSN TDM with CAS"}, { 0x18, "TDMoIP TDM with CAS"}, - { 0x40, "IP-interworking"}, + { 0x40, "IP-interworking"}, { 0, NULL} }; @@ -1,5 +1,5 @@ /* @(#) $Header: /tcpdump/master/tcpdump/l2vpn.h,v 1.1 2004-06-15 09:42:41 hannes Exp $ (LBL) */ -/* +/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph @@ -1,4 +1,4 @@ -/* +/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph @@ -1,5 +1,5 @@ /* @(#) $Header: /tcpdump/master/tcpdump/nlpid.h,v 1.4 2004-10-19 15:27:55 hannes Exp $ (LBL) */ -/* +/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph @@ -35,7 +35,7 @@ * +------------------------------------+ * */ - + #define OSPF_OPTION_T 0x01 /* T bit: TOS support */ #define OSPF_OPTION_E 0x02 /* E bit: External routes advertised */ #define OSPF_OPTION_MC 0x04 /* MC bit: Multicast capable */ @@ -1,4 +1,4 @@ -/* +/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph @@ -1,5 +1,5 @@ /* @(#) $Header: /tcpdump/master/tcpdump/oui.h,v 1.8 2008-01-09 09:40:47 hannes Exp $ (LBL) */ -/* +/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph diff --git a/print-802_11.c b/print-802_11.c index c9d60a27..e3a4bddb 100644 --- a/print-802_11.c +++ b/print-802_11.c @@ -2134,7 +2134,7 @@ print_radiotap_field(struct cpack_state *s, u_int32_t bit, u_int8_t *flags, * the guard interval, so we can look * up the rate. */ - htrate = + htrate = ieee80211_float_htrates \ [u3.u8] \ [((u2.u8 & IEEE80211_RADIOTAP_MCS_BANDWIDTH_MASK) == IEEE80211_RADIOTAP_MCS_BANDWIDTH_40 ? 1 : 0)] \ diff --git a/print-ap1394.c b/print-ap1394.c index ab0713b5..f83d1628 100644 --- a/print-ap1394.c +++ b/print-ap1394.c @@ -113,7 +113,7 @@ ap1394_if_print(const struct pcap_pkthdr *h, const u_char *p) if (!suppress_default_print) default_print(p, caplen); - } + } return FIREWIRE_HDRLEN; } diff --git a/print-arp.c b/print-arp.c index e53c58ca..291d3097 100644 --- a/print-arp.c +++ b/print-arp.c @@ -192,7 +192,7 @@ atmarp_addr_print(netdissect_options *ndo, ND_PRINT((ndo, "<No address>")); else { ND_PRINT((ndo, "%s", linkaddr_string(ha, LINKADDR_ATM, ha_len))); - if (srca_len != 0) + if (srca_len != 0) ND_PRINT((ndo, ",%s", linkaddr_string(srca, LINKADDR_ATM, srca_len))); } @@ -240,7 +240,7 @@ atmarp_print(netdissect_options *ndo, /* print operation */ printf("%s%s ", - ndo->ndo_vflag ? ", " : "", + ndo->ndo_vflag ? ", " : "", tok2str(arpop_values, "Unknown (%u)", op)); switch (op) { @@ -308,7 +308,7 @@ arp_print(netdissect_options *ndo, pro = PRO(ap); op = OP(ap); - + /* if its ATM then call the ATM ARP printer for Frame-relay ARP most of the fields are similar to Ethernet so overload the Ethernet Printer @@ -355,7 +355,7 @@ arp_print(netdissect_options *ndo, /* print operation */ printf("%s%s ", - ndo->ndo_vflag ? ", " : "", + ndo->ndo_vflag ? ", " : "", tok2str(arpop_values, "Unknown (%u)", op)); switch (op) { diff --git a/print-atm.c b/print-atm.c index 0327b0d4..f75f8ab6 100644 --- a/print-atm.c +++ b/print-atm.c @@ -261,7 +261,7 @@ sig_print(const u_char *p, int caplen) } if (p[PROTO_POS] == Q2931) { /* - * protocol:Q.2931 for User to Network Interface + * protocol:Q.2931 for User to Network Interface * (UNI 3.1) signalling */ printf("Q.2931"); @@ -353,7 +353,7 @@ struct oam_fm_ais_rdi_t { u_int8_t unused[28]; }; -int +int oam_print (const u_char *p, u_int length, u_int hec) { u_int32_t cell_header; @@ -444,7 +444,7 @@ oam_print (const u_char *p, u_int length, u_int hec) { cksum = EXTRACT_16BITS(p + OAM_CELLTYPE_FUNCTYPE_LEN + OAM_FUNCTION_SPECIFIC_LEN) & OAM_CRC10_MASK; cksum_shouldbe = verify_crc10_cksum(0, p, OAM_PAYLOAD_LEN); - + printf("\n\tcksum 0x%03x (%scorrect)", cksum, cksum_shouldbe == 0 ? "" : "in"); diff --git a/print-bfd.c b/print-bfd.c index f157684f..0020222d 100644 --- a/print-bfd.c +++ b/print-bfd.c @@ -53,7 +53,7 @@ static const char rcsid[] _U_ = * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ -/* +/* * Control packet, BFDv1, draft-ietf-bfd-base-02.txt * * 0 1 2 3 @@ -194,7 +194,7 @@ bfd_print(register const u_char *pptr, register u_int len, register u_int port) len); return; } - + printf("BFDv%u, length: %u\n\t%s, Flags: [%s], Diagnostic: %s (0x%02x)", version, len, @@ -202,7 +202,7 @@ bfd_print(register const u_char *pptr, register u_int len, register u_int port) bittok2str(bfd_v0_flag_values, "none", bfd_header->flags), tok2str(bfd_diag_values,"unknown",BFD_EXTRACT_DIAG(bfd_header->version_diag)), BFD_EXTRACT_DIAG(bfd_header->version_diag)); - + printf("\n\tDetection Timer Multiplier: %u (%u ms Detection time), BFD Length: %u", bfd_header->detect_time_multiplier, bfd_header->detect_time_multiplier * EXTRACT_32BITS(bfd_header->desired_min_tx_interval)/1000, @@ -228,7 +228,7 @@ bfd_print(register const u_char *pptr, register u_int len, register u_int port) len); return; } - + printf("BFDv%u, length: %u\n\t%s, State %s, Flags: [%s], Diagnostic: %s (0x%02x)", version, len, @@ -237,7 +237,7 @@ bfd_print(register const u_char *pptr, register u_int len, register u_int port) bittok2str(bfd_v1_flag_values, "none", bfd_header->flags & 0x3f), tok2str(bfd_diag_values,"unknown",BFD_EXTRACT_DIAG(bfd_header->version_diag)), BFD_EXTRACT_DIAG(bfd_header->version_diag)); - + printf("\n\tDetection Timer Multiplier: %u (%u ms Detection time), BFD Length: %u", bfd_header->detect_time_multiplier, bfd_header->detect_time_multiplier * EXTRACT_32BITS(bfd_header->desired_min_tx_interval)/1000, diff --git a/print-bgp.c b/print-bgp.c index 2ad7cbcb..974903fc 100644 --- a/print-bgp.c +++ b/print-bgp.c @@ -111,7 +111,7 @@ struct bgp_route_refresh { u_int8_t afi[2]; /* the compiler messes this structure up */ u_int8_t res; /* when doing misaligned sequences of int8 and int16 */ u_int8_t safi; /* afi should be int16 - so we have to access it using */ -}; /* EXTRACT_16BITS(&bgp_route_refresh->afi) (sigh) */ +}; /* EXTRACT_16BITS(&bgp_route_refresh->afi) (sigh) */ #define BGP_ROUTE_REFRESH_SIZE 23 #define bgp_attr_lenlen(flags, p) \ @@ -387,7 +387,7 @@ static const struct tok bgp_safi_values[] = { #define BGP_EXT_COM_OSPF_RTYPE2 0x8000 /* duplicate - keep for backwards compatability */ #define BGP_EXT_COM_OSPF_RID 0x0107 /* OSPF Router ID,Format RouterID(4B):Unused(2B) */ -#define BGP_EXT_COM_OSPF_RID2 0x8001 /* duplicate - keep for backwards compatability */ +#define BGP_EXT_COM_OSPF_RID2 0x8001 /* duplicate - keep for backwards compatability */ #define BGP_EXT_COM_L2INFO 0x800a /* draft-kompella-ppvpn-l2vpn */ @@ -427,7 +427,7 @@ static const struct tok bgp_extd_comm_subtype_values[] = { { BGP_EXT_COM_OSPF_RTYPE2, "ospf-route-type"}, { BGP_EXT_COM_OSPF_RID, "ospf-router-id"}, { BGP_EXT_COM_OSPF_RID2, "ospf-router-id"}, - { BGP_EXT_COM_L2INFO, "layer2-info"}, + { BGP_EXT_COM_L2INFO, "layer2-info"}, { BGP_EXT_COM_EIGRP_GEN , "eigrp-general-route (flag, tag)" }, { BGP_EXT_COM_EIGRP_METRIC_AS_DELAY , "eigrp-route-metric (AS, delay)" }, { BGP_EXT_COM_EIGRP_METRIC_REL_NH_BW , "eigrp-route-metric (reliability, nexthop, bandwidth)" }, @@ -451,12 +451,12 @@ static const struct tok bgp_extd_comm_subtype_values[] = { #define BGP_OSPF_RTYPE_METRIC_TYPE 0x1 /* LSB of RTYPE Options Field */ static const struct tok bgp_extd_comm_ospf_rtype_values[] = { - { BGP_OSPF_RTYPE_RTR, "Router" }, - { BGP_OSPF_RTYPE_NET, "Network" }, - { BGP_OSPF_RTYPE_SUM, "Summary" }, - { BGP_OSPF_RTYPE_EXT, "External" }, + { BGP_OSPF_RTYPE_RTR, "Router" }, + { BGP_OSPF_RTYPE_NET, "Network" }, + { BGP_OSPF_RTYPE_SUM, "Summary" }, + { BGP_OSPF_RTYPE_EXT, "External" }, { BGP_OSPF_RTYPE_NSSA,"NSSA External" }, - { BGP_OSPF_RTYPE_SHAM,"MPLS-VPN Sham" }, + { BGP_OSPF_RTYPE_SHAM,"MPLS-VPN Sham" }, { 0, NULL }, }; @@ -643,7 +643,7 @@ bgp_vpn_sg_print (const u_char *pptr, char *buf, u_int buflen) { bgp_vpn_ip_print(pptr, addr_length)); pptr += (addr_length >> 3); } - + /* Group address length, encoded in bits */ TCHECK2(pptr[0], 1); addr_length = *pptr++; @@ -799,7 +799,7 @@ decode_mdt_vpn_nlri(const u_char *pptr, char *buf, u_int buflen) const u_char *rd; const u_char *vpn_ip; - + TCHECK(pptr[0]); /* if the NLRI is not predefined length, quit.*/ @@ -822,7 +822,7 @@ decode_mdt_vpn_nlri(const u_char *pptr, char *buf, u_int buflen) snprintf(buf, buflen, "RD: %s, VPN IP Address: %s, MC Group Address: %s", bgp_vpn_rd_print(rd), ipaddr_string(vpn_ip), ipaddr_string(pptr)); - + return MDT_VPN_NLRI_LEN + 1; trunc: @@ -967,12 +967,12 @@ decode_labeled_vpn_l2(const u_char *pptr, char *buf, u_int buflen) * -> Assume a 12 Byte-length NLRI is auto-discovery-only * and > 17 as old format. Complain for the middle case */ - if (plen==12) { + if (plen==12) { /* assume AD-only with RD, BGPNH */ TCHECK2(pptr[0],12); buf[0]='\0'; strlen=snprintf(buf, buflen, "RD: %s, BGPNH: %s", - bgp_vpn_rd_print(pptr), + bgp_vpn_rd_print(pptr), /* need something like getname() here */ getname(pptr+8) ); @@ -980,7 +980,7 @@ decode_labeled_vpn_l2(const u_char *pptr, char *buf, u_int buflen) pptr+=12; tlen-=12; return plen; - } else if (plen>17) { + } else if (plen>17) { /* assume old format */ /* RD, ID, LBLKOFF, LBLBASE */ @@ -1035,7 +1035,7 @@ decode_labeled_vpn_l2(const u_char *pptr, char *buf, u_int buflen) tlen-=(tlv_len<<3); /* the tlv-length is expressed in bits so lets shift it right */ } return plen+2; - + } else { /* complain bitterly ? */ /* fall through */ @@ -1293,7 +1293,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) u_int16_t af; u_int8_t safi, snpa, nhlen; union { /* copy buffer for bandwidth values */ - float f; + float f; u_int32_t i; } bw; int advance; @@ -1353,7 +1353,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) TCHECK2(tptr[2 + i], as_size); printf("%s ", as_printf(astostr, sizeof(astostr), - as_size == 2 ? + as_size == 2 ? EXTRACT_16BITS(&tptr[2 + i]) : EXTRACT_32BITS(&tptr[2 + i]))); } @@ -1473,7 +1473,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) TCHECK2(tptr[0], 3); af = EXTRACT_16BITS(tptr); safi = tptr[2]; - + printf("\n\t AFI: %s (%u), %sSAFI: %s (%u)", tok2strbuf(af_values, "Unknown AFI", af, tokbuf, sizeof(tokbuf)), @@ -1493,7 +1493,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) case (AFNUM_INET<<8 | SAFNUM_VPNMULTICAST): case (AFNUM_INET<<8 | SAFNUM_VPNUNIMULTICAST): case (AFNUM_INET<<8 | SAFNUM_MULTICAST_VPN): - case (AFNUM_INET<<8 | SAFNUM_MDT): + case (AFNUM_INET<<8 | SAFNUM_MDT): #ifdef INET6 case (AFNUM_INET6<<8 | SAFNUM_UNICAST): case (AFNUM_INET6<<8 | SAFNUM_MULTICAST): @@ -1544,7 +1544,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) case (AFNUM_INET<<8 | SAFNUM_LABUNICAST): case (AFNUM_INET<<8 | SAFNUM_RT_ROUTING_INFO): case (AFNUM_INET<<8 | SAFNUM_MULTICAST_VPN): - case (AFNUM_INET<<8 | SAFNUM_MDT): + case (AFNUM_INET<<8 | SAFNUM_MDT): if (tlen < (int)sizeof(struct in_addr)) { printf("invalid len"); tlen = 0; @@ -1790,7 +1790,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) else if (advance == -2) goto trunc; else - printf("\n\t %s", buf); + printf("\n\t %s", buf); break; case (AFNUM_NSAP<<8 | SAFNUM_UNICAST): case (AFNUM_NSAP<<8 | SAFNUM_MULTICAST): @@ -1813,7 +1813,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) goto trunc; else printf("\n\t %s", buf); - break; + break; default: TCHECK2(*tptr,tlen); printf("\n\t no AFI %u / SAFI %u decoder",af,safi); @@ -1848,7 +1848,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) printf("\n\t End-of-Rib Marker (empty NLRI)"); tptr += 3; - + while (len - (tptr - pptr) > 0) { switch (af<<8 | safi) { case (AFNUM_INET<<8 | SAFNUM_UNICAST): @@ -1933,7 +1933,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) else if (advance == -2) goto trunc; else - printf("\n\t %s", buf); + printf("\n\t %s", buf); break; case (AFNUM_NSAP<<8 | SAFNUM_UNICAST): case (AFNUM_NSAP<<8 | SAFNUM_MULTICAST): @@ -1956,7 +1956,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) goto trunc; else printf("\n\t %s", buf); - break; + break; case (AFNUM_INET<<8 | SAFNUM_MDT): advance = decode_mdt_vpn_nlri(tptr, buf, sizeof(buf)); if (advance == -1) @@ -1980,7 +1980,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) TCHECK2(*(tptr-3),tlen); printf("no AFI %u / SAFI %u decoder",af,safi); if (vflag <= 1) - print_unknown_data(tptr-3,"\n\t ",tlen); + print_unknown_data(tptr-3,"\n\t ",tlen); advance = 0; tptr = pptr + len; break; @@ -2046,7 +2046,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) printf("%s", getname(tptr+2)); break; case BGP_EXT_COM_OSPF_RTYPE: - case BGP_EXT_COM_OSPF_RTYPE2: + case BGP_EXT_COM_OSPF_RTYPE2: printf(": area:%s, router-type:%s, metric-type:%s%s", getname(tptr+2), tok2strbuf(bgp_extd_comm_ospf_rtype_values, @@ -2081,7 +2081,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) case BGPTYPE_PMSI_TUNNEL: { u_int8_t tunnel_type, flags; - + tunnel_type = *(tptr+1); flags = *tptr; tlen = len; @@ -2147,7 +2147,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) while (len) { u_int aflags, atype, alenlen, alen; - + TCHECK2(tptr[0], 2); if (len < 2) goto trunc; @@ -2162,14 +2162,14 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) alen = bgp_attr_len(aflags, tptr); tptr += alenlen; len -= alenlen; - + printf("\n\t %s (%u), length: %u", tok2strbuf(bgp_attr_values, "Unknown Attribute", atype, tokbuf, sizeof(tokbuf)), atype, alen); - + if (aflags) { printf(", Flags [%s%s%s%s", aflags & 0x80 ? "O" : "", @@ -2187,7 +2187,7 @@ bgp_attr_print(u_int atype, const u_char *pptr, u_int len) len -= alen; } break; - + default: TCHECK2(*pptr,len); @@ -2310,7 +2310,7 @@ bgp_open_print(const u_char *dat, int length) printf("\n\t Optional parameters, length: %u", bgpo.bgpo_optlen); /* some little sanity checking */ - if (length < bgpo.bgpo_optlen+BGP_OPEN_SIZE) + if (length < bgpo.bgpo_optlen+BGP_OPEN_SIZE) return; /* ugly! */ @@ -2489,7 +2489,7 @@ bgp_update_print(const u_char *dat, int length) len -= alen; length -= alen; } - } + } if (length) { /* @@ -2619,7 +2619,7 @@ bgp_route_refresh_print(const u_char *pptr, int len) { /* this stinks but the compiler pads the structure * weird */ EXTRACT_16BITS(&bgp_route_refresh_header->afi), - tokbuf, sizeof(tokbuf)), + tokbuf, sizeof(tokbuf)), EXTRACT_16BITS(&bgp_route_refresh_header->afi), tok2strbuf(bgp_safi_values,"Unknown", bgp_route_refresh_header->safi, @@ -2630,7 +2630,7 @@ bgp_route_refresh_print(const u_char *pptr, int len) { TCHECK2(*pptr, len); print_unknown_data(pptr,"\n\t ", len); } - + return; trunc: printf("[|BGP]"); diff --git a/print-bootp.c b/print-bootp.c index 97a39c05..499f9785 100644 --- a/print-bootp.c +++ b/print-bootp.c @@ -701,7 +701,7 @@ rfc1048_print(register const u_char *bp) case TAG_CLASSLESS_STATIC_RT: case TAG_CLASSLESS_STA_RT_MS: - { + { u_int mask_width, significant_octets, i; /* this option should be at least 5 bytes long */ @@ -9,8 +9,8 @@ * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: - * ``This product includes software developed by Paolo Abeni.'' - * The name of author may not be used to endorse or promote products derived + * ``This product includes software developed by Paolo Abeni.'' + * The name of author may not be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF diff --git a/print-cfm.c b/print-cfm.c index 5df498c5..b71014db 100644 --- a/print-cfm.c +++ b/print-cfm.c @@ -280,7 +280,7 @@ cfm_mgmt_addr_print(register const u_char *tptr) { const char * cfm_egress_id_string(register const u_char *tptr) { static char egress_id_buffer[80]; - + snprintf(egress_id_buffer, sizeof(egress_id_buffer), "MAC 0x%4x-%s", EXTRACT_16BITS(tptr), @@ -404,7 +404,7 @@ cfm_print(register const u_char *pptr, register u_int length) { tok2str(cfm_ma_nameformat_values, "Unknown", *ma_nameformat), *ma_nameformat, - *ma_namelength); + *ma_namelength); printf("\n\t MA Name: "); switch (*ma_nameformat) { @@ -482,7 +482,7 @@ cfm_print(register const u_char *pptr, register u_int length) { tptr += cfm_common_header->first_tlv_offset; tlen -= cfm_common_header->first_tlv_offset; - + while (tlen > 0) { cfm_tlv_header = (const struct cfm_tlv_header_t *)tptr; @@ -492,7 +492,7 @@ cfm_print(register const u_char *pptr, register u_int length) { if (cfm_tlv_type != CFM_TLV_END) { /* did we capture enough for fully decoding the object header ? */ - TCHECK2(*tptr, sizeof(struct cfm_tlv_header_t)); + TCHECK2(*tptr, sizeof(struct cfm_tlv_header_t)); cfm_tlv_len=EXTRACT_16BITS(&cfm_tlv_header->length); } else { cfm_tlv_len = 0; diff --git a/print-chdlc.c b/print-chdlc.c index 36db69db..79eaaa9e 100644 --- a/print-chdlc.c +++ b/print-chdlc.c @@ -42,7 +42,7 @@ static const char rcsid[] _U_ = static void chdlc_slarp_print(const u_char *, u_int); -static const struct tok chdlc_cast_values[] = { +static const struct tok chdlc_cast_values[] = { { CHDLC_UNICAST, "unicast" }, { CHDLC_BCAST, "bcast" }, { 0, NULL} diff --git a/print-dccp.c b/print-dccp.c index adf4577d..cf5d2113 100644 --- a/print-dccp.c +++ b/print-dccp.c @@ -50,22 +50,22 @@ static const char *dccp_reset_codes[] = { }; static const char *dccp_feature_nums[] = { - "reserved", + "reserved", "ccid", "allow_short_seqno", "sequence_window", - "ecn_incapable", - "ack_ratio", + "ecn_incapable", + "ack_ratio", "send_ack_vector", - "send_ndp_count", - "minimum checksum coverage", + "send_ndp_count", + "minimum checksum coverage", "check data checksum", }; static inline u_int dccp_csum_coverage(const struct dccp_hdr* dh, u_int len) { u_int cov; - + if (DCCPH_CSCOV(dh) == 0) return len; cov = (dh->dccph_doff + DCCPH_CSCOV(dh) - 1) * sizeof(u_int32_t); @@ -164,7 +164,7 @@ static int dccp_print_option(const u_char *option); /** * dccp_print - show dccp packet * @bp - beginning of dccp packet - * @data2 - beginning of enclosing + * @data2 - beginning of enclosing * @len - lenght of ip packet */ void dccp_print(const u_char *bp, const u_char *data2, u_int len) @@ -312,7 +312,7 @@ void dccp_print(const u_char *bp, const u_char *data2, u_int len) break; } - if ((DCCPH_TYPE(dh) != DCCP_PKT_DATA) && + if ((DCCPH_TYPE(dh) != DCCP_PKT_DATA) && (DCCPH_TYPE(dh) != DCCP_PKT_REQUEST)) dccp_print_ack_no(bp); @@ -326,19 +326,19 @@ void dccp_print(const u_char *bp, const u_char *data2, u_int len) const u_char *cp; u_int optlen; cp = bp + dccp_basic_hdr_len(dh) + extlen; - printf(" <"); + printf(" <"); hlen -= dccp_basic_hdr_len(dh) + extlen; while(1){ TCHECK(*cp); optlen = dccp_print_option(cp); if (!optlen) goto trunc2; - if (hlen <= optlen) break; + if (hlen <= optlen) break; hlen -= optlen; cp += optlen; printf(", "); } - printf(">"); + printf(">"); } return; trunc: @@ -348,7 +348,7 @@ trunc2: } static int dccp_print_option(const u_char *option) -{ +{ u_int8_t optlen, i; TCHECK(*option); @@ -367,60 +367,60 @@ static int dccp_print_option(const u_char *option) switch (*option){ case 0: printf("nop"); - break; + break; case 1: printf("mandatory"); - break; + break; case 2: printf("slowreceiver"); - break; + break; case 32: printf("change_l"); if (*(option +2) < 10){ printf(" %s", dccp_feature_nums[*(option +2)]); - for (i = 0; i < optlen -3; i ++) printf(" %d", *(option +3 + i)); + for (i = 0; i < optlen -3; i ++) printf(" %d", *(option +3 + i)); } - break; + break; case 33: printf("confirm_l"); if (*(option +2) < 10){ printf(" %s", dccp_feature_nums[*(option +2)]); - for (i = 0; i < optlen -3; i ++) printf(" %d", *(option +3 + i)); + for (i = 0; i < optlen -3; i ++) printf(" %d", *(option +3 + i)); } break; case 34: printf("change_r"); if (*(option +2) < 10){ printf(" %s", dccp_feature_nums[*(option +2)]); - for (i = 0; i < optlen -3; i ++) printf(" %d", *(option +3 + i)); + for (i = 0; i < optlen -3; i ++) printf(" %d", *(option +3 + i)); } break; case 35: printf("confirm_r"); if (*(option +2) < 10){ printf(" %s", dccp_feature_nums[*(option +2)]); - for (i = 0; i < optlen -3; i ++) printf(" %d", *(option +3 + i)); + for (i = 0; i < optlen -3; i ++) printf(" %d", *(option +3 + i)); } break; case 36: printf("initcookie 0x"); - for (i = 0; i < optlen -2; i ++) printf("%02x", *(option +2 + i)); + for (i = 0; i < optlen -2; i ++) printf("%02x", *(option +2 + i)); break; case 37: printf("ndp_count"); - for (i = 0; i < optlen -2; i ++) printf(" %d", *(option +2 + i)); + for (i = 0; i < optlen -2; i ++) printf(" %d", *(option +2 + i)); break; case 38: printf("ack_vector0 0x"); - for (i = 0; i < optlen -2; i ++) printf("%02x", *(option +2 + i)); + for (i = 0; i < optlen -2; i ++) printf("%02x", *(option +2 + i)); break; case 39: printf("ack_vector1 0x"); - for (i = 0; i < optlen -2; i ++) printf("%02x", *(option +2 + i)); + for (i = 0; i < optlen -2; i ++) printf("%02x", *(option +2 + i)); break; case 40: printf("data_dropped 0x"); - for (i = 0; i < optlen -2; i ++) printf("%02x", *(option +2 + i)); + for (i = 0; i < optlen -2; i ++) printf("%02x", *(option +2 + i)); break; case 41: printf("timestamp %u", EXTRACT_32BITS(option + 2)); @@ -437,7 +437,7 @@ static int dccp_print_option(const u_char *option) break; case 44: printf("data_checksum "); - for (i = 0; i < optlen -2; i ++) printf("%02x", *(option +2 + i)); + for (i = 0; i < optlen -2; i ++) printf("%02x", *(option +2 + i)); break; default : if (*option >= 128) { @@ -454,7 +454,7 @@ static int dccp_print_option(const u_char *option) } break; } - + printf("unknown_opt %d", *option); break; } diff --git a/print-dhcp6.c b/print-dhcp6.c index 255f24aa..c210ebc1 100644 --- a/print-dhcp6.c +++ b/print-dhcp6.c @@ -28,7 +28,7 @@ */ /* * RFC3315: DHCPv6 - * supported DHCPv6 options: + * supported DHCPv6 options: * RFC3319: Session Initiation Protocol (SIP) Servers options, * RFC3633: IPv6 Prefix options, * RFC3646: DNS Configuration options, diff --git a/print-dtp.c b/print-dtp.c index 14ac6916..90ce6cc3 100644 --- a/print-dtp.c +++ b/print-dtp.c @@ -28,7 +28,7 @@ #include "interface.h" #include "addrtoname.h" -#include "extract.h" +#include "extract.h" #include "nlpid.h" #define DTP_HEADER_LEN 1 @@ -54,12 +54,12 @@ dtp_print (const u_char *pptr, u_int length) if (length < DTP_HEADER_LEN) goto trunc; - tptr = pptr; + tptr = pptr; - if (!TTEST2(*tptr, DTP_HEADER_LEN)) + if (!TTEST2(*tptr, DTP_HEADER_LEN)) goto trunc; - printf("DTPv%u, length %u", + printf("DTPv%u, length %u", (*tptr), length); @@ -74,11 +74,11 @@ dtp_print (const u_char *pptr, u_int length) while (tptr < (pptr+length)) { - if (!TTEST2(*tptr, 4)) + if (!TTEST2(*tptr, 4)) goto trunc; type = EXTRACT_16BITS(tptr); - len = EXTRACT_16BITS(tptr+2); + len = EXTRACT_16BITS(tptr+2); /* infinite loop check */ if (type == 0 || len == 0) { @@ -94,7 +94,7 @@ dtp_print (const u_char *pptr, u_int length) printf(", %s", tptr+4); break; - case DTP_STATUS_TLV: + case DTP_STATUS_TLV: case DTP_DTP_TYPE_TLV: printf(", 0x%x", *(tptr+4)); break; @@ -105,7 +105,7 @@ dtp_print (const u_char *pptr, u_int length) default: break; - } + } tptr += len; } diff --git a/print-dvmrp.c b/print-dvmrp.c index 437e7160..1353c46c 100644 --- a/print-dvmrp.c +++ b/print-dvmrp.c @@ -165,7 +165,7 @@ trunc: return; } -static int +static int print_report(register const u_char *bp, register const u_char *ep, register u_int len) { diff --git a/print-eap.c b/print-eap.c index 9fb333ad..b1dea6d0 100644 --- a/print-eap.c +++ b/print-eap.c @@ -113,7 +113,7 @@ static const struct tok eap_type_values[] = { { EAP_TYPE_EXPANDED_TYPES, "Expanded types" }, { EAP_TYPE_EXPERIMENTAL, "Experimental" }, { 0, NULL} -}; +}; #define EAP_TLS_EXTRACT_BIT_L(x) (((x)&0x80)>>7) @@ -167,7 +167,7 @@ eap_print(netdissect_options *ndo _U_, const u_char *tptr; u_int tlen, type, subtype; int count=0, len; - + tptr = cp; tlen = length; eap = (const struct eap_frame_t *)cp; @@ -182,8 +182,8 @@ eap_print(netdissect_options *ndo _U_, EXTRACT_16BITS(eap->length)); return; } - - printf("%s (%u) v%u, len %u", + + printf("%s (%u) v%u, len %u", tok2str(eap_frame_type_values, "unknown", eap->type), eap->type, eap->version, @@ -202,7 +202,7 @@ eap_print(netdissect_options *ndo _U_, *(tptr+1), len); - if (!TTEST2(*tptr, len)) + if (!TTEST2(*tptr, len)) goto trunc; if (type <= 2) { /* For EAP_REQUEST and EAP_RESPONSE only */ @@ -211,7 +211,7 @@ eap_print(netdissect_options *ndo _U_, tok2str(eap_type_values, "unknown", *(tptr+4)), *(tptr+4)); - switch (subtype) { + switch (subtype) { case EAP_TYPE_IDENTITY: if (len - 5 > 0) { printf(", Identity: "); @@ -234,8 +234,8 @@ eap_print(netdissect_options *ndo _U_, * the desired authentication * type one octet per type */ - while (count < len) { - printf(" %s (%u),", + while (count < len) { + printf(" %s (%u),", tok2str(eap_type_values, "unknown", *(tptr+count)), *(tptr+count)); count++; @@ -243,10 +243,10 @@ eap_print(netdissect_options *ndo _U_, break; case EAP_TYPE_TTLS: - printf(" TTLSv%u", + printf(" TTLSv%u", EAP_TTLS_VERSION(*(tptr+5))); /* fall through */ case EAP_TYPE_TLS: - printf(" flags [%s] 0x%02x,", + printf(" flags [%s] 0x%02x,", bittok2str(eap_tls_flags_values, "none", *(tptr+5)), *(tptr+5)); @@ -278,7 +278,7 @@ eap_print(netdissect_options *ndo _U_, /* FIXME - TLV attributes follow */ break; - case EAP_TYPE_MD5_CHALLENGE: + case EAP_TYPE_MD5_CHALLENGE: case EAP_TYPE_OTP: case EAP_TYPE_GTC: case EAP_TYPE_EXPANDED_TYPES: @@ -287,7 +287,7 @@ eap_print(netdissect_options *ndo _U_, break; } } - break; + break; case EAP_FRAME_TYPE_LOGOFF: case EAP_FRAME_TYPE_ENCAP_ASF_ALERT: diff --git a/print-egp.c b/print-egp.c index bea2996c..5d0bb79f 100644 --- a/print-egp.c +++ b/print-egp.c @@ -237,7 +237,7 @@ egp_print(register const u_int8_t *bp, register u_int length) } else printf("EGPv%u, length %u", egp->egp_version, - length); + length); if (egp->egp_version != EGP_VERSION) { printf("[version %d]", egp->egp_version); diff --git a/print-eigrp.c b/print-eigrp.c index 4f941d96..86288450 100644 --- a/print-eigrp.c +++ b/print-eigrp.c @@ -115,14 +115,14 @@ struct eigrp_tlv_general_parm_t { u_int8_t k5; u_int8_t res; u_int8_t holdtime[2]; -}; +}; struct eigrp_tlv_sw_version_t { u_int8_t ios_major; u_int8_t ios_minor; u_int8_t eigrp_major; u_int8_t eigrp_minor; -}; +}; struct eigrp_tlv_ip_int_t { u_int8_t nexthop[4]; @@ -135,7 +135,7 @@ struct eigrp_tlv_ip_int_t { u_int8_t reserved[2]; u_int8_t plen; u_int8_t destination; /* variable length [1-4] bytes encoding */ -}; +}; struct eigrp_tlv_ip_ext_t { u_int8_t nexthop[4]; @@ -155,7 +155,7 @@ struct eigrp_tlv_ip_ext_t { u_int8_t reserved2[2]; u_int8_t plen; u_int8_t destination; /* variable length [1-4] bytes encoding */ -}; +}; struct eigrp_tlv_at_cable_setup_t { u_int8_t cable_start[2]; @@ -174,7 +174,7 @@ struct eigrp_tlv_at_int_t { u_int8_t reserved[2]; u_int8_t cable_start[2]; u_int8_t cable_end[2]; -}; +}; struct eigrp_tlv_at_ext_t { u_int8_t nexthop[4]; diff --git a/print-enc.c b/print-enc.c index 5c01f3ef..b2dc06c4 100644 --- a/print-enc.c +++ b/print-enc.c @@ -73,7 +73,7 @@ enc_if_print(const struct pcap_pkthdr *h, register const u_char *p) length -= ENC_HDRLEN; caplen -= ENC_HDRLEN; p += ENC_HDRLEN; - + switch (hdr->af) { case AF_INET: ip_print(gndo, p, length); diff --git a/print-esp.c b/print-esp.c index 407fdb36..57644707 100644 --- a/print-esp.c +++ b/print-esp.c @@ -106,7 +106,7 @@ int esp_print_decrypt_buffer_by_ikev2(netdissect_options *ndo, /* initiator arg is any non-zero value */ if(initiator) initiator=1; - + /* see if we can find the SA, and if so, decode it */ for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) { if (sa->spi == 0 @@ -141,7 +141,7 @@ int esp_print_decrypt_buffer_by_ikev2(netdissect_options *ndo, ndo->ndo_snapend = end; return 1; - + } USES_APPLE_RST @@ -200,12 +200,12 @@ int espprint_decode_hex(netdissect_options *ndo, int i; len = strlen(hex) / 2; - + if (len > binbuf_len) { (*ndo->ndo_warning)(ndo, "secret is too big: %d\n", len); return 0; } - + i = 0; while (hex[0] != '\0' && hex[1]!='\0') { binbuf[i] = hex2byte(ndo, hex); @@ -229,14 +229,14 @@ espprint_decode_encalgo(netdissect_options *ndo, const EVP_CIPHER *evp; int authlen = 0; char *colon, *p; - + colon = strchr(decode, ':'); if (colon == NULL) { (*ndo->ndo_warning)(ndo, "failed to decode espsecret: %s\n", decode); return 0; } *colon = '\0'; - + if (strlen(decode) > strlen("-hmac96") && !strcmp(decode + strlen(decode) - strlen("-hmac96"), "-hmac96")) { @@ -258,11 +258,11 @@ espprint_decode_encalgo(netdissect_options *ndo, sa->ivlen = 0; return 0; } - + sa->evp = evp; sa->authlen = authlen; sa->ivlen = EVP_CIPHER_iv_length(evp); - + colon++; if (colon[0] == '0' && colon[1] == 'x') { /* decode some hex! */ @@ -272,7 +272,7 @@ espprint_decode_encalgo(netdissect_options *ndo, if(sa->secretlen == 0) return 0; } else { i = strlen(colon); - + if (i < sizeof(sa->secret)) { memcpy(sa->secret, colon, i); sa->secretlen = i; @@ -302,7 +302,7 @@ espprint_decode_authalgo(netdissect_options *ndo, return 0; } *colon = '\0'; - + if(strcasecmp(colon,"sha1") == 0 || strcasecmp(colon,"md5") == 0) { sa->authlen = 12; @@ -321,21 +321,21 @@ static void esp_print_decode_ikeline(netdissect_options *ndo, char *line, int ilen, rlen; char *authkey; char *enckey; - + init = strsep(&line, " \t"); icookie = strsep(&line, " \t"); rcookie = strsep(&line, " \t"); authkey = strsep(&line, " \t"); enckey = strsep(&line, " \t"); - + /* if any fields are missing */ if(!init || !icookie || !rcookie || !authkey || !enckey) { (*ndo->ndo_warning)(ndo, "print_esp: failed to find all fields for ikev2 at %s:%u", file, lineno); - + return; } - + ilen = strlen(icookie); rlen = strlen(rcookie); @@ -349,7 +349,7 @@ static void esp_print_decode_ikeline(netdissect_options *ndo, char *line, (*ndo->ndo_warning)(ndo, "init=%s icookie=%s(%u) rcookie=%s(%u)", init, icookie, ilen, rcookie, rlen); - + return; } @@ -364,7 +364,7 @@ static void esp_print_decode_ikeline(netdissect_options *ndo, char *line, if(!espprint_decode_encalgo(ndo, enckey, &sa1)) return; if(!espprint_decode_authalgo(ndo, authkey, &sa1)) return; - + esp_print_addsa(ndo, &sa1, FALSE); } @@ -430,27 +430,27 @@ static void esp_print_decode_onesecret(netdissect_options *ndo, char *line, if (spikey && strcasecmp(spikey, "ikev2") == 0) { esp_print_decode_ikeline(ndo, line, file, lineno); return; - } + } if (spikey) { - + char *spistr, *foo; u_int32_t spino; struct sockaddr_in *sin; #ifdef INET6 struct sockaddr_in6 *sin6; #endif - + spistr = strsep(&spikey, "@"); - + spino = strtoul(spistr, &foo, 0); if (spistr == foo || !spikey) { (*ndo->ndo_warning)(ndo, "print_esp: failed to decode spi# %s\n", foo); return; } - + sa1.spi = spino; - + sin = (struct sockaddr_in *)&sa1.daddr; #ifdef INET6 sin6 = (struct sockaddr_in6 *)&sa1.daddr; @@ -476,7 +476,7 @@ static void esp_print_decode_onesecret(netdissect_options *ndo, char *line, /* skip any blank spaces */ while (isspace((unsigned char)*decode)) decode++; - + if(!espprint_decode_encalgo(ndo, decode, &sa1)) { return; } @@ -645,7 +645,7 @@ esp_print(netdissect_options *ndo, */ if (sa == NULL) sa = ndo->ndo_sa_default; - + /* if not found fail */ if (sa == NULL) goto fail; diff --git a/print-ether.c b/print-ether.c index 4bc8ad3a..1ade6c26 100644 --- a/print-ether.c +++ b/print-ether.c @@ -39,7 +39,7 @@ static const char rcsid[] _U_ = #include "ethertype.h" #include "ether.h" -const struct tok ethertype_values[] = { +const struct tok ethertype_values[] = { { ETHERTYPE_IP, "IPv4" }, { ETHERTYPE_MPLS, "MPLS unicast" }, { ETHERTYPE_MPLS_MULTI, "MPLS multicast" }, @@ -84,7 +84,7 @@ const struct tok ethertype_values[] = { { ETHERTYPE_CFM_OLD, "CFM (old)" }, { ETHERTYPE_CFM, "CFM" }, { ETHERTYPE_LLDP, "LLDP" }, - { ETHERTYPE_TIPC, "TIPC"}, + { ETHERTYPE_TIPC, "TIPC"}, { ETHERTYPE_GEONET_OLD, "GeoNet (old)"}, { ETHERTYPE_GEONET, "GeoNet"}, { ETHERTYPE_CALM_FAST, "CALM FAST"}, @@ -108,14 +108,14 @@ ether_hdr_print(netdissect_options *ndo, if (!ndo->ndo_qflag) { if (ether_type <= ETHERMTU) (void)ND_PRINT((ndo, ", 802.3")); - else + else (void)ND_PRINT((ndo, ", ethertype %s (0x%04x)", tok2str(ethertype_values,"Unknown", ether_type), ether_type)); } else { if (ether_type <= ETHERMTU) (void)ND_PRINT((ndo, ", 802.3")); - else + else (void)ND_PRINT((ndo, ", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", ether_type))); } diff --git a/print-forces.c b/print-forces.c index 0778a340..49c26ae0 100644 --- a/print-forces.c +++ b/print-forces.c @@ -1056,7 +1056,7 @@ pdata_print(register const u_char * pptr, register u_int len, if (more_pd > 0) { int consumed = len - more_pd; pptr += consumed; - len = more_pd; + len = more_pd; /* XXX: Argh, recurse some more */ return recpdoptlv_print(pptr, len, op_msk, indent+1); } else @@ -181,7 +181,7 @@ fr_hdrlen(const u_char *p, u_int addr_len) { if (!p[addr_len + 1] /* pad exist */) return addr_len + 1 /* UI */ + 1 /* pad */ + 1 /* NLPID */; - else + else return addr_len + 1 /* UI */ + 1 /* NLPID */; } @@ -208,7 +208,7 @@ fr_hdr_print(int length, u_int addr_len, u_int dlci, u_int8_t *flags, u_int16_t bittok2str(fr_header_flag_values, "none", EXTRACT_32BITS(flags)), tok2str(ethertype_values, "unknown", nlpid), nlpid, - length); + length); } } @@ -406,7 +406,7 @@ mfr_print(register const u_char *p, u_int length) /* * FRF.16 Link Integrity Control Frame - * + * * 7 6 5 4 3 2 1 0 * +----+----+----+----+----+----+----+----+ * | B | E | C=1| 0 0 0 0 | EA | @@ -491,7 +491,7 @@ mfr_print(register const u_char *p, u_int length) /* do we want to see a hexdump of the IE ? */ if (vflag > 1 ) print_unknown_data(tptr,"\n\t ",ie_len); - + tlen-=ie_len; tptr+=ie_len; } @@ -499,7 +499,7 @@ mfr_print(register const u_char *p, u_int length) } /* * FRF.16 Fragmentation Frame - * + * * 7 6 5 4 3 2 1 0 * +----+----+----+----+----+----+----+----+ * | B | E | C=0|seq. (high 4 bits) | EA | @@ -539,7 +539,7 @@ mfr_print(register const u_char *p, u_int length) /* an NLPID of 0xb1 indicates a 2-byte * FRF.15 header - * + * * 7 6 5 4 3 2 1 0 * +----+----+----+----+----+----+----+----+ * ~ Q.922 header ~ @@ -556,7 +556,7 @@ mfr_print(register const u_char *p, u_int length) static void frf15_print (const u_char *p, u_int length) { - + u_int16_t sequence_num, flags; flags = p[0]&MFR_BEC_MASK; @@ -584,13 +584,13 @@ frf15_print (const u_char *p, u_int length) { */ /* Q.933 packet format - Format of Other Protocols + Format of Other Protocols using Q.933 NLPID - +-------------------------------+ - | Q.922 Address | + +-------------------------------+ + | Q.922 Address | + +---------------+---------------+ + |Control 0x03 | NLPID 0x08 | +---------------+---------------+ - |Control 0x03 | NLPID 0x08 | - +---------------+---------------+ | L2 Protocol ID | | octet 1 | octet 2 | +-------------------------------+ @@ -743,7 +743,7 @@ q933_print(const u_char *p, u_int length) if (p[2] == MSG_ANSI_LOCKING_SHIFT) { is_ansi = 1; } - + printf("%s", eflag ? "" : "Q.933, "); /* printing out header part */ @@ -772,7 +772,7 @@ q933_print(const u_char *p, u_int length) } length -= 2 + is_ansi; ptemp += 2 + is_ansi; - + /* Loop through the rest of IE */ while (length > sizeof(struct ie_tlv_header_t)) { ie_p = (struct ie_tlv_header_t *)ptemp; @@ -804,7 +804,7 @@ q933_print(const u_char *p, u_int length) if (fr_q933_print_ie_codeset[codeset] != NULL) { ie_is_known = fr_q933_print_ie_codeset[codeset](ie_p, ptemp); - } + } if (vflag >= 1 && !ie_is_known) { print_unknown_data(ptemp+2,"\n\t",ie_p->ie_len); @@ -853,7 +853,7 @@ fr_q933_print_ie_codeset5(const struct ie_tlv_header_t *ie_p, const u_char *p) if (!vflag) { printf(", "); } - /* now parse the DLCI information element. */ + /* now parse the DLCI information element. */ if ((ie_p->ie_len < 3) || (p[2] & 0x80) || ((ie_p->ie_len == 3) && !(p[3] & 0x80)) || @@ -864,7 +864,7 @@ fr_q933_print_ie_codeset5(const struct ie_tlv_header_t *ie_p, const u_char *p) !(p[ie_p->ie_len + 1] & 0x80)) { printf("Invalid DLCI IE"); } - + dlci = ((p[2] & 0x3F) << 4) | ((p[3] & 0x78) >> 3); if (ie_p->ie_len == 4) { dlci = (dlci << 6) | ((p[4] & 0x7E) >> 1); diff --git a/print-gre.c b/print-gre.c index 66a40f94..f734251f 100644 --- a/print-gre.c +++ b/print-gre.c @@ -69,9 +69,9 @@ static const char tstr[] = "[|gre]"; static const struct tok gre_flag_values[] = { { GRE_CP, "checksum present"}, - { GRE_RP, "routing present"}, - { GRE_KP, "key present"}, - { GRE_SP, "sequence# present"}, + { GRE_RP, "routing present"}, + { GRE_KP, "key present"}, + { GRE_SP, "sequence# present"}, { GRE_sP, "source routing present"}, { GRE_RECRS, "recursion count"}, { GRE_AP, "ack present"}, diff --git a/print-icmp.c b/print-icmp.c index 98925944..135b9a44 100644 --- a/print-icmp.c +++ b/print-icmp.c @@ -89,7 +89,7 @@ struct icmp { #define icmp_data icmp_dun.id_data }; -#define ICMP_MPLS_EXT_EXTRACT_VERSION(x) (((x)&0xf0)>>4) +#define ICMP_MPLS_EXT_EXTRACT_VERSION(x) (((x)&0xf0)>>4) #define ICMP_MPLS_EXT_VERSION 2 /* @@ -329,7 +329,7 @@ icmp_tstamp_print(u_int tstamp) { snprintf(buf, sizeof(buf), "%02u:%02u:%02u.%03u",hrs,min,sec,msec); return buf; } - + void icmp_print(const u_char *bp, u_int plen, const u_char *bp2, int fragmented) { @@ -612,7 +612,7 @@ icmp_print(const u_char *bp, u_int plen, const u_char *bp2, int fragmented) printf("\n\tMPLS extension v%u", ICMP_MPLS_EXT_EXTRACT_VERSION(*(ext_dp->icmp_ext_version_res))); - + /* * Sanity checking of the header. */ @@ -650,7 +650,7 @@ icmp_print(const u_char *bp, u_int plen, const u_char *bp2, int fragmented) hlen-=sizeof(struct icmp_mpls_ext_object_header_t); /* length field includes tlv header */ - /* infinite loop protection */ + /* infinite loop protection */ if ((obj_class_num == 0) || (obj_tlen < sizeof(struct icmp_mpls_ext_object_header_t))) { return; diff --git a/print-icmp6.c b/print-icmp6.c index 811e5a06..4953340f 100644 --- a/print-icmp6.c +++ b/print-icmp6.c @@ -247,7 +247,7 @@ rpl_print(netdissect_options *ndo, } else { ND_PRINT((ndo, ", (CLR)")); } - + switch(basecode) { case ND_RPL_DIS: ND_PRINT((ndo, "DODAG Information Solicitation")); @@ -295,7 +295,7 @@ rpl_print(netdissect_options *ndo, trunc: ND_PRINT((ndo," [|truncated]")); return; - + } @@ -345,7 +345,7 @@ icmp6_print(netdissect_options *ndo, dp->icmp6_type == ICMP6_HADISCOV_REPLY || dp->icmp6_type == ICMP6_MOBILEPREFIX_ADVERT )) printf(", length %u", length); - + switch (dp->icmp6_type) { case ICMP6_DST_UNREACH: TCHECK(oip->ip6_dst); @@ -585,7 +585,7 @@ icmp6_print(netdissect_options *ndo, return; } if (!vflag) - printf(", length %u", length); + printf(", length %u", length); return; trunc: fputs("[|icmp6]", stdout); @@ -738,11 +738,11 @@ icmp6_opt_print(const u_char *bp, int resid) case ND_OPT_RDNSS: oprd = (struct nd_opt_rdnss *)op; l = (op->nd_opt_len - 1) / 2; - printf(" lifetime %us,", - EXTRACT_32BITS(&oprd->nd_opt_rdnss_lifetime)); + printf(" lifetime %us,", + EXTRACT_32BITS(&oprd->nd_opt_rdnss_lifetime)); for (i = 0; i < l; i++) { TCHECK(oprd->nd_opt_rdnss_addr[i]); - printf(" addr: %s", + printf(" addr: %s", ip6addr_string(&oprd->nd_opt_rdnss_addr[i])); } break; diff --git a/print-isakmp.c b/print-isakmp.c index 5b212b99..4339e6a4 100644 --- a/print-isakmp.c +++ b/print-isakmp.c @@ -108,10 +108,10 @@ static const u_char *ikev2_e_print(netdissect_options *ndo, struct isakmp *base, u_char tpay, const struct isakmp_gen *ext, - u_int item_len, - const u_char *end_pointer, + u_int item_len, + const u_char *end_pointer, u_int32_t phase, - u_int32_t doi0, + u_int32_t doi0, u_int32_t proto0, int depth); @@ -161,11 +161,11 @@ static const char *npstr[] = { "v2cr", "v2auth","v2nonce", "v2n", "v2d", /* 38- 42 */ "v2vid", "v2TSi", "v2TSr", "v2e", "v2cp", /* 43- 47 */ "v2eap", /* 48 */ - + }; /* isakmp->np */ -static const u_char *(*npfunc[])(netdissect_options *ndo, u_char tpay, +static const u_char *(*npfunc[])(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len, const u_char *end_pointer, @@ -231,7 +231,7 @@ static const char *etypestr[] = { ND_PRINT((ndo," [|%s]", NPSTR(np))); \ goto done; \ } - + #define NPFUNC(x) \ (((x) < sizeof(npfunc)/sizeof(npfunc[0]) && npfunc[(x)]) \ @@ -445,13 +445,13 @@ static int ike_show_somedata(struct netdissect_options *ndo, if(len > 10) { len = 10; } - + /* really shouldn't happen because of above */ if(end < cp + len) { end = cp+len; elen = ep - end; } - + ND_PRINT((ndo," data=(")); if(!rawprint(ndo, (caddr_t)(cp), len)) goto trunc; ND_PRINT((ndo, "...")); @@ -628,10 +628,10 @@ ikev1_p_print(netdissect_options *ndo, u_char tpay _U_, ext = (struct isakmp_gen *)((u_char *)(p + 1) + prop.spi_size); ND_TCHECK(*ext); - + cp = ikev1_sub_print(ndo, ISAKMP_NPTYPE_T, ext, ep, phase, doi0, prop.prot_id, depth); - + return cp; trunc: ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_P))); @@ -1446,7 +1446,7 @@ ikev2_t_print(netdissect_options *ndo, u_char tpay _U_, int pcount, ikev2_pay_print(ndo, NPSTR(ISAKMP_NPTYPE_T), t.h.critical); t_id = ntohs(t.t_id); - + map = NULL; nmap = 0; @@ -1532,7 +1532,7 @@ ikev2_p_print(netdissect_options *ndo, u_char tpay _U_, int pcount _U_, cp = ikev2_sub_print(ndo, NULL, ISAKMP_NPTYPE_T, ext, ep, phase, doi0, prop.prot_id, depth); - + return cp; trunc: ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_P))); @@ -1540,7 +1540,7 @@ trunc: } static const u_char * -ikev2_sa_print(netdissect_options *ndo, u_char tpay, +ikev2_sa_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext1, u_int item_len _U_, const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_, @@ -1568,7 +1568,7 @@ trunc: } static const u_char * -ikev2_ke_print(netdissect_options *ndo, u_char tpay, +ikev2_ke_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_, @@ -1584,7 +1584,7 @@ ikev2_ke_print(netdissect_options *ndo, u_char tpay, ND_PRINT((ndo," len=%u group=%s", ntohs(ke.h.len) - 8, STR_OR_ID(ntohs(ke.ke_group), dh_p_map))); - + if (2 < ndo->ndo_vflag && 8 < ntohs(ke.h.len)) { ND_PRINT((ndo," ")); if (!rawprint(ndo, (caddr_t)(k + 1), ntohs(ke.h.len) - 8)) @@ -1597,7 +1597,7 @@ trunc: } static const u_char * -ikev2_ID_print(netdissect_options *ndo, u_char tpay, +ikev2_ID_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_, @@ -1679,7 +1679,7 @@ trunc: } static const u_char * -ikev2_cert_print(netdissect_options *ndo, u_char tpay, +ikev2_cert_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_, @@ -1689,7 +1689,7 @@ ikev2_cert_print(netdissect_options *ndo, u_char tpay, } static const u_char * -ikev2_cr_print(netdissect_options *ndo, u_char tpay, +ikev2_cr_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_, @@ -1699,7 +1699,7 @@ ikev2_cr_print(netdissect_options *ndo, u_char tpay, } static const u_char * -ikev2_auth_print(netdissect_options *ndo, u_char tpay, +ikev2_auth_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_, @@ -1716,7 +1716,7 @@ ikev2_auth_print(netdissect_options *ndo, u_char tpay, ikev2_pay_print(ndo, NPSTR(tpay), a.h.critical); len = ntohs(a.h.len); - ND_PRINT((ndo," len=%d method=%s", len-4, + ND_PRINT((ndo," len=%d method=%s", len-4, STR_OR_ID(a.auth_method, v2_auth))); if (1 < ndo->ndo_vflag && 4 < len) { @@ -1735,7 +1735,7 @@ trunc: } static const u_char * -ikev2_nonce_print(netdissect_options *ndo, u_char tpay, +ikev2_nonce_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_, @@ -1765,7 +1765,7 @@ trunc: /* notify payloads */ static const u_char * -ikev2_n_print(netdissect_options *ndo, u_char tpay _U_, +ikev2_n_print(netdissect_options *ndo, u_char tpay _U_, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_, @@ -1853,7 +1853,7 @@ ikev2_n_print(netdissect_options *ndo, u_char tpay _U_, showspi = 0; break; - case IV2_NOTIFY_FAILED_CP_REQUIRED: + case IV2_NOTIFY_FAILED_CP_REQUIRED: notify_name = "failed:cp_required"; showspi = 0; break; @@ -1868,7 +1868,7 @@ ikev2_n_print(netdissect_options *ndo, u_char tpay _U_, showspi = 0; break; - case IV2_NOTIFY_SET_WINDOW_SIZE: + case IV2_NOTIFY_SET_WINDOW_SIZE: notify_name = "set_window_size"; showspi = 0; break; @@ -1878,7 +1878,7 @@ ikev2_n_print(netdissect_options *ndo, u_char tpay _U_, showspi = 0; break; - case IV2_NOTIFY_IPCOMP_SUPPORTED: + case IV2_NOTIFY_IPCOMP_SUPPORTED: notify_name = "ipcomp_supported"; showspi = 0; break; @@ -1940,7 +1940,7 @@ ikev2_n_print(netdissect_options *ndo, u_char tpay _U_, if(notify_name) { ND_PRINT((ndo," type=%u(%s)", type, notify_name)); } - + if (showspi && n.spi_size) { ND_PRINT((ndo," spi=")); @@ -1964,7 +1964,7 @@ ikev2_n_print(netdissect_options *ndo, u_char tpay _U_, } else if(showsomedata && cp < ep) { if(!ike_show_somedata(ndo, cp, ep)) goto trunc; } - + return (u_char *)ext + item_len; trunc: ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_N))); @@ -1972,7 +1972,7 @@ trunc: } static const u_char * -ikev2_d_print(netdissect_options *ndo, u_char tpay, +ikev2_d_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_, @@ -1982,7 +1982,7 @@ ikev2_d_print(netdissect_options *ndo, u_char tpay, } static const u_char * -ikev2_vid_print(netdissect_options *ndo, u_char tpay, +ikev2_vid_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_, @@ -1996,7 +1996,7 @@ ikev2_vid_print(netdissect_options *ndo, u_char tpay, safememcpy(&e, ext, sizeof(e)); ikev2_pay_print(ndo, NPSTR(tpay), e.critical); ND_PRINT((ndo," len=%d vid=", ntohs(e.len) - 4)); - + vid = (const u_char *)(ext+1); len = ntohs(e.len) - 4; ND_TCHECK2(*vid, len); @@ -2016,7 +2016,7 @@ trunc: } static const u_char * -ikev2_TS_print(netdissect_options *ndo, u_char tpay, +ikev2_TS_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_, @@ -2031,7 +2031,7 @@ ikev2_e_print(netdissect_options *ndo, _U_ #endif struct isakmp *base, - u_char tpay, + u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, #ifndef HAVE_LIBCRYPTO @@ -2070,14 +2070,14 @@ ikev2_e_print(netdissect_options *ndo, dat = (u_char *)(ext+1); ND_TCHECK2(*dat, dlen); - + #ifdef HAVE_LIBCRYPTO /* try to decypt it! */ if(esp_print_decrypt_buffer_by_ikev2(ndo, base->flags & ISAKMP_FLAG_I, base->i_ck, base->r_ck, dat, dat+dlen)) { - + ext = (const struct isakmp_gen *)ndo->ndo_packetp; /* got it decrypted, print stuff inside. */ @@ -2085,7 +2085,7 @@ ikev2_e_print(netdissect_options *ndo, phase, doi, proto, depth+1); } #endif - + /* always return NULL, because E must be at end, and NP refers * to what was inside. @@ -2097,7 +2097,7 @@ trunc: } static const u_char * -ikev2_cp_print(netdissect_options *ndo, u_char tpay, +ikev2_cp_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_, @@ -2107,7 +2107,7 @@ ikev2_cp_print(netdissect_options *ndo, u_char tpay, } static const u_char * -ikev2_eap_print(netdissect_options *ndo, u_char tpay, +ikev2_eap_print(netdissect_options *ndo, u_char tpay, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_, @@ -2170,7 +2170,7 @@ ikev1_sub_print(netdissect_options *ndo, while (np) { ND_TCHECK(*ext); - + safememcpy(&e, ext, sizeof(e)); ND_TCHECK2(*ext, ntohs(e.len)); @@ -2227,16 +2227,16 @@ ikev1_print(netdissect_options *ndo, u_char np; int i; int phase; - + p = (const struct isakmp *)bp; ep = ndo->ndo_snapend; - + phase = (EXTRACT_32BITS(base->msgid) == 0) ? 1 : 2; if (phase == 1) ND_PRINT((ndo," phase %d", phase)); else ND_PRINT((ndo," phase %d/others", phase)); - + i = cookie_find(&base->i_ck); if (i < 0) { if (iszero((u_char *)&base->r_ck, sizeof(base->r_ck))) { @@ -2254,18 +2254,18 @@ ikev1_print(netdissect_options *ndo, else ND_PRINT((ndo," ?")); } - + ND_PRINT((ndo," %s", ETYPESTR(base->etype))); if (base->flags) { ND_PRINT((ndo,"[%s%s]", base->flags & ISAKMP_FLAG_E ? "E" : "", base->flags & ISAKMP_FLAG_C ? "C" : "")); } - + if (ndo->ndo_vflag) { const struct isakmp_gen *ext; - + ND_PRINT((ndo,":")); - + /* regardless of phase... */ if (base->flags & ISAKMP_FLAG_E) { /* @@ -2275,13 +2275,13 @@ ikev1_print(netdissect_options *ndo, ND_PRINT((ndo," [encrypted %s]", NPSTR(base->np))); goto done; } - + CHECKLEN(p + 1, base->np); np = base->np; ext = (struct isakmp_gen *)(p + 1); ikev1_sub_print(ndo, np, ext, ep, phase, 0, 0, 0); } - + done: if (ndo->ndo_vflag) { if (ntohl(base->len) != length) { @@ -2354,11 +2354,11 @@ ikev2_sub_print(netdissect_options *ndo, struct isakmp_gen e; cp = (const u_char *)ext; - pcount = 0; + pcount = 0; while (np) { pcount++; ND_TCHECK(*ext); - + safememcpy(&e, ext, sizeof(e)); ND_TCHECK2(*ext, ntohs(e.len)); @@ -2521,7 +2521,7 @@ isakmp_rfc3948_print(netdissect_options *ndo, if(length < 4) { goto trunc; } - + /* * see if this is an IKE packet */ @@ -2545,7 +2545,7 @@ isakmp_rfc3948_print(netdissect_options *ndo, bp += advance; length -= advance + padlen; nh = enh & 0xff; - + ip_print_inner(ndo, bp, length, nh, bp2); return; } @@ -2563,5 +2563,5 @@ trunc: */ - + diff --git a/print-isoclns.c b/print-isoclns.c index 4b72f549..2097a855 100644 --- a/print-isoclns.c +++ b/print-isoclns.c @@ -452,10 +452,10 @@ static const struct tok isis_mt_capability_subtlv_values[] = { }; struct isis_spb_mcid { - u_int8_t format_id; - u_int8_t name[32]; + u_int8_t format_id; + u_int8_t name[32]; u_int8_t revision_lvl[2]; - u_int8_t digest[16]; + u_int8_t digest[16]; }; struct isis_subtlv_spb_mcid { @@ -468,7 +468,7 @@ struct isis_subtlv_spb_instance { u_int8_t cist_external_root_path_cost[4]; u_int8_t bridge_priority[2]; u_int8_t spsourceid[4]; - u_int8_t no_of_trees; + u_int8_t no_of_trees; }; #define CLNP_SEGMENT_PART 0x80 @@ -681,7 +681,7 @@ void isoclns_print(const u_int8_t *p, u_int length, u_int caplen) printf("OSI NLPID %s (0x%02x): ", tok2str(nlpid_values,"Unknown",*p), *p); - + switch (*p) { case NLPID_CLNP: @@ -861,7 +861,7 @@ static int clnp_print (const u_int8_t *pptr, u_int length) while (li >= 2) { u_int op, opli; const u_int8_t *tptr; - + TCHECK2(*pptr, 2); if (li < 2) { printf(", bad opts/li"); @@ -878,7 +878,7 @@ static int clnp_print (const u_int8_t *pptr, u_int length) li -= opli; tptr = pptr; tlen = opli; - + printf("\n\t %s Option #%u, length %u, value: ", tok2str(clnp_option_values,"Unknown",op), op, @@ -888,7 +888,7 @@ static int clnp_print (const u_int8_t *pptr, u_int length) case CLNP_OPTION_ROUTE_RECORDING: /* those two options share the format */ - case CLNP_OPTION_SOURCE_ROUTING: + case CLNP_OPTION_SOURCE_ROUTING: printf("%s %s", tok2str(clnp_option_sr_rr_values,"Unknown",*tptr), tok2str(clnp_option_sr_rr_string_values,"Unknown Option %u",op)); @@ -980,12 +980,12 @@ static int clnp_print (const u_int8_t *pptr, u_int length) /* FIXME recursion protection */ clnp_print(pptr, length-clnp_header->length_indicator); break; - } + } case CLNP_PDU_DT: case CLNP_PDU_MD: case CLNP_PDU_ERQ: - + default: /* dump the PDU specific data */ if (length-(pptr-optr) > 0) { @@ -1060,7 +1060,7 @@ esis_print(const u_int8_t *pptr, u_int length) printf(" version %d packet not supported", esis_header->version); return; } - + if (li > length) { printf(" length indicator(%d) > PDU size (%d)!", li, length); return; @@ -1174,7 +1174,7 @@ esis_print(const u_int8_t *pptr, u_int length) li--; printf("\n\t Number of Source Addresses: %u", source_address_number); - + while (source_address_number > 0) { TCHECK(*pptr); if (li < 1) { @@ -1222,7 +1222,7 @@ esis_print(const u_int8_t *pptr, u_int length) default: if (vflag <= 1) { - if (pptr < snapend) + if (pptr < snapend) print_unknown_data(pptr,"\n\t ",snapend-pptr); } return; @@ -1232,7 +1232,7 @@ esis_print(const u_int8_t *pptr, u_int length) while (li != 0) { u_int op, opli; const u_int8_t *tptr; - + if (li < 2) { printf(", bad opts/li"); return; @@ -1247,7 +1247,7 @@ esis_print(const u_int8_t *pptr, u_int length) } li -= opli; tptr = pptr; - + printf("\n\t %s Option #%u, length %u, value: ", tok2str(esis_option_values,"Unknown",op), op, @@ -1299,7 +1299,7 @@ esis_print(const u_int8_t *pptr, u_int length) } trunc: return; -} +} static void @@ -1309,19 +1309,19 @@ isis_print_mcid (const struct isis_spb_mcid *mcid) printf( "ID: %d, Name: ", mcid->format_id); - for(i=0; i<32; i++) - { + for(i=0; i<32; i++) + { printf("%c", mcid->name[i]); if(mcid->name[i] == '\0') break; } - printf("\n\t Lvl: %d", + printf("\n\t Lvl: %d", EXTRACT_16BITS(mcid->revision_lvl)); printf( ", Digest: "); - for(i=0;i<16;i++) + for(i=0;i<16;i++) printf("%.2x ",mcid->digest[i]); } @@ -1384,7 +1384,7 @@ isis_print_mt_port_cap_subtlv (const u_int8_t *tptr, int len) tptr++; printf( "\n\t Digest: "); - + for(i=1;i<=8; i++) { printf("%08x ", EXTRACT_32BITS(tptr)); @@ -1408,7 +1408,7 @@ isis_print_mt_port_cap_subtlv (const u_int8_t *tptr, int len) if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_BVID_MIN_LEN)) goto trunctlv; - printf("\n\t ECT: %08x", + printf("\n\t ECT: %08x", EXTRACT_32BITS(tptr)); tptr = tptr+4; @@ -1424,7 +1424,7 @@ isis_print_mt_port_cap_subtlv (const u_int8_t *tptr, int len) break; } - + default: break; } @@ -1434,7 +1434,7 @@ isis_print_mt_port_cap_subtlv (const u_int8_t *tptr, int len) trunctlv: printf("\n\t\t packet exceeded snapshot"); - return(1); + return(1); } static int @@ -1442,8 +1442,8 @@ isis_print_mt_capability_subtlv (const u_int8_t *tptr, int len) { int stlv_type, stlv_len, tmp; - while (len > 0) - { + while (len > 0) + { stlv_type = *(tptr++); stlv_len = *(tptr++); @@ -1452,14 +1452,14 @@ isis_print_mt_capability_subtlv (const u_int8_t *tptr, int len) tok2str(isis_mt_capability_subtlv_values, "unknown", stlv_type), stlv_type, stlv_len); - + len = len - 2; switch (stlv_type) - { + { case ISIS_SUBTLV_SPB_INSTANCE: - if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN)) + if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN)) goto trunctlv; printf("\n\t CIST Root-ID: %08x", EXTRACT_32BITS(tptr)); @@ -1469,12 +1469,12 @@ isis_print_mt_capability_subtlv (const u_int8_t *tptr, int len) printf(", Path Cost: %08x", EXTRACT_32BITS(tptr)); tptr = tptr+4; printf(", Prio: %d", EXTRACT_16BITS(tptr)); - tptr = tptr + 2; - printf("\n\t RES: %d", + tptr = tptr + 2; + printf("\n\t RES: %d", EXTRACT_16BITS(tptr) >> 5); - printf(", V: %d", + printf(", V: %d", (EXTRACT_16BITS(tptr) >> 4) & 0x0001); - printf(", SPSource-ID: %d", + printf(", SPSource-ID: %d", (EXTRACT_32BITS(tptr) & 0x000fffff)); tptr = tptr+4; printf(", No of Trees: %x", *(tptr)); @@ -1491,9 +1491,9 @@ isis_print_mt_capability_subtlv (const u_int8_t *tptr, int len) printf ("\n\t U:%d, M:%d, A:%d, RES:%d", *(tptr) >> 7, (*(tptr) >> 6) & 0x01, (*(tptr) >> 5) & 0x01, (*(tptr) & 0x1f)); - + tptr++; - + printf (", ECT: %08x", EXTRACT_32BITS(tptr)); tptr = tptr + 4; @@ -1504,14 +1504,14 @@ isis_print_mt_capability_subtlv (const u_int8_t *tptr, int len) tptr = tptr + 3; len = len - ISIS_SUBTLV_SPB_INSTANCE_VLAN_TUPLE_LEN; - tmp--; + tmp--; } break; case ISIS_SUBTLV_SPBM_SI: - if (!TTEST2(*(tptr), 6)) + if (!TTEST2(*(tptr), 6)) goto trunctlv; printf("\n\t BMAC: %08x", EXTRACT_32BITS(tptr)); @@ -1641,13 +1641,13 @@ isis_print_tlv_ip_reach (const u_int8_t *cp, const char *ident, int length) ident, ISIS_LSP_TLV_METRIC_VALUE(tlv_ip_reach->isis_metric_block.metric_delay), ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_delay) ? "External" : "Internal"); - + if (!ISIS_LSP_TLV_METRIC_SUPPORTED(tlv_ip_reach->isis_metric_block.metric_expense)) printf("%s Expense Metric: %u, %s", ident, ISIS_LSP_TLV_METRIC_VALUE(tlv_ip_reach->isis_metric_block.metric_expense), ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_expense) ? "External" : "Internal"); - + if (!ISIS_LSP_TLV_METRIC_SUPPORTED(tlv_ip_reach->isis_metric_block.metric_error)) printf("%s Error Metric: %u, %s", ident, @@ -1707,7 +1707,7 @@ isis_print_ip_reach_subtlv (const u_int8_t *tptr,int subt,int subl,const char *i break; } return(1); - + trunctlv: printf("%spacket exceeded snapshot",ident); return(0); @@ -1723,7 +1723,7 @@ isis_print_is_reach_subtlv (const u_int8_t *tptr,u_int subt,u_int subl,const cha u_int te_class,priority_level,gmpls_switch_cap; union { /* int to float conversion buffer for several subTLVs */ - float f; + float f; u_int32_t i; } bw; @@ -1740,7 +1740,7 @@ isis_print_is_reach_subtlv (const u_int8_t *tptr,u_int subt,u_int subl,const cha goto trunctlv; switch(subt) { - case ISIS_SUBTLV_EXT_IS_REACH_ADMIN_GROUP: + case ISIS_SUBTLV_EXT_IS_REACH_ADMIN_GROUP: case ISIS_SUBTLV_EXT_IS_REACH_LINK_LOCAL_REMOTE_ID: case ISIS_SUBTLV_EXT_IS_REACH_LINK_REMOTE_ID: if (subl >= 4) { @@ -1755,7 +1755,7 @@ isis_print_is_reach_subtlv (const u_int8_t *tptr,u_int subt,u_int subl,const cha printf(", %s", ipaddr_string(tptr)); break; case ISIS_SUBTLV_EXT_IS_REACH_MAX_LINK_BW : - case ISIS_SUBTLV_EXT_IS_REACH_RESERVABLE_BW: + case ISIS_SUBTLV_EXT_IS_REACH_RESERVABLE_BW: if (subl >= 4) { bw.i = EXTRACT_32BITS(tptr); printf(", %.3f Mbps", bw.f*8/1000000 ); @@ -1888,7 +1888,7 @@ isis_print_ext_is_reach (const u_int8_t *tptr,const char *ident, int tlv_type) { char ident_buffer[20]; int subtlv_type,subtlv_len,subtlv_sum_len; int proc_bytes = 0; /* how many bytes did we process ? */ - + if (!TTEST2(*tptr, NODE_ID_LEN)) return(0); @@ -1901,7 +1901,7 @@ isis_print_ext_is_reach (const u_int8_t *tptr,const char *ident, int tlv_type) { printf(", Metric: %d",EXTRACT_24BITS(tptr)); tptr+=3; } - + if (!TTEST2(*tptr, 1)) return(0); subtlv_sum_len=*(tptr++); /* read out subTLV length */ @@ -1933,7 +1933,7 @@ isis_print_ext_is_reach (const u_int8_t *tptr,const char *ident, int tlv_type) { static int isis_print_mtid (const u_int8_t *tptr,const char *ident) { - + if (!TTEST2(*tptr, 2)) return(0); @@ -1973,7 +1973,7 @@ isis_print_extd_ip_reach (const u_int8_t *tptr, const char *ident, u_int16_t afi metric = EXTRACT_32BITS(tptr); processed=4; tptr+=4; - + if (afi == AF_INET) { if (!TTEST2(*tptr, 1)) /* fetch status byte */ return (0); @@ -2004,7 +2004,7 @@ isis_print_extd_ip_reach (const u_int8_t *tptr, const char *ident, u_int16_t afi return (0); /* somebody is fooling us */ byte_length = (bit_length + 7) / 8; /* prefix has variable length encoding */ - + if (!TTEST2(*tptr, byte_length)) return (0); memset(prefix, 0, sizeof prefix); /* clear the copy buffer */ @@ -2023,8 +2023,8 @@ isis_print_extd_ip_reach (const u_int8_t *tptr, const char *ident, u_int16_t afi ident, ip6addr_string(prefix), bit_length); -#endif - +#endif + printf(", Distribution: %s, Metric: %u", ISIS_MASK_TLV_EXTD_IP_UPDOWN(status_byte) ? "down" : "up", metric); @@ -2037,7 +2037,7 @@ isis_print_extd_ip_reach (const u_int8_t *tptr, const char *ident, u_int16_t afi ISIS_MASK_TLV_EXTD_IP6_IE(status_byte) ? "External" : "Internal", ISIS_MASK_TLV_EXTD_IP6_SUBTLV(status_byte) ? ", sub-TLVs present" : ""); #endif - + if ((afi == AF_INET && ISIS_MASK_TLV_EXTD_IP_SUBTLV(status_byte)) #ifdef INET6 || (afi == AF_INET6 && ISIS_MASK_TLV_EXTD_IP6_SUBTLV(status_byte)) @@ -2052,7 +2052,7 @@ isis_print_extd_ip_reach (const u_int8_t *tptr, const char *ident, u_int16_t afi sublen=*(tptr++); processed+=sublen+1; printf(" (%u)",sublen); /* print out subTLV length */ - + while (sublen>0) { if (!TTEST2(*tptr,2)) return (0); @@ -2166,7 +2166,7 @@ static int isis_print (const u_int8_t *p, u_int length) } /* toss any non 6-byte sys-ID len PDUs */ - if (id_length != 6 ) { + if (id_length != 6 ) { printf("bad packet -- illegal sys-ID length (%u)", id_length); return (0); } @@ -2338,7 +2338,7 @@ static int isis_print (const u_int8_t *p, u_int length) header_lsp->checksum[1] = 0; header_lsp->remaining_lifetime[0] = 0; header_lsp->remaining_lifetime[1] = 0; - + printf(", PDU length: %u, Flags: [ %s", pdu_len, @@ -2524,7 +2524,7 @@ static int isis_print (const u_int8_t *p, u_int length) ext_is_len = isis_print_ext_is_reach(tptr,"\n\t ",tlv_type); if (ext_is_len == 0) /* did something go wrong ? */ goto trunctlv; - + tmp-=ext_is_len; tptr+=ext_is_len; } @@ -2544,7 +2544,7 @@ static int isis_print (const u_int8_t *p, u_int length) while (tmp >= NODE_ID_LEN+3+1) { /* is it worth attempting a decode ? */ ext_is_len = isis_print_ext_is_reach(tptr,"\n\t ",tlv_type); if (ext_is_len == 0) /* did something go wrong ? */ - goto trunctlv; + goto trunctlv; tmp-=ext_is_len; tptr+=ext_is_len; } @@ -2693,7 +2693,7 @@ static int isis_print (const u_int8_t *p, u_int length) break; case ISIS_SUBTLV_AUTH_GENERIC: key_id = EXTRACT_16BITS((tptr+1)); - printf("%u, password: ", key_id); + printf("%u, password: ", key_id); for(i=1 + sizeof(u_int16_t);i<tlv_len;i++) { if (!TTEST2(*(tptr+i), 1)) goto trunctlv; @@ -2765,7 +2765,7 @@ static int isis_print (const u_int8_t *p, u_int length) goto trunctlv; printf("\n\t RES: %d, MTID(s): %d", - (EXTRACT_16BITS (tptr) >> 12), + (EXTRACT_16BITS (tptr) >> 12), (EXTRACT_16BITS (tptr) & 0x0fff)); tmp = tmp-2; @@ -2945,7 +2945,7 @@ static int isis_print (const u_int8_t *p, u_int length) if (!TTEST2(*tptr, SYSTEM_ID_LEN)) goto trunctlv; printf(", for %s",isis_print_id(tptr,SYSTEM_ID_LEN)); - } + } break; case ISIS_TLV_IDRP_INFO: diff --git a/print-juniper.c b/print-juniper.c index feb5b9ba..efc3789b 100644 --- a/print-juniper.c +++ b/print-juniper.c @@ -1,6 +1,6 @@ /* NetBSD: print-juniper.c,v 1.2 2007/07/24 11:53:45 drochner Exp */ -/* +/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph @@ -87,8 +87,8 @@ enum { JUNIPER_EXT_TLV_IFD_MEDIATYPE = 3, JUNIPER_EXT_TLV_IFL_IDX = 4, JUNIPER_EXT_TLV_IFL_UNIT = 5, - JUNIPER_EXT_TLV_IFL_ENCAPS = 6, - JUNIPER_EXT_TLV_TTP_IFD_MEDIATYPE = 7, + JUNIPER_EXT_TLV_IFL_ENCAPS = 6, + JUNIPER_EXT_TLV_TTP_IFD_MEDIATYPE = 7, JUNIPER_EXT_TLV_TTP_IFL_ENCAPS = 8 }; @@ -544,9 +544,9 @@ juniper_es_print(const struct pcap_pkthdr *h, register const u_char *p) if (eflag) { if (!es_type_bundle) { - printf("ES SA, index %u, ttl %u type %s (%u), spi %u, Tunnel %s > %s, length %u\n", + printf("ES SA, index %u, ttl %u type %s (%u), spi %u, Tunnel %s > %s, length %u\n", EXTRACT_16BITS(&ih->sa_index), - ih->ttl, + ih->ttl, tok2str(juniper_ipsec_type_values,"Unknown",ih->type), ih->type, EXTRACT_32BITS(&ih->spi), @@ -554,9 +554,9 @@ juniper_es_print(const struct pcap_pkthdr *h, register const u_char *p) ipaddr_string(&ih->dst_ip), l2info.length); } else { - printf("ES SA, index %u, ttl %u type %s (%u), length %u\n", + printf("ES SA, index %u, ttl %u type %s (%u), length %u\n", EXTRACT_16BITS(&ih->sa_index), - ih->ttl, + ih->ttl, tok2str(juniper_ipsec_type_values,"Unknown",ih->type), ih->type, l2info.length); @@ -742,7 +742,7 @@ juniper_pppoe_atm_print(const struct pcap_pkthdr *h, register const u_char *p) l2info.caplen-ETHERTYPE_LEN) == 0) /* ether_type not known, probably it wasn't one */ printf("unknown ethertype 0x%04x", extracted_ethertype); - + return l2info.header_len; } #endif @@ -817,7 +817,7 @@ juniper_mfr_print(const struct pcap_pkthdr *h, register const u_char *p) l2info.pictype = DLT_JUNIPER_MFR; if(juniper_parse_header(p, h, &l2info) == 0) return l2info.header_len; - + p+=l2info.header_len; /* child-link ? */ @@ -859,7 +859,7 @@ juniper_mfr_print(const struct pcap_pkthdr *h, register const u_char *p) case (LLC_UI<<8 | NLPID_IP): case (LLC_UI<<8 | NLPID_IP6): /* pass IP{4,6} to the OSI layer for proper link-layer printing */ - isoclns_print(p-1, l2info.length+1, l2info.caplen+1); + isoclns_print(p-1, l2info.length+1, l2info.caplen+1); break; default: printf("unknown protocol 0x%04x, length %u",l2info.proto, l2info.length); @@ -1151,11 +1151,11 @@ juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct junip TCHECK2(p[0],4); l2info->flags = p[3]; l2info->direction = p[3]&JUNIPER_BPF_PKT_IN; - + if (EXTRACT_24BITS(p) != JUNIPER_MGC_NUMBER) { /* magic number found ? */ printf("no magic-number found!"); return 0; - } + } if (eflag) /* print direction */ printf("%3s ",tok2str(juniper_direction_values,"---",l2info->direction)); @@ -1177,32 +1177,32 @@ juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct junip jnx_ext_len = EXTRACT_16BITS(tptr); jnx_header_len += 2; tptr +=2; - + /* nail up the total length - * just in case something goes wrong * with TLV parsing */ jnx_header_len += jnx_ext_len; - + if (vflag>1) printf(", PCAP Extension(s) total length %u", jnx_ext_len); - + TCHECK2(tptr[0], jnx_ext_len); while (jnx_ext_len > JUNIPER_EXT_TLV_OVERHEAD) { tlv_type = *(tptr++); tlv_len = *(tptr++); tlv_value = 0; - + /* sanity check */ if (tlv_type == 0 || tlv_len == 0) break; - + if (vflag>1) printf("\n\t %s Extension TLV #%u, length %u, value ", tok2str(jnx_ext_tlv_values,"Unknown",tlv_type), tlv_type, tlv_len); - + tlv_value = juniper_read_tlv_value(tptr, tlv_type, tlv_len); switch (tlv_type) { case JUNIPER_EXT_TLV_IFD_NAME: @@ -1236,16 +1236,16 @@ juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct junip } break; } - + tptr+=tlv_len; jnx_ext_len -= tlv_len+JUNIPER_EXT_TLV_OVERHEAD; } - + if (vflag>1) printf("\n\t-----original packet-----\n\t"); - } - - if ((l2info->flags & JUNIPER_BPF_NO_L2 ) == JUNIPER_BPF_NO_L2 ) { + } + + if ((l2info->flags & JUNIPER_BPF_NO_L2 ) == JUNIPER_BPF_NO_L2 ) { if (eflag) printf("no-L2-hdr, "); @@ -1259,7 +1259,7 @@ juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct junip l2info->header_len=jnx_header_len+4; return 0; /* stop parsing the output further */ - + } l2info->header_len = jnx_header_len; p+=l2info->header_len; @@ -1281,7 +1281,7 @@ juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct junip l2info->cookie_type = AS_COOKIE_ID; l2info->cookie_len = 8; break; - + default: l2info->bundle = l2info->cookie[0]; break; @@ -1316,9 +1316,9 @@ juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct junip } if (eflag) printf(": "); /* print demarc b/w L2/L3*/ - - l2info->proto = EXTRACT_16BITS(p+l2info->cookie_len); + + l2info->proto = EXTRACT_16BITS(p+l2info->cookie_len); break; } ++lp; @@ -1335,7 +1335,7 @@ juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct junip break; case AS_COOKIE_ID: l2info->bundle = (EXTRACT_16BITS(&l2info->cookie[6])>>3)&0xfff; - l2info->proto = (l2info->cookie[5])&JUNIPER_LSQ_L3_PROTO_MASK; + l2info->proto = (l2info->cookie[5])&JUNIPER_LSQ_L3_PROTO_MASK; break; default: l2info->bundle = l2info->cookie[0]; @@ -1348,7 +1348,7 @@ juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct junip switch (l2info->cookie_type) { case LS_COOKIE_ID: l2info->bundle = l2info->cookie[1]; - l2info->proto = EXTRACT_16BITS(p); + l2info->proto = EXTRACT_16BITS(p); l2info->header_len += 2; l2info->length -= 2; l2info->caplen -= 2; @@ -1371,7 +1371,7 @@ juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct junip switch (l2info->cookie_type) { case LS_COOKIE_ID: l2info->bundle = l2info->cookie[1]; - l2info->proto = EXTRACT_16BITS(p); + l2info->proto = EXTRACT_16BITS(p); l2info->header_len += 2; l2info->length -= 2; l2info->caplen -= 2; @@ -1402,7 +1402,7 @@ juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct junip default: break; } - + if (eflag) printf("control-word 0x%08x ", control_word); } @@ -1437,7 +1437,7 @@ juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct junip printf("Unknown Juniper DLT_ type %u: ", l2info->pictype); break; } - + if (eflag > 1) printf("hlen %u, proto 0x%04x, ",l2info->header_len,l2info->proto); diff --git a/print-ldp.c b/print-ldp.c index 262c9bda..f852004d 100644 --- a/print-ldp.c +++ b/print-ldp.c @@ -91,8 +91,8 @@ struct ldp_msg_header { u_int8_t id[4]; }; -#define LDP_MASK_MSG_TYPE(x) ((x)&0x7fff) -#define LDP_MASK_U_BIT(x) ((x)&0x8000) +#define LDP_MASK_MSG_TYPE(x) ((x)&0x7fff) +#define LDP_MASK_U_BIT(x) ((x)&0x8000) #define LDP_MSG_NOTIF 0x0001 #define LDP_MSG_HELLO 0x0100 @@ -126,8 +126,8 @@ static const struct tok ldp_msg_values[] = { { 0, NULL} }; -#define LDP_MASK_TLV_TYPE(x) ((x)&0x3fff) -#define LDP_MASK_F_BIT(x) ((x)&0x4000) +#define LDP_MASK_TLV_TYPE(x) ((x)&0x3fff) +#define LDP_MASK_F_BIT(x) ((x)&0x4000) #define LDP_TLV_FEC 0x0100 #define LDP_TLV_ADDRESS_LIST 0x0101 @@ -220,8 +220,8 @@ static const struct tok ldp_fec_martini_ifparm_vccv_cv_values[] = { int ldp_msg_print(register const u_char *); int ldp_tlv_print(register const u_char *); - -/* + +/* * ldp tlv header * * 0 1 2 3 @@ -256,7 +256,7 @@ ldp_tlv_print(register const u_char *tptr) { char buf[100]; int i; - ldp_tlv_header = (const struct ldp_tlv_header *)tptr; + ldp_tlv_header = (const struct ldp_tlv_header *)tptr; tlv_len=EXTRACT_16BITS(ldp_tlv_header->length); tlv_tlen=tlv_len; tlv_type=LDP_MASK_TLV_TYPE(EXTRACT_16BITS(ldp_tlv_header->type)); @@ -311,7 +311,7 @@ ldp_tlv_print(register const u_char *tptr) { TCHECK2(*tptr, sizeof(struct in_addr)); printf(" %s",ipaddr_string(tptr)); tlv_tlen-=sizeof(struct in_addr); - tptr+=sizeof(struct in_addr); + tptr+=sizeof(struct in_addr); } break; #ifdef INET6 @@ -320,7 +320,7 @@ ldp_tlv_print(register const u_char *tptr) { TCHECK2(*tptr, sizeof(struct in6_addr)); printf(" %s",ip6addr_string(tptr)); tlv_tlen-=sizeof(struct in6_addr); - tptr+=sizeof(struct in6_addr); + tptr+=sizeof(struct in6_addr); } break; #endif @@ -533,7 +533,7 @@ ldp_tlv_print(register const u_char *tptr) { break; } return(tlv_len+4); /* Type & Length fields not included */ - + trunc: printf("\n\t\t packet exceeded snapshot"); return 0; @@ -589,7 +589,7 @@ ldp_msg_print(register const u_char *pptr) { EXTRACT_16BITS(&ldp_com_header->label_space), pdu_len); - /* bail out if non-verbose */ + /* bail out if non-verbose */ if (vflag < 1) return 0; @@ -628,7 +628,7 @@ ldp_msg_print(register const u_char *pptr) { hexdump=FALSE; switch(msg_type) { - + case LDP_MSG_NOTIF: case LDP_MSG_HELLO: case LDP_MSG_INIT: diff --git a/print-llc.c b/print-llc.c index 356e313d..5c0d1ced 100644 --- a/print-llc.c +++ b/print-llc.c @@ -75,7 +75,7 @@ static const struct tok llc_cmd_values[] = { { 0, NULL } }; -static const struct tok llc_flag_values[] = { +static const struct tok llc_flag_values[] = { { 0, "Command" }, { LLC_GSAP, "Response" }, { LLC_U_POLL, "Poll" }, @@ -86,14 +86,14 @@ static const struct tok llc_flag_values[] = { }; -static const struct tok llc_ig_flag_values[] = { +static const struct tok llc_ig_flag_values[] = { { 0, "Individual" }, { LLC_IG, "Group" }, { 0, NULL } }; -static const struct tok llc_supervisory_values[] = { +static const struct tok llc_supervisory_values[] = { { 0, "Receiver Ready" }, { 1, "Receiver not Ready" }, { 2, "Reject" }, @@ -101,7 +101,7 @@ static const struct tok llc_supervisory_values[] = { }; -static const struct tok cisco_values[] = { +static const struct tok cisco_values[] = { { PID_CISCO_CDP, "CDP" }, { PID_CISCO_VTP, "VTP" }, { PID_CISCO_DTP, "DTP" }, @@ -111,7 +111,7 @@ static const struct tok cisco_values[] = { { 0, NULL } }; -static const struct tok bridged_values[] = { +static const struct tok bridged_values[] = { { PID_RFC2684_ETH_FCS, "Ethernet + FCS" }, { PID_RFC2684_ETH_NOFCS, "Ethernet w/o FCS" }, { PID_RFC2684_802_4_FCS, "802.4 + FCS" }, @@ -126,7 +126,7 @@ static const struct tok bridged_values[] = { { 0, NULL }, }; -static const struct tok null_values[] = { +static const struct tok null_values[] = { { 0, NULL } }; @@ -445,7 +445,7 @@ snap_print(const u_char *p, u_int length, u_int caplen, u_int bridge_pad) cdp_print(p, length, caplen); return (1); case PID_CISCO_DTP: - dtp_print(p, length); + dtp_print(p, length); return (1); case PID_CISCO_UDLD: udld_print(p, length); diff --git a/print-lldp.c b/print-lldp.c index 04591ab2..2cbe7d3e 100644 --- a/print-lldp.c +++ b/print-lldp.c @@ -40,8 +40,8 @@ static const char rcsid[] _U_ = #include "af.h" #include "oui.h" -#define LLDP_EXTRACT_TYPE(x) (((x)&0xfe00)>>9) -#define LLDP_EXTRACT_LEN(x) ((x)&0x01ff) +#define LLDP_EXTRACT_TYPE(x) (((x)&0xfe00)>>9) +#define LLDP_EXTRACT_LEN(x) ((x)&0x01ff) /* * TLV type codes @@ -244,7 +244,7 @@ static const struct tok lldp_tia_location_lci_catype_values[] = { static const struct tok lldp_tia_location_lci_what_values[] = { { 0, "location of DHCP server"}, - { 1, "location of the network element believed to be closest to the client"}, + { 1, "location of the network element believed to be closest to the client"}, { 2, "location of the client"}, { 0, NULL} }; @@ -473,7 +473,7 @@ static const struct tok lldp_tia_inventory_values[] = { /* * From RFC 3636 - ifMauAutoNegCapAdvertisedBits - */ + */ #define LLDP_MAU_PMD_OTHER (1 << 15) #define LLDP_MAU_PMD_10BASE_T (1 << 14) #define LLDP_MAU_PMD_10BASE_T_FD (1 << 13) @@ -629,7 +629,7 @@ static void print_tsa_assignment_table(const u_char *ptr) { printf("\n\t TSA Assignment Table"); printf("\n\t Traffic Class: 0 1 2 3 4 5 6 7"); - printf("\n\t Value : %-3d %-3d %-3d %-3d %-3d %-3d %-3d %-3d", + printf("\n\t Value : %-3d %-3d %-3d %-3d %-3d %-3d %-3d %-3d", ptr[0],ptr[1],ptr[2],ptr[3],ptr[4],ptr[5],ptr[6],ptr[7]); } @@ -703,7 +703,7 @@ lldp_private_8021_print(const u_char *tptr, u_int tlv_len) } tval=*(tptr+4); printf("\n\t Pre-Priority CNPV Indicator"); - printf("\n\t Priority : 0 1 2 3 4 5 6 7"); + printf("\n\t Priority : 0 1 2 3 4 5 6 7"); printf("\n\t Value : "); for(i=0;i<NO_OF_BITS;i++) printf("%-2d ",(tval>>i)&0x01); @@ -715,31 +715,31 @@ lldp_private_8021_print(const u_char *tptr, u_int tlv_len) printf("%-2d ",(tval>>i)&0x01); break; - case LLDP_PRIVATE_8021_SUBTYPE_ETS_CONFIGURATION: + case LLDP_PRIVATE_8021_SUBTYPE_ETS_CONFIGURATION: if(tlv_len<LLDP_PRIVATE_8021_SUBTYPE_ETS_CONFIGURATION_LENGTH) { return hexdump; } tval=*(tptr+4); printf("\n\t Willing:%d, CBS:%d, RES:%d, Max TCs:%d", tval>>7, (tval>>6) & 0x02, (tval>>3) & 0x07, tval & 0x07); - + /*Print Priority Assignment Table*/ print_ets_priority_assignment_table(tptr+5); - + /*Print TC Bandwidth Table*/ print_tc_bandwidth_table(tptr+9); - + /* Print TSA Assignment Table */ print_tsa_assignment_table(tptr+17); - + break; case LLDP_PRIVATE_8021_SUBTYPE_ETS_RECOMMENDATION: if(tlv_len<LLDP_PRIVATE_8021_SUBTYPE_ETS_RECOMMENDATION_LENGTH) { return hexdump; - } + } printf("\n\t RES: %d",*(tptr+4)); - /*Print Priority Assignment Table */ + /*Print Priority Assignment Table */ print_ets_priority_assignment_table(tptr+5); /*Print TC Bandwidth Table */ print_tc_bandwidth_table(tptr+9); @@ -771,7 +771,7 @@ lldp_private_8021_print(const u_char *tptr, u_int tlv_len) return hexdump; } /* Length of Application Priority Table */ - sublen=tlv_len-5; + sublen=tlv_len-5; if(sublen%3!=0){ return hexdump; } @@ -818,7 +818,7 @@ lldp_private_8021_print(const u_char *tptr, u_int tlv_len) sublen=tlv_len-8; if(sublen%3!=0) { return hexdump; - } + } i=0; while(i<sublen) { tval=EXTRACT_24BITS(tptr+i+8); @@ -1016,7 +1016,7 @@ lldp_private_tia_print(const u_char *tptr, u_int tlv_len) lci_len = lci_len-3; tptr = tptr + 9; - /* Decode each civic address element */ + /* Decode each civic address element */ while (lci_len > 0) { if (lci_len < 2) { return hexdump; @@ -1025,7 +1025,7 @@ lldp_private_tia_print(const u_char *tptr, u_int tlv_len) ca_len = *(tptr+1); tptr += 2; - lci_len -= 2; + lci_len -= 2; printf("\n\t CA type \'%s\' (%u), length %u: ", tok2str(lldp_tia_location_lci_catype_values, "unknown", ca_type), @@ -1047,7 +1047,7 @@ lldp_private_tia_print(const u_char *tptr, u_int tlv_len) case LLDP_TIA_LOCATION_DATA_FORMAT_ECS_ELIN: printf("\n\t ECS ELIN id "); - safeputs((const char *)tptr+5, tlv_len-5); + safeputs((const char *)tptr+5, tlv_len-5); break; default: @@ -1273,7 +1273,7 @@ lldp_network_addr_print(const u_char *tptr, u_int len) { case AFNUM_INET: if (len < 4) return NULL; - pfunc = getname; + pfunc = getname; break; #ifdef INET6 case AFNUM_INET6: @@ -1310,7 +1310,7 @@ lldp_mgmt_addr_tlv_print(const u_char *pptr, u_int len) { const u_char *tptr; u_int tlen; char *mgmt_addr; - + tlen = len; tptr = pptr; @@ -1362,7 +1362,7 @@ lldp_mgmt_addr_tlv_print(const u_char *pptr, u_int len) { } return 1; -} +} void lldp_print(register const u_char *pptr, register u_int len) { @@ -1372,7 +1372,7 @@ lldp_print(register const u_char *pptr, register u_int len) { u_int oui, tlen, hexdump, tlv_type, tlv_len; const u_char *tptr; char *network_addr; - + tptr = pptr; tlen = len; @@ -1558,7 +1558,7 @@ lldp_print(register const u_char *pptr, register u_int len) { } oui = EXTRACT_24BITS(tptr); printf(": OUI %s (0x%06x)", tok2str(oui_values, "Unknown", oui), oui); - + switch (oui) { case OUI_IEEE_8021_PRIVATE: hexdump = lldp_private_8021_print(tptr, tlv_len); diff --git a/print-lmp.c b/print-lmp.c index c03e12ed..614089cd 100644 --- a/print-lmp.c +++ b/print-lmp.c @@ -51,14 +51,14 @@ static const char rcsid[] _U_ = struct lmp_common_header { u_int8_t version_res[2]; - u_int8_t flags; + u_int8_t flags; u_int8_t msg_type; u_int8_t length[2]; u_int8_t reserved[2]; }; #define LMP_VERSION 1 -#define LMP_EXTRACT_VERSION(x) (((x)&0xf0)>>4) +#define LMP_EXTRACT_VERSION(x) (((x)&0xf0)>>4) static const struct tok lmp_header_flag_values[] = { { 0x01, "Control Channel Down"}, @@ -205,7 +205,7 @@ static const struct tok lmp_msg_type_values[] = { { 0, NULL} }; -/* +/* * LMP object header * * 0 1 2 3 @@ -216,7 +216,7 @@ static const struct tok lmp_msg_type_values[] = { * | | * // (object contents) // * | | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct lmp_object_header { @@ -229,7 +229,7 @@ struct lmp_object_header { #define LMP_OBJ_NODE_ID 2 #define LMP_OBJ_LINK_ID 3 #define LMP_OBJ_INTERFACE_ID 4 -#define LMP_OBJ_MESSAGE_ID 5 +#define LMP_OBJ_MESSAGE_ID 5 #define LMP_OBJ_CONFIG 6 #define LMP_OBJ_HELLO 7 #define LMP_OBJ_VERIFY_BEGIN 8 @@ -279,13 +279,13 @@ static const struct tok lmp_data_link_subobj[] = { #define LMP_CTYPE_LOC 1 #define LMP_CTYPE_RMT 2 #define LMP_CTYPE_UNMD 3 - + #define LMP_CTYPE_IPV4_LOC 1 #define LMP_CTYPE_IPV4_RMT 2 #define LMP_CTYPE_IPV6_LOC 3 #define LMP_CTYPE_IPV6_RMT 4 -#define LMP_CTYPE_UNMD_LOC 5 -#define LMP_CTYPE_UNMD_RMT 6 +#define LMP_CTYPE_UNMD_LOC 5 +#define LMP_CTYPE_UNMD_RMT 6 #define LMP_CTYPE_1 1 #define LMP_CTYPE_2 2 @@ -302,7 +302,7 @@ static const struct tok lmp_data_link_subobj[] = { #define LMP_CTYPE_SERVICE_CONFIG_TRANSPARENCY_TCM 3 #define LMP_CTYPE_SERVICE_CONFIG_NETWORK_DIVERSITY 4 -/* +/* * Different link types allowed in the Client Port Service Attributes * subobject defined for LMP Service Discovery in the UNI 1.0 spec */ @@ -372,7 +372,7 @@ lmp_print(register const u_char *pptr, register u_int len) { int link_type; union { /* int to float conversion buffer */ - float f; + float f; u_int32_t i; } bw; @@ -530,7 +530,7 @@ lmp_print(register const u_char *pptr, register u_int len) { hexdump=TRUE; } break; - + case LMP_OBJ_HELLO: switch(lmp_obj_ctype) { case LMP_CTYPE_HELLO: @@ -542,14 +542,14 @@ lmp_print(register const u_char *pptr, register u_int len) { default: hexdump=TRUE; } - break; - + break; + case LMP_OBJ_TE_LINK: printf("\n\t Flags: [%s]", bittok2str(lmp_obj_te_link_flag_values, "none", EXTRACT_16BITS(obj_tptr)>>8)); - + switch(lmp_obj_ctype) { case LMP_CTYPE_IPV4: printf("\n\t Local Link-ID: %s (0x%08x)" @@ -559,7 +559,7 @@ lmp_print(register const u_char *pptr, register u_int len) { ipaddr_string(obj_tptr+8), EXTRACT_32BITS(obj_tptr+8)); break; - + #ifdef INET6 case LMP_CTYPE_IPV6: #endif @@ -568,13 +568,13 @@ lmp_print(register const u_char *pptr, register u_int len) { hexdump=TRUE; } break; - + case LMP_OBJ_DATA_LINK: printf("\n\t Flags: [%s]", bittok2str(lmp_obj_data_link_flag_values, "none", EXTRACT_16BITS(obj_tptr)>>8)); - + switch(lmp_obj_ctype) { case LMP_CTYPE_IPV4: case LMP_CTYPE_UNMD: @@ -584,8 +584,8 @@ lmp_print(register const u_char *pptr, register u_int len) { EXTRACT_32BITS(obj_tptr+4), ipaddr_string(obj_tptr+8), EXTRACT_32BITS(obj_tptr+8)); - - total_subobj_len = lmp_obj_len - 16; + + total_subobj_len = lmp_obj_len - 16; offset = 12; while (total_subobj_len > 0 && hexdump == FALSE ) { subobj_type = EXTRACT_16BITS(obj_tptr+offset)>>8; @@ -599,13 +599,13 @@ lmp_print(register const u_char *pptr, register u_int len) { switch(subobj_type) { case INT_SWITCHING_TYPE_SUBOBJ: printf("\n\t Switching Type: %s (%u)", - tok2str(gmpls_switch_cap_values, - "Unknown", + tok2str(gmpls_switch_cap_values, + "Unknown", EXTRACT_16BITS(obj_tptr+offset+2)>>8), EXTRACT_16BITS(obj_tptr+offset+2)>>8); printf("\n\t Encoding Type: %s (%u)", - tok2str(gmpls_encoding_values, - "Unknown", + tok2str(gmpls_encoding_values, + "Unknown", EXTRACT_16BITS(obj_tptr+offset+2)&0x00FF), EXTRACT_16BITS(obj_tptr+offset+2)&0x00FF); bw.i = EXTRACT_32BITS(obj_tptr+offset+4); @@ -614,7 +614,7 @@ lmp_print(register const u_char *pptr, register u_int len) { bw.i = EXTRACT_32BITS(obj_tptr+offset+8); printf("\n\t Max Reservable Bandwidth: %.3f Mbps", bw.f*8/1000000); - break; + break; case WAVELENGTH_SUBOBJ: printf("\n\t Wavelength: %u", EXTRACT_32BITS(obj_tptr+offset+4)); @@ -627,16 +627,16 @@ lmp_print(register const u_char *pptr, register u_int len) { total_subobj_len-=subobj_len; offset+=subobj_len; } - + break; -#ifdef INET6 +#ifdef INET6 case LMP_CTYPE_IPV6: #endif default: hexdump=TRUE; } - break; - + break; + case LMP_OBJ_VERIFY_BEGIN: switch(lmp_obj_ctype) { case LMP_CTYPE_1: @@ -659,12 +659,12 @@ lmp_print(register const u_char *pptr, register u_int len) { printf("\n\t Wavelength: %u", EXTRACT_32BITS(obj_tptr+16)); break; - + default: hexdump=TRUE; } - break; - + break; + case LMP_OBJ_VERIFY_BEGIN_ACK: switch(lmp_obj_ctype) { case LMP_CTYPE_1: @@ -673,24 +673,24 @@ lmp_print(register const u_char *pptr, register u_int len) { EXTRACT_16BITS(obj_tptr), EXTRACT_16BITS(obj_tptr+2)); break; - + default: hexdump=TRUE; } - break; - + break; + case LMP_OBJ_VERIFY_ID: switch(lmp_obj_ctype) { case LMP_CTYPE_1: printf("\n\t Verify ID: %u", EXTRACT_32BITS(obj_tptr)); break; - + default: hexdump=TRUE; } - break; - + break; + case LMP_OBJ_CHANNEL_STATUS: switch(lmp_obj_ctype) { case LMP_CTYPE_IPV4: @@ -701,15 +701,15 @@ lmp_print(register const u_char *pptr, register u_int len) { printf("\n\t Interface ID: %s (0x%08x)", ipaddr_string(obj_tptr+offset), EXTRACT_32BITS(obj_tptr+offset)); - - printf("\n\t\t Active: %s (%u)", (EXTRACT_32BITS(obj_tptr+offset+4)>>31) ? + + printf("\n\t\t Active: %s (%u)", (EXTRACT_32BITS(obj_tptr+offset+4)>>31) ? "Allocated" : "Non-allocated", (EXTRACT_32BITS(obj_tptr+offset+4)>>31)); - - printf("\n\t\t Direction: %s (%u)", (EXTRACT_32BITS(obj_tptr+offset+4)>>30)&0x1 ? + + printf("\n\t\t Direction: %s (%u)", (EXTRACT_32BITS(obj_tptr+offset+4)>>30)&0x1 ? "Transmit" : "Receive", - (EXTRACT_32BITS(obj_tptr+offset+4)>>30)&0x1); - + (EXTRACT_32BITS(obj_tptr+offset+4)>>30)&0x1); + printf("\n\t\t Channel Status: %s (%u)", tok2str(lmp_obj_channel_status_values, "Unknown", @@ -718,14 +718,14 @@ lmp_print(register const u_char *pptr, register u_int len) { offset+=8; } break; -#ifdef INET6 +#ifdef INET6 case LMP_CTYPE_IPV6: #endif default: hexdump=TRUE; } - break; - + break; + case LMP_OBJ_CHANNEL_STATUS_REQ: switch(lmp_obj_ctype) { case LMP_CTYPE_IPV4: @@ -738,14 +738,14 @@ lmp_print(register const u_char *pptr, register u_int len) { offset+=4; } break; -#ifdef INET6 +#ifdef INET6 case LMP_CTYPE_IPV6: #endif default: hexdump=TRUE; } - break; - + break; + case LMP_OBJ_ERROR_CODE: switch(lmp_obj_ctype) { case LMP_CTYPE_BEGIN_VERIFY_ERROR: @@ -754,7 +754,7 @@ lmp_print(register const u_char *pptr, register u_int len) { "none", EXTRACT_32BITS(obj_tptr))); break; - + case LMP_CTYPE_LINK_SUMMARY_ERROR: printf("\n\t Error Code: %s", bittok2str(lmp_obj_link_summary_error_values, @@ -764,31 +764,31 @@ lmp_print(register const u_char *pptr, register u_int len) { default: hexdump=TRUE; } - break; + break; case LMP_OBJ_SERVICE_CONFIG: switch (lmp_obj_ctype) { case LMP_CTYPE_SERVICE_CONFIG_SP: - + printf("\n\t Flags: %s", bittok2str(lmp_obj_service_config_sp_flag_values, - "none", + "none", EXTRACT_16BITS(obj_tptr)>>8)); printf("\n\t UNI Version: %u", EXTRACT_16BITS(obj_tptr) & 0x00FF); break; - + case LMP_CTYPE_SERVICE_CONFIG_CPSA: - + link_type = EXTRACT_16BITS(obj_tptr)>>8; - + printf("\n\t Link Type: %s (%u)", tok2str(lmp_sd_service_config_cpsa_link_type_values, "Unknown", link_type), link_type); - + if (link_type == LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SDH) { printf("\n\t Signal Type: %s (%u)", tok2str(lmp_sd_service_config_cpsa_signal_type_sdh_values, @@ -796,7 +796,7 @@ lmp_print(register const u_char *pptr, register u_int len) { EXTRACT_16BITS(obj_tptr) & 0x00FF), EXTRACT_16BITS(obj_tptr) & 0x00FF); } - + if (link_type == LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SONET) { printf("\n\t Signal Type: %s (%u)", tok2str(lmp_sd_service_config_cpsa_signal_type_sonet_values, @@ -804,37 +804,37 @@ lmp_print(register const u_char *pptr, register u_int len) { EXTRACT_16BITS(obj_tptr) & 0x00FF), EXTRACT_16BITS(obj_tptr) & 0x00FF); } - + printf("\n\t Transparency: %s", bittok2str(lmp_obj_service_config_cpsa_tp_flag_values, "none", EXTRACT_16BITS(obj_tptr+2)>>8)); - + printf("\n\t Contiguous Concatenation Types: %s", bittok2str(lmp_obj_service_config_cpsa_cct_flag_values, "none", EXTRACT_16BITS(obj_tptr+2)>>8 & 0x00FF)); - + printf("\n\t Minimum NCC: %u", EXTRACT_16BITS(obj_tptr+4)); - + printf("\n\t Maximum NCC: %u", EXTRACT_16BITS(obj_tptr+6)); - + printf("\n\t Minimum NVC:%u", EXTRACT_16BITS(obj_tptr+8)); - + printf("\n\t Maximum NVC:%u", EXTRACT_16BITS(obj_tptr+10)); - + printf("\n\t Local Interface ID: %s (0x%08x)", ipaddr_string(obj_tptr+12), EXTRACT_32BITS(obj_tptr+12)); - + break; - + case LMP_CTYPE_SERVICE_CONFIG_TRANSPARENCY_TCM: - + printf("\n\t Transparency Flags: %s", bittok2str( lmp_obj_service_config_nsa_transparency_flag_values, @@ -846,11 +846,11 @@ lmp_print(register const u_char *pptr, register u_int len) { lmp_obj_service_config_nsa_tcm_flag_values, "none", EXTRACT_16BITS(obj_tptr+6) & 0x00FF)); - + break; - + case LMP_CTYPE_SERVICE_CONFIG_NETWORK_DIVERSITY: - + printf("\n\t Diversity: Flags: %s", bittok2str( lmp_obj_service_config_nsa_network_diversity_flag_values, diff --git a/print-lspping.c b/print-lspping.c index 2ca57fb0..f51d7ad7 100644 --- a/print-lspping.c +++ b/print-lspping.c @@ -68,9 +68,9 @@ struct lspping_common_header { u_int8_t version[2]; u_int8_t reserved[2]; u_int8_t msg_type; - u_int8_t reply_mode; - u_int8_t return_code; - u_int8_t return_subcode; + u_int8_t reply_mode; + u_int8_t return_code; + u_int8_t return_subcode; u_int8_t sender_handle[4]; u_int8_t seq_number[4]; u_int8_t ts_sent_sec[4]; @@ -112,7 +112,7 @@ static const struct tok lspping_return_code_values[] = { }; -/* +/* * LSPPING TLV header * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 @@ -475,7 +475,7 @@ lspping_print(register const u_char *pptr, register u_int len) { int tlen,lspping_tlv_len,lspping_tlv_type,tlv_tlen; int tlv_hexdump,subtlv_hexdump; int lspping_subtlv_len,lspping_subtlv_type; - struct timeval timestamp; + struct timeval timestamp; union { const struct lspping_tlv_downstream_map_ipv4_t *lspping_tlv_downstream_map_ipv4; @@ -544,26 +544,26 @@ lspping_print(register const u_char *pptr, register u_int len) { lspping_com_header->return_code == 12 ) printf("\n\t Return Code: %s %u (%u)\n\t Return Subcode: (%u)", tok2str(lspping_return_code_values, "unknown",lspping_com_header->return_code), - lspping_com_header->return_subcode, + lspping_com_header->return_subcode, lspping_com_header->return_code, lspping_com_header->return_subcode); else printf("\n\t Return Code: %s (%u)\n\t Return Subcode: (%u)", - tok2str(lspping_return_code_values, "unknown",lspping_com_header->return_code), + tok2str(lspping_return_code_values, "unknown",lspping_com_header->return_code), lspping_com_header->return_code, lspping_com_header->return_subcode); - + printf("\n\t Sender Handle: 0x%08x, Sequence: %u", EXTRACT_32BITS(lspping_com_header->sender_handle), EXTRACT_32BITS(lspping_com_header->seq_number)); timestamp.tv_sec=EXTRACT_32BITS(lspping_com_header->ts_sent_sec); - timestamp.tv_usec=EXTRACT_32BITS(lspping_com_header->ts_sent_usec); + timestamp.tv_usec=EXTRACT_32BITS(lspping_com_header->ts_sent_usec); printf("\n\t Sender Timestamp: "); ts_print(×tamp); timestamp.tv_sec=EXTRACT_32BITS(lspping_com_header->ts_rcvd_sec); - timestamp.tv_usec=EXTRACT_32BITS(lspping_com_header->ts_rcvd_usec); + timestamp.tv_usec=EXTRACT_32BITS(lspping_com_header->ts_rcvd_usec); printf("Receiver Timestamp: "); if ((timestamp.tv_sec != 0) && (timestamp.tv_usec != 0)) ts_print(×tamp); @@ -620,7 +620,7 @@ lspping_print(register const u_char *pptr, register u_int len) { lspping_subtlv_type=EXTRACT_16BITS(lspping_subtlv_header->type); lspping_subtlv_len=EXTRACT_16BITS(lspping_subtlv_header->length); subtlv_tptr=tlv_tptr+sizeof(struct lspping_tlv_header); - + if (lspping_subtlv_len == 0) break; @@ -729,7 +729,7 @@ lspping_print(register const u_char *pptr, register u_int len) { "unknown", EXTRACT_16BITS(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_endpt->encapsulation)), EXTRACT_16BITS(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_endpt->encapsulation)); - + break; /* the old L2VPN VCID subTLV does not have support for the sender field */ @@ -744,7 +744,7 @@ lspping_print(register const u_char *pptr, register u_int len) { "unknown", EXTRACT_16BITS(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old->encapsulation)), EXTRACT_16BITS(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old->encapsulation)); - + break; case LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_VCID: @@ -759,7 +759,7 @@ lspping_print(register const u_char *pptr, register u_int len) { "unknown", EXTRACT_16BITS(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid->encapsulation)), EXTRACT_16BITS(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid->encapsulation)); - + break; default: @@ -829,7 +829,7 @@ lspping_print(register const u_char *pptr, register u_int len) { tlv_ptr.lspping_tlv_downstream_map_info= \ (const struct lspping_tlv_downstream_map_info_t *)tlv_tptr; - + /* FIXME add hash-key type, depth limit, multipath processing */ @@ -870,7 +870,7 @@ lspping_print(register const u_char *pptr, register u_int len) { case LSPPING_TLV_PAD: case LSPPING_TLV_ERROR_CODE: case LSPPING_TLV_VENDOR_PRIVATE: - + default: if (vflag <= 1) print_unknown_data(tlv_tptr,"\n\t ",tlv_tlen); diff --git a/print-lwapp.c b/print-lwapp.c index 154876f5..41b7e08a 100644 --- a/print-lwapp.c +++ b/print-lwapp.c @@ -36,7 +36,7 @@ static const char rcsid[] _U_ = #include "extract.h" #include "addrtoname.h" -/* +/* * LWAPP transport (common) header * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 @@ -76,9 +76,9 @@ struct lwapp_control_header { }; #define LWAPP_VERSION 0 -#define LWAPP_EXTRACT_VERSION(x) (((x)&0xC0)>>6) -#define LWAPP_EXTRACT_RID(x) (((x)&0x38)>>3) -#define LWAPP_EXTRACT_CONTROL_BIT(x) (((x)&0x04)>>2) +#define LWAPP_EXTRACT_VERSION(x) (((x)&0xC0)>>6) +#define LWAPP_EXTRACT_RID(x) (((x)&0x38)>>3) +#define LWAPP_EXTRACT_CONTROL_BIT(x) (((x)&0x04)>>2) static const struct tok lwapp_header_bits_values[] = { { 0x01, "Last Fragment Bit"}, @@ -154,9 +154,9 @@ static const struct tok lwapp_msg_type_values[] = { { 0, NULL} }; -/* +/* * LWAPP message elements - * + * * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -236,7 +236,7 @@ lwapp_control_print(const u_char *pptr, u_int len, int has_ap_ident) { lwapp_control_header = (const struct lwapp_control_header *)tptr; msg_tlen = EXTRACT_16BITS(lwapp_control_header->len); - /* print message header */ + /* print message header */ printf("\n\t Msg type: %s (%u), Seqnum: %u, Msg len: %d, Session: 0x%08x", tok2str(lwapp_msg_type_values,"Unknown",lwapp_control_header->msg_type), lwapp_control_header->msg_type, diff --git a/print-mobility.c b/print-mobility.c index 21e3cedf..a63e574d 100644 --- a/print-mobility.c +++ b/print-mobility.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2002 WIDE Project. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/print-mpcp.c b/print-mpcp.c index 244f2802..47fa7dbf 100644 --- a/print-mpcp.c +++ b/print-mpcp.c @@ -63,7 +63,7 @@ static const struct tok mpcp_opcode_values[] = { }; #define MPCP_GRANT_NUMBER_LEN 1 -#define MPCP_GRANT_NUMBER_MASK 0x7 +#define MPCP_GRANT_NUMBER_MASK 0x7 static const struct tok mpcp_grant_flag_values[] = { { 0x08, "Discovery" }, { 0x10, "Force Grant #1" }, @@ -183,7 +183,7 @@ mpcp_print(register const u_char *pptr, register u_int length) { for (grant = 1; grant <= grant_numbers; grant++) { if (!TTEST2(*tptr, sizeof(const struct mpcp_grant_t))) goto trunc; - mpcp.grant = (const struct mpcp_grant_t *)tptr; + mpcp.grant = (const struct mpcp_grant_t *)tptr; printf("\n\tGrant #%u, Start-Time %u ticks, duration %u ticks", grant, EXTRACT_32BITS(mpcp.grant->starttime), @@ -214,7 +214,7 @@ mpcp_print(register const u_char *pptr, register u_int length) { tptr++; report=1; - while (report_bitmap != 0) { + while (report_bitmap != 0) { if (report_bitmap & 1) { if (!TTEST2(*tptr, MPCP_TIMESTAMP_DURATION_LEN)) goto trunc; @@ -232,7 +232,7 @@ mpcp_print(register const u_char *pptr, register u_int length) { case MPCP_OPCODE_REG_REQ: if (!TTEST2(*tptr, sizeof(const struct mpcp_reg_req_t))) goto trunc; - mpcp.reg_req = (const struct mpcp_reg_req_t *)tptr; + mpcp.reg_req = (const struct mpcp_reg_req_t *)tptr; printf("\n\tFlags [ %s ], Pending-Grants %u", bittok2str(mpcp_reg_req_flag_values, "Reserved", mpcp.reg_req->flags), mpcp.reg_req->pending_grants); @@ -241,7 +241,7 @@ mpcp_print(register const u_char *pptr, register u_int length) { case MPCP_OPCODE_REG: if (!TTEST2(*tptr, sizeof(const struct mpcp_reg_t))) goto trunc; - mpcp.reg = (const struct mpcp_reg_t *)tptr; + mpcp.reg = (const struct mpcp_reg_t *)tptr; printf("\n\tAssigned-Port %u, Flags [ %s ]" \ "\n\tSync-Time %u ticks, Echoed-Pending-Grants %u", EXTRACT_16BITS(mpcp.reg->assigned_port), @@ -253,7 +253,7 @@ mpcp_print(register const u_char *pptr, register u_int length) { case MPCP_OPCODE_REG_ACK: if (!TTEST2(*tptr, sizeof(const struct mpcp_reg_ack_t))) goto trunc; - mpcp.reg_ack = (const struct mpcp_reg_ack_t *)tptr; + mpcp.reg_ack = (const struct mpcp_reg_ack_t *)tptr; printf("\n\tEchoed-Assigned-Port %u, Flags [ %s ]" \ "\n\tEchoed-Sync-Time %u ticks", EXTRACT_16BITS(mpcp.reg_ack->echoed_assigned_port), diff --git a/print-mpls.c b/print-mpls.c index d97cce52..ac9358f6 100644 --- a/print-mpls.c +++ b/print-mpls.c @@ -147,7 +147,7 @@ mpls_print(const u_char *bp, u_int length) case 0x4f: pt = PT_IPV4; break; - + case 0x60: case 0x61: case 0x62: diff --git a/print-ntp.c b/print-ntp.c index 28c86199..747192dc 100644 --- a/print-ntp.c +++ b/print-ntp.c @@ -101,10 +101,10 @@ ntp_print(register const u_char *cp, u_int length) length); return; } - + printf (", length %u\n\t%s", length, - tok2str(ntp_mode_values, "Unknown mode", mode)); + tok2str(ntp_mode_values, "Unknown mode", mode)); leapind = bp->status & LEAPMASK; printf (", Leap indicator: %s (%u)", @@ -112,7 +112,7 @@ ntp_print(register const u_char *cp, u_int length) leapind); TCHECK(bp->stratum); - printf(", Stratum %u (%s)", + printf(", Stratum %u (%s)", bp->stratum, tok2str(ntp_stratum_values, (bp->stratum >=2 && bp->stratum<=15) ? "secondary reference" : "reserved", bp->stratum)); diff --git a/print-ospf.c b/print-ospf.c index 0841c096..55feeba5 100644 --- a/print-ospf.c +++ b/print-ospf.c @@ -208,7 +208,7 @@ ospf_print_grace_lsa (const u_int8_t *tptr, u_int ls_length) { tlv_length = EXTRACT_16BITS(tptr+2); tptr+=4; ls_length-=4; - + printf("\n\t %s TLV (%u), length %u, value: ", tok2str(lsa_opaque_grace_tlv_values,"unknown",tlv_type), tlv_type, @@ -280,7 +280,7 @@ ospf_print_te_lsa (const u_int8_t *tptr, u_int ls_length) { u_int tlv_type, tlv_length, subtlv_type, subtlv_length; u_int priority_level, te_class, count_srlg; union { /* int to float conversion buffer for several subTLVs */ - float f; + float f; u_int32_t i; } bw; @@ -294,7 +294,7 @@ ospf_print_te_lsa (const u_int8_t *tptr, u_int ls_length) { tlv_length = EXTRACT_16BITS(tptr+2); tptr+=4; ls_length-=4; - + printf("\n\t %s TLV (%u), length: %u", tok2str(lsa_opaque_te_tlv_values,"unknown",tlv_type), tlv_type, @@ -324,12 +324,12 @@ ospf_print_te_lsa (const u_int8_t *tptr, u_int ls_length) { subtlv_length = EXTRACT_16BITS(tptr+2); tptr+=4; tlv_length-=4; - + printf("\n\t %s subTLV (%u), length: %u", tok2str(lsa_opaque_te_link_tlv_subtlv_values,"unknown",subtlv_type), subtlv_type, subtlv_length); - + TCHECK2(*tptr, subtlv_length); switch(subtlv_type) { case LS_OPAQUE_TE_LINK_SUBTLV_ADMIN_GROUP: @@ -424,13 +424,13 @@ ospf_print_te_lsa (const u_int8_t *tptr, u_int ls_length) { /* in OSPF everything has to be 32-bit aligned, including subTLVs */ if (subtlv_length%4 != 0) subtlv_length+=4-(subtlv_length%4); - + tlv_length-=subtlv_length; tptr+=subtlv_length; - + } break; - + case LS_OPAQUE_TE_TLV_ROUTER: if (tlv_length < 4) { printf("\n\t TLV length %u < 4", tlv_length); @@ -439,7 +439,7 @@ ospf_print_te_lsa (const u_int8_t *tptr, u_int ls_length) { TCHECK2(*tptr, 4); printf(", %s", ipaddr_string(tptr)); break; - + default: if (vflag <= 1) { if(!print_unknown_data(tptr,"\n\t ",tlv_length)) @@ -494,7 +494,7 @@ ospf_print_lshdr(register const struct lsa_hdr *lshp) *(&lshp->un_lsa_id.opaque_field.opaque_type)), *(&lshp->un_lsa_id.opaque_field.opaque_type), EXTRACT_24BITS(&lshp->un_lsa_id.opaque_field.opaque_id) - + ); break; @@ -538,7 +538,7 @@ ospf_print_tos_metrics(const union un_tos *tos) /* * All but the first metric contain a valid topology id. */ - while (toscount) { + while (toscount) { printf("\n\t\ttopology %s(%u), metric %u", tok2str(ospf_topology_values, "", metric_count ? tos->metrics.tos_type : 0), @@ -592,7 +592,7 @@ ospf_print_lsa(register const struct lsa *lsap) case RLA_TYPE_VIRTUAL: printf("\n\t Virtual Link: Neighbor Router-ID: %s, Interface Address: %s", ipaddr_string(&rlp->link_id), - ipaddr_string(&rlp->link_data)); + ipaddr_string(&rlp->link_data)); break; case RLA_TYPE_ROUTER: @@ -739,7 +739,7 @@ ospf_print_lsa(register const struct lsa *lsap) break; case LS_TYPE_OPAQUE_LL: /* fall through */ - case LS_TYPE_OPAQUE_AL: + case LS_TYPE_OPAQUE_AL: case LS_TYPE_OPAQUE_DW: switch (*(&lsap->ls_hdr.un_lsa_id.opaque_field.opaque_type)) { @@ -756,7 +756,7 @@ ospf_print_lsa(register const struct lsa *lsap) tlv_length = EXTRACT_16BITS(tptr+2); tptr+=4; ls_length-=4; - + printf("\n\t %s TLV (%u), length: %u, value: ", tok2str(lsa_opaque_ri_tlv_values,"unknown",tlv_type), tlv_type, @@ -810,7 +810,7 @@ ospf_print_lsa(register const struct lsa *lsap) if(!print_unknown_data((u_int8_t *)lsap->lsa_un.un_unknown, "\n\t ", ls_length)) return(ls_end); - } + } break; } } @@ -821,7 +821,7 @@ ospf_print_lsa(register const struct lsa *lsap) "\n\t ", ls_length)) { return(ls_end); } - + return (ls_end); trunc: return (NULL); @@ -1015,7 +1015,7 @@ ospf_decode_v2(register const struct ospfhdr *op, ipaddr_string(&lsrp->un_ls_stateid.ls_stateid)); break; } - + ++lsrp; } break; diff --git a/print-ospf6.c b/print-ospf6.c index 90d4bac8..dba73ab8 100644 --- a/print-ospf6.c +++ b/print-ospf6.c @@ -266,7 +266,7 @@ ospf6_print_lsa(register const struct lsa6 *lsap, const u_char *dataend) "\n\t Neighbor Interface-ID %s, Interface %s", ipaddr_string(&rlp->link_nrtid), ipaddr_string(&rlp->link_nifid), - ipaddr_string(&rlp->link_ifid)); + ipaddr_string(&rlp->link_ifid)); break; case RLA_TYPE_ROUTER: @@ -274,7 +274,7 @@ ospf6_print_lsa(register const struct lsa6 *lsap, const u_char *dataend) "\n\t Neighbor Interface-ID %s, Interface %s", ipaddr_string(&rlp->link_nrtid), ipaddr_string(&rlp->link_nifid), - ipaddr_string(&rlp->link_ifid)); + ipaddr_string(&rlp->link_ifid)); break; case RLA_TYPE_TRANSIT: diff --git a/print-otv.c b/print-otv.c index cd539574..25c21f09 100644 --- a/print-otv.c +++ b/print-otv.c @@ -46,7 +46,7 @@ otv_print(const u_char *bp, u_int len) u_int8_t flags; u_int32_t overlay_id; u_int32_t instance_id; - + if (len < 8) { printf("[|OTV]"); return; diff --git a/print-pflog.c b/print-pflog.c index 0798d941..b38fd99b 100644 --- a/print-pflog.c +++ b/print-pflog.c @@ -144,7 +144,7 @@ pflog_if_print(const struct pcap_pkthdr *h, register const u_char *p) TCHECK(*hdr); if (eflag) pflog_print(hdr); - + /* skip to the real packet */ af = hdr->af; length -= hdrlen; @@ -175,7 +175,7 @@ pflog_if_print(const struct pcap_pkthdr *h, register const u_char *p) if (!suppress_default_print) default_print(p, caplen); } - + return (hdrlen); trunc: printf("%s", pflog); diff --git a/print-pgm.c b/print-pgm.c index b6138c6f..2f899bcc 100644 --- a/print-pgm.c +++ b/print-pgm.c @@ -142,7 +142,7 @@ typedef enum _pgm_type { #define PGM_OPT_PGMCC_DATA 0x12 #define PGM_OPT_PGMCC_FEEDBACK 0x13 - + #define PGM_OPT_MASK 0x7f #define PGM_OPT_END 0x80 /* end of options marker */ @@ -472,7 +472,7 @@ pgm_print(register const u_char *bp, register u_int length, break; } - if (pgm->pgm_options & PGM_OPT_BIT_PRESENT) { + if (pgm->pgm_options & PGM_OPT_BIT_PRESENT) { /* * make sure there's enough for the first option header @@ -480,7 +480,7 @@ pgm_print(register const u_char *bp, register u_int length, if (!TTEST2(*bp, PGM_MIN_OPT_LEN)) { (void)printf("[|OPT]"); return; - } + } /* * That option header MUST be an OPT_LENGTH option @@ -524,7 +524,7 @@ pgm_print(register const u_char *bp, register u_int length, if (!TTEST2(*bp, opt_len - 2)) { (void)printf(" [|OPT]"); return; - } + } switch (opt_type & PGM_OPT_MASK) { case PGM_OPT_LENGTH: diff --git a/print-pim.c b/print-pim.c index 71360836..3c6b7d34 100644 --- a/print-pim.c +++ b/print-pim.c @@ -95,7 +95,7 @@ static const struct tok pimv2_register_flag_values[] = { { PIMV2_REGISTER_FLAG_BORDER, "Border" }, { PIMV2_REGISTER_FLAG_NULL, "Null" }, { 0, NULL} -}; +}; /* * XXX: We consider a case where IPv6 is not ready yet for portability, diff --git a/print-ppp.c b/print-ppp.c index 0ae88118..de49e7e3 100644 --- a/print-ppp.c +++ b/print-ppp.c @@ -439,7 +439,7 @@ handle_ctrl_proto(u_int proto, const u_char *pptr, int length) TCHECK2(*tptr, 2); code = *tptr++; - + printf("%s (0x%02x), id %u, length %u", tok2str(cpcodes, "Unknown Opcode",code), code, @@ -508,7 +508,7 @@ handle_ctrl_proto(u_int proto, const u_char *pptr, int length) if (pfunc == NULL) /* catch the above null pointer if unknown CP */ break; - + if ((j = (*pfunc)(tptr, len)) == 0) break; x -= j; @@ -761,7 +761,7 @@ print_lcp_config_options(const u_char *p, int length) print_unknown_data(&p[2],"\n\t ",len-2); break; } - + if (vflag>1) print_unknown_data(&p[2],"\n\t ",len-2); /* exclude TLV header */ @@ -1041,14 +1041,14 @@ print_ipcp_config_options(const u_char *p, int length) if (len > IPCPOPT_IPCOMP_MINLEN) { ipcomp_subopttotallen = len - IPCPOPT_IPCOMP_MINLEN; p += IPCPOPT_IPCOMP_MINLEN; - + printf("\n\t Suboptions, length %u", ipcomp_subopttotallen); while (ipcomp_subopttotallen >= 2) { TCHECK2(*p, 2); ipcomp_subopt = *p; ipcomp_suboptlen = *(p+1); - + /* sanity check */ if (ipcomp_subopt == 0 || ipcomp_suboptlen == 0 ) @@ -1296,7 +1296,7 @@ ppp_hdlc(const u_char *p, int length) /* now lets guess about the payload codepoint format */ proto = *b; /* start with a one-octet codepoint guess */ - + switch (proto) { case PPP_IP: ip_print(gndo, b+1, t - b - 1); diff --git a/print-pppoe.c b/print-pppoe.c index f8c9008a..6b08b6f1 100644 --- a/print-pppoe.c +++ b/print-pppoe.c @@ -17,8 +17,8 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Original code by Greg Stark <gsstark@mit.edu> + * + * Original code by Greg Stark <gsstark@mit.edu> */ #ifndef lint @@ -189,7 +189,7 @@ pppoe_print(register const u_char *bp, u_int length) } printf("]"); } - + } else printf(" [%s]", tok2str(pppoetag2str, diff --git a/print-radius.c b/print-radius.c index a1efa446..08922673 100644 --- a/print-radius.c +++ b/print-radius.c @@ -842,7 +842,7 @@ radius_attrs_print(register const u_char *attr, u_int length) if (length < 2) goto trunc; TCHECK(*rad_attr); - + if (rad_attr->type > 0 && rad_attr->type < TAM_SIZE(attr_type)) attr_string = attr_type[rad_attr->type].name; else diff --git a/print-rip.c b/print-rip.c index bd17d5f1..6310e5da 100644 --- a/print-rip.c +++ b/print-rip.c @@ -69,7 +69,7 @@ static const struct tok rip_cmd_values[] = { /* * rfc 1723 - * + * * 0 1 2 3 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ diff --git a/print-rpki-rtr.c b/print-rpki-rtr.c index c705c050..a7841bbe 100644 --- a/print-rpki-rtr.c +++ b/print-rpki-rtr.c @@ -285,7 +285,7 @@ rpki_rtr_pdu_print (const u_char *tptr, u_int indent) /* * Extract, trail-zero and print the Error message. - */ + */ text_length = 0; if (tlen > 4) { text_length = EXTRACT_32BITS(tptr); @@ -304,7 +304,7 @@ rpki_rtr_pdu_print (const u_char *tptr, u_int indent) /* * Unknown data, please hexdump. - */ + */ hexdump = TRUE; } diff --git a/print-rsvp.c b/print-rsvp.c index 2d54a3eb..bec82f5e 100644 --- a/print-rsvp.c +++ b/print-rsvp.c @@ -59,10 +59,10 @@ struct rsvp_common_header { u_int8_t length[2]; }; -/* +/* * RFC2205 object header * - * + * * 0 1 2 3 * +-------------+-------------+-------------+-------------+ * | Length (bytes) | Class-Num | C-Type | @@ -80,7 +80,7 @@ struct rsvp_object_header { }; #define RSVP_VERSION 1 -#define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4) +#define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4) #define RSVP_EXTRACT_FLAGS(x) ((x)&0x0f) #define RSVP_MSGTYPE_PATH 1 @@ -121,7 +121,7 @@ static const struct tok rsvp_header_flag_values[] = { #define RSVP_OBJ_RSVP_HOP 3 /* rfc2205, rfc3473 */ #define RSVP_OBJ_INTEGRITY 4 /* rfc2747 */ #define RSVP_OBJ_TIME_VALUES 5 /* rfc2205 */ -#define RSVP_OBJ_ERROR_SPEC 6 +#define RSVP_OBJ_ERROR_SPEC 6 #define RSVP_OBJ_SCOPE 7 #define RSVP_OBJ_STYLE 8 /* rfc2205 */ #define RSVP_OBJ_FLOWSPEC 9 /* rfc2215 */ @@ -442,7 +442,7 @@ static const struct tok rsvp_obj_error_code_diffserv_te_values[] = { { 4, "CT/setup priority do not form a configured TE-Class" }, { 5, "CT/holding priority do not form a configured TE-Class" }, { 6, "CT/setup priority and CT/holding priority do not form a configured TE-Class" }, - { 7, "Inconsistency between signaled PSC and signaled CT" }, + { 7, "Inconsistency between signaled PSC and signaled CT" }, { 8, "Inconsistency between signaled PHBs and signaled CT" }, { 0, NULL} }; @@ -488,7 +488,7 @@ static const struct tok rsvp_obj_generalized_uni_values[] = { static int rsvp_intserv_print(const u_char *, u_short); -/* +/* * this is a dissector for all the intserv defined * specs as defined per rfc2215 * it is called from various rsvp objects; @@ -574,7 +574,7 @@ rsvp_intserv_print(const u_char *tptr, u_short obj_tlen) { printf("\n\t\tComposed MTU: %u bytes", EXTRACT_32BITS(tptr+4)); break; case 127: - /* + /* * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | 127 (e) | 0 (f) | 5 (g) | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -603,7 +603,7 @@ rsvp_intserv_print(const u_char *tptr, u_short obj_tlen) { break; case 130: - /* + /* * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | 130 (h) | 0 (i) | 2 (j) | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -701,7 +701,7 @@ _U_ ((rsvp_obj_header->class_num)<<8)+rsvp_obj_ctype), rsvp_obj_ctype, rsvp_obj_len); - + if(tlen < rsvp_obj_len) { printf("%sERROR: object goes past end of objects TLV", ident); return -1; @@ -730,7 +730,7 @@ _U_ *(obj_tptr+5), EXTRACT_16BITS(obj_tptr+6)); obj_tlen-=8; - obj_tptr+=8; + obj_tptr+=8; break; #ifdef INET6 case RSVP_CTYPE_IPV6: @@ -745,7 +745,7 @@ _U_ *(obj_tptr+sizeof(struct in6_addr)+1), EXTRACT_16BITS(obj_tptr+sizeof(struct in6_addr)+2)); obj_tlen-=20; - obj_tptr+=20; + obj_tptr+=20; break; case RSVP_CTYPE_TUNNEL_IPV6: @@ -757,7 +757,7 @@ _U_ EXTRACT_16BITS(obj_tptr+18), ip6addr_string(obj_tptr+20)); obj_tlen-=36; - obj_tptr+=36; + obj_tptr+=36; break; case RSVP_CTYPE_14: /* IPv6 p2mp LSP Tunnel */ @@ -769,7 +769,7 @@ _U_ EXTRACT_16BITS(obj_tptr+6), ip6addr_string(obj_tptr+8)); obj_tlen-=26; - obj_tptr+=26; + obj_tptr+=26; break; #endif case RSVP_CTYPE_13: /* IPv4 p2mp LSP Tunnel */ @@ -781,7 +781,7 @@ _U_ EXTRACT_16BITS(obj_tptr+6), ipaddr_string(obj_tptr+8)); obj_tlen-=12; - obj_tptr+=12; + obj_tptr+=12; break; case RSVP_CTYPE_TUNNEL_IPV4: case RSVP_CTYPE_UNI_IPV4: @@ -793,7 +793,7 @@ _U_ EXTRACT_16BITS(obj_tptr+6), ipaddr_string(obj_tptr+8)); obj_tlen-=12; - obj_tptr+=12; + obj_tptr+=12; break; default: hexdump=TRUE; @@ -809,7 +809,7 @@ _U_ ident, ipaddr_string(obj_tptr)); obj_tlen-=sizeof(struct in_addr); - obj_tptr+=sizeof(struct in_addr); + obj_tptr+=sizeof(struct in_addr); break; #ifdef INET6 case RSVP_CTYPE_IPV6: @@ -819,7 +819,7 @@ _U_ ident, ip6addr_string(obj_tptr)); obj_tlen-=sizeof(struct in6_addr); - obj_tptr+=sizeof(struct in6_addr); + obj_tptr+=sizeof(struct in6_addr); break; #endif default: @@ -836,7 +836,7 @@ _U_ ident, ipaddr_string(obj_tptr)); obj_tlen-=sizeof(struct in_addr); - obj_tptr+=sizeof(struct in_addr); + obj_tptr+=sizeof(struct in_addr); break; #ifdef INET6 case RSVP_CTYPE_IPV6: @@ -846,7 +846,7 @@ _U_ ident, ip6addr_string(obj_tptr)); obj_tlen-=sizeof(struct in6_addr); - obj_tptr+=sizeof(struct in6_addr); + obj_tptr+=sizeof(struct in6_addr); break; #endif default: @@ -1065,7 +1065,7 @@ _U_ tok2str(rsvp_obj_xro_values, "Unknown %u", RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr)), - *(obj_tptr+1)); + *(obj_tptr+1)); if (*(obj_tptr+1) == 0) { /* prevent infinite loops */ printf("%s ERROR: zero length ERO subtype",ident); @@ -1169,7 +1169,7 @@ _U_ switch(rsvp_obj_ctype) { int subobj_type,af,subobj_len,total_subobj_len; - case RSVP_CTYPE_1: + case RSVP_CTYPE_1: if (obj_tlen < 4) return-1; @@ -1338,7 +1338,7 @@ _U_ *(obj_tptr), (*(obj_tptr+1)&0x80) ? "" : "not", intserv_serv_tlen); - + obj_tptr+=4; /* get to the start of the parameter list */ obj_tlen-=4; @@ -1458,7 +1458,7 @@ _U_ (int)obj_ptr.rsvp_obj_frr->setup_prio, (int)obj_ptr.rsvp_obj_frr->hold_prio, (int)obj_ptr.rsvp_obj_frr->hop_limit, - bw.f*8/1000000); + bw.f*8/1000000); printf("%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x", ident, EXTRACT_32BITS(obj_ptr.rsvp_obj_frr->include_any), @@ -1476,7 +1476,7 @@ _U_ (int)obj_ptr.rsvp_obj_frr->setup_prio, (int)obj_ptr.rsvp_obj_frr->hold_prio, (int)obj_ptr.rsvp_obj_frr->hop_limit, - bw.f*8/1000000); + bw.f*8/1000000); printf("%s Include Colors: 0x%08x, Exclude Colors: 0x%08x", ident, EXTRACT_32BITS(obj_ptr.rsvp_obj_frr->include_any), @@ -1497,7 +1497,7 @@ _U_ printf("%s PLR-ID: %s, Avoid-Node-ID: %s", ident, ipaddr_string(obj_tptr), - ipaddr_string(obj_tptr+4)); + ipaddr_string(obj_tptr+4)); obj_tlen-=8; obj_tptr+=8; } @@ -1513,7 +1513,7 @@ _U_ case RSVP_CTYPE_1: printf("%s CT: %u", ident, - EXTRACT_32BITS(obj_tptr)&0x7); + EXTRACT_32BITS(obj_tptr)&0x7); obj_tlen-=4; obj_tptr+=4; break; @@ -1687,11 +1687,11 @@ _U_ default: hexdump=TRUE; } - break; + break; case RSVP_OBJ_ADMIN_STATUS: switch(rsvp_obj_ctype) { - case RSVP_CTYPE_1: + case RSVP_CTYPE_1: if (obj_tlen < 4) return-1; printf("%s Flags [%s]", ident, @@ -1707,7 +1707,7 @@ _U_ case RSVP_OBJ_LABEL_SET: switch(rsvp_obj_ctype) { - case RSVP_CTYPE_1: + case RSVP_CTYPE_1: if (obj_tlen < 4) return-1; action = (EXTRACT_16BITS(obj_tptr)>>8); @@ -1750,7 +1750,7 @@ _U_ case RSVP_OBJ_S2L: switch (rsvp_obj_ctype) { - case RSVP_CTYPE_IPV4: + case RSVP_CTYPE_IPV4: if (obj_tlen < 4) return-1; printf("%s Sub-LSP destination address: %s", @@ -1760,7 +1760,7 @@ _U_ obj_tptr+=4; break; #ifdef INET6 - case RSVP_CTYPE_IPV6: + case RSVP_CTYPE_IPV6: if (obj_tlen < 16) return-1; printf("%s Sub-LSP destination address: %s", @@ -1878,7 +1878,7 @@ rsvp_print(register const u_char *pptr, register u_int len) { return; } subtlen=EXTRACT_16BITS(rsvp_com_header->length); - + printf("\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x", RSVP_EXTRACT_VERSION(rsvp_com_header->version_flags), tok2str(rsvp_msg_type_values, "unknown, type: %u",rsvp_com_header->msg_type), @@ -1893,7 +1893,7 @@ rsvp_print(register const u_char *pptr, register u_int len) { */ rsvp_com_header->checksum[0] = 0; rsvp_com_header->checksum[1] = 0; - + if (subtlen < sizeof(const struct rsvp_common_header)) { printf("ERROR: common header too short %u < %lu", subtlen, (unsigned long)sizeof(const struct rsvp_common_header)); @@ -1933,8 +1933,8 @@ rsvp_print(register const u_char *pptr, register u_int len) { return; break; - default: - print_unknown_data(tptr,"\n\t ",tlen); + default: + print_unknown_data(tptr,"\n\t ",tlen); break; } @@ -2261,7 +2261,7 @@ vol_reply_print(register const u_char *bp, int length, int32_t opcode) printf(" <none!>"); } break; - + default: ; diff --git a/print-sflow.c b/print-sflow.c index 1a23d49e..5c01b669 100644 --- a/print-sflow.c +++ b/print-sflow.c @@ -38,9 +38,9 @@ static const char rcsid[] _U_ = #include "extract.h" #include "addrtoname.h" -/* +/* * sFlow datagram - * + * * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -58,7 +58,7 @@ static const char rcsid[] _U_ = * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | num samples in datagram | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * + * */ struct sflow_datagram_t { @@ -162,7 +162,7 @@ static const struct tok sflow_flow_raw_protocol_values[] = { { SFLOW_HEADER_PROTOCOL_IPV6, "IPv6"}, { 0, NULL} }; - + struct sflow_expanded_flow_raw_t { u_int8_t protocol[4]; u_int8_t length[4]; @@ -237,28 +237,28 @@ static const struct tok sflow_iface_direction_values[] = { { SFLOW_IFACE_DIRECTION_IN, "in"}, { SFLOW_IFACE_DIRECTION_OUT, "out"}, { 0, NULL} -}; +}; struct sflow_generic_counter_t { u_int8_t ifindex[4]; u_int8_t iftype[4]; u_int8_t ifspeed[8]; - u_int8_t ifdirection[4]; + u_int8_t ifdirection[4]; u_int8_t ifstatus[4]; - u_int8_t ifinoctets[8]; - u_int8_t ifinunicastpkts[4]; - u_int8_t ifinmulticastpkts[4]; - u_int8_t ifinbroadcastpkts[4]; - u_int8_t ifindiscards[4]; - u_int8_t ifinerrors[4]; - u_int8_t ifinunkownprotos[4]; + u_int8_t ifinoctets[8]; + u_int8_t ifinunicastpkts[4]; + u_int8_t ifinmulticastpkts[4]; + u_int8_t ifinbroadcastpkts[4]; + u_int8_t ifindiscards[4]; + u_int8_t ifinerrors[4]; + u_int8_t ifinunkownprotos[4]; u_int8_t ifoutoctets[8]; - u_int8_t ifoutunicastpkts[4]; - u_int8_t ifoutmulticastpkts[4]; - u_int8_t ifoutbroadcastpkts[4]; - u_int8_t ifoutdiscards[4]; - u_int8_t ifouterrors[4]; - u_int8_t ifpromiscmode[4]; + u_int8_t ifoutunicastpkts[4]; + u_int8_t ifoutmulticastpkts[4]; + u_int8_t ifoutbroadcastpkts[4]; + u_int8_t ifoutdiscards[4]; + u_int8_t ifouterrors[4]; + u_int8_t ifpromiscmode[4]; }; struct sflow_ethernet_counter_t { @@ -282,8 +282,8 @@ struct sflow_100basevg_counter_t { u_int8_t in_highpriority_octets[8]; u_int8_t in_normpriority_frames[4]; u_int8_t in_normpriority_octets[8]; - u_int8_t in_ipmerrors[4]; - u_int8_t in_oversized[4]; + u_int8_t in_ipmerrors[4]; + u_int8_t in_oversized[4]; u_int8_t in_data_errors[4]; u_int8_t in_null_addressed_frames[4]; u_int8_t out_highpriority_frames[4]; @@ -341,7 +341,7 @@ print_sflow_counter_generic(const u_char *pointer, u_int len) { EXTRACT_32BITS(sflow_gen_counter->ifoutmulticastpkts), EXTRACT_32BITS(sflow_gen_counter->ifoutbroadcastpkts), EXTRACT_32BITS(sflow_gen_counter->ifoutdiscards)); - printf("\n\t Out errors %u, promisc mode %u", + printf("\n\t Out errors %u, promisc mode %u", EXTRACT_32BITS(sflow_gen_counter->ifouterrors), EXTRACT_32BITS(sflow_gen_counter->ifpromiscmode)); @@ -363,12 +363,12 @@ print_sflow_counter_ethernet(const u_char *pointer, u_int len){ EXTRACT_32BITS(sflow_eth_counter->single_collision_frames), EXTRACT_32BITS(sflow_eth_counter->multiple_collision_frames), EXTRACT_32BITS(sflow_eth_counter->test_errors)); - printf("\n\t deferred %u, late collision %u, excessive collision %u, mac trans error %u", + printf("\n\t deferred %u, late collision %u, excessive collision %u, mac trans error %u", EXTRACT_32BITS(sflow_eth_counter->deferred_transmissions), EXTRACT_32BITS(sflow_eth_counter->late_collisions), EXTRACT_32BITS(sflow_eth_counter->excessive_collisions), EXTRACT_32BITS(sflow_eth_counter->mac_transmit_errors)); - printf("\n\t carrier error %u, frames too long %u, mac receive errors %u, symbol errors %u", + printf("\n\t carrier error %u, frames too long %u, mac receive errors %u, symbol errors %u", EXTRACT_32BITS(sflow_eth_counter->carrier_sense_errors), EXTRACT_32BITS(sflow_eth_counter->frame_too_longs), EXTRACT_32BITS(sflow_eth_counter->mac_receive_errors), @@ -422,7 +422,7 @@ static int print_sflow_counter_vlan(const u_char *pointer, u_int len) { const struct sflow_vlan_counter_t *sflow_vlan_counter; - + if (len < sizeof(struct sflow_vlan_counter_t)) return 1; @@ -538,7 +538,7 @@ sflow_print_counter_records(const u_char *pointer, u_int len, u_int records) { tptr += counter_len; tlen -= counter_len; nrecords--; - + } return 0; @@ -564,7 +564,7 @@ sflow_print_counter_sample(const u_char *pointer, u_int len) { nrecords = EXTRACT_32BITS(sflow_counter_sample->records); type = typesource >> 24; index = typesource & 0x0FFF; - + printf(" seqnum %u, type %u, idx %u, records %u", EXTRACT_32BITS(sflow_counter_sample->seqnum), type, @@ -596,7 +596,7 @@ sflow_print_expanded_counter_sample(const u_char *pointer, u_int len) { EXTRACT_32BITS(sflow_expanded_counter_sample->type), EXTRACT_32BITS(sflow_expanded_counter_sample->index), nrecords); - + return sflow_print_counter_records(pointer + sizeof(struct sflow_expanded_counter_sample_t), len - sizeof(struct sflow_expanded_counter_sample_t), nrecords); @@ -684,7 +684,7 @@ sflow_print_flow_records(const u_char *pointer, u_int len, u_int records) { /* so, the funky encoding means we cannot blythly mask-off bits, we must also check the enterprise. */ - + enterprise = EXTRACT_32BITS(sflow_flow_record->format); flow_type = enterprise & 0x0FFF; enterprise = enterprise >> 12; @@ -802,7 +802,7 @@ sflow_print_expanded_flow_sample(const u_char *pointer, u_int len) { EXTRACT_32BITS(sflow_expanded_flow_sample->pool), EXTRACT_32BITS(sflow_expanded_flow_sample->drops), EXTRACT_32BITS(sflow_expanded_flow_sample->records)); - + return sflow_print_flow_records(pointer + sizeof(struct sflow_expanded_flow_sample_t), len - sizeof(struct sflow_expanded_flow_sample_t), nrecords); @@ -873,7 +873,7 @@ sflow_print(const u_char *pptr, u_int len) { tptr += sizeof(struct sflow_sample_header); tlen -= sizeof(struct sflow_sample_header); - + printf("\n\t%s (%u), length %u,", tok2str(sflow_format_values, "Unknown", sflow_sample_type), sflow_sample_type, diff --git a/print-sll.c b/print-sll.c index 062398e1..b23ca264 100644 --- a/print-sll.c +++ b/print-sll.c @@ -67,7 +67,7 @@ sll_print(register const struct sll_header *sllp, u_int length) if (!qflag) { ether_type = EXTRACT_16BITS(&sllp->sll_protocol); - + if (ether_type <= ETHERMTU) { /* * Not an Ethernet type; what type is it? diff --git a/print-slow.c b/print-slow.c index fdfefccf..8bfe3f18 100644 --- a/print-slow.c +++ b/print-slow.c @@ -67,7 +67,7 @@ static const struct tok slow_oam_flag_values[] = { { 0x0020, "Remote Evaluating" }, { 0x0040, "Remote Stable" }, { 0, NULL} -}; +}; #define SLOW_OAM_CODE_INFO 0x00 #define SLOW_OAM_CODE_EVENT_NOTIF 0x01 @@ -220,7 +220,7 @@ struct lacp_tlv_actor_partner_info_t { u_int8_t port[2]; u_int8_t state; u_int8_t pad[3]; -}; +}; static const struct tok lacp_tlv_actor_partner_info_state_values[] = { { 0x01, "Activity"}, @@ -237,18 +237,18 @@ static const struct tok lacp_tlv_actor_partner_info_state_values[] = { struct lacp_tlv_collector_info_t { u_int8_t max_delay[2]; u_int8_t pad[12]; -}; +}; struct marker_tlv_marker_info_t { u_int8_t req_port[2]; u_int8_t req_sys[ETHER_ADDR_LEN]; u_int8_t req_trans_id[4]; u_int8_t pad[2]; -}; +}; struct lacp_marker_tlv_terminator_t { u_int8_t pad[50]; -}; +}; void slow_marker_lacp_print(register const u_char *, register u_int); void slow_oam_print(register const u_char *, register u_int); @@ -349,7 +349,7 @@ void slow_marker_lacp_print(register const u_char *tptr, register u_int tlen) { const struct lacp_tlv_collector_info_t *lacp_tlv_collector_info; const struct marker_tlv_marker_info_t *marker_tlv_marker_info; } tlv_ptr; - + while(tlen>0) { /* did we capture enough for fully decoding the tlv header ? */ TCHECK2(*tptr, sizeof(struct tlv_header_t)); @@ -479,7 +479,7 @@ void slow_oam_print(register const u_char *tptr, register u_int tlen) { const struct slow_oam_variableresponse_t *slow_oam_variableresponse; const struct slow_oam_loopbackctrl_t *slow_oam_loopbackctrl; } tlv; - + ptr.slow_oam_common_header = (struct slow_oam_common_header_t *)tptr; tptr += sizeof(struct slow_oam_common_header_t); tlen -= sizeof(struct slow_oam_common_header_t); @@ -507,11 +507,11 @@ void slow_oam_print(register const u_char *tptr, register u_int tlen) { printf("\n\t ERROR: illegal length - should be 0"); } return; - + case SLOW_OAM_INFO_TYPE_LOCAL: /* identical format - fall through */ case SLOW_OAM_INFO_TYPE_REMOTE: tlv.slow_oam_info = (const struct slow_oam_info_t *)tptr; - + if (tlv.slow_oam_info->info_length != sizeof(struct slow_oam_info_t)) { printf("\n\t ERROR: illegal length - should be %lu", @@ -539,11 +539,11 @@ void slow_oam_print(register const u_char *tptr, register u_int tlen) { EXTRACT_24BITS(&tlv.slow_oam_info->oui), EXTRACT_32BITS(&tlv.slow_oam_info->vendor_private)); break; - + case SLOW_OAM_INFO_TYPE_ORG_SPECIFIC: hexdump = TRUE; break; - + default: hexdump = TRUE; break; @@ -581,13 +581,13 @@ void slow_oam_print(register const u_char *tptr, register u_int tlen) { printf("\n\t ERROR: illegal length - should be 0"); } return; - + case SLOW_OAM_LINK_EVENT_ERR_SYM_PER: /* identical format - fall through */ case SLOW_OAM_LINK_EVENT_ERR_FRM: case SLOW_OAM_LINK_EVENT_ERR_FRM_PER: case SLOW_OAM_LINK_EVENT_ERR_FRM_SUMM: tlv.slow_oam_link_event = (const struct slow_oam_link_event_t *)tptr; - + if (tlv.slow_oam_link_event->event_length != sizeof(struct slow_oam_link_event_t)) { printf("\n\t ERROR: illegal length - should be %lu", @@ -607,11 +607,11 @@ void slow_oam_print(register const u_char *tptr, register u_int tlen) { EXTRACT_64BITS(&tlv.slow_oam_link_event->errors_running_total), EXTRACT_32BITS(&tlv.slow_oam_link_event->event_running_total)); break; - + case SLOW_OAM_LINK_EVENT_ORG_SPECIFIC: hexdump = TRUE; break; - + default: hexdump = TRUE; break; @@ -632,7 +632,7 @@ void slow_oam_print(register const u_char *tptr, register u_int tlen) { tptr += ptr.slow_oam_tlv_header->length; } break; - + case SLOW_OAM_CODE_LOOPBACK_CTRL: tlv.slow_oam_loopbackctrl = (const struct slow_oam_loopbackctrl_t *)tptr; printf("\n\t Command %s (%u)", diff --git a/print-smb.c b/print-smb.c index e1c2f799..7a9044c5 100644 --- a/print-smb.c +++ b/print-smb.c @@ -900,7 +900,7 @@ print_smb(const u_char *buf, const u_char *maxbuf) if (command == 0xFF) break; TCHECK2(words[3], 2); - newsmboffset = EXTRACT_LE_16BITS(words + 3); + newsmboffset = EXTRACT_LE_16BITS(words + 3); fn = smbfind(command, smb_fns); diff --git a/print-stp.c b/print-stp.c index 5c9b12d7..76d1c094 100644 --- a/print-stp.c +++ b/print-stp.c @@ -28,7 +28,7 @@ static const char rcsid[] _U_ = #include "addrtoname.h" #include "extract.h" -#define RSTP_EXTRACT_PORT_ROLE(x) (((x)&0x0C)>>2) +#define RSTP_EXTRACT_PORT_ROLE(x) (((x)&0x0C)>>2) /* STP timers are expressed in multiples of 1/256th second */ #define STP_TIME_BASE 256 #define STP_BPDU_MSTP_MIN_LEN 102 @@ -144,7 +144,7 @@ stp_print_config_bpdu(const struct stp_bpdu_ *stp_bpdu, u_int length) * MSTP BPDU * * 2 - bytes Protocol Id - * 1 - byte Protocol Ver. + * 1 - byte Protocol Ver. * 1 - byte BPDU tye * 1 - byte Flags * 8 - bytes CIST Root Identifier @@ -171,11 +171,11 @@ stp_print_config_bpdu(const struct stp_bpdu_ *stp_bpdu, u_int length) * Ref. IEEE 802.1aq. Section 14 * * 2 - bytes Version 4 length - * 1 - byte Aux Config Identifier + * 1 - byte Aux Config Identifier * 32 - bytes Aux Config Name * 2 - bytes Aux Revision level * 16 - bytes Aux Config Digest [MD5] - * 1 - byte (1 - 2) Agreement Number + * 1 - byte (1 - 2) Agreement Number * (3 - 4) Discarded Agreement Number * (5) Agreement Valid Flag * (6) Restricted Role Flag @@ -283,8 +283,8 @@ stp_print_mstp_bpdu(const struct stp_bpdu_ *stp_bpdu, u_int length) EXTRACT_32BITS(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 8), EXTRACT_32BITS(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 12)); - printf ("CIST int-root-pathcost %u, ", - EXTRACT_32BITS(ptr + MST_BPDU_CIST_INT_PATH_COST_OFFSET)); + printf ("CIST int-root-pathcost %u, ", + EXTRACT_32BITS(ptr + MST_BPDU_CIST_INT_PATH_COST_OFFSET)); printf("\n\tCIST bridge-id %s, ", stp_print_bridge_id(ptr + MST_BPDU_CIST_BRIDGE_ID_OFFSET)); @@ -301,7 +301,7 @@ stp_print_mstp_bpdu(const struct stp_bpdu_ *stp_bpdu, u_int length) MST_BPDU_MSTI_ROOT_PRIO_OFFSET); msti = msti & 0x0FFF; - printf("\n\tMSTI %d, Flags [%s], port-role %s", + printf("\n\tMSTI %d, Flags [%s], port-role %s", msti, bittok2str(stp_bpdu_flag_values, "none", ptr[offset]), tok2str(rstp_obj_port_role_values, "Unknown", RSTP_EXTRACT_PORT_ROLE(ptr[offset]))); @@ -342,12 +342,12 @@ stp_print_spb_bpdu(const struct stp_bpdu_ *stp_bpdu, u_int offset) EXTRACT_32BITS(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET + 4), EXTRACT_32BITS(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET + 8), EXTRACT_32BITS(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET + 12)); - + printf("\n\tAgreement num %d, Discarded Agreement num %d, Agreement valid-" "flag %d, \n\tRestricted role-flag: %d, Format id %d cap %d, " "Convention id %d cap %d, \n\tEdge count %d, " "Agreement digest %08x%08x%08x%08x%08x\n", - ptr[offset + SPB_BPDU_AGREEMENT_OFFSET]>>6, + ptr[offset + SPB_BPDU_AGREEMENT_OFFSET]>>6, ptr[offset + SPB_BPDU_AGREEMENT_OFFSET]>>4 & 0x3, ptr[offset + SPB_BPDU_AGREEMENT_OFFSET]>>3 & 0x1, ptr[offset + SPB_BPDU_AGREEMENT_OFFSET]>>2 & 0x1, @@ -372,13 +372,13 @@ stp_print(const u_char *p, u_int length) const struct stp_bpdu_ *stp_bpdu; u_int mstp_len; u_int spb_len; - + stp_bpdu = (struct stp_bpdu_*)p; /* Minimum STP Frame size. */ if (length < 4) goto trunc; - + if (EXTRACT_16BITS(&stp_bpdu->protocol_id)) { printf("unknown STP version, length %u", length); return; diff --git a/print-sunatm.c b/print-sunatm.c index e6f19e85..94a17b40 100644 --- a/print-sunatm.c +++ b/print-sunatm.c @@ -39,10 +39,10 @@ static const char rcsid[] _U_ = #endif #include <tcpdump-stdinc.h> - + struct mbuf; struct rtentry; - + #include <stdio.h> #include <pcap.h> diff --git a/print-symantec.c b/print-symantec.c index 8b4ee38c..84a2e7f5 100644 --- a/print-symantec.c +++ b/print-symantec.c @@ -57,15 +57,15 @@ symantec_hdr_print(register const u_char *bp, u_int length) if (!qflag) { if (etype <= ETHERMTU) (void)printf("invalid ethertype %u", etype); - else + else (void)printf("ethertype %s (0x%04x)", tok2str(ethertype_values,"Unknown", etype), etype); } else { if (etype <= ETHERMTU) (void)printf("invalid ethertype %u", etype); - else - (void)printf("%s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", etype)); + else + (void)printf("%s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", etype)); } (void)printf(", length %u: ", length); @@ -114,7 +114,7 @@ symantec_if_print(const struct pcap_pkthdr *h, const u_char *p) if (!suppress_default_print) default_print(p, caplen); - } + } return (sizeof (struct symantec_header)); } diff --git a/print-tcp.c b/print-tcp.c index f8331d38..e28994e6 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -659,7 +659,7 @@ tcp_print(register const u_char *bp, register u_int length, if ((flags & TH_RST) && vflag) { print_tcp_rst_data(bp, length); return; - } + } if (packettype) { switch (packettype) { diff --git a/print-tftp.c b/print-tftp.c index fcd009d9..9d2d919d 100644 --- a/print-tftp.c +++ b/print-tftp.c @@ -119,7 +119,7 @@ tftp_print(register const u_char *bp, u_int length) fn_print(p, snapend); } } - + if (i) goto trunc; break; diff --git a/print-tipc.c b/print-tipc.c index 8dc3abbc..56c1b660 100644 --- a/print-tipc.c +++ b/print-tipc.c @@ -227,7 +227,7 @@ print_payload(netdissect_options *ndo, const struct payload_tipc_pkthdr *ap) trunc: ND_PRINT((ndo, "%s", tstr)); } - + static void print_internal(netdissect_options *ndo, const struct internal_tipc_pkthdr *ap) { @@ -365,7 +365,7 @@ tipc_print(netdissect_options *ndo, const u_char *bp, u_int length _U_, case TIPC_USER_NAME_DISTRIBUTOR: case TIPC_USER_CONN_MANAGER: print_payload(ndo, (struct payload_tipc_pkthdr *)bp); - break; + break; case TIPC_USER_LINK_CONFIG: print_link_conf(ndo, (struct link_conf_tipc_pkthdr *)bp); diff --git a/print-udld.c b/print-udld.c index e8395d0a..c0fc793c 100644 --- a/print-udld.c +++ b/print-udld.c @@ -12,7 +12,7 @@ * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * - * UNIDIRECTIONAL LINK DETECTION (UDLD) as per + * UNIDIRECTIONAL LINK DETECTION (UDLD) as per * http://www.ietf.org/internet-drafts/draft-foschiano-udld-02.txt * * Original code by Carles Kishimoto <carles.kishimoto@gmail.com> @@ -29,7 +29,7 @@ #include "interface.h" #include "addrtoname.h" -#include "extract.h" +#include "extract.h" #include "nlpid.h" #define UDLD_HEADER_LEN 4 @@ -68,19 +68,19 @@ static const struct tok udld_flags_values[] = { /* * - * 0 1 2 3 - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | Ver | Opcode | Flags | Checksum | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | List of TLVs (variable length list) | - * | ... | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * 0 1 2 3 + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Ver | Opcode | Flags | Checksum | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | List of TLVs (variable length list) | + * | ... | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * */ -#define UDLD_EXTRACT_VERSION(x) (((x)&0xe0)>>5) -#define UDLD_EXTRACT_OPCODE(x) ((x)&0x1f) +#define UDLD_EXTRACT_VERSION(x) (((x)&0xe0)>>5) +#define UDLD_EXTRACT_OPCODE(x) ((x)&0x1f) void udld_print (const u_char *pptr, u_int length) @@ -91,14 +91,14 @@ udld_print (const u_char *pptr, u_int length) if (length < UDLD_HEADER_LEN) goto trunc; - tptr = pptr; + tptr = pptr; - if (!TTEST2(*tptr, UDLD_HEADER_LEN)) + if (!TTEST2(*tptr, UDLD_HEADER_LEN)) goto trunc; code = UDLD_EXTRACT_OPCODE(*tptr); - printf("UDLDv%u, Code %s (%x), Flags [%s] (0x%02x), length %u", + printf("UDLDv%u, Code %s (%x), Flags [%s] (0x%02x), length %u", UDLD_EXTRACT_VERSION(*tptr), tok2str(udld_code_values, "Reserved", code), code, @@ -119,11 +119,11 @@ udld_print (const u_char *pptr, u_int length) while (tptr < (pptr+length)) { - if (!TTEST2(*tptr, 4)) + if (!TTEST2(*tptr, 4)) goto trunc; type = EXTRACT_16BITS(tptr); - len = EXTRACT_16BITS(tptr+2); + len = EXTRACT_16BITS(tptr+2); len -= 4; tptr += 4; @@ -140,11 +140,11 @@ udld_print (const u_char *pptr, u_int length) case UDLD_DEVICE_ID_TLV: case UDLD_PORT_ID_TLV: case UDLD_ECHO_TLV: - case UDLD_DEVICE_NAME_TLV: + case UDLD_DEVICE_NAME_TLV: printf(", %s", tptr); break; - case UDLD_MESSAGE_INTERVAL_TLV: + case UDLD_MESSAGE_INTERVAL_TLV: case UDLD_TIMEOUT_INTERVAL_TLV: printf(", %us", (*tptr)); break; @@ -155,7 +155,7 @@ udld_print (const u_char *pptr, u_int length) default: break; - } + } tptr += len; } diff --git a/print-vqp.c b/print-vqp.c index 2d9e8e1f..9076b905 100644 --- a/print-vqp.c +++ b/print-vqp.c @@ -12,7 +12,7 @@ * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * - * support for the Cisco prop. VQP Protocol + * support for the Cisco prop. VQP Protocol * * Original code by Carles Kishimoto <Carles.Kishimoto@bsc.es> */ @@ -106,7 +106,7 @@ static const struct tok vqp_obj_values[] = { }; void -vqp_print(register const u_char *pptr, register u_int len) +vqp_print(register const u_char *pptr, register u_int len) { const struct vqp_common_header_t *vqp_common_header; const struct vqp_obj_tlv_t *vqp_obj_tlv; @@ -141,7 +141,7 @@ vqp_print(register const u_char *pptr, register u_int len) len); return; } - + /* ok they seem to want to know everything - lets fully decode it */ nitems = vqp_common_header->nitems; printf("\n\tVQPv%u, %s Message, error-code %s (%u), seq 0x%08x, items %u, length %u", @@ -175,7 +175,7 @@ vqp_print(register const u_char *pptr, register u_int len) } /* did we capture enough for fully decoding the object ? */ - if (!TTEST2(*tptr, vqp_obj_len)) + if (!TTEST2(*tptr, vqp_obj_len)) goto trunc; switch(vqp_obj_type) { diff --git a/print-vtp.c b/print-vtp.c index 04ae24c7..61a6f26a 100644 --- a/print-vtp.c +++ b/print-vtp.c @@ -15,8 +15,8 @@ * VLAN TRUNKING PROTOCOL (VTP) * * Reference documentation: - * http://www.cisco.com/en/US/tech/tk389/tk689/technologies_tech_note09186a0080094c52.shtml - * http://www.cisco.com/warp/public/473/21.html + * http://www.cisco.com/en/US/tech/tk389/tk689/technologies_tech_note09186a0080094c52.shtml + * http://www.cisco.com/warp/public/473/21.html * http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm * * Original code ode by Carles Kishimoto <carles.kishimoto@gmail.com> @@ -33,7 +33,7 @@ #include "interface.h" #include "addrtoname.h" -#include "extract.h" +#include "extract.h" #include "nlpid.h" #define VTP_HEADER_LEN 36 @@ -130,14 +130,14 @@ vtp_print (const u_char *pptr, u_int length) if (length < VTP_HEADER_LEN) goto trunc; - tptr = pptr; + tptr = pptr; - if (!TTEST2(*tptr, VTP_HEADER_LEN)) + if (!TTEST2(*tptr, VTP_HEADER_LEN)) goto trunc; type = *(tptr+1); printf("VTPv%u, Message %s (0x%02x), length %u", - *tptr, + *tptr, tok2str(vtp_message_type_values,"Unknown message type", type), *(tptr+1), length); @@ -148,7 +148,7 @@ vtp_print (const u_char *pptr, u_int length) } /* verbose mode print all fields */ - printf("\n\tDomain name: %s, %s: %u", + printf("\n\tDomain name: %s, %s: %u", (tptr+4), tok2str(vtp_header_values,"Unknown",*(tptr+1)), *(tptr+2)); @@ -176,13 +176,13 @@ vtp_print (const u_char *pptr, u_int length) * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | MD5 digest (16 bytes) | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * + * */ printf("\n\t Config Rev %x, Updater %s", EXTRACT_32BITS(tptr), ipaddr_string(tptr+4)); - tptr += 8; + tptr += 8; printf(", Timestamp 0x%08x 0x%08x 0x%08x", EXTRACT_32BITS(tptr), EXTRACT_32BITS(tptr + 4), @@ -215,12 +215,12 @@ vtp_print (const u_char *pptr, u_int length) * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | VLAN info field N | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * + * */ printf(", Config Rev %x", EXTRACT_32BITS(tptr)); - /* + /* * VLAN INFORMATION * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -264,9 +264,9 @@ vtp_print (const u_char *pptr, u_int length) while (len > 0) { - /* + /* * Cisco specs says 2 bytes for type + 2 bytes for length, take only 1 - * See: http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm + * See: http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm */ type = *tptr; tlv_len = *(tptr+1); diff --git a/print-vxlan.c b/print-vxlan.c index 80344634..16e08700 100644 --- a/print-vxlan.c +++ b/print-vxlan.c @@ -37,7 +37,7 @@ * |R|R|R|R|I|R|R|R| Reserved | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | VXLAN Network Identifier (VNI) | Reserved | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ void @@ -45,7 +45,7 @@ vxlan_print(const u_char *bp, u_int len) { u_int8_t flags; u_int32_t vni; - + if (len < 8) { printf("[|VXLAN]"); return; diff --git a/signature.c b/signature.c index b2a7084a..55b69b86 100644 --- a/signature.c +++ b/signature.c @@ -1,4 +1,4 @@ -/* +/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph @@ -11,7 +11,7 @@ * FOR A PARTICULAR PURPOSE. * * Functions for signature and digest verification. - * + * * Original code by Hannes Gredler (hannes@juniper.net) */ diff --git a/signature.h b/signature.h index e48b7229..f6389013 100644 --- a/signature.h +++ b/signature.h @@ -1,4 +1,4 @@ -/* +/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph diff --git a/tcpdump-stdinc.h b/tcpdump-stdinc.h index 91f3361b..34cfb76b 100644 --- a/tcpdump-stdinc.h +++ b/tcpdump-stdinc.h @@ -189,7 +189,7 @@ typedef char* caddr_t; #define FOPEN_WRITE_BIN FOPEN_WRITE_TXT #endif -#if defined(__GNUC__) && defined(__i386__) && !defined(__APPLE__) && !defined(__ntohl) +#if defined(__GNUC__) && defined(__i386__) && !defined(__APPLE__) && !defined(__ntohl) #undef ntohl #undef ntohs #undef htonl @@ -548,7 +548,7 @@ droproot(const char *username, const char *chroot_dir) fprintf(stderr, "tcpdump: Chroot without dropping root is insecure\n"); exit(1); } - + pw = getpwnam(username); if (pw) { if (chroot_dir) { @@ -574,7 +574,7 @@ droproot(const char *username, const char *chroot_dir) if (initgroups(pw->pw_name, pw->pw_gid) != 0 || setgid(pw->pw_gid) != 0 || setuid(pw->pw_uid) != 0) { fprintf(stderr, "tcpdump: Couldn't change to '%.32s' uid=%lu gid=%lu: %s\n", - username, + username, (unsigned long)pw->pw_uid, (unsigned long)pw->pw_gid, pcap_strerror(errno)); @@ -641,7 +641,7 @@ MakeFilename(char *buffer, char *orig_name, int cnt, int max_chars) static int tcpdump_printf(netdissect_options *ndo _U_, const char *fmt, ...) { - + va_list args; int ret; @@ -733,7 +733,7 @@ main(int argc, char **argv) gndo->ndo_error=ndo_error; gndo->ndo_warning=ndo_warning; gndo->ndo_snaplen = DEFAULT_SNAPLEN; - + cnt = -1; device = NULL; infile = NULL; @@ -859,7 +859,7 @@ main(int argc, char **argv) case 'i': if (optarg[0] == '0' && optarg[1] == 0) error("Invalid adapter index"); - + #ifdef HAVE_PCAP_FINDALLDEVS /* * If the argument is a number, treat it as @@ -1082,7 +1082,7 @@ main(int argc, char **argv) case 'W': Wflag = atoi(optarg); - if (Wflag < 0) + if (Wflag < 0) error("invalid number of output files %s", optarg); WflagChars = getWflagChars(Wflag); break; @@ -1179,7 +1179,7 @@ main(int argc, char **argv) #ifdef WITH_USER /* if run as root, prepare for dropping root privileges */ if (getuid() == 0 || geteuid() == 0) { - /* Run with '-Z root' to restore old behaviour */ + /* Run with '-Z root' to restore old behaviour */ if (!username) username = WITH_USER; } @@ -1262,7 +1262,7 @@ main(int argc, char **argv) fprintf(stderr, "%s: listening on %s\n", program_name, device); } - fflush(stderr); + fflush(stderr); #endif /* WIN32 */ #ifdef HAVE_PCAP_CREATE pd = pcap_create(device, ebuf); @@ -1420,7 +1420,7 @@ main(int argc, char **argv) init_addrtoname(localnet, netmask); init_checksum(); -#ifndef WIN32 +#ifndef WIN32 (void)setsignal(SIGPIPE, cleanup); (void)setsignal(SIGTERM, cleanup); (void)setsignal(SIGINT, cleanup); @@ -1429,7 +1429,7 @@ main(int argc, char **argv) (void)setsignal(SIGCHLD, child_cleanup); #endif /* Cooperate with nohup(1) */ -#ifndef WIN32 +#ifndef WIN32 if ((oldhandler = setsignal(SIGHUP, cleanup)) != SIG_DFL) (void)setsignal(SIGHUP, oldhandler); #endif /* WIN32 */ @@ -188,12 +188,12 @@ ts_print(register const struct timeval *tvp) if (b_sec == 0) { /* init timestamp for first packet */ b_usec = tvp->tv_usec; - b_sec = tvp->tv_sec; + b_sec = tvp->tv_sec; } d_usec = tvp->tv_usec - b_usec; d_sec = tvp->tv_sec - b_sec; - + while (d_usec < 0) { d_usec += 1000000; d_sec--; |