From ed85e20e4d6a27d5405f37366dd34b64c10a9211 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 23 Apr 2014 00:20:40 -0700 Subject: [PATCH] u_intN_t is dead, long live uintN_t. And, as we require at least autoconf 2.61, and as autoconf 2.61 and later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to define the uintN_t and intN_t macros if the system doesn't define them for us. This lets us get rid of bitypes.h as well. --- aclocal.m4 | 5 +- addrtoname.c | 24 ++-- checksum.c | 22 ++-- config.h.in | 15 --- configure | 159 +++++++++++++----------- configure.in | 56 +++------ cpack.c | 32 ++--- in_cksum.c | 32 ++--- parsenfsfh.c | 8 +- print-802_11.c | 296 ++++++++++++++++++++++---------------------- print-802_15_4.c | 8 +- print-ah.c | 2 +- print-aodv.c | 112 ++++++++--------- print-ap1394.c | 2 +- print-arcnet.c | 28 ++--- print-atalk.c | 16 +-- print-atm.c | 24 ++-- print-babel.c | 4 +- print-bfd.c | 26 ++-- print-bgp.c | 74 +++++------ print-bootp.c | 14 +-- print-carp.c | 2 +- print-cfm.c | 56 ++++----- print-chdlc.c | 12 +- print-cnfp.c | 30 ++--- print-dccp.c | 54 ++++---- print-decnet.c | 16 +-- print-dhcp6.c | 24 ++-- print-domain.c | 2 +- print-dvmrp.c | 8 +- print-egp.c | 42 +++---- print-eigrp.c | 154 +++++++++++------------ print-enc.c | 6 +- print-esp.c | 8 +- print-ether.c | 4 +- print-forces.c | 170 ++++++++++++------------- print-fr.c | 24 ++-- print-geonet.c | 8 +- print-gre.c | 26 ++-- print-hsrp.c | 20 +-- print-icmp.c | 80 ++++++------ print-icmp6.c | 194 ++++++++++++++--------------- print-igmp.c | 30 ++--- print-igrp.c | 28 ++--- print-ip.c | 26 ++-- print-ip6.c | 10 +- print-ipcomp.c | 8 +- print-ipx.c | 24 ++-- print-isakmp.c | 314 +++++++++++++++++++++++------------------------ print-isoclns.c | 212 ++++++++++++++++---------------- print-juniper.c | 76 ++++++------ print-krb.c | 4 +- print-l2tp.c | 44 +++---- print-lane.c | 16 +-- print-ldp.c | 18 +-- print-llc.c | 8 +- print-lldp.c | 26 ++-- print-lmp.c | 18 +-- print-lspping.c | 138 ++++++++++----------- print-lwapp.c | 20 +-- print-lwres.c | 20 +-- print-m3ua.c | 16 +-- print-mobile.c | 10 +- print-mobility.c | 16 +-- print-mpcp.c | 32 ++--- print-mpls.c | 4 +- print-mptcp.c | 98 +++++++-------- print-msnlb.c | 10 +- print-nflog.c | 4 +- print-nfs.c | 150 +++++++++++----------- print-ntp.c | 24 ++-- print-olsr.c | 76 ++++++------ print-ospf.c | 40 +++--- print-ospf6.c | 130 ++++++++++---------- print-otv.c | 6 +- print-pflog.c | 8 +- print-pgm.c | 136 ++++++++++---------- print-pim.c | 18 +-- print-ppi.c | 6 +- print-ppp.c | 4 +- print-pppoe.c | 2 +- print-pptp.c | 252 ++++++++++++++++++------------------- print-radius.c | 20 +-- print-rip.c | 42 +++---- print-ripng.c | 12 +- print-rrcp.c | 4 +- print-rsvp.c | 50 ++++---- print-rx.c | 70 +++++------ print-sctp.c | 112 ++++++++--------- print-sflow.c | 220 ++++++++++++++++----------------- print-sll.c | 12 +- print-slow.c | 90 +++++++------- print-smb.c | 4 +- print-snmp.c | 20 +-- print-stp.c | 32 ++--- print-sunrpc.c | 38 +++--- print-symantec.c | 8 +- print-syslog.c | 6 +- print-tcp.c | 22 ++-- print-timed.c | 10 +- print-tipc.c | 68 +++++----- print-token.c | 12 +- print-udp.c | 56 ++++----- print-vqp.c | 20 +-- print-vrrp.c | 4 +- print-vtp.c | 14 +-- print-vxlan.c | 4 +- print-wb.c | 48 ++++---- print-zeromq.c | 10 +- signature.c | 8 +- smbutil.c | 36 +++--- tcpdump-stdinc.h | 7 +- util.c | 4 +- 113 files changed, 2506 insertions(+), 2538 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 056b22db..40d53e82 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -818,16 +818,13 @@ AC_DEFUN(AC_LBL_CHECK_64BIT_FORMAT, [[ # ifdef HAVE_INTTYPES_H #include -# endif -# ifdef HAVE_SYS_BITYPES_H - #include # endif #include #include main() { - u_int64_t t = 1; + uint64_t t = 1; char strbuf[16+1]; sprintf(strbuf, "%016$1x", t << 32); if (strcmp(strbuf, "0000000100000000") == 0) diff --git a/addrtoname.c b/addrtoname.c index f3fabb06..97fd04c4 100644 --- a/addrtoname.c +++ b/addrtoname.c @@ -78,7 +78,7 @@ extern int ether_ntohost(char *, const struct ether_addr *); #define HASHNAMESIZE 4096 struct hnamemem { - u_int32_t addr; + uint32_t addr; const char *name; struct hnamemem *nxt; }; @@ -155,7 +155,7 @@ static struct enamemem nsaptable[HASHNAMESIZE]; static struct enamemem bytestringtable[HASHNAMESIZE]; struct protoidmem { - u_int32_t p_oui; + uint32_t p_oui; u_short p_proto; const char *p_name; struct protoidmem *p_nxt; @@ -167,7 +167,7 @@ static struct protoidmem protoidtable[HASHNAMESIZE]; * A faster replacement for inet_ntoa(). */ const char * -intoa(u_int32_t addr) +intoa(uint32_t addr) { register char *cp; register u_int byte; @@ -196,8 +196,8 @@ intoa(u_int32_t addr) return cp + 1; } -static u_int32_t f_netmask; -static u_int32_t f_localnet; +static uint32_t f_netmask; +static uint32_t f_localnet; /* * Return a name for the IP address pointed to by ap. This address @@ -222,7 +222,7 @@ const char * getname(netdissect_options *ndo, const u_char *ap) { register struct hostent *hp; - u_int32_t addr; + uint32_t addr; static struct hnamemem *p; /* static for longjmp() */ memcpy(&addr, ap, sizeof(addr)); @@ -274,7 +274,7 @@ getname6(netdissect_options *ndo, const u_char *ap) struct in6_addr addr; struct for_hash_addr { char fill[14]; - u_int16_t d; + uint16_t d; } addra; } addr; static struct h6namemem *p; /* static for longjmp() */ @@ -580,7 +580,7 @@ etherproto_string(u_short port) { register char *cp; register struct hnamemem *tp; - register u_int32_t i = port; + register uint32_t i = port; char buf[sizeof("0000")]; for (tp = &eprototable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) @@ -663,7 +663,7 @@ const char * tcpport_string(u_short port) { register struct hnamemem *tp; - register u_int32_t i = port; + register uint32_t i = port; char buf[sizeof("00000")]; for (tp = &tporttable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) @@ -682,7 +682,7 @@ const char * udpport_string(register u_short port) { register struct hnamemem *tp; - register u_int32_t i = port; + register uint32_t i = port; char buf[sizeof("00000")]; for (tp = &uporttable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) @@ -702,7 +702,7 @@ ipxsap_string(u_short port) { register char *cp; register struct hnamemem *tp; - register u_int32_t i = port; + register uint32_t i = port; char buf[sizeof("0000")]; for (tp = &ipxsaptable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) @@ -1137,7 +1137,7 @@ init_ipxsaparray(void) * of the local network. mask is its subnet mask. */ void -init_addrtoname(netdissect_options *ndo, u_int32_t localnet, u_int32_t mask) +init_addrtoname(netdissect_options *ndo, uint32_t localnet, uint32_t mask) { if (ndo->ndo_fflag) { f_localnet = localnet; diff --git a/checksum.c b/checksum.c index e451bdd4..d8263c7a 100644 --- a/checksum.c +++ b/checksum.c @@ -51,7 +51,7 @@ for i in range(len(crc_table)/8): sys.stdout.write("\n") */ -static const u_int16_t crc10_table[256] = +static const uint16_t crc10_table[256] = { 0x0000, 0x0233, 0x0255, 0x0066, 0x0299, 0x00aa, 0x00cc, 0x02ff, 0x0301, 0x0132, 0x0154, 0x0367, 0x0198, 0x03ab, 0x03cd, 0x01fe, @@ -92,8 +92,8 @@ init_crc10_table(void) { #define CRC10_POLYNOMIAL 0x633 register int i, j; - register u_int16_t accum; - u_int16_t verify_crc10_table[256]; + register uint16_t accum; + uint16_t verify_crc10_table[256]; for ( i = 0; i < 256; i++ ) { @@ -110,8 +110,8 @@ init_crc10_table(void) #undef CRC10_POLYNOMIAL } -u_int16_t -verify_crc10_cksum(u_int16_t accum, const u_char *p, int length) +uint16_t +verify_crc10_cksum(uint16_t accum, const u_char *p, int length) { register int i; @@ -136,16 +136,16 @@ init_checksum(void) { * Creates the OSI Fletcher checksum. See 8473-1, Appendix C, section C.3. * The checksum field of the passed PDU does not need to be reset to zero. */ -u_int16_t -create_osi_cksum (const u_int8_t *pptr, int checksum_offset, int length) +uint16_t +create_osi_cksum (const uint8_t *pptr, int checksum_offset, int length) { int x; int y; - u_int32_t mul; - u_int32_t c0; - u_int32_t c1; - u_int16_t checksum; + uint32_t mul; + uint32_t c0; + uint32_t c1; + uint16_t checksum; int index; c0 = 0; diff --git a/config.h.in b/config.h.in index a3ae3ac4..c8c6507c 100644 --- a/config.h.in +++ b/config.h.in @@ -184,9 +184,6 @@ /* Define to 1 if the system has the type `struct ether_addr'. */ #undef HAVE_STRUCT_ETHER_ADDR -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_BITYPES_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H @@ -337,18 +334,6 @@ a type exists and the standard includes do not define it. */ #undef int8_t -/* Define to `unsigned short' if u_int16_t not defined. */ -#undef u_int16_t - -/* Define to `unsigned int' if u_int32_t not defined. */ -#undef u_int32_t - -/* Define to `unsigned long long' if u_int64_t not defined. */ -#undef u_int64_t - -/* Define to `unsigned char' if u_int8_t not defined. */ -#undef u_int8_t - /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t diff --git a/configure b/configure index 114edcd6..37aa8a1b 100755 --- a/configure +++ b/configure @@ -6897,75 +6897,107 @@ _ACEOF # -# For now, we're using the old BSD-style u_intXX_t types, so check for -# them. +# The minimum version of autoconf that we support is 2.61, and it +# supports the AC_TYPE_UINTn_T macros. Use them; we've stopped +# using the old BSD-style u_intXX_t types. # -# We should probably migrate to the standard C uintXX_t types. -# -for ac_header in sys/bitypes.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/bitypes.h" "ac_cv_header_sys_bitypes_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_bitypes_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_BITYPES_H 1 +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT8_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint8_t $ac_cv_c_uint8_t _ACEOF +;; + esac -fi +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) -done +cat >>confdefs.h <<_ACEOF +#define int8_t $ac_cv_c_int8_t +_ACEOF +;; +esac +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) -ac_fn_c_check_type "$LINENO" "u_int8_t" "ac_cv_type_u_int8_t" "$ac_includes_default -#ifdef HAVE_SYS_BITYPES_H -#include -#endif -" -if test "x$ac_cv_type_u_int8_t" = xyes; then : -else +cat >>confdefs.h <<_ACEOF +#define uint16_t $ac_cv_c_uint16_t +_ACEOF +;; + esac -$as_echo "#define u_int8_t unsigned char" >>confdefs.h +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) -fi +cat >>confdefs.h <<_ACEOF +#define int16_t $ac_cv_c_int16_t +_ACEOF +;; +esac -ac_fn_c_check_type "$LINENO" "u_int16_t" "ac_cv_type_u_int16_t" "$ac_includes_default -#ifdef HAVE_SYS_BITYPES_H -#include -#endif -" -if test "x$ac_cv_type_u_int16_t" = xyes; then : +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) -else +$as_echo "#define _UINT32_T 1" >>confdefs.h -$as_echo "#define u_int16_t unsigned short" >>confdefs.h -fi +cat >>confdefs.h <<_ACEOF +#define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac -ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "$ac_includes_default -#ifdef HAVE_SYS_BITYPES_H -#include -#endif -" -if test "x$ac_cv_type_u_int32_t" = xyes; then : +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) -else +cat >>confdefs.h <<_ACEOF +#define int32_t $ac_cv_c_int32_t +_ACEOF +;; +esac -$as_echo "#define u_int32_t unsigned int" >>confdefs.h +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) -fi +$as_echo "#define _UINT64_T 1" >>confdefs.h -ac_fn_c_check_type "$LINENO" "u_int64_t" "ac_cv_type_u_int64_t" "$ac_includes_default -#ifdef HAVE_SYS_BITYPES_H -#include -#endif -" -if test "x$ac_cv_type_u_int64_t" = xyes; then : -else +cat >>confdefs.h <<_ACEOF +#define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac -$as_echo "#define u_int64_t unsigned long long" >>confdefs.h +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) -fi +cat >>confdefs.h <<_ACEOF +#define int64_t $ac_cv_c_int64_t +_ACEOF +;; +esac # @@ -6992,16 +7024,13 @@ $as_echo_n "checking whether inttypes.h defines the PRI[doxu]64 macros... " >&6; #include #include #include - #ifdef HAVE_SYS_BITYPES_H - #include - #endif main() { - printf("%" PRId64 "\n", (u_int64_t)1); - printf("%" PRIo64 "\n", (u_int64_t)1); - printf("%" PRIx64 "\n", (u_int64_t)1); - printf("%" PRIu64 "\n", (u_int64_t)1); + printf("%" PRId64 "\n", (uint64_t)1); + printf("%" PRIo64 "\n", (uint64_t)1); + printf("%" PRIx64 "\n", (uint64_t)1); + printf("%" PRIu64 "\n", (uint64_t)1); } @@ -7049,16 +7078,13 @@ else # ifdef HAVE_INTTYPES_H #include -# endif -# ifdef HAVE_SYS_BITYPES_H - #include # endif #include #include main() { - u_int64_t t = 1; + uint64_t t = 1; char strbuf[16+1]; sprintf(strbuf, "%016lx", t << 32); if (strcmp(strbuf, "0000000100000000") == 0) @@ -7106,16 +7132,13 @@ else # ifdef HAVE_INTTYPES_H #include -# endif -# ifdef HAVE_SYS_BITYPES_H - #include # endif #include #include main() { - u_int64_t t = 1; + uint64_t t = 1; char strbuf[16+1]; sprintf(strbuf, "%016llx", t << 32); if (strcmp(strbuf, "0000000100000000") == 0) @@ -7163,16 +7186,13 @@ else # ifdef HAVE_INTTYPES_H #include -# endif -# ifdef HAVE_SYS_BITYPES_H - #include # endif #include #include main() { - u_int64_t t = 1; + uint64_t t = 1; char strbuf[16+1]; sprintf(strbuf, "%016Lx", t << 32); if (strcmp(strbuf, "0000000100000000") == 0) @@ -7220,16 +7240,13 @@ else # ifdef HAVE_INTTYPES_H #include -# endif -# ifdef HAVE_SYS_BITYPES_H - #include # endif #include #include main() { - u_int64_t t = 1; + uint64_t t = 1; char strbuf[16+1]; sprintf(strbuf, "%016qx", t << 32); if (strcmp(strbuf, "0000000100000000") == 0) diff --git a/configure.in b/configure.in index e347d512..a027c5c6 100644 --- a/configure.in +++ b/configure.in @@ -879,41 +879,18 @@ AC_TYPE_UINT32_T AC_TYPE_UINT64_T # -# For now, we're using the old BSD-style u_intXX_t types, so check for -# them. +# The minimum version of autoconf that we support is 2.61, and it +# supports the AC_TYPE_UINTn_T macros. Use them; we've stopped +# using the old BSD-style u_intXX_t types. # -# We should probably migrate to the standard C uintXX_t types. -# -AC_CHECK_HEADERS(sys/bitypes.h) - -AC_CHECK_TYPE([u_int8_t], , - [AC_DEFINE([u_int8_t], [unsigned char], - [Define to `unsigned char' if u_int8_t not defined.])], - [AC_INCLUDES_DEFAULT -#ifdef HAVE_SYS_BITYPES_H -#include -#endif]) -AC_CHECK_TYPE([u_int16_t], , - [AC_DEFINE([u_int16_t], [unsigned short], - [Define to `unsigned short' if u_int16_t not defined.])], - [AC_INCLUDES_DEFAULT -#ifdef HAVE_SYS_BITYPES_H -#include -#endif]) -AC_CHECK_TYPE([u_int32_t], , - [AC_DEFINE([u_int32_t], [unsigned int], - [Define to `unsigned int' if u_int32_t not defined.])], - [AC_INCLUDES_DEFAULT -#ifdef HAVE_SYS_BITYPES_H -#include -#endif]) -AC_CHECK_TYPE([u_int64_t], , - [AC_DEFINE([u_int64_t], [unsigned long long], - [Define to `unsigned long long' if u_int64_t not defined.])], - [AC_INCLUDES_DEFAULT -#ifdef HAVE_SYS_BITYPES_H -#include -#endif]) +AC_TYPE_UINT8_T +AC_TYPE_INT8_T +AC_TYPE_UINT16_T +AC_TYPE_INT16_T +AC_TYPE_UINT32_T +AC_TYPE_INT32_T +AC_TYPE_UINT64_T +AC_TYPE_INT64_T # # Check for @@ -932,16 +909,13 @@ AC_CHECK_HEADERS(inttypes.h, #include #include #include - #ifdef HAVE_SYS_BITYPES_H - #include - #endif main() { - printf("%" PRId64 "\n", (u_int64_t)1); - printf("%" PRIo64 "\n", (u_int64_t)1); - printf("%" PRIx64 "\n", (u_int64_t)1); - printf("%" PRIu64 "\n", (u_int64_t)1); + printf("%" PRId64 "\n", (uint64_t)1); + printf("%" PRIo64 "\n", (uint64_t)1); + printf("%" PRIx64 "\n", (uint64_t)1); + printf("%" PRIu64 "\n", (uint64_t)1); } ]]) ], diff --git a/cpack.c b/cpack.c index 3cbb9f92..16bfd151 100644 --- a/cpack.c +++ b/cpack.c @@ -39,8 +39,8 @@ #include "cpack.h" #include "extract.h" -u_int8_t * -cpack_next_boundary(u_int8_t *buf, u_int8_t *p, size_t alignment) +uint8_t * +cpack_next_boundary(uint8_t *buf, uint8_t *p, size_t alignment) { size_t misalignment = (size_t)(p - buf) % alignment; @@ -54,10 +54,10 @@ cpack_next_boundary(u_int8_t *buf, u_int8_t *p, size_t alignment) * wordsize bytes remain in the buffer after the boundary. Otherwise, * return a pointer to the boundary. */ -u_int8_t * +uint8_t * cpack_align_and_reserve(struct cpack_state *cs, size_t wordsize) { - u_int8_t *next; + uint8_t *next; /* Ensure alignment. */ next = cpack_next_boundary(cs->c_buf, cs->c_next, wordsize); @@ -81,7 +81,7 @@ cpack_advance(struct cpack_state *cs, const size_t toskip) } int -cpack_init(struct cpack_state *cs, u_int8_t *buf, size_t buflen) +cpack_init(struct cpack_state *cs, uint8_t *buf, size_t buflen) { memset(cs, 0, sizeof(*cs)); @@ -94,55 +94,55 @@ cpack_init(struct cpack_state *cs, u_int8_t *buf, size_t buflen) /* Unpack a 64-bit unsigned integer. */ int -cpack_uint64(struct cpack_state *cs, u_int64_t *u) +cpack_uint64(struct cpack_state *cs, uint64_t *u) { - u_int8_t *next; + uint8_t *next; if ((next = cpack_align_and_reserve(cs, sizeof(*u))) == NULL) return -1; *u = EXTRACT_LE_64BITS(next); - /* Move pointer past the u_int64_t. */ + /* Move pointer past the uint64_t. */ cs->c_next = next + sizeof(*u); return 0; } /* Unpack a 32-bit unsigned integer. */ int -cpack_uint32(struct cpack_state *cs, u_int32_t *u) +cpack_uint32(struct cpack_state *cs, uint32_t *u) { - u_int8_t *next; + uint8_t *next; if ((next = cpack_align_and_reserve(cs, sizeof(*u))) == NULL) return -1; *u = EXTRACT_LE_32BITS(next); - /* Move pointer past the u_int32_t. */ + /* Move pointer past the uint32_t. */ cs->c_next = next + sizeof(*u); return 0; } /* Unpack a 16-bit unsigned integer. */ int -cpack_uint16(struct cpack_state *cs, u_int16_t *u) +cpack_uint16(struct cpack_state *cs, uint16_t *u) { - u_int8_t *next; + uint8_t *next; if ((next = cpack_align_and_reserve(cs, sizeof(*u))) == NULL) return -1; *u = EXTRACT_LE_16BITS(next); - /* Move pointer past the u_int16_t. */ + /* Move pointer past the uint16_t. */ cs->c_next = next + sizeof(*u); return 0; } /* Unpack an 8-bit unsigned integer. */ int -cpack_uint8(struct cpack_state *cs, u_int8_t *u) +cpack_uint8(struct cpack_state *cs, uint8_t *u) { /* No space left? */ if ((size_t)(cs->c_next - cs->c_buf) >= cs->c_len) @@ -150,7 +150,7 @@ cpack_uint8(struct cpack_state *cs, u_int8_t *u) *u = *cs->c_next; - /* Move pointer past the u_int8_t. */ + /* Move pointer past the uint8_t. */ cs->c_next++; return 0; } diff --git a/in_cksum.c b/in_cksum.c index b81f2baf..8c08e590 100644 --- a/in_cksum.c +++ b/in_cksum.c @@ -54,27 +54,27 @@ #define ADDCARRY(x) {if ((x) > 65535) (x) -= 65535;} #define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);} -u_int16_t +uint16_t in_cksum(const struct cksum_vec *vec, int veclen) { - register const u_int16_t *w; + register const uint16_t *w; register int sum = 0; register int mlen = 0; int byte_swapped = 0; union { - u_int8_t c[2]; - u_int16_t s; + uint8_t c[2]; + uint16_t s; } s_util; union { - u_int16_t s[2]; - u_int32_t l; + uint16_t s[2]; + uint32_t l; } l_util; for (; veclen != 0; vec++, veclen--) { if (vec->len == 0) continue; - w = (const u_int16_t *)(void *)vec->ptr; + w = (const uint16_t *)(void *)vec->ptr; if (mlen == -1) { /* * The first byte of this chunk is the continuation @@ -84,9 +84,9 @@ in_cksum(const struct cksum_vec *vec, int veclen) * s_util.c[0] is already saved when scanning previous * chunk. */ - s_util.c[1] = *(const u_int8_t *)w; + s_util.c[1] = *(const uint8_t *)w; sum += s_util.s; - w = (const u_int16_t *)(void *)((const u_int8_t *)w + 1); + w = (const uint16_t *)(void *)((const uint8_t *)w + 1); mlen = vec->len - 1; } else mlen = vec->len; @@ -96,8 +96,8 @@ in_cksum(const struct cksum_vec *vec, int veclen) if ((1 & (unsigned long) w) && (mlen > 0)) { REDUCE; sum <<= 8; - s_util.c[0] = *(const u_int8_t *)w; - w = (const u_int16_t *)(void *)((const u_int8_t *)w + 1); + s_util.c[0] = *(const uint8_t *)w; + w = (const uint16_t *)(void *)((const uint8_t *)w + 1); mlen--; byte_swapped = 1; } @@ -129,13 +129,13 @@ in_cksum(const struct cksum_vec *vec, int veclen) sum <<= 8; byte_swapped = 0; if (mlen == -1) { - s_util.c[1] = *(const u_int8_t *)w; + s_util.c[1] = *(const uint8_t *)w; sum += s_util.s; mlen = 0; } else mlen = -1; } else if (mlen == -1) - s_util.c[0] = *(const u_int8_t *)w; + s_util.c[0] = *(const uint8_t *)w; } if (mlen == -1) { /* The last mbuf has odd # of bytes. Follow the @@ -154,10 +154,10 @@ in_cksum(const struct cksum_vec *vec, int veclen) * that the checksum covers (including the checksum itself), compute * what the checksum field *should* have been. */ -u_int16_t -in_cksum_shouldbe(u_int16_t sum, u_int16_t computed_sum) +uint16_t +in_cksum_shouldbe(uint16_t sum, uint16_t computed_sum) { - u_int32_t shouldbe; + uint32_t shouldbe; /* * The value that should have gone into the checksum field diff --git a/parsenfsfh.c b/parsenfsfh.c index a86a4316..826ca94e 100644 --- a/parsenfsfh.c +++ b/parsenfsfh.c @@ -79,7 +79,7 @@ #ifdef ultrix /* Nasty hack to keep the Ultrix C compiler from emitting bogus warnings */ -#define XFF(x) ((u_int32_t)(x)) +#define XFF(x) ((uint32_t)(x)) #else #define XFF(x) (x) #endif @@ -107,13 +107,13 @@ static int is_UCX(const unsigned char *); void Parse_fh(register const unsigned char *fh, int len _U_, my_fsid *fsidp, - u_int32_t *inop, + uint32_t *inop, const char **osnamep, /* if non-NULL, return OS name here */ const char **fsnamep, /* if non-NULL, return server fs name here (for VMS) */ int ourself) /* true if file handle was generated on this host */ { register const unsigned char *fhp = fh; - u_int32_t temp; + uint32_t temp; int fhtype = FHT_UNKNOWN; int i; @@ -364,7 +364,7 @@ Parse_fh(register const unsigned char *fh, int len _U_, my_fsid *fsidp, memcpy((char *)fsidp, (char *)fh, 14); } else { - u_int32_t tempa[4]; /* at least 16 bytes, maybe more */ + uint32_t tempa[4]; /* at least 16 bytes, maybe more */ memset((char *)tempa, 0, sizeof(tempa)); memcpy((char *)tempa, (char *)fh, 14); /* ensure alignment */ diff --git a/print-802_11.c b/print-802_11.c index 3628f3dc..d7fe3ddd 100644 --- a/print-802_11.c +++ b/print-802_11.c @@ -170,12 +170,12 @@ static const struct tok ctrl_str[] = { #define FC_ORDER(fc) ((fc) & 0x8000) struct mgmt_header_t { - u_int16_t fc; - u_int16_t duration; - u_int8_t da[6]; - u_int8_t sa[6]; - u_int8_t bssid[6]; - u_int16_t seq_ctrl; + uint16_t fc; + uint16_t duration; + uint8_t da[6]; + uint8_t sa[6]; + uint8_t bssid[6]; + uint16_t seq_ctrl; }; #define MGMT_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\ @@ -189,54 +189,54 @@ struct mgmt_header_t { #define CAPABILITY_PRIVACY(cap) ((cap) & 0x0010) struct ssid_t { - u_int8_t element_id; - u_int8_t length; + uint8_t element_id; + uint8_t length; u_char ssid[33]; /* 32 + 1 for null */ }; struct rates_t { - u_int8_t element_id; - u_int8_t length; - u_int8_t rate[16]; + uint8_t element_id; + uint8_t length; + uint8_t rate[16]; }; struct challenge_t { - u_int8_t element_id; - u_int8_t length; - u_int8_t text[254]; /* 1-253 + 1 for null */ + uint8_t element_id; + uint8_t length; + uint8_t text[254]; /* 1-253 + 1 for null */ }; struct fh_t { - u_int8_t element_id; - u_int8_t length; - u_int16_t dwell_time; - u_int8_t hop_set; - u_int8_t hop_pattern; - u_int8_t hop_index; + uint8_t element_id; + uint8_t length; + uint16_t dwell_time; + uint8_t hop_set; + uint8_t hop_pattern; + uint8_t hop_index; }; struct ds_t { - u_int8_t element_id; - u_int8_t length; - u_int8_t channel; + uint8_t element_id; + uint8_t length; + uint8_t channel; }; struct cf_t { - u_int8_t element_id; - u_int8_t length; - u_int8_t count; - u_int8_t period; - u_int16_t max_duration; - u_int16_t dur_remaing; + uint8_t element_id; + uint8_t length; + uint8_t count; + uint8_t period; + uint16_t max_duration; + uint16_t dur_remaing; }; struct tim_t { - u_int8_t element_id; - u_int8_t length; - u_int8_t count; - u_int8_t period; - u_int8_t bitmap_control; - u_int8_t bitmap[251]; + uint8_t element_id; + uint8_t length; + uint8_t count; + uint8_t period; + uint8_t bitmap_control; + uint8_t bitmap[251]; }; #define E_SSID 0 @@ -266,18 +266,18 @@ struct tim_t { struct mgmt_body_t { - u_int8_t timestamp[IEEE802_11_TSTAMP_LEN]; - u_int16_t beacon_interval; - u_int16_t listen_interval; - u_int16_t status_code; - u_int16_t aid; + uint8_t timestamp[IEEE802_11_TSTAMP_LEN]; + uint16_t beacon_interval; + uint16_t listen_interval; + uint16_t status_code; + uint16_t aid; u_char ap[IEEE802_11_AP_LEN]; - u_int16_t reason_code; - u_int16_t auth_alg; - u_int16_t auth_trans_seq_num; + uint16_t reason_code; + uint16_t auth_alg; + uint16_t auth_trans_seq_num; int challenge_present; struct challenge_t challenge; - u_int16_t capability_info; + uint16_t capability_info; int ssid_present; struct ssid_t ssid; int rates_present; @@ -293,84 +293,84 @@ struct mgmt_body_t { }; struct ctrl_rts_t { - u_int16_t fc; - u_int16_t duration; - u_int8_t ra[6]; - u_int8_t ta[6]; - u_int8_t fcs[4]; + uint16_t fc; + uint16_t duration; + uint8_t ra[6]; + uint8_t ta[6]; + uint8_t fcs[4]; }; #define CTRL_RTS_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\ IEEE802_11_RA_LEN+IEEE802_11_TA_LEN) struct ctrl_cts_t { - u_int16_t fc; - u_int16_t duration; - u_int8_t ra[6]; - u_int8_t fcs[4]; + uint16_t fc; + uint16_t duration; + uint8_t ra[6]; + uint8_t fcs[4]; }; #define CTRL_CTS_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+IEEE802_11_RA_LEN) struct ctrl_ack_t { - u_int16_t fc; - u_int16_t duration; - u_int8_t ra[6]; - u_int8_t fcs[4]; + uint16_t fc; + uint16_t duration; + uint8_t ra[6]; + uint8_t fcs[4]; }; #define CTRL_ACK_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+IEEE802_11_RA_LEN) struct ctrl_ps_poll_t { - u_int16_t fc; - u_int16_t aid; - u_int8_t bssid[6]; - u_int8_t ta[6]; - u_int8_t fcs[4]; + uint16_t fc; + uint16_t aid; + uint8_t bssid[6]; + uint8_t ta[6]; + uint8_t fcs[4]; }; #define CTRL_PS_POLL_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_AID_LEN+\ IEEE802_11_BSSID_LEN+IEEE802_11_TA_LEN) struct ctrl_end_t { - u_int16_t fc; - u_int16_t duration; - u_int8_t ra[6]; - u_int8_t bssid[6]; - u_int8_t fcs[4]; + uint16_t fc; + uint16_t duration; + uint8_t ra[6]; + uint8_t bssid[6]; + uint8_t fcs[4]; }; #define CTRL_END_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\ IEEE802_11_RA_LEN+IEEE802_11_BSSID_LEN) struct ctrl_end_ack_t { - u_int16_t fc; - u_int16_t duration; - u_int8_t ra[6]; - u_int8_t bssid[6]; - u_int8_t fcs[4]; + uint16_t fc; + uint16_t duration; + uint8_t ra[6]; + uint8_t bssid[6]; + uint8_t fcs[4]; }; #define CTRL_END_ACK_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\ IEEE802_11_RA_LEN+IEEE802_11_BSSID_LEN) struct ctrl_ba_t { - u_int16_t fc; - u_int16_t duration; - u_int8_t ra[6]; - u_int8_t fcs[4]; + uint16_t fc; + uint16_t duration; + uint8_t ra[6]; + uint8_t fcs[4]; }; #define CTRL_BA_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+IEEE802_11_RA_LEN) struct ctrl_bar_t { - u_int16_t fc; - u_int16_t dur; - u_int8_t ra[6]; - u_int8_t ta[6]; - u_int16_t ctl; - u_int16_t seq; - u_int8_t fcs[4]; + uint16_t fc; + uint16_t dur; + uint8_t ra[6]; + uint8_t ta[6]; + uint16_t ctl; + uint16_t seq; + uint8_t fcs[4]; }; #define CTRL_BAR_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\ @@ -378,12 +378,12 @@ struct ctrl_bar_t { IEEE802_11_CTL_LEN+IEEE802_11_SEQ_LEN) struct meshcntl_t { - u_int8_t flags; - u_int8_t ttl; - u_int8_t seq[4]; - u_int8_t addr4[6]; - u_int8_t addr5[6]; - u_int8_t addr6[6]; + uint8_t flags; + uint8_t ttl; + uint8_t seq[4]; + uint8_t addr4[6]; + uint8_t addr5[6]; + uint8_t addr6[6]; }; #define IV_IV(iv) ((iv) & 0xFFFFFF) @@ -443,18 +443,18 @@ struct meshcntl_t { * Note well: all radiotap fields are little-endian. */ struct ieee80211_radiotap_header { - u_int8_t it_version; /* Version 0. Only increases + uint8_t it_version; /* Version 0. Only increases * for drastic changes, * introduction of compatible * new fields does not count. */ - u_int8_t it_pad; - u_int16_t it_len; /* length of the whole + uint8_t it_pad; + uint16_t it_len; /* length of the whole * header in bytes, including * it_version, it_pad, * it_len, and data fields. */ - u_int32_t it_present; /* A bitmap telling which + uint32_t it_present; /* A bitmap telling which * fields are present. Set bit 31 * (0x80000000) to extend the * bitmap by another 32 bits. @@ -466,25 +466,25 @@ struct ieee80211_radiotap_header { /* Name Data type Units * ---- --------- ----- * - * IEEE80211_RADIOTAP_TSFT u_int64_t microseconds + * IEEE80211_RADIOTAP_TSFT uint64_t microseconds * * Value in microseconds of the MAC's 64-bit 802.11 Time * Synchronization Function timer when the first bit of the * MPDU arrived at the MAC. For received frames, only. * - * IEEE80211_RADIOTAP_CHANNEL 2 x u_int16_t MHz, bitmap + * IEEE80211_RADIOTAP_CHANNEL 2 x uint16_t MHz, bitmap * * Tx/Rx frequency in MHz, followed by flags (see below). * Note that IEEE80211_RADIOTAP_XCHANNEL must be used to * represent an HT channel as there is not enough room in * the flags word. * - * IEEE80211_RADIOTAP_FHSS u_int16_t see below + * IEEE80211_RADIOTAP_FHSS uint16_t see below * * For frequency-hopping radios, the hop set (first byte) * and pattern (second byte). * - * IEEE80211_RADIOTAP_RATE u_int8_t 500kb/s or index + * IEEE80211_RADIOTAP_RATE uint8_t 500kb/s or index * * Tx/Rx data rate. If bit 0x80 is set then it represents an * an MCS index and not an IEEE rate. @@ -501,30 +501,30 @@ struct ieee80211_radiotap_header { * RF noise power at the antenna, decibel difference from one * milliwatt. * - * IEEE80211_RADIOTAP_DB_ANTSIGNAL u_int8_t decibel (dB) + * IEEE80211_RADIOTAP_DB_ANTSIGNAL uint8_t decibel (dB) * * RF signal power at the antenna, decibel difference from an * arbitrary, fixed reference. * - * IEEE80211_RADIOTAP_DB_ANTNOISE u_int8_t decibel (dB) + * IEEE80211_RADIOTAP_DB_ANTNOISE uint8_t decibel (dB) * * RF noise power at the antenna, decibel difference from an * arbitrary, fixed reference point. * - * IEEE80211_RADIOTAP_LOCK_QUALITY u_int16_t unitless + * IEEE80211_RADIOTAP_LOCK_QUALITY uint16_t unitless * * Quality of Barker code lock. Unitless. Monotonically * nondecreasing with "better" lock strength. Called "Signal * Quality" in datasheets. (Is there a standard way to measure * this?) * - * IEEE80211_RADIOTAP_TX_ATTENUATION u_int16_t unitless + * IEEE80211_RADIOTAP_TX_ATTENUATION uint16_t unitless * * Transmit power expressed as unitless distance from max * power set at factory calibration. 0 is max power. * Monotonically nondecreasing with lower power levels. * - * IEEE80211_RADIOTAP_DB_TX_ATTENUATION u_int16_t decibels (dB) + * IEEE80211_RADIOTAP_DB_TX_ATTENUATION uint16_t decibels (dB) * * Transmit power expressed as decibel distance from max power * set at factory calibration. 0 is max power. Monotonically @@ -537,24 +537,24 @@ struct ieee80211_radiotap_header { * reference). This is the absolute power level measured at * the antenna port. * - * IEEE80211_RADIOTAP_FLAGS u_int8_t bitmap + * IEEE80211_RADIOTAP_FLAGS uint8_t bitmap * * Properties of transmitted and received frames. See flags * defined below. * - * IEEE80211_RADIOTAP_ANTENNA u_int8_t antenna index + * IEEE80211_RADIOTAP_ANTENNA uint8_t antenna index * * Unitless indication of the Rx/Tx antenna for this packet. * The first antenna is antenna 0. * - * IEEE80211_RADIOTAP_RX_FLAGS u_int16_t bitmap + * IEEE80211_RADIOTAP_RX_FLAGS uint16_t bitmap * * Properties of received frames. See flags defined below. * - * IEEE80211_RADIOTAP_XCHANNEL u_int32_t bitmap - * u_int16_t MHz - * u_int8_t channel number - * u_int8_t .5 dBm + * IEEE80211_RADIOTAP_XCHANNEL uint32_t bitmap + * uint16_t MHz + * uint8_t channel number + * uint8_t .5 dBm * * Extended channel specification: flags (see below) followed by * frequency in MHz, the corresponding IEEE channel number, and @@ -562,18 +562,18 @@ struct ieee80211_radiotap_header { * units. This property supersedes IEEE80211_RADIOTAP_CHANNEL * and only one of the two should be present. * - * IEEE80211_RADIOTAP_MCS u_int8_t known - * u_int8_t flags - * u_int8_t mcs + * IEEE80211_RADIOTAP_MCS uint8_t known + * uint8_t flags + * uint8_t mcs * * Bitset indicating which fields have known values, followed * by bitset of flag values, followed by the MCS rate index as * in IEEE 802.11n. * * IEEE80211_RADIOTAP_VENDOR_NAMESPACE - * u_int8_t OUI[3] - * u_int8_t subspace - * u_int16_t length + * uint8_t OUI[3] + * uint8_t subspace + * uint16_t length * * The Vendor Namespace Field contains three sub-fields. The first * sub-field is 3 bytes long. It contains the vendor's IEEE 802 @@ -689,9 +689,9 @@ static const char tstr[] = "[|802.11]"; /* This is used to save state when parsing/processing parameters */ struct radiotap_state { - u_int32_t present; + uint32_t present; - u_int8_t rate; + uint8_t rate; }; #define PRINT_SSID(p) \ @@ -1279,7 +1279,7 @@ static int wep_print(netdissect_options *ndo, const u_char *p) { - u_int32_t iv; + uint32_t iv; if (!ND_TTEST2(*p, IEEE802_11_IV_LEN + IEEE802_11_KID_LEN)) return 0; @@ -1614,7 +1614,7 @@ handle_assoc_response(netdissect_options *ndo, ret = parse_elements(ndo, &pbody, p, offset, length); - ND_PRINT((ndo, " AID(%x) :%s: %s", ((u_int16_t)(pbody.aid << 2 )) >> 2 , + ND_PRINT((ndo, " AID(%x) :%s: %s", ((uint16_t)(pbody.aid << 2 )) >> 2 , CAPABILITY_PRIVACY(pbody.capability_info) ? " PRIVACY " : "", (pbody.status_code < NUM_STATUSES ? status_text[pbody.status_code] @@ -1928,7 +1928,7 @@ handle_action(netdissect_options *ndo, static int mgmt_body_print(netdissect_options *ndo, - u_int16_t fc, const struct mgmt_header_t *pmh, + uint16_t fc, const struct mgmt_header_t *pmh, const u_char *p, u_int length) { ND_PRINT((ndo, "%s", tok2str(st_str, "Unhandled Management subtype(%x)", FC_SUBTYPE(fc)))); @@ -1975,7 +1975,7 @@ mgmt_body_print(netdissect_options *ndo, static int ctrl_body_print(netdissect_options *ndo, - u_int16_t fc, const u_char *p) + uint16_t fc, const u_char *p) { ND_PRINT((ndo, "%s", tok2str(ctrl_str, "Unknown Ctrl Subtype", FC_SUBTYPE(fc)))); switch (FC_SUBTYPE(fc)) { @@ -2060,8 +2060,8 @@ ctrl_body_print(netdissect_options *ndo, static void data_header_print(netdissect_options *ndo, - u_int16_t fc, const u_char *p, const u_int8_t **srcp, - const u_int8_t **dstp) + uint16_t fc, const u_char *p, const uint8_t **srcp, + const uint8_t **dstp) { u_int subtype = FC_SUBTYPE(fc); @@ -2137,7 +2137,7 @@ data_header_print(netdissect_options *ndo, static void mgmt_header_print(netdissect_options *ndo, - const u_char *p, const u_int8_t **srcp, const u_int8_t **dstp) + const u_char *p, const uint8_t **srcp, const uint8_t **dstp) { const struct mgmt_header_t *hp = (const struct mgmt_header_t *) p; @@ -2155,8 +2155,8 @@ mgmt_header_print(netdissect_options *ndo, static void ctrl_header_print(netdissect_options *ndo, - u_int16_t fc, const u_char *p, const u_int8_t **srcp, - const u_int8_t **dstp) + uint16_t fc, const u_char *p, const uint8_t **srcp, + const uint8_t **dstp) { if (srcp != NULL) *srcp = NULL; @@ -2213,7 +2213,7 @@ ctrl_header_print(netdissect_options *ndo, static int extract_header_length(netdissect_options *ndo, - u_int16_t fc) + uint16_t fc) { int len; @@ -2263,9 +2263,9 @@ extract_mesh_header_length(const u_char *p) */ static void ieee_802_11_hdr_print(netdissect_options *ndo, - u_int16_t fc, const u_char *p, u_int hdrlen, - u_int meshdrlen, const u_int8_t **srcp, - const u_int8_t **dstp) + uint16_t fc, const u_char *p, u_int hdrlen, + u_int meshdrlen, const uint8_t **srcp, + const uint8_t **dstp) { if (ndo->ndo_vflag) { if (FC_MORE_DATA(fc)) @@ -2329,9 +2329,9 @@ ieee802_11_print(netdissect_options *ndo, const u_char *p, u_int length, u_int orig_caplen, int pad, u_int fcslen) { - u_int16_t fc; + uint16_t fc; u_int caplen, hdrlen, meshdrlen; - const u_int8_t *src, *dst; + const uint8_t *src, *dst; u_short extracted_ethertype; caplen = orig_caplen; @@ -2501,16 +2501,16 @@ print_chaninfo(netdissect_options *ndo, static int print_radiotap_field(netdissect_options *ndo, - struct cpack_state *s, u_int32_t bit, u_int8_t *flags, - struct radiotap_state *state, u_int32_t presentflags) + struct cpack_state *s, uint32_t bit, uint8_t *flags, + struct radiotap_state *state, uint32_t presentflags) { union { int8_t i8; - u_int8_t u8; + uint8_t u8; int16_t i16; - u_int16_t u16; - u_int32_t u32; - u_int64_t u64; + uint16_t u16; + uint32_t u32; + uint64_t u64; } u, u2, u3, u4; int rc; @@ -2581,9 +2581,9 @@ print_radiotap_field(netdissect_options *ndo, rc = cpack_uint8(s, &u3.u8); break; case IEEE80211_RADIOTAP_VENDOR_NAMESPACE: { - u_int8_t vns[3]; - u_int16_t length; - u_int8_t subspace; + uint8_t vns[3]; + uint16_t length; + uint8_t subspace; if ((cpack_align_and_reserve(s, 2)) == NULL) { rc = -1; @@ -2832,13 +2832,13 @@ ieee802_11_radio_print(netdissect_options *ndo, struct cpack_state cpacker; struct ieee80211_radiotap_header *hdr; - u_int32_t present, next_present; - u_int32_t presentflags = 0; - u_int32_t *presentp, *last_presentp; + uint32_t present, next_present; + uint32_t presentflags = 0; + uint32_t *presentp, *last_presentp; enum ieee80211_radiotap_type bit; int bit0; u_int len; - u_int8_t flags; + uint8_t flags; int pad; u_int fcslen; struct radiotap_state state; @@ -2856,7 +2856,7 @@ ieee802_11_radio_print(netdissect_options *ndo, ND_PRINT((ndo, "%s", tstr)); return caplen; } - cpack_init(&cpacker, (u_int8_t *)hdr, len); /* align against header start */ + cpack_init(&cpacker, (uint8_t *)hdr, len); /* align against header start */ cpack_advance(&cpacker, sizeof(*hdr)); /* includes the 1st bitmap */ for (last_presentp = &hdr->it_present; IS_EXTENDED(last_presentp) && @@ -2916,7 +2916,7 @@ static u_int ieee802_11_avs_radio_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen) { - u_int32_t caphdr_len; + uint32_t caphdr_len; if (caplen < 8) { ND_PRINT((ndo, "%s", tstr)); @@ -2968,7 +2968,7 @@ prism_if_print(netdissect_options *ndo, { u_int caplen = h->caplen; u_int length = h->len; - u_int32_t msgcode; + uint32_t msgcode; if (caplen < 4) { ND_PRINT((ndo, "%s", tstr)); diff --git a/print-802_15_4.c b/print-802_15_4.c index 71409ff6..26c28ee6 100644 --- a/print-802_15_4.c +++ b/print-802_15_4.c @@ -44,7 +44,7 @@ static const char *ftypes[] = { }; static int -extract_header_length(u_int16_t fc) +extract_header_length(uint16_t fc) { int len = 0; @@ -92,8 +92,8 @@ ieee802_15_4_if_print(netdissect_options *ndo, { u_int caplen = h->caplen; int hdrlen; - u_int16_t fc; - u_int8_t seq; + uint16_t fc; + uint8_t seq; if (caplen < 3) { ND_PRINT((ndo, "[|802.15.4] %x", caplen)); @@ -121,7 +121,7 @@ ieee802_15_4_if_print(netdissect_options *ndo, p+= hdrlen; caplen -= hdrlen; } else { - u_int16_t panid = 0; + uint16_t panid = 0; switch ((fc >> 10) & 0x3) { case 0x00: diff --git a/print-ah.c b/print-ah.c index dd4130e4..0badf482 100644 --- a/print-ah.c +++ b/print-ah.c @@ -39,7 +39,7 @@ ah_print(netdissect_options *ndo, register const u_char *bp) register const struct ah *ah; register const u_char *ep; int sumlen; - u_int32_t spi; + uint32_t spi; ah = (const struct ah *)bp; ep = ndo->ndo_snapend; /* 'ep' points to the end of available data. */ diff --git a/print-aodv.c b/print-aodv.c index 3d7ba36b..8c4bd1ed 100644 --- a/print-aodv.c +++ b/print-aodv.c @@ -46,36 +46,36 @@ struct aodv_rreq { - u_int8_t rreq_type; /* AODV message type (1) */ - u_int8_t rreq_flags; /* various flags */ - u_int8_t rreq_zero0; /* reserved, set to zero */ - u_int8_t rreq_hops; /* number of hops from originator */ - u_int32_t rreq_id; /* request ID */ - u_int32_t rreq_da; /* destination IPv4 address */ - u_int32_t rreq_ds; /* destination sequence number */ - u_int32_t rreq_oa; /* originator IPv4 address */ - u_int32_t rreq_os; /* originator sequence number */ + uint8_t rreq_type; /* AODV message type (1) */ + uint8_t rreq_flags; /* various flags */ + uint8_t rreq_zero0; /* reserved, set to zero */ + uint8_t rreq_hops; /* number of hops from originator */ + uint32_t rreq_id; /* request ID */ + uint32_t rreq_da; /* destination IPv4 address */ + uint32_t rreq_ds; /* destination sequence number */ + uint32_t rreq_oa; /* originator IPv4 address */ + uint32_t rreq_os; /* originator sequence number */ }; #ifdef INET6 struct aodv_rreq6 { - u_int8_t rreq_type; /* AODV message type (1) */ - u_int8_t rreq_flags; /* various flags */ - u_int8_t rreq_zero0; /* reserved, set to zero */ - u_int8_t rreq_hops; /* number of hops from originator */ - u_int32_t rreq_id; /* request ID */ + uint8_t rreq_type; /* AODV message type (1) */ + uint8_t rreq_flags; /* various flags */ + uint8_t rreq_zero0; /* reserved, set to zero */ + uint8_t rreq_hops; /* number of hops from originator */ + uint32_t rreq_id; /* request ID */ struct in6_addr rreq_da; /* destination IPv6 address */ - u_int32_t rreq_ds; /* destination sequence number */ + uint32_t rreq_ds; /* destination sequence number */ struct in6_addr rreq_oa; /* originator IPv6 address */ - u_int32_t rreq_os; /* originator sequence number */ + uint32_t rreq_os; /* originator sequence number */ }; struct aodv_rreq6_draft_01 { - u_int8_t rreq_type; /* AODV message type (16) */ - u_int8_t rreq_flags; /* various flags */ - u_int8_t rreq_zero0; /* reserved, set to zero */ - u_int8_t rreq_hops; /* number of hops from originator */ - u_int32_t rreq_id; /* request ID */ - u_int32_t rreq_ds; /* destination sequence number */ - u_int32_t rreq_os; /* originator sequence number */ + uint8_t rreq_type; /* AODV message type (16) */ + uint8_t rreq_flags; /* various flags */ + uint8_t rreq_zero0; /* reserved, set to zero */ + uint8_t rreq_hops; /* number of hops from originator */ + uint32_t rreq_id; /* request ID */ + uint32_t rreq_ds; /* destination sequence number */ + uint32_t rreq_os; /* originator sequence number */ struct in6_addr rreq_da; /* destination IPv6 address */ struct in6_addr rreq_oa; /* originator IPv6 address */ }; @@ -89,35 +89,35 @@ struct aodv_rreq6_draft_01 { #define RREQ_FLAGS_MASK 0xF8 /* mask for rreq_flags */ struct aodv_rrep { - u_int8_t rrep_type; /* AODV message type (2) */ - u_int8_t rrep_flags; /* various flags */ - u_int8_t rrep_ps; /* prefix size */ - u_int8_t rrep_hops; /* number of hops from o to d */ - u_int32_t rrep_da; /* destination IPv4 address */ - u_int32_t rrep_ds; /* destination sequence number */ - u_int32_t rrep_oa; /* originator IPv4 address */ - u_int32_t rrep_life; /* lifetime of this route */ + uint8_t rrep_type; /* AODV message type (2) */ + uint8_t rrep_flags; /* various flags */ + uint8_t rrep_ps; /* prefix size */ + uint8_t rrep_hops; /* number of hops from o to d */ + uint32_t rrep_da; /* destination IPv4 address */ + uint32_t rrep_ds; /* destination sequence number */ + uint32_t rrep_oa; /* originator IPv4 address */ + uint32_t rrep_life; /* lifetime of this route */ }; #ifdef INET6 struct aodv_rrep6 { - u_int8_t rrep_type; /* AODV message type (2) */ - u_int8_t rrep_flags; /* various flags */ - u_int8_t rrep_ps; /* prefix size */ - u_int8_t rrep_hops; /* number of hops from o to d */ + uint8_t rrep_type; /* AODV message type (2) */ + uint8_t rrep_flags; /* various flags */ + uint8_t rrep_ps; /* prefix size */ + uint8_t rrep_hops; /* number of hops from o to d */ struct in6_addr rrep_da; /* destination IPv6 address */ - u_int32_t rrep_ds; /* destination sequence number */ + uint32_t rrep_ds; /* destination sequence number */ struct in6_addr rrep_oa; /* originator IPv6 address */ - u_int32_t rrep_life; /* lifetime of this route */ + uint32_t rrep_life; /* lifetime of this route */ }; struct aodv_rrep6_draft_01 { - u_int8_t rrep_type; /* AODV message type (17) */ - u_int8_t rrep_flags; /* various flags */ - u_int8_t rrep_ps; /* prefix size */ - u_int8_t rrep_hops; /* number of hops from o to d */ - u_int32_t rrep_ds; /* destination sequence number */ + uint8_t rrep_type; /* AODV message type (17) */ + uint8_t rrep_flags; /* various flags */ + uint8_t rrep_ps; /* prefix size */ + uint8_t rrep_hops; /* number of hops from o to d */ + uint32_t rrep_ds; /* destination sequence number */ struct in6_addr rrep_da; /* destination IPv6 address */ struct in6_addr rrep_oa; /* originator IPv6 address */ - u_int32_t rrep_life; /* lifetime of this route */ + uint32_t rrep_life; /* lifetime of this route */ }; #endif @@ -127,25 +127,25 @@ struct aodv_rrep6_draft_01 { #define RREP_PREFIX_MASK 0x1F /* mask for prefix size */ struct rerr_unreach { - u_int32_t u_da; /* IPv4 address */ - u_int32_t u_ds; /* sequence number */ + uint32_t u_da; /* IPv4 address */ + uint32_t u_ds; /* sequence number */ }; #ifdef INET6 struct rerr_unreach6 { struct in6_addr u_da; /* IPv6 address */ - u_int32_t u_ds; /* sequence number */ + uint32_t u_ds; /* sequence number */ }; struct rerr_unreach6_draft_01 { struct in6_addr u_da; /* IPv6 address */ - u_int32_t u_ds; /* sequence number */ + uint32_t u_ds; /* sequence number */ }; #endif struct aodv_rerr { - u_int8_t rerr_type; /* AODV message type (3 or 18) */ - u_int8_t rerr_flags; /* various flags */ - u_int8_t rerr_zero0; /* reserved, set to zero */ - u_int8_t rerr_dc; /* destination count */ + uint8_t rerr_type; /* AODV message type (3 or 18) */ + uint8_t rerr_flags; /* various flags */ + uint8_t rerr_zero0; /* reserved, set to zero */ + uint8_t rerr_dc; /* destination count */ union { struct rerr_unreach dest[1]; #ifdef INET6 @@ -159,8 +159,8 @@ struct aodv_rerr { #define RERR_FLAGS_MASK 0x80 /* mask for rerr_flags */ struct aodv_rrep_ack { - u_int8_t ra_type; - u_int8_t ra_zero0; + uint8_t ra_type; + uint8_t ra_zero0; }; union aodv { @@ -187,13 +187,13 @@ union aodv { #define AODV_V6_DRAFT_01_RREP_ACK 19 /* IPV6 route response acknowledgment */ struct aodv_ext { - u_int8_t type; /* extension type */ - u_int8_t length; /* extension length */ + uint8_t type; /* extension type */ + uint8_t length; /* extension length */ }; struct aodv_hello { struct aodv_ext eh; /* extension header */ - u_int8_t interval[4]; /* expect my next hello in + uint8_t interval[4]; /* expect my next hello in * (n) ms * NOTE: this is not aligned */ }; diff --git a/print-ap1394.c b/print-ap1394.c index 39600811..3befe233 100644 --- a/print-ap1394.c +++ b/print-ap1394.c @@ -52,7 +52,7 @@ static inline void ap1394_hdr_print(netdissect_options *ndo, register const u_char *bp, u_int length) { register const struct firewire_header *fp; - u_int16_t firewire_type; + uint16_t firewire_type; fp = (const struct firewire_header *)bp; diff --git a/print-arcnet.c b/print-arcnet.c index d2a6d87d..cdd4a650 100644 --- a/print-arcnet.c +++ b/print-arcnet.c @@ -40,22 +40,22 @@ * as given to interface code. */ struct arc_header { - u_int8_t arc_shost; - u_int8_t arc_dhost; - u_int8_t arc_type; + uint8_t arc_shost; + uint8_t arc_dhost; + uint8_t arc_type; /* * only present for newstyle encoding with LL fragmentation. * Don't use sizeof(anything), use ARC_HDR{,NEW}LEN instead. */ - u_int8_t arc_flag; - u_int16_t arc_seqid; + uint8_t arc_flag; + uint16_t arc_seqid; /* * only present in exception packets (arc_flag == 0xff) */ - u_int8_t arc_type2; /* same as arc_type */ - u_int8_t arc_flag2; /* real flag value */ - u_int16_t arc_seqid2; /* real seqid value */ + uint8_t arc_type2; /* same as arc_type */ + uint8_t arc_flag2; /* real flag value */ + uint16_t arc_seqid2; /* real seqid value */ }; #define ARC_HDRLEN 3 @@ -84,17 +84,17 @@ struct arc_header { * never presents packets that look like exception frames. */ struct arc_linux_header { - u_int8_t arc_shost; - u_int8_t arc_dhost; - u_int16_t arc_offset; - u_int8_t arc_type; + uint8_t arc_shost; + uint8_t arc_dhost; + uint16_t arc_offset; + uint8_t arc_type; /* * only present for newstyle encoding with LL fragmentation. * Don't use sizeof(anything), use ARC_LINUX_HDR{,NEW}LEN * instead. */ - u_int8_t arc_flag; - u_int16_t arc_seqid; + uint8_t arc_flag; + uint16_t arc_seqid; }; #define ARC_LINUX_HDRLEN 5 diff --git a/print-atalk.c b/print-atalk.c index 9be3d079..2816bfaf 100644 --- a/print-atalk.c +++ b/print-atalk.c @@ -50,13 +50,13 @@ static const struct tok type2str[] = { }; struct aarp { - u_int16_t htype, ptype; - u_int8_t halen, palen; - u_int16_t op; - u_int8_t hsaddr[6]; - u_int8_t psaddr[4]; - u_int8_t hdaddr[6]; - u_int8_t pdaddr[4]; + uint16_t htype, ptype; + uint8_t halen, palen; + uint16_t op; + uint8_t hsaddr[6]; + uint8_t psaddr[4]; + uint8_t hdaddr[6]; + uint8_t pdaddr[4]; }; static void atp_print(netdissect_options *, const struct atATP *, u_int); @@ -250,7 +250,7 @@ atp_print(netdissect_options *ndo, register const struct atATP *ap, u_int length) { char c; - u_int32_t data; + uint32_t data; if ((const u_char *)(ap + 1) > ndo->ndo_snapend) { /* Just bail if we don't have the whole chunk. */ diff --git a/print-atm.c b/print-atm.c index 528bf2c5..285c6a40 100644 --- a/print-atm.c +++ b/print-atm.c @@ -162,7 +162,7 @@ atm_if_print(netdissect_options *ndo, { u_int caplen = h->caplen; u_int length = h->len; - u_int32_t llchdr; + uint32_t llchdr; u_int hdrlen = 0; if (caplen < 8) { @@ -334,26 +334,26 @@ atm_print(netdissect_options *ndo, } struct oam_fm_loopback_t { - u_int8_t loopback_indicator; - u_int8_t correlation_tag[4]; - u_int8_t loopback_id[12]; - u_int8_t source_id[12]; - u_int8_t unused[16]; + uint8_t loopback_indicator; + uint8_t correlation_tag[4]; + uint8_t loopback_id[12]; + uint8_t source_id[12]; + uint8_t unused[16]; }; struct oam_fm_ais_rdi_t { - u_int8_t failure_type; - u_int8_t failure_location[16]; - u_int8_t unused[28]; + uint8_t failure_type; + uint8_t failure_location[16]; + uint8_t unused[28]; }; int oam_print (netdissect_options *ndo, const u_char *p, u_int length, u_int hec) { - u_int32_t cell_header; - u_int16_t vpi, vci, cksum, cksum_shouldbe, idx; - u_int8_t cell_type, func_type, payload, clp; + uint32_t cell_header; + uint16_t vpi, vci, cksum, cksum_shouldbe, idx; + uint8_t cell_type, func_type, payload, clp; union { const struct oam_fm_loopback_t *oam_fm_loopback; diff --git a/print-babel.c b/print-babel.c index 1e2f7e82..ba96dfd4 100644 --- a/print-babel.c +++ b/print-babel.c @@ -144,7 +144,7 @@ format_address(netdissect_options *ndo, const u_char *prefix) } static const char * -format_interval(const u_int16_t i) +format_interval(const uint16_t i) { static char buf[sizeof("000.00s")]; @@ -155,7 +155,7 @@ format_interval(const u_int16_t i) } static const char * -format_interval_update(const u_int16_t i) +format_interval_update(const uint16_t i) { return i == 0xFFFF ? "infinity" : format_interval(i); } diff --git a/print-bfd.c b/print-bfd.c index b9d69cf4..f1c2ee8c 100644 --- a/print-bfd.c +++ b/print-bfd.c @@ -66,15 +66,15 @@ */ struct bfd_header_t { - u_int8_t version_diag; - u_int8_t flags; - u_int8_t detect_time_multiplier; - u_int8_t length; - u_int8_t my_discriminator[4]; - u_int8_t your_discriminator[4]; - u_int8_t desired_min_tx_interval[4]; - u_int8_t required_min_rx_interval[4]; - u_int8_t required_min_echo_interval[4]; + uint8_t version_diag; + uint8_t flags; + uint8_t detect_time_multiplier; + uint8_t length; + uint8_t my_discriminator[4]; + uint8_t your_discriminator[4]; + uint8_t desired_min_tx_interval[4]; + uint8_t required_min_rx_interval[4]; + uint8_t required_min_echo_interval[4]; }; /* @@ -88,9 +88,9 @@ struct bfd_header_t { */ struct bfd_auth_header_t { - u_int8_t auth_type; - u_int8_t auth_len; - u_int8_t auth_data; + uint8_t auth_type; + uint8_t auth_len; + uint8_t auth_data; }; static const struct tok bfd_v1_authentication_values[] = { @@ -164,7 +164,7 @@ bfd_print(netdissect_options *ndo, register const u_char *pptr, { const struct bfd_header_t *bfd_header; const struct bfd_auth_header_t *bfd_auth_header; - u_int8_t version = 0; + uint8_t version = 0; bfd_header = (const struct bfd_header_t *)pptr; if (port == BFD_CONTROL_PORT) { diff --git a/print-bgp.c b/print-bgp.c index 283a2d58..74d7a560 100644 --- a/print-bgp.c +++ b/print-bgp.c @@ -47,9 +47,9 @@ #include "l2vpn.h" struct bgp { - u_int8_t bgp_marker[16]; - u_int16_t bgp_len; - u_int8_t bgp_type; + uint8_t bgp_marker[16]; + uint16_t bgp_len; + uint8_t bgp_type; }; #define BGP_SIZE 19 /* unaligned */ @@ -69,42 +69,42 @@ static const struct tok bgp_msg_values[] = { }; struct bgp_open { - u_int8_t bgpo_marker[16]; - u_int16_t bgpo_len; - u_int8_t bgpo_type; - u_int8_t bgpo_version; - u_int16_t bgpo_myas; - u_int16_t bgpo_holdtime; - u_int32_t bgpo_id; - u_int8_t bgpo_optlen; + uint8_t bgpo_marker[16]; + uint16_t bgpo_len; + uint8_t bgpo_type; + uint8_t bgpo_version; + uint16_t bgpo_myas; + uint16_t bgpo_holdtime; + uint32_t bgpo_id; + uint8_t bgpo_optlen; /* options should follow */ }; #define BGP_OPEN_SIZE 29 /* unaligned */ struct bgp_opt { - u_int8_t bgpopt_type; - u_int8_t bgpopt_len; + uint8_t bgpopt_type; + uint8_t bgpopt_len; /* variable length */ }; #define BGP_OPT_SIZE 2 /* some compilers may pad to 4 bytes */ #define BGP_CAP_HEADER_SIZE 2 /* some compilers may pad to 4 bytes */ struct bgp_notification { - u_int8_t bgpn_marker[16]; - u_int16_t bgpn_len; - u_int8_t bgpn_type; - u_int8_t bgpn_major; - u_int8_t bgpn_minor; + uint8_t bgpn_marker[16]; + uint16_t bgpn_len; + uint8_t bgpn_type; + uint8_t bgpn_major; + uint8_t bgpn_minor; }; #define BGP_NOTIFICATION_SIZE 21 /* unaligned */ struct bgp_route_refresh { - u_int8_t bgp_marker[16]; - u_int16_t len; - u_int8_t type; - 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 */ + uint8_t bgp_marker[16]; + uint16_t len; + uint8_t type; + uint8_t afi[2]; /* the compiler messes this structure up */ + uint8_t res; /* when doing misaligned sequences of int8 and int16 */ + uint8_t safi; /* afi should be int16 - so we have to access it using */ }; /* EXTRACT_16BITS(&bgp_route_refresh->afi) (sigh) */ #define BGP_ROUTE_REFRESH_SIZE 23 @@ -624,7 +624,7 @@ static int bgp_vpn_sg_print(netdissect_options *ndo, const u_char *pptr, char *buf, u_int buflen) { - u_int8_t addr_length; + uint8_t addr_length; u_int total_length, offset; total_length = 0; @@ -710,7 +710,7 @@ static int decode_rt_routing_info(netdissect_options *ndo, const u_char *pptr, char *buf, u_int buflen) { - u_int8_t route_target[8]; + uint8_t route_target[8]; u_int plen; ND_TCHECK(pptr[0]); @@ -855,7 +855,7 @@ static int decode_multicast_vpn(netdissect_options *ndo, const u_char *pptr, char *buf, u_int buflen) { - u_int8_t route_type, route_length, addr_length, sg_length; + uint8_t route_type, route_length, addr_length, sg_length; u_int offset; ND_TCHECK2(pptr[0], 2); @@ -1174,7 +1174,7 @@ static int decode_clnp_prefix(netdissect_options *ndo, const u_char *pptr, char *buf, u_int buflen) { - u_int8_t addr[19]; + uint8_t addr[19]; u_int plen; ND_TCHECK(pptr[0]); @@ -1204,7 +1204,7 @@ static int decode_labeled_vpn_clnp_prefix(netdissect_options *ndo, const u_char *pptr, char *buf, u_int buflen) { - u_int8_t addr[19]; + uint8_t addr[19]; u_int plen; ND_TCHECK(pptr[0]); @@ -1248,7 +1248,7 @@ trunc: */ static int bgp_attr_get_as_size(netdissect_options *ndo, - u_int8_t bgpa_type, const u_char *pptr, int len) + uint8_t bgpa_type, const u_char *pptr, int len) { const u_char *tptr = pptr; @@ -1302,11 +1302,11 @@ bgp_attr_print(netdissect_options *ndo, u_int atype, const u_char *pptr, u_int len) { int i; - u_int16_t af; - u_int8_t safi, snpa, nhlen; + uint16_t af; + uint8_t safi, snpa, nhlen; union { /* copy buffer for bandwidth values */ float f; - u_int32_t i; + uint32_t i; } bw; int advance; u_int tlen; @@ -1435,7 +1435,7 @@ bgp_attr_print(netdissect_options *ndo, break; } while (tlen>0) { - u_int32_t comm; + uint32_t comm; ND_TCHECK2(tptr[0], 4); comm = EXTRACT_32BITS(tptr); switch (comm) { @@ -2008,7 +2008,7 @@ bgp_attr_print(netdissect_options *ndo, break; } while (tlen>0) { - u_int16_t extd_comm; + uint16_t extd_comm; ND_TCHECK2(tptr[0], 2); extd_comm=EXTRACT_16BITS(tptr); @@ -2092,7 +2092,7 @@ bgp_attr_print(netdissect_options *ndo, case BGPTYPE_PMSI_TUNNEL: { - u_int8_t tunnel_type, flags; + uint8_t tunnel_type, flags; tunnel_type = *(tptr+1); flags = *tptr; @@ -2708,7 +2708,7 @@ bgp_print(netdissect_options *ndo, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; struct bgp bgp; - u_int16_t hlen; + uint16_t hlen; char tokbuf[TOKBUFSIZE]; ep = dat + length; diff --git a/print-bootp.c b/print-bootp.c index 5e7e9a99..4da4f952 100644 --- a/print-bootp.c +++ b/print-bootp.c @@ -152,13 +152,13 @@ bootp_print(netdissect_options *ndo, /* Decode the vendor buffer */ ND_TCHECK(bp->bp_vend[0]); if (memcmp((const char *)bp->bp_vend, vm_rfc1048, - sizeof(u_int32_t)) == 0) + sizeof(uint32_t)) == 0) rfc1048_print(ndo, bp->bp_vend); else if (memcmp((const char *)bp->bp_vend, vm_cmu, - sizeof(u_int32_t)) == 0) + sizeof(uint32_t)) == 0) cmu_print(ndo, bp->bp_vend); else { - u_int32_t ul; + uint32_t ul; ul = EXTRACT_32BITS(&bp->bp_vend); if (ul != 0) @@ -363,14 +363,14 @@ static void rfc1048_print(netdissect_options *ndo, register const u_char *bp) { - register u_int16_t tag; + register uint16_t tag; register u_int len; register const char *cp; register char c; int first, idx; - u_int32_t ul; - u_int16_t us; - u_int8_t uc, subopt, suboptlen; + uint32_t ul; + uint16_t us; + uint8_t uc, subopt, suboptlen; ND_PRINT((ndo, "\n\t Vendor-rfc1048 Extensions")); diff --git a/print-carp.c b/print-carp.c index 976e4f22..7b9f28ce 100644 --- a/print-carp.c +++ b/print-carp.c @@ -68,7 +68,7 @@ carp_print(netdissect_options *ndo, register const u_char *bp, register u_int le bp[1], bp[5], bp[2], bp[3])); if (ndo->ndo_vflag) { struct cksum_vec vec[1]; - vec[0].ptr = (const u_int8_t *)bp; + vec[0].ptr = (const uint8_t *)bp; vec[0].len = len; if (ND_TTEST2(bp[0], len) && in_cksum(vec, 1)) ND_PRINT((ndo, " (bad carp cksum %x!)", diff --git a/print-cfm.c b/print-cfm.c index 25fac19b..a4602369 100644 --- a/print-cfm.c +++ b/print-cfm.c @@ -34,10 +34,10 @@ #include "af.h" struct cfm_common_header_t { - u_int8_t mdlevel_version; - u_int8_t opcode; - u_int8_t flags; - u_int8_t first_tlv_offset; + uint8_t mdlevel_version; + uint8_t opcode; + uint8_t flags; + uint8_t first_tlv_offset; }; #define CFM_VERSION 0 @@ -63,13 +63,13 @@ static const struct tok cfm_opcode_values[] = { * Message Formats. */ struct cfm_ccm_t { - u_int8_t sequence[4]; - u_int8_t ma_epi[2]; - u_int8_t md_nameformat; - u_int8_t md_namelength; - u_int8_t md_name[46]; /* md name and short ma name */ - u_int8_t reserved_itu[16]; - u_int8_t reserved[6]; + uint8_t sequence[4]; + uint8_t ma_epi[2]; + uint8_t md_nameformat; + uint8_t md_namelength; + uint8_t md_name[46]; /* md name and short ma name */ + uint8_t reserved_itu[16]; + uint8_t reserved[6]; }; /* @@ -114,17 +114,17 @@ static const struct tok cfm_ma_nameformat_values[] = { }; struct cfm_lbm_t { - u_int8_t transaction_id[4]; - u_int8_t reserved[4]; + uint8_t transaction_id[4]; + uint8_t reserved[4]; }; struct cfm_ltm_t { - u_int8_t transaction_id[4]; - u_int8_t egress_id[8]; - u_int8_t ttl; - u_int8_t original_mac[ETHER_ADDR_LEN]; - u_int8_t target_mac[ETHER_ADDR_LEN]; - u_int8_t reserved[3]; + uint8_t transaction_id[4]; + uint8_t egress_id[8]; + uint8_t ttl; + uint8_t original_mac[ETHER_ADDR_LEN]; + uint8_t target_mac[ETHER_ADDR_LEN]; + uint8_t reserved[3]; }; static const struct tok cfm_ltm_flag_values[] = { @@ -133,12 +133,12 @@ static const struct tok cfm_ltm_flag_values[] = { }; struct cfm_ltr_t { - u_int8_t transaction_id[4]; - u_int8_t last_egress_id[8]; - u_int8_t next_egress_id[8]; - u_int8_t ttl; - u_int8_t replay_action; - u_int8_t reserved[6]; + uint8_t transaction_id[4]; + uint8_t last_egress_id[8]; + uint8_t next_egress_id[8]; + uint8_t ttl; + uint8_t replay_action; + uint8_t reserved[6]; }; static const struct tok cfm_ltr_flag_values[] = { @@ -182,8 +182,8 @@ static const struct tok cfm_tlv_values[] = { */ struct cfm_tlv_header_t { - u_int8_t type; - u_int8_t length[2]; + uint8_t type; + uint8_t length[2]; }; /* FIXME define TLV formats */ @@ -285,7 +285,7 @@ cfm_print(netdissect_options *ndo, const struct cfm_common_header_t *cfm_common_header; const struct cfm_tlv_header_t *cfm_tlv_header; - const u_int8_t *tptr, *tlv_ptr, *ma_name, *ma_nameformat, *ma_namelength; + const uint8_t *tptr, *tlv_ptr, *ma_name, *ma_nameformat, *ma_namelength; u_int hexdump, tlen, cfm_tlv_len, cfm_tlv_type, ccm_interval; diff --git a/print-chdlc.c b/print-chdlc.c index 7b2b66ba..8e8bb46d 100644 --- a/print-chdlc.c +++ b/print-chdlc.c @@ -114,19 +114,19 @@ chdlc_print(netdissect_options *ndo, register const u_char *p, u_int length) { * The fixed-length portion of a SLARP packet. */ struct cisco_slarp { - u_int8_t code[4]; + uint8_t code[4]; #define SLARP_REQUEST 0 #define SLARP_REPLY 1 #define SLARP_KEEPALIVE 2 union { struct { - u_int8_t addr[4]; - u_int8_t mask[4]; + uint8_t addr[4]; + uint8_t mask[4]; } addr; struct { - u_int8_t myseq[4]; - u_int8_t yourseq[4]; - u_int8_t rel[2]; + uint8_t myseq[4]; + uint8_t yourseq[4]; + uint8_t rel[2]; } keep; } un; }; diff --git a/print-cnfp.c b/print-cnfp.c index 3ae7c37a..07c940cb 100644 --- a/print-cnfp.c +++ b/print-cnfp.c @@ -50,27 +50,27 @@ #include "ipproto.h" struct nfhdr { - u_int32_t ver_cnt; /* version [15], and # of records */ - u_int32_t msys_uptime; - u_int32_t utc_sec; - u_int32_t utc_nsec; - u_int32_t sequence; /* v5 flow sequence number */ - u_int32_t reserved; /* v5 only */ + uint32_t ver_cnt; /* version [15], and # of records */ + uint32_t msys_uptime; + uint32_t utc_sec; + uint32_t utc_nsec; + uint32_t sequence; /* v5 flow sequence number */ + uint32_t reserved; /* v5 only */ }; struct nfrec { struct in_addr src_ina; struct in_addr dst_ina; struct in_addr nhop_ina; - u_int32_t ifaces; /* src,dst ifaces */ - u_int32_t packets; - u_int32_t octets; - u_int32_t start_time; /* sys_uptime value */ - u_int32_t last_time; /* sys_uptime value */ - u_int32_t ports; /* src,dst ports */ - u_int32_t proto_tos; /* proto, tos, pad, flags(v5) */ - u_int32_t asses; /* v1: flags; v5: src,dst AS */ - u_int32_t masks; /* src,dst addr prefix; v6: encaps */ + uint32_t ifaces; /* src,dst ifaces */ + uint32_t packets; + uint32_t octets; + uint32_t start_time; /* sys_uptime value */ + uint32_t last_time; /* sys_uptime value */ + uint32_t ports; /* src,dst ports */ + uint32_t proto_tos; /* proto, tos, pad, flags(v5) */ + uint32_t asses; /* v1: flags; v5: src,dst AS */ + uint32_t masks; /* src,dst addr prefix; v6: encaps */ struct in_addr peer_nexthop; /* v6: IP address of the nexthop within the peer (FIB)*/ }; diff --git a/print-dccp.c b/print-dccp.c index 891c2a55..9262e078 100644 --- a/print-dccp.c +++ b/print-dccp.c @@ -41,13 +41,13 @@ * @dccph_seq - 24-bit sequence number */ struct dccp_hdr { - u_int16_t dccph_sport, + uint16_t dccph_sport, dccph_dport; - u_int8_t dccph_doff; - u_int8_t dccph_ccval_cscov; - u_int16_t dccph_checksum; - u_int8_t dccph_xtr; - u_int8_t dccph_seq[3]; + uint8_t dccph_doff; + uint8_t dccph_ccval_cscov; + uint16_t dccph_checksum; + uint8_t dccph_xtr; + uint8_t dccph_seq[3]; } UNALIGNED; /** @@ -65,14 +65,14 @@ struct dccp_hdr { * @dccph_seq - 48-bit sequence number */ struct dccp_hdr_ext { - u_int16_t dccph_sport, + uint16_t dccph_sport, dccph_dport; - u_int8_t dccph_doff; - u_int8_t dccph_ccval_cscov; - u_int16_t dccph_checksum; - u_int8_t dccph_xtr; - u_int8_t reserved; - u_int8_t dccph_seq[6]; + uint8_t dccph_doff; + uint8_t dccph_ccval_cscov; + uint16_t dccph_checksum; + uint8_t dccph_xtr; + uint8_t reserved; + uint8_t dccph_seq[6]; } UNALIGNED; #define DCCPH_CCVAL(dh) (((dh)->dccph_ccval_cscov >> 4) & 0xF) @@ -87,7 +87,7 @@ struct dccp_hdr_ext { * @dccph_req_service - Service to which the client app wants to connect */ struct dccp_hdr_request { - u_int32_t dccph_req_service; + uint32_t dccph_req_service; } UNALIGNED; /** @@ -97,8 +97,8 @@ struct dccp_hdr_request { * @dccph_resp_service - Echoes the Service Code on a received DCCP-Request */ struct dccp_hdr_response { - u_int8_t dccph_resp_ack[8]; /* always 8 bytes */ - u_int32_t dccph_resp_service; + uint8_t dccph_resp_ack[8]; /* always 8 bytes */ + uint32_t dccph_resp_service; } UNALIGNED; /** @@ -108,8 +108,8 @@ struct dccp_hdr_response { * @dccph_reset_service - Echoes the Service Code on a received DCCP-Request */ struct dccp_hdr_reset { - u_int8_t dccph_reset_ack[8]; /* always 8 bytes */ - u_int8_t dccph_reset_code, + uint8_t dccph_reset_ack[8]; /* always 8 bytes */ + uint8_t dccph_reset_code, dccph_reset_data[3]; } UNALIGNED; @@ -179,36 +179,36 @@ static inline u_int dccp_csum_coverage(const struct dccp_hdr* dh, u_int len) if (DCCPH_CSCOV(dh) == 0) return len; - cov = (dh->dccph_doff + DCCPH_CSCOV(dh) - 1) * sizeof(u_int32_t); + cov = (dh->dccph_doff + DCCPH_CSCOV(dh) - 1) * sizeof(uint32_t); return (cov > len)? len : cov; } static int dccp_cksum(netdissect_options *ndo, const struct ip *ip, const struct dccp_hdr *dh, u_int len) { - return nextproto4_cksum(ndo, ip, (const u_int8_t *)(void *)dh, len, + return nextproto4_cksum(ndo, ip, (const uint8_t *)(void *)dh, len, dccp_csum_coverage(dh, len), IPPROTO_DCCP); } #ifdef INET6 static int dccp6_cksum(const struct ip6_hdr *ip6, const struct dccp_hdr *dh, u_int len) { - return nextproto6_cksum(ip6, (const u_int8_t *)(void *)dh, len, + return nextproto6_cksum(ip6, (const uint8_t *)(void *)dh, len, dccp_csum_coverage(dh, len), IPPROTO_DCCP); } #endif -static const char *dccp_reset_code(u_int8_t code) +static const char *dccp_reset_code(uint8_t code) { if (code >= __DCCP_RESET_CODE_LAST) return "invalid"; return dccp_reset_codes[code]; } -static u_int64_t dccp_seqno(const u_char *bp) +static uint64_t dccp_seqno(const u_char *bp) { const struct dccp_hdr *dh = (const struct dccp_hdr *)bp; - u_int64_t seqno; + uint64_t seqno; if (DCCPH_X(dh) != 0) { const struct dccp_hdr_ext *dhx = (const struct dccp_hdr_ext *)bp; @@ -229,7 +229,7 @@ static void dccp_print_ack_no(netdissect_options *ndo, const u_char *bp) { const struct dccp_hdr *dh = (const struct dccp_hdr *)bp; const u_char *ackp = bp + dccp_basic_hdr_len(dh); - u_int64_t ackno; + uint64_t ackno; if (DCCPH_X(dh) != 0) { ND_TCHECK2(*ackp, 8); @@ -329,7 +329,7 @@ void dccp_print(netdissect_options *ndo, const u_char *bp, const u_char *data2, /* checksum calculation */ if (ndo->ndo_vflag && ND_TTEST2(bp[0], len)) { - u_int16_t sum = 0, dccp_sum; + uint16_t sum = 0, dccp_sum; dccp_sum = EXTRACT_16BITS(&dh->dccph_checksum); ND_PRINT((ndo, "cksum 0x%04x ", dccp_sum)); @@ -509,7 +509,7 @@ static const struct tok dccp_option_values[] = { static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_int hlen) { - u_int8_t optlen, i; + uint8_t optlen, i; ND_TCHECK(*option); diff --git a/print-decnet.c b/print-decnet.c index a1546217..18045150 100644 --- a/print-decnet.c +++ b/print-decnet.c @@ -44,7 +44,7 @@ struct rtentry; static const char tstr[] = "[|decnet]"; #ifndef WIN32 -typedef u_int8_t byte[1]; /* single byte field */ +typedef uint8_t byte[1]; /* single byte field */ #else /* * the keyword 'byte' generates conflicts in Windows @@ -52,17 +52,17 @@ typedef u_int8_t byte[1]; /* single byte field */ typedef unsigned char Byte[1]; /* single byte field */ #define byte Byte #endif /* WIN32 */ -typedef u_int8_t word[2]; /* 2 byte field */ -typedef u_int8_t longword[4]; /* 4 bytes field */ +typedef uint8_t word[2]; /* 2 byte field */ +typedef uint8_t longword[4]; /* 4 bytes field */ /* * Definitions for DECNET Phase IV protocol headers */ union etheraddress { - u_int8_t dne_addr[6]; /* full ethernet address */ + uint8_t dne_addr[6]; /* full ethernet address */ struct { - u_int8_t dne_hiord[4]; /* DECnet HIORD prefix */ - u_int8_t dne_nodeaddr[2]; /* DECnet node address */ + uint8_t dne_hiord[4]; /* DECnet HIORD prefix */ + uint8_t dne_nodeaddr[2]; /* DECnet node address */ } dne_remote; }; @@ -76,8 +76,8 @@ typedef union etheraddress etheraddr; /* Ethernet address */ #define DN_MAXADDL 20 /* max size of DECnet address */ struct dn_naddr { - u_int16_t a_len; /* length of address */ - u_int8_t a_addr[DN_MAXADDL]; /* address as bytes */ + uint16_t a_len; /* length of address */ + uint8_t a_addr[DN_MAXADDL]; /* address as bytes */ }; /* diff --git a/print-dhcp6.c b/print-dhcp6.c index 20fd763d..53b96ef9 100644 --- a/print-dhcp6.c +++ b/print-dhcp6.c @@ -103,8 +103,8 @@ static const struct tok dh6_msgtype_str[] = { /* DHCP6 base packet format */ struct dhcp6 { union { - u_int8_t m; - u_int32_t x; + uint8_t m; + uint32_t x; } dh6_msgtypexid; /* options follow */ }; @@ -114,10 +114,10 @@ struct dhcp6 { /* DHCPv6 relay messages */ struct dhcp6_relay { - u_int8_t dh6relay_msgtype; - u_int8_t dh6relay_hcnt; - u_int8_t dh6relay_linkaddr[16]; /* XXX: badly aligned */ - u_int8_t dh6relay_peeraddr[16]; + uint8_t dh6relay_msgtype; + uint8_t dh6relay_hcnt; + uint8_t dh6relay_linkaddr[16]; /* XXX: badly aligned */ + uint8_t dh6relay_peeraddr[16]; /* options follow */ }; @@ -261,8 +261,8 @@ static const struct tok dh6opt_stcode_str[] = { }; struct dhcp6opt { - u_int16_t dh6opt_type; - u_int16_t dh6opt_len; + uint16_t dh6opt_type; + uint16_t dh6opt_len; /* type-dependent data follows */ }; @@ -279,14 +279,14 @@ dhcp6opt_print(netdissect_options *ndo, const struct dhcp6opt *dh6o; const u_char *tp; size_t i; - u_int16_t opttype; + uint16_t opttype; size_t optlen; - u_int8_t auth_proto; + uint8_t auth_proto; u_int authinfolen, authrealmlen; int remain_len; /* Length of remaining options */ int label_len; /* Label length */ - u_int16_t subopt_code; - u_int16_t subopt_len; + uint16_t subopt_code; + uint16_t subopt_len; if (cp == ep) return; diff --git a/print-domain.c b/print-domain.c index 45db5c73..8805007a 100644 --- a/print-domain.c +++ b/print-domain.c @@ -581,7 +581,7 @@ ns_print(netdissect_options *ndo, register const HEADER *np; register int qdcount, ancount, nscount, arcount; register const u_char *cp; - u_int16_t b2; + uint16_t b2; np = (const HEADER *)bp; ND_TCHECK(*np); diff --git a/print-dvmrp.c b/print-dvmrp.c index 76a86445..96a0ee73 100644 --- a/print-dvmrp.c +++ b/print-dvmrp.c @@ -62,7 +62,7 @@ static int print_prune(netdissect_options *, const u_char *); static int print_graft(netdissect_options *, const u_char *); static int print_graft_ack(netdissect_options *, const u_char *); -static u_int32_t target_level; +static uint32_t target_level; void dvmrp_print(netdissect_options *ndo, @@ -163,7 +163,7 @@ print_report(netdissect_options *ndo, register const u_char *bp, register const u_char *ep, register u_int len) { - register u_int32_t mask, origin; + register uint32_t mask, origin; register int metric, done; register u_int i, width; @@ -173,7 +173,7 @@ print_report(netdissect_options *ndo, return (0); } ND_TCHECK2(bp[0], 3); - mask = (u_int32_t)0xff << 24 | bp[0] << 16 | bp[1] << 8 | bp[2]; + mask = (uint32_t)0xff << 24 | bp[0] << 16 | bp[1] << 8 | bp[2]; width = 1; if (bp[0]) width = 2; @@ -221,7 +221,7 @@ print_probe(netdissect_options *ndo, register const u_char *bp, register const u_char *ep, register u_int len) { - register u_int32_t genid; + register uint32_t genid; ND_TCHECK2(bp[0], 4); if ((len < 4) || ((bp + 4) > ep)) { diff --git a/print-egp.c b/print-egp.c index 5013c2ff..9c5c811e 100644 --- a/print-egp.c +++ b/print-egp.c @@ -30,15 +30,15 @@ #include "extract.h" struct egp_packet { - u_int8_t egp_version; + uint8_t egp_version; #define EGP_VERSION 2 - u_int8_t egp_type; + uint8_t egp_type; #define EGPT_ACQUIRE 3 #define EGPT_REACH 5 #define EGPT_POLL 2 #define EGPT_UPDATE 1 #define EGPT_ERROR 8 - u_int8_t egp_code; + uint8_t egp_code; #define EGPC_REQUEST 0 #define EGPC_CONFIRM 1 #define EGPC_REFUSE 2 @@ -46,7 +46,7 @@ struct egp_packet { #define EGPC_CEASEACK 4 #define EGPC_HELLO 0 #define EGPC_HEARDU 1 - u_int8_t egp_status; + uint8_t egp_status; #define EGPS_UNSPEC 0 #define EGPS_ACTIVE 1 #define EGPS_PASSIVE 2 @@ -59,13 +59,13 @@ struct egp_packet { #define EGPS_UP 1 #define EGPS_DOWN 2 #define EGPS_UNSOL 0x80 - u_int16_t egp_checksum; - u_int16_t egp_as; - u_int16_t egp_sequence; + uint16_t egp_checksum; + uint16_t egp_as; + uint16_t egp_sequence; union { - u_int16_t egpu_hello; - u_int8_t egpu_gws[2]; - u_int16_t egpu_reason; + uint16_t egpu_hello; + uint8_t egpu_gws[2]; + uint16_t egpu_reason; #define EGPR_UNSPEC 0 #define EGPR_BADHEAD 1 #define EGPR_BADDATA 2 @@ -79,8 +79,8 @@ struct egp_packet { #define egp_extgw egp_handg.egpu_gws[1] #define egp_reason egp_handg.egpu_reason union { - u_int16_t egpu_poll; - u_int32_t egpu_sourcenet; + uint16_t egpu_poll; + uint32_t egpu_sourcenet; } egp_pands; #define egp_poll egp_pands.egpu_poll #define egp_sourcenet egp_pands.egpu_sourcenet @@ -130,9 +130,9 @@ static void egpnrprint(netdissect_options *ndo, register const struct egp_packet *egp) { - register const u_int8_t *cp; - u_int32_t addr; - register u_int32_t net; + register const uint8_t *cp; + uint32_t addr; + register uint32_t net; register u_int netlen; int gateways, distances, networks; int t_gateways; @@ -152,7 +152,7 @@ egpnrprint(netdissect_options *ndo, net = 0; netlen = 0; } - cp = (u_int8_t *)(egp + 1); + cp = (uint8_t *)(egp + 1); t_gateways = egp->egp_intgw + egp->egp_extgw; for (gateways = 0; gateways < t_gateways; ++gateways) { @@ -187,14 +187,14 @@ egpnrprint(netdissect_options *ndo, while (--networks >= 0) { /* Pickup network number */ ND_TCHECK2(cp[0], 1); - addr = (u_int32_t)*cp++ << 24; + addr = (uint32_t)*cp++ << 24; if (IN_CLASSB(addr)) { ND_TCHECK2(cp[0], 1); - addr |= (u_int32_t)*cp++ << 16; + addr |= (uint32_t)*cp++ << 16; } else if (!IN_CLASSA(addr)) { ND_TCHECK2(cp[0], 2); - addr |= (u_int32_t)*cp++ << 16; - addr |= (u_int32_t)*cp++ << 8; + addr |= (uint32_t)*cp++ << 16; + addr |= (uint32_t)*cp++ << 8; } ND_PRINT((ndo, " %s", ipaddr_string(ndo, &addr))); } @@ -208,7 +208,7 @@ trunc: void egp_print(netdissect_options *ndo, - register const u_int8_t *bp, register u_int length) + register const uint8_t *bp, register u_int length) { register const struct egp_packet *egp; register int status; diff --git a/print-eigrp.c b/print-eigrp.c index f6d28294..a3feb8ef 100644 --- a/print-eigrp.c +++ b/print-eigrp.c @@ -33,13 +33,13 @@ */ struct eigrp_common_header { - u_int8_t version; - u_int8_t opcode; - u_int8_t checksum[2]; - u_int8_t flags[4]; - u_int8_t seq[4]; - u_int8_t ack[4]; - u_int8_t asn[4]; + uint8_t version; + uint8_t opcode; + uint8_t checksum[2]; + uint8_t flags[4]; + uint8_t seq[4]; + uint8_t ack[4]; + uint8_t asn[4]; }; #define EIGRP_VERSION 2 @@ -68,8 +68,8 @@ static const struct tok eigrp_common_header_flag_values[] = { }; struct eigrp_tlv_header { - u_int8_t type[2]; - u_int8_t length[2]; + uint8_t type[2]; + uint8_t length[2]; }; #define EIGRP_TLV_GENERAL_PARM 0x0001 @@ -102,91 +102,91 @@ static const struct tok eigrp_tlv_values[] = { }; struct eigrp_tlv_general_parm_t { - u_int8_t k1; - u_int8_t k2; - u_int8_t k3; - u_int8_t k4; - u_int8_t k5; - u_int8_t res; - u_int8_t holdtime[2]; + uint8_t k1; + uint8_t k2; + uint8_t k3; + uint8_t k4; + uint8_t k5; + uint8_t res; + uint8_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; + uint8_t ios_major; + uint8_t ios_minor; + uint8_t eigrp_major; + uint8_t eigrp_minor; }; struct eigrp_tlv_ip_int_t { - u_int8_t nexthop[4]; - u_int8_t delay[4]; - u_int8_t bandwidth[4]; - u_int8_t mtu[3]; - u_int8_t hopcount; - u_int8_t reliability; - u_int8_t load; - u_int8_t reserved[2]; - u_int8_t plen; - u_int8_t destination; /* variable length [1-4] bytes encoding */ + uint8_t nexthop[4]; + uint8_t delay[4]; + uint8_t bandwidth[4]; + uint8_t mtu[3]; + uint8_t hopcount; + uint8_t reliability; + uint8_t load; + uint8_t reserved[2]; + uint8_t plen; + uint8_t destination; /* variable length [1-4] bytes encoding */ }; struct eigrp_tlv_ip_ext_t { - u_int8_t nexthop[4]; - u_int8_t origin_router[4]; - u_int8_t origin_as[4]; - u_int8_t tag[4]; - u_int8_t metric[4]; - u_int8_t reserved[2]; - u_int8_t proto_id; - u_int8_t flags; - u_int8_t delay[4]; - u_int8_t bandwidth[4]; - u_int8_t mtu[3]; - u_int8_t hopcount; - u_int8_t reliability; - u_int8_t load; - u_int8_t reserved2[2]; - u_int8_t plen; - u_int8_t destination; /* variable length [1-4] bytes encoding */ + uint8_t nexthop[4]; + uint8_t origin_router[4]; + uint8_t origin_as[4]; + uint8_t tag[4]; + uint8_t metric[4]; + uint8_t reserved[2]; + uint8_t proto_id; + uint8_t flags; + uint8_t delay[4]; + uint8_t bandwidth[4]; + uint8_t mtu[3]; + uint8_t hopcount; + uint8_t reliability; + uint8_t load; + uint8_t reserved2[2]; + uint8_t plen; + uint8_t destination; /* variable length [1-4] bytes encoding */ }; struct eigrp_tlv_at_cable_setup_t { - u_int8_t cable_start[2]; - u_int8_t cable_end[2]; - u_int8_t router_id[4]; + uint8_t cable_start[2]; + uint8_t cable_end[2]; + uint8_t router_id[4]; }; struct eigrp_tlv_at_int_t { - u_int8_t nexthop[4]; - u_int8_t delay[4]; - u_int8_t bandwidth[4]; - u_int8_t mtu[3]; - u_int8_t hopcount; - u_int8_t reliability; - u_int8_t load; - u_int8_t reserved[2]; - u_int8_t cable_start[2]; - u_int8_t cable_end[2]; + uint8_t nexthop[4]; + uint8_t delay[4]; + uint8_t bandwidth[4]; + uint8_t mtu[3]; + uint8_t hopcount; + uint8_t reliability; + uint8_t load; + uint8_t reserved[2]; + uint8_t cable_start[2]; + uint8_t cable_end[2]; }; struct eigrp_tlv_at_ext_t { - u_int8_t nexthop[4]; - u_int8_t origin_router[4]; - u_int8_t origin_as[4]; - u_int8_t tag[4]; - u_int8_t proto_id; - u_int8_t flags; - u_int8_t metric[2]; - u_int8_t delay[4]; - u_int8_t bandwidth[4]; - u_int8_t mtu[3]; - u_int8_t hopcount; - u_int8_t reliability; - u_int8_t load; - u_int8_t reserved2[2]; - u_int8_t cable_start[2]; - u_int8_t cable_end[2]; + uint8_t nexthop[4]; + uint8_t origin_router[4]; + uint8_t origin_as[4]; + uint8_t tag[4]; + uint8_t proto_id; + uint8_t flags; + uint8_t metric[2]; + uint8_t delay[4]; + uint8_t bandwidth[4]; + uint8_t mtu[3]; + uint8_t hopcount; + uint8_t reliability; + uint8_t load; + uint8_t reserved2[2]; + uint8_t cable_start[2]; + uint8_t cable_end[2]; }; static const struct tok eigrp_ext_proto_id_values[] = { @@ -211,7 +211,7 @@ eigrp_print(netdissect_options *ndo, register const u_char *pptr, register u_int const struct eigrp_tlv_header *eigrp_tlv_header; const u_char *tptr,*tlv_tptr; u_int tlen,eigrp_tlv_len,eigrp_tlv_type,tlv_tlen, byte_length, bit_length; - u_int8_t prefix[4]; + uint8_t prefix[4]; union { const struct eigrp_tlv_general_parm_t *eigrp_tlv_general_parm; diff --git a/print-enc.c b/print-enc.c index 556ff815..73b2f444 100644 --- a/print-enc.c +++ b/print-enc.c @@ -73,9 +73,9 @@ #define M_AUTH 0x0800 /* packet was authenticated (AH) */ struct enchdr { - u_int32_t af; - u_int32_t spi; - u_int32_t flags; + uint32_t af; + uint32_t spi; + uint32_t flags; }; #define ENC_PRINT_TYPE(wh, xf, nam) \ diff --git a/print-esp.c b/print-esp.c index a82460f8..8e267d45 100644 --- a/print-esp.c +++ b/print-esp.c @@ -85,8 +85,8 @@ */ struct newesp { - u_int32_t esp_spi; /* ESP */ - u_int32_t esp_seq; /* Sequence number */ + uint32_t esp_spi; /* ESP */ + uint32_t esp_seq; /* Sequence number */ /*variable size*/ /* (IV and) Payload data */ /*variable size*/ /* padding */ /*8bit*/ /* pad size */ @@ -106,7 +106,7 @@ struct sa_list { struct sa_list *next; u_int daddr_version; union inaddr_u daddr; - u_int32_t spi; /* if == 0, then IKEv2 */ + uint32_t spi; /* if == 0, then IKEv2 */ int initiator; u_char spii[8]; /* for IKEv2 */ u_char spir[8]; @@ -465,7 +465,7 @@ static void esp_print_decode_onesecret(netdissect_options *ndo, char *line, if (spikey) { char *spistr, *foo; - u_int32_t spino; + uint32_t spino; spistr = strsep(&spikey, "@"); diff --git a/print-ether.c b/print-ether.c index f3f43c1e..7e9f78be 100644 --- a/print-ether.c +++ b/print-ether.c @@ -89,7 +89,7 @@ ether_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length) { register const struct ether_header *ep; - u_int16_t ether_type; + uint16_t ether_type; ep = (const struct ether_header *)bp; @@ -181,7 +181,7 @@ recurse: return; } if (ndo->ndo_eflag) { - u_int16_t tag = EXTRACT_16BITS(p); + uint16_t tag = EXTRACT_16BITS(p); ND_PRINT((ndo, "vlan %u, p %u%s, ", tag & 0xfff, diff --git a/print-forces.c b/print-forces.c index 3a12d03f..45bd74f9 100644 --- a/print-forces.c +++ b/print-forces.c @@ -62,12 +62,12 @@ static const char tstr[] = "[|forces]"; #define TTLV_T2 (ONE_MORE_TTLV|MAX_TLV) struct tom_h { - u_int32_t v; - u_int16_t flags; - u_int16_t op_msk; + uint32_t v; + uint16_t flags; + uint16_t op_msk; const char *s; int (*print) (netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); }; enum { @@ -86,7 +86,7 @@ enum { }; #define TOM_MAX_IND (_TOM_RSV_MAX - 1) -static inline int tom_valid(u_int8_t tom) +static inline int tom_valid(uint8_t tom) { if (tom > 0) { if (tom >= 0x7 && tom <= 0xe) @@ -100,7 +100,7 @@ static inline int tom_valid(u_int8_t tom) return 0; } -static inline const char *ForCES_node(u_int32_t node) +static inline const char *ForCES_node(uint32_t node) { if (node <= 0x3FFFFFFF) return "FE"; @@ -153,17 +153,17 @@ static const struct tok ForCES_TPs[] = { * Structure of forces header, naked of TLVs. */ struct forcesh { - u_int8_t fm_vrsvd; /* version and reserved */ + uint8_t fm_vrsvd; /* version and reserved */ #define ForCES_V(forcesh) ((forcesh)->fm_vrsvd >> 4) - u_int8_t fm_tom; /* type of message */ - u_int16_t fm_len; /* total length * 4 bytes */ -#define ForCES_BLN(forcesh) ((u_int32_t)(EXTRACT_16BITS(&(forcesh)->fm_len) << 2)) - u_int32_t fm_sid; /* Source ID */ + uint8_t fm_tom; /* type of message */ + uint16_t fm_len; /* total length * 4 bytes */ +#define ForCES_BLN(forcesh) ((uint32_t)(EXTRACT_16BITS(&(forcesh)->fm_len) << 2)) + uint32_t fm_sid; /* Source ID */ #define ForCES_SID(forcesh) EXTRACT_32BITS(&(forcesh)->fm_sid) - u_int32_t fm_did; /* Destination ID */ + uint32_t fm_did; /* Destination ID */ #define ForCES_DID(forcesh) EXTRACT_32BITS(&(forcesh)->fm_did) - u_int8_t fm_cor[8]; /* correlator */ - u_int32_t fm_flags; /* flags */ + uint8_t fm_cor[8]; /* correlator */ + uint32_t fm_flags; /* flags */ #define ForCES_ACK(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0xC0000000) >> 30) #define ForCES_PRI(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x38000000) >> 27) #define ForCES_RS1(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x07000000) >> 24) @@ -225,24 +225,24 @@ enum { }; struct optlv_h { - u_int16_t flags; - u_int16_t op_msk; + uint16_t flags; + uint16_t op_msk; const char *s; int (*print) (netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); }; static int genoptlv_print(netdissect_options *, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); static int recpdoptlv_print(netdissect_options *, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); static int invoptlv_print(netdissect_options *, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); #define OP_MIN_SIZ 8 struct pathdata_h { - u_int16_t pflags; - u_int16_t pIDcnt; + uint16_t pflags; + uint16_t pIDcnt; }; #define B_FULLD 0x1 @@ -274,7 +274,7 @@ static const struct optlv_h OPTLV_msg[F_OP_MAX + 1] = { /* F_OP_RTRCOMP */ {ZERO_TTLV, 0, " RTRCOMP", NULL}, }; -static inline const struct optlv_h *get_forces_optlv_h(u_int16_t opt) +static inline const struct optlv_h *get_forces_optlv_h(uint16_t opt) { if (opt > F_OP_MAX || opt <= F_OP_RSV) return &OPTLV_msg[F_OP_RSV]; @@ -309,7 +309,7 @@ static inline char *indent_pr(int indent, int nlpref) return r; } -static inline int op_valid(u_int16_t op, u_int16_t mask) +static inline int op_valid(uint16_t op, uint16_t mask) { int opb = 1 << (op - 1); @@ -357,7 +357,7 @@ static const struct tok ForCES_TLV[] = { }; #define TLV_HLN 4 -static inline int ttlv_valid(u_int16_t ttlv) +static inline int ttlv_valid(uint16_t ttlv) { if (ttlv > 0) { if (ttlv == 1 || ttlv == 0x1000) @@ -374,13 +374,13 @@ static inline int ttlv_valid(u_int16_t ttlv) } struct forces_ilv { - u_int32_t type; - u_int32_t length; + uint32_t type; + uint32_t length; }; struct forces_tlv { - u_int16_t type; - u_int16_t length; + uint16_t type; + uint16_t length; }; #define F_ALN_LEN(len) ( ((len)+ForCES_ALNL-1) & ~(ForCES_ALNL-1) ) @@ -441,17 +441,17 @@ static inline int ilv_valid(const struct forces_ilv *ilv, u_int rlen) } static int lfbselect_print(netdissect_options *, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); static int redirect_print(netdissect_options *, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); static int asrtlv_print(netdissect_options *, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); static int asttlv_print(netdissect_options *, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); struct forces_lfbsh { - u_int32_t class; - u_int32_t instance; + uint32_t class; + uint32_t instance; }; #define ASSNS_OPS (B_OP_REPORT) @@ -482,7 +482,7 @@ static const struct tom_h ForCES_msg[TOM_MAX_IND + 1] = { {TOM_QUERYREP, TTLV_T2, CFG_QYR, "Query Response", lfbselect_print}, }; -static inline const struct tom_h *get_forces_tom(u_int8_t tom) +static inline const struct tom_h *get_forces_tom(uint8_t tom) { int i; for (i = TOM_RSV_I; i <= TOM_MAX_IND; i++) { @@ -494,12 +494,12 @@ static inline const struct tom_h *get_forces_tom(u_int8_t tom) } struct pdata_ops { - u_int32_t v; - u_int16_t flags; - u_int16_t op_msk; + uint32_t v; + uint16_t flags; + uint16_t op_msk; const char *s; int (*print) (netdissect_options *, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); }; enum { @@ -513,7 +513,7 @@ enum { }; #define PD_MAX_IND (_TOM_RSV_MAX - 1) -static inline int pd_valid(u_int16_t pd) +static inline int pd_valid(uint16_t pd) { if (pd >= F_TLV_PDAT && pd <= F_TLV_REST) return 1; @@ -522,7 +522,7 @@ static inline int pd_valid(u_int16_t pd) static inline void chk_op_type(netdissect_options *ndo, - u_int16_t type, u_int16_t msk, u_int16_t omsk) + uint16_t type, uint16_t msk, uint16_t omsk) { if (type != F_TLV_PDAT) { if (msk & B_KEYIN) { @@ -544,19 +544,19 @@ chk_op_type(netdissect_options *ndo, #define F_TABAPPEND 4 struct res_val { - u_int8_t result; - u_int8_t resv1; - u_int16_t resv2; + uint8_t result; + uint8_t resv1; + uint16_t resv2; }; static int prestlv_print(netdissect_options *, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); static int pkeyitlv_print(netdissect_options *, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); static int fdatatlv_print(netdissect_options *, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); static int sdatatlv_print(netdissect_options *, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent); + uint16_t op_msk, int indent); static const struct pdata_ops ForCES_pdata[PD_MAX_IND + 1] = { /* PD_RSV_I */ {0, 0, 0, "Invalid message", NULL}, @@ -568,7 +568,7 @@ static const struct pdata_ops ForCES_pdata[PD_MAX_IND + 1] = { {F_TLV_PDAT, 0, 0, "Inner PATH-DATA TLV", recpdoptlv_print}, }; -static inline const struct pdata_ops *get_forces_pd(u_int16_t pd) +static inline const struct pdata_ops *get_forces_pd(uint16_t pd) { int i; for (i = PD_RSV_I + 1; i <= PD_MAX_IND; i++) { @@ -642,7 +642,7 @@ static const struct tok ForCES_errs[] = { static int prestlv_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk _U_, int indent) + uint16_t op_msk _U_, int indent) { const struct forces_tlv *tlv = (struct forces_tlv *)pptr; register const u_char *tdp = (u_char *) TLV_DATA(tlv); @@ -680,12 +680,12 @@ trunc: static int fdatatlv_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk _U_, int indent) + uint16_t op_msk _U_, int indent) { const struct forces_tlv *tlv = (struct forces_tlv *)pptr; u_int rlen; register const u_char *tdp = (u_char *) TLV_DATA(tlv); - u_int16_t type; + uint16_t type; /* * pdatacnt_print() or pkeyitlv_print() has ensured that len @@ -715,7 +715,7 @@ trunc: static int sdatailv_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk _U_, int indent) + uint16_t op_msk _U_, int indent) { u_int rlen; const struct forces_ilv *ilv = (struct forces_ilv *)pptr; @@ -761,12 +761,12 @@ trunc: static int sdatatlv_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent) + uint16_t op_msk, int indent) { const struct forces_tlv *tlv = (struct forces_tlv *)pptr; u_int rlen; register const u_char *tdp = (u_char *) TLV_DATA(tlv); - u_int16_t type; + uint16_t type; /* * pdatacnt_print() has ensured that len (the TLV length) @@ -790,15 +790,15 @@ trunc: static int pkeyitlv_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent) + uint16_t op_msk, int indent) { const struct forces_tlv *tlv = (struct forces_tlv *)pptr; register const u_char *tdp = (u_char *) TLV_DATA(tlv); register const u_char *dp = tdp + 4; const struct forces_tlv *kdtlv = (struct forces_tlv *)dp; - u_int32_t id; + uint32_t id; char *ib = indent_pr(indent, 0); - u_int16_t type, tll; + uint16_t type, tll; u_int invtlv; ND_TCHECK(*tdp); @@ -833,10 +833,10 @@ trunc: static int pdatacnt_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t IDcnt, u_int16_t op_msk, int indent) + uint16_t IDcnt, uint16_t op_msk, int indent) { u_int i; - u_int32_t id; + uint32_t id; char *ib = indent_pr(indent, 0); if ((op_msk & B_APPND) && ndo->ndo_vflag >= 3) { @@ -855,7 +855,7 @@ pdatacnt_print(netdissect_options *ndo, if ((op_msk & B_TRNG) || (op_msk & B_KEYIN)) { if (op_msk & B_TRNG) { - u_int32_t starti, endi; + uint32_t starti, endi; if (len < PTH_DESC_SIZE) { ND_PRINT((ndo, "pathlength %d with key/range too short %d\n", @@ -880,7 +880,7 @@ pdatacnt_print(netdissect_options *ndo, if (op_msk & B_KEYIN) { struct forces_tlv *keytlv; - u_int16_t tll; + uint16_t tll; if (len < PTH_DESC_SIZE) { ND_PRINT((ndo, "pathlength %d with key/range too short %d\n", @@ -915,8 +915,8 @@ pdatacnt_print(netdissect_options *ndo, if (len) { const struct forces_tlv *pdtlv = (struct forces_tlv *)pptr; - u_int16_t type; - u_int16_t tll; + uint16_t type; + uint16_t tll; int pad = 0; u_int aln; u_int invtlv; @@ -988,13 +988,13 @@ trunc: static int pdata_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent) + uint16_t op_msk, int indent) { const struct pathdata_h *pdh = (struct pathdata_h *)pptr; char *ib = indent_pr(indent, 0); u_int minsize = 0; int more_pd = 0; - u_int16_t idcnt = 0; + uint16_t idcnt = 0; ND_TCHECK(*pdh); if (len < sizeof(struct pathdata_h)) @@ -1052,10 +1052,10 @@ trunc: static int genoptlv_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent) + uint16_t op_msk, int indent) { const struct forces_tlv *pdtlv = (struct forces_tlv *)pptr; - u_int16_t type; + uint16_t type; int tll; u_int invtlv; char *ib = indent_pr(indent, 0); @@ -1098,12 +1098,12 @@ trunc: static int recpdoptlv_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent) + uint16_t op_msk, int indent) { const struct forces_tlv *pdtlv = (struct forces_tlv *)pptr; int tll; u_int invtlv; - u_int16_t type; + uint16_t type; register const u_char *dp; char *ib; @@ -1152,7 +1152,7 @@ trunc: static int invoptlv_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk _U_, int indent) + uint16_t op_msk _U_, int indent) { char *ib = indent_pr(indent, 1); @@ -1166,11 +1166,11 @@ invoptlv_print(netdissect_options *ndo, static int otlv_print(netdissect_options *ndo, - const struct forces_tlv *otlv, u_int16_t op_msk _U_, int indent) + const struct forces_tlv *otlv, uint16_t op_msk _U_, int indent) { int rc = 0; register const u_char *dp = (u_char *) TLV_DATA(otlv); - u_int16_t type; + uint16_t type; int tll; char *ib = indent_pr(indent, 0); const struct optlv_h *ops; @@ -1216,9 +1216,9 @@ trunc: static int asttlv_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk _U_, int indent) + uint16_t op_msk _U_, int indent) { - u_int32_t rescode; + uint32_t rescode; u_int dlen; char *ib = indent_pr(indent, 0); @@ -1274,9 +1274,9 @@ trunc: static int asrtlv_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk _U_, int indent) + uint16_t op_msk _U_, int indent) { - u_int32_t rescode; + uint32_t rescode; u_int dlen; char *ib = indent_pr(indent, 0); @@ -1329,7 +1329,7 @@ trunc: static int gentltlv_print(netdissect_options *ndo, register const u_char * pptr _U_, register u_int len, - u_int16_t op_msk _U_, int indent _U_) + uint16_t op_msk _U_, int indent _U_) { u_int dlen = len - TLV_HDRL; @@ -1345,7 +1345,7 @@ gentltlv_print(netdissect_options *ndo, static int print_metailv(netdissect_options *ndo, - register const u_char * pptr, u_int16_t op_msk _U_, int indent) + register const u_char * pptr, uint16_t op_msk _U_, int indent) { u_int rlen; char *ib = indent_pr(indent, 0); @@ -1374,7 +1374,7 @@ trunc: static int print_metatlv(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk _U_, int indent) + uint16_t op_msk _U_, int indent) { u_int dlen; char *ib = indent_pr(indent, 0); @@ -1416,7 +1416,7 @@ trunc: static int print_reddata(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk _U_, int indent _U_) + uint16_t op_msk _U_, int indent _U_) { u_int dlen; char *ib = indent_pr(indent, 0); @@ -1438,7 +1438,7 @@ print_reddata(netdissect_options *ndo, static int redirect_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk _U_, int indent) + uint16_t op_msk _U_, int indent) { const struct forces_tlv *tlv = (struct forces_tlv *)pptr; u_int dlen; @@ -1507,7 +1507,7 @@ trunc: static int lfbselect_print(netdissect_options *ndo, register const u_char * pptr, register u_int len, - u_int16_t op_msk, int indent) + uint16_t op_msk, int indent) { const struct forces_lfbsh *lfbs; const struct forces_tlv *otlv; @@ -1679,7 +1679,7 @@ forces_print(netdissect_options *ndo, { const struct forcesh *fhdr; u_int mlen; - u_int32_t flg_raw; + uint32_t flg_raw; const struct tom_h *tops; int rc = 0; diff --git a/print-fr.c b/print-fr.c index 8b3de128..ae476528 100644 --- a/print-fr.c +++ b/print-fr.c @@ -96,7 +96,7 @@ static const struct tok frf_flag_values[] = { * save the flags dep. on address length */ static int parse_q922_addr(const u_char *p, u_int *dlci, - u_int *addr_len, u_int8_t *flags) + u_int *addr_len, uint8_t *flags) { if ((p[0] & FR_EA_BIT)) return -1; @@ -133,7 +133,7 @@ static int parse_q922_addr(const u_char *p, u_int *dlci, char *q922_string(const u_char *p) { static u_int dlci, addr_len; - static u_int8_t flags[4]; + static uint8_t flags[4]; static char buffer[sizeof("DLCI xxxxxxxxxx")]; memset(buffer, 0, sizeof(buffer)); @@ -182,7 +182,7 @@ fr_hdrlen(const u_char *p, u_int addr_len) static void fr_hdr_print(netdissect_options *ndo, - int length, u_int addr_len, u_int dlci, u_int8_t *flags, u_int16_t nlpid) + int length, u_int addr_len, u_int dlci, uint8_t *flags, uint16_t nlpid) { if (ndo->ndo_qflag) { ND_PRINT((ndo, "Q.922, DLCI %u, length %u: ", @@ -230,12 +230,12 @@ u_int fr_print(netdissect_options *ndo, register const u_char *p, u_int length) { - u_int16_t extracted_ethertype; + uint16_t extracted_ethertype; u_int dlci; u_int addr_len; - u_int16_t nlpid; + uint16_t nlpid; u_int hdr_len; - u_int8_t flags[4]; + uint8_t flags[4]; if (parse_q922_addr(p, &dlci, &addr_len, flags)) { ND_PRINT((ndo, "Q.922, invalid address")); @@ -390,8 +390,8 @@ static const struct tok mfr_ctrl_ie_values[] = { #define MFR_ID_STRING_MAXLEN 50 struct ie_tlv_header_t { - u_int8_t ie_type; - u_int8_t ie_len; + uint8_t ie_type; + uint8_t ie_len; }; u_int @@ -399,9 +399,9 @@ mfr_print(netdissect_options *ndo, register const u_char *p, u_int length) { u_int tlen,idx,hdr_len = 0; - u_int16_t sequence_num; - u_int8_t ie_type,ie_len; - const u_int8_t *tptr; + uint16_t sequence_num; + uint8_t ie_type,ie_len; + const uint8_t *tptr; /* @@ -558,7 +558,7 @@ static void frf15_print(netdissect_options *ndo, const u_char *p, u_int length) { - u_int16_t sequence_num, flags; + uint16_t sequence_num, flags; flags = p[0]&MFR_BEC_MASK; sequence_num = (p[0]&0x1e)<<7 | p[1]; diff --git a/print-geonet.c b/print-geonet.c index ee7292c2..d902066e 100644 --- a/print-geonet.c +++ b/print-geonet.c @@ -78,8 +78,8 @@ static void print_btp(netdissect_options *ndo, const u_char *bp) { - u_int16_t dest = EXTRACT_16BITS(bp+0); - u_int16_t src = EXTRACT_16BITS(bp+2); + uint16_t dest = EXTRACT_16BITS(bp+0); + uint16_t src = EXTRACT_16BITS(bp+2); ND_PRINT((ndo, "; BTP Dst:%u Src:%u", dest, src)); } @@ -87,7 +87,7 @@ static void print_long_pos_vector(netdissect_options *ndo, const u_char *bp) { - u_int32_t lat, lon; + uint32_t lat, lon; ND_PRINT((ndo, "GN_ADDR:%s ", linkaddr_string (ndo, bp, 0, GEONET_ADDR_LEN))); @@ -113,7 +113,7 @@ geonet_print(netdissect_options *ndo, const u_char *eth, const u_char *bp, u_int int next_hdr = bp[0] & 0x0f; int hdr_type = bp[1] >> 4; int hdr_subtype = bp[1] & 0x0f; - u_int16_t payload_length = EXTRACT_16BITS(bp+4); + uint16_t payload_length = EXTRACT_16BITS(bp+4); int hop_limit = bp[7]; const char *next_hdr_txt = "Unknown"; const char *hdr_type_txt = "Unknown"; diff --git a/print-gre.c b/print-gre.c index 9c22120b..604a9696 100644 --- a/print-gre.c +++ b/print-gre.c @@ -78,9 +78,9 @@ static const struct tok gre_flag_values[] = { static void gre_print_0(netdissect_options *, const u_char *, u_int); static void gre_print_1(netdissect_options *, const u_char *, u_int); -static void gre_sre_print(netdissect_options *, u_int16_t, u_int8_t, u_int8_t, const u_char *, u_int); -static void gre_sre_ip_print(netdissect_options *, u_int8_t, u_int8_t, const u_char *, u_int); -static void gre_sre_asn_print(netdissect_options *, u_int8_t, u_int8_t, const u_char *, u_int); +static void gre_sre_print(netdissect_options *, uint16_t, uint8_t, uint8_t, const u_char *, u_int); +static void gre_sre_ip_print(netdissect_options *, uint8_t, uint8_t, const u_char *, u_int); +static void gre_sre_asn_print(netdissect_options *, uint8_t, uint8_t, const u_char *, u_int); void gre_print(netdissect_options *ndo, const u_char *bp, u_int length) @@ -111,7 +111,7 @@ static void gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length) { u_int len = length; - u_int16_t flags, prot; + uint16_t flags, prot; flags = EXTRACT_16BITS(bp); if (ndo->ndo_vflag) @@ -160,9 +160,9 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length) if (flags & GRE_RP) { for (;;) { - u_int16_t af; - u_int8_t sreoff; - u_int8_t srelen; + uint16_t af; + uint8_t sreoff; + uint8_t srelen; if (len < 4) goto trunc; @@ -233,7 +233,7 @@ static void gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length) { u_int len = length; - u_int16_t flags, prot; + uint16_t flags, prot; flags = EXTRACT_16BITS(bp); len -= 2; @@ -251,7 +251,7 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length) if (flags & GRE_KP) { - u_int32_t k; + uint32_t k; if (len < 4) goto trunc; @@ -310,8 +310,8 @@ trunc: } static void -gre_sre_print(netdissect_options *ndo, u_int16_t af, u_int8_t sreoff, - u_int8_t srelen, const u_char *bp, u_int len) +gre_sre_print(netdissect_options *ndo, uint16_t af, uint8_t sreoff, + uint8_t srelen, const u_char *bp, u_int len) { switch (af) { case GRESRE_IP: @@ -330,7 +330,7 @@ gre_sre_print(netdissect_options *ndo, u_int16_t af, u_int8_t sreoff, } static void -gre_sre_ip_print(netdissect_options *ndo, u_int8_t sreoff, u_int8_t srelen, +gre_sre_ip_print(netdissect_options *ndo, uint8_t sreoff, uint8_t srelen, const u_char *bp, u_int len) { struct in_addr a; @@ -365,7 +365,7 @@ gre_sre_ip_print(netdissect_options *ndo, u_int8_t sreoff, u_int8_t srelen, } static void -gre_sre_asn_print(netdissect_options *ndo, u_int8_t sreoff, u_int8_t srelen, +gre_sre_asn_print(netdissect_options *ndo, uint8_t sreoff, uint8_t srelen, const u_char *bp, u_int len) { const u_char *up = bp; diff --git a/print-hsrp.c b/print-hsrp.c index 9b8e70e4..b72ac0a6 100644 --- a/print-hsrp.c +++ b/print-hsrp.c @@ -79,20 +79,20 @@ static const struct tok states[] = { /* HSRP protocol header. */ struct hsrp { - u_int8_t hsrp_version; - u_int8_t hsrp_op_code; - u_int8_t hsrp_state; - u_int8_t hsrp_hellotime; - u_int8_t hsrp_holdtime; - u_int8_t hsrp_priority; - u_int8_t hsrp_group; - u_int8_t hsrp_reserved; - u_int8_t hsrp_authdata[HSRP_AUTH_SIZE]; + uint8_t hsrp_version; + uint8_t hsrp_op_code; + uint8_t hsrp_state; + uint8_t hsrp_hellotime; + uint8_t hsrp_holdtime; + uint8_t hsrp_priority; + uint8_t hsrp_group; + uint8_t hsrp_reserved; + uint8_t hsrp_authdata[HSRP_AUTH_SIZE]; struct in_addr hsrp_virtaddr; }; void -hsrp_print(netdissect_options *ndo, register const u_int8_t *bp, register u_int len) +hsrp_print(netdissect_options *ndo, register const uint8_t *bp, register u_int len) { struct hsrp *hp = (struct hsrp *) bp; diff --git a/print-icmp.c b/print-icmp.c index bebf3b7a..a86c7f01 100644 --- a/print-icmp.c +++ b/print-icmp.c @@ -47,17 +47,17 @@ * Structure of an icmp header. */ struct icmp { - u_int8_t icmp_type; /* type of message, see below */ - u_int8_t icmp_code; /* type sub code */ - u_int16_t icmp_cksum; /* ones complement cksum of struct */ + uint8_t icmp_type; /* type of message, see below */ + uint8_t icmp_code; /* type sub code */ + uint16_t icmp_cksum; /* ones complement cksum of struct */ union { - u_int8_t ih_pptr; /* ICMP_PARAMPROB */ + uint8_t ih_pptr; /* ICMP_PARAMPROB */ struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ struct ih_idseq { - u_int16_t icd_id; - u_int16_t icd_seq; + uint16_t icd_id; + uint16_t icd_seq; } ih_idseq; - u_int32_t ih_void; + uint32_t ih_void; } icmp_hun; #define icmp_pptr icmp_hun.ih_pptr #define icmp_gwaddr icmp_hun.ih_gwaddr @@ -66,16 +66,16 @@ struct icmp { #define icmp_void icmp_hun.ih_void union { struct id_ts { - u_int32_t its_otime; - u_int32_t its_rtime; - u_int32_t its_ttime; + uint32_t its_otime; + uint32_t its_rtime; + uint32_t its_ttime; } id_ts; struct id_ip { struct ip idi_ip; /* options and then 64 bits of data */ } id_ip; - u_int32_t id_mask; - u_int8_t id_data[1]; + uint32_t id_mask; + uint8_t id_data[1]; } icmp_dun; #define icmp_otime icmp_dun.id_ts.its_otime #define icmp_rtime icmp_dun.id_ts.its_rtime @@ -98,7 +98,7 @@ struct icmp { */ #define ICMP_MINLEN 8 /* abs minimum */ #define ICMP_EXTD_MINLEN (156 - sizeof (struct ip)) /* draft-bonica-internet-icmp-08 */ -#define ICMP_TSLEN (8 + 3 * sizeof (u_int32_t)) /* timestamp */ +#define ICMP_TSLEN (8 + 3 * sizeof (uint32_t)) /* timestamp */ #define ICMP_MASKLEN 12 /* address mask */ #define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */ #define ICMP_ADVLEN(p) (8 + (IP_HL(&(p)->icmp_ip) << 2) + 8) @@ -241,20 +241,20 @@ static const struct tok type2str[] = { /* rfc1191 */ struct mtu_discovery { - u_int16_t unused; - u_int16_t nexthopmtu; + uint16_t unused; + uint16_t nexthopmtu; }; /* rfc1256 */ struct ih_rdiscovery { - u_int8_t ird_addrnum; - u_int8_t ird_addrsiz; - u_int16_t ird_lifetime; + uint8_t ird_addrnum; + uint8_t ird_addrsiz; + uint16_t ird_lifetime; }; struct id_rdiscovery { - u_int32_t ird_addr; - u_int32_t ird_pref; + uint32_t ird_addr; + uint32_t ird_pref; }; /* @@ -284,22 +284,22 @@ struct id_rdiscovery { */ struct icmp_ext_t { - u_int8_t icmp_type; - u_int8_t icmp_code; - u_int8_t icmp_checksum[2]; - u_int8_t icmp_reserved; - u_int8_t icmp_length; - u_int8_t icmp_reserved2[2]; - u_int8_t icmp_ext_legacy_header[128]; /* extension header starts 128 bytes after ICMP header */ - u_int8_t icmp_ext_version_res[2]; - u_int8_t icmp_ext_checksum[2]; - u_int8_t icmp_ext_data[1]; + uint8_t icmp_type; + uint8_t icmp_code; + uint8_t icmp_checksum[2]; + uint8_t icmp_reserved; + uint8_t icmp_length; + uint8_t icmp_reserved2[2]; + uint8_t icmp_ext_legacy_header[128]; /* extension header starts 128 bytes after ICMP header */ + uint8_t icmp_ext_version_res[2]; + uint8_t icmp_ext_checksum[2]; + uint8_t icmp_ext_data[1]; }; struct icmp_mpls_ext_object_header_t { - u_int8_t length[2]; - u_int8_t class_num; - u_int8_t ctype; + uint8_t length[2]; + uint8_t class_num; + uint8_t ctype; }; static const struct tok icmp_mpls_ext_obj_values[] = { @@ -337,8 +337,8 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char * const char *str, *fmt; const struct ip *oip; const struct udphdr *ouh; - const u_int8_t *obj_tptr; - u_int32_t raw_label; + const uint8_t *obj_tptr; + uint32_t raw_label; const u_char *snapend_save; const struct icmp_mpls_ext_object_header_t *icmp_mpls_ext_object_header; u_int hlen, dport, mtu, obj_tlen, obj_class_num, obj_ctype; @@ -557,10 +557,10 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char * } ND_PRINT((ndo, "ICMP %s, length %u", str, plen)); if (ndo->ndo_vflag && !fragmented) { /* don't attempt checksumming if this is a frag */ - u_int16_t sum, icmp_sum; + uint16_t sum, icmp_sum; struct cksum_vec vec[1]; if (ND_TTEST2(*bp, plen)) { - vec[0].ptr = (const u_int8_t *)(void *)dp; + vec[0].ptr = (const uint8_t *)(void *)dp; vec[0].len = plen; sum = in_cksum(vec, 1); if (sum != 0) { @@ -600,7 +600,7 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char * * however not all implementations set the length field proper. */ if (!ext_dp->icmp_length) { - vec[0].ptr = (const u_int8_t *)(void *)&ext_dp->icmp_ext_version_res; + vec[0].ptr = (const uint8_t *)(void *)&ext_dp->icmp_ext_version_res; vec[0].len = plen - ICMP_EXTD_MINLEN; if (in_cksum(vec, 1)) { return; @@ -620,7 +620,7 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char * } hlen = plen - ICMP_EXTD_MINLEN; - vec[0].ptr = (const u_int8_t *)(void *)&ext_dp->icmp_ext_version_res; + vec[0].ptr = (const uint8_t *)(void *)&ext_dp->icmp_ext_version_res; vec[0].len = hlen; ND_PRINT((ndo, ", checksum 0x%04x (%scorrect), length %u", EXTRACT_16BITS(ext_dp->icmp_ext_checksum), @@ -628,7 +628,7 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char * hlen)); hlen -= 4; /* subtract common header size */ - obj_tptr = (u_int8_t *)ext_dp->icmp_ext_data; + obj_tptr = (uint8_t *)ext_dp->icmp_ext_data; while (hlen > sizeof(struct icmp_mpls_ext_object_header_t)) { diff --git a/print-icmp6.c b/print-icmp6.c index 121f9337..a5a27bed 100644 --- a/print-icmp6.c +++ b/print-icmp6.c @@ -74,13 +74,13 @@ */ struct icmp6_hdr { - u_int8_t icmp6_type; /* type field */ - u_int8_t icmp6_code; /* code field */ - u_int16_t icmp6_cksum; /* checksum field */ + uint8_t icmp6_type; /* type field */ + uint8_t icmp6_code; /* code field */ + uint16_t icmp6_cksum; /* checksum field */ union { - u_int32_t icmp6_un_data32[1]; /* type-specific field */ - u_int16_t icmp6_un_data16[2]; /* type-specific field */ - u_int8_t icmp6_un_data8[4]; /* type-specific field */ + uint32_t icmp6_un_data32[1]; /* type-specific field */ + uint16_t icmp6_un_data16[2]; /* type-specific field */ + uint8_t icmp6_un_data8[4]; /* type-specific field */ } icmp6_dataun; }; @@ -201,8 +201,8 @@ struct nd_router_solicit { /* router solicitation */ struct nd_router_advert { /* router advertisement */ struct icmp6_hdr nd_ra_hdr; - u_int32_t nd_ra_reachable; /* reachable time */ - u_int32_t nd_ra_retransmit; /* retransmit timer */ + uint32_t nd_ra_reachable; /* reachable time */ + uint32_t nd_ra_retransmit; /* retransmit timer */ /* could be followed by options */ }; @@ -267,8 +267,8 @@ struct nd_redirect { /* redirect */ #define nd_rd_reserved nd_rd_hdr.icmp6_data32[0] struct nd_opt_hdr { /* Neighbor discovery option header */ - u_int8_t nd_opt_type; - u_int8_t nd_opt_len; + uint8_t nd_opt_type; + uint8_t nd_opt_len; /* followed by option specific data*/ }; @@ -284,13 +284,13 @@ struct nd_opt_hdr { /* Neighbor discovery option header */ #define ND_OPT_DNSSL 31 struct nd_opt_prefix_info { /* prefix information */ - u_int8_t nd_opt_pi_type; - u_int8_t nd_opt_pi_len; - u_int8_t nd_opt_pi_prefix_len; - u_int8_t nd_opt_pi_flags_reserved; - u_int8_t nd_opt_pi_valid_time[4]; - u_int8_t nd_opt_pi_preferred_time[4]; - u_int8_t nd_opt_pi_reserved2[4]; + uint8_t nd_opt_pi_type; + uint8_t nd_opt_pi_len; + uint8_t nd_opt_pi_prefix_len; + uint8_t nd_opt_pi_flags_reserved; + uint8_t nd_opt_pi_valid_time[4]; + uint8_t nd_opt_pi_preferred_time[4]; + uint8_t nd_opt_pi_reserved2[4]; struct in6_addr nd_opt_pi_prefix; }; @@ -299,57 +299,57 @@ struct nd_opt_prefix_info { /* prefix information */ #define ND_OPT_PI_FLAG_ROUTER 0x20 /*2292bis*/ struct nd_opt_rd_hdr { /* redirected header */ - u_int8_t nd_opt_rh_type; - u_int8_t nd_opt_rh_len; - u_int16_t nd_opt_rh_reserved1; - u_int32_t nd_opt_rh_reserved2; + uint8_t nd_opt_rh_type; + uint8_t nd_opt_rh_len; + uint16_t nd_opt_rh_reserved1; + uint32_t nd_opt_rh_reserved2; /* followed by IP header and data */ }; struct nd_opt_mtu { /* MTU option */ - u_int8_t nd_opt_mtu_type; - u_int8_t nd_opt_mtu_len; - u_int16_t nd_opt_mtu_reserved; - u_int32_t nd_opt_mtu_mtu; + uint8_t nd_opt_mtu_type; + uint8_t nd_opt_mtu_len; + uint16_t nd_opt_mtu_reserved; + uint32_t nd_opt_mtu_mtu; }; struct nd_opt_rdnss { /* RDNSS RFC 6106 5.1 */ - u_int8_t nd_opt_rdnss_type; - u_int8_t nd_opt_rdnss_len; - u_int16_t nd_opt_rdnss_reserved; - u_int32_t nd_opt_rdnss_lifetime; + uint8_t nd_opt_rdnss_type; + uint8_t nd_opt_rdnss_len; + uint16_t nd_opt_rdnss_reserved; + uint32_t nd_opt_rdnss_lifetime; struct in6_addr nd_opt_rdnss_addr[1]; /* variable-length */ }; struct nd_opt_dnssl { /* DNSSL RFC 6106 5.2 */ - u_int8_t nd_opt_dnssl_type; - u_int8_t nd_opt_dnssl_len; - u_int16_t nd_opt_dnssl_reserved; - u_int32_t nd_opt_dnssl_lifetime; + uint8_t nd_opt_dnssl_type; + uint8_t nd_opt_dnssl_len; + uint16_t nd_opt_dnssl_reserved; + uint32_t nd_opt_dnssl_lifetime; /* followed by list of DNS search domains, variable-length */ }; struct nd_opt_advinterval { /* Advertisement interval option */ - u_int8_t nd_opt_adv_type; - u_int8_t nd_opt_adv_len; - u_int16_t nd_opt_adv_reserved; - u_int32_t nd_opt_adv_interval; + uint8_t nd_opt_adv_type; + uint8_t nd_opt_adv_len; + uint16_t nd_opt_adv_reserved; + uint32_t nd_opt_adv_interval; }; struct nd_opt_homeagent_info { /* Home Agent info */ - u_int8_t nd_opt_hai_type; - u_int8_t nd_opt_hai_len; - u_int16_t nd_opt_hai_reserved; + uint8_t nd_opt_hai_type; + uint8_t nd_opt_hai_len; + uint16_t nd_opt_hai_reserved; int16_t nd_opt_hai_preference; - u_int16_t nd_opt_hai_lifetime; + uint16_t nd_opt_hai_lifetime; }; struct nd_opt_route_info { /* route info */ - u_int8_t nd_opt_rti_type; - u_int8_t nd_opt_rti_len; - u_int8_t nd_opt_rti_prefixlen; - u_int8_t nd_opt_rti_flags; - u_int32_t nd_opt_rti_lifetime; + uint8_t nd_opt_rti_type; + uint8_t nd_opt_rti_len; + uint8_t nd_opt_rti_prefixlen; + uint8_t nd_opt_rti_flags; + uint32_t nd_opt_rti_lifetime; /* prefix follows */ }; @@ -359,11 +359,11 @@ struct nd_opt_route_info { /* route info */ struct icmp6_namelookup { struct icmp6_hdr icmp6_nl_hdr; - u_int8_t icmp6_nl_nonce[8]; + uint8_t icmp6_nl_nonce[8]; int32_t icmp6_nl_ttl; #if 0 - u_int8_t icmp6_nl_len; - u_int8_t icmp6_nl_name[3]; + uint8_t icmp6_nl_len; + uint8_t icmp6_nl_name[3]; #endif /* could be followed by options */ }; @@ -373,7 +373,7 @@ struct icmp6_namelookup { */ struct icmp6_nodeinfo { struct icmp6_hdr icmp6_ni_hdr; - u_int8_t icmp6_ni_nonce[8]; + uint8_t icmp6_ni_nonce[8]; /* could be followed by reply data */ }; @@ -391,22 +391,22 @@ struct icmp6_nodeinfo { #define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */ /* network endian */ -#define NI_SUPTYPE_FLAG_COMPRESS ((u_int16_t)htons(0x1)) -#define NI_FQDN_FLAG_VALIDTTL ((u_int16_t)htons(0x1)) +#define NI_SUPTYPE_FLAG_COMPRESS ((uint16_t)htons(0x1)) +#define NI_FQDN_FLAG_VALIDTTL ((uint16_t)htons(0x1)) /* network endian */ -#define NI_NODEADDR_FLAG_TRUNCATE ((u_int16_t)htons(0x1)) -#define NI_NODEADDR_FLAG_ALL ((u_int16_t)htons(0x2)) -#define NI_NODEADDR_FLAG_COMPAT ((u_int16_t)htons(0x4)) -#define NI_NODEADDR_FLAG_LINKLOCAL ((u_int16_t)htons(0x8)) -#define NI_NODEADDR_FLAG_SITELOCAL ((u_int16_t)htons(0x10)) -#define NI_NODEADDR_FLAG_GLOBAL ((u_int16_t)htons(0x20)) -#define NI_NODEADDR_FLAG_ANYCAST ((u_int16_t)htons(0x40)) /* just experimental. not in spec */ +#define NI_NODEADDR_FLAG_TRUNCATE ((uint16_t)htons(0x1)) +#define NI_NODEADDR_FLAG_ALL ((uint16_t)htons(0x2)) +#define NI_NODEADDR_FLAG_COMPAT ((uint16_t)htons(0x4)) +#define NI_NODEADDR_FLAG_LINKLOCAL ((uint16_t)htons(0x8)) +#define NI_NODEADDR_FLAG_SITELOCAL ((uint16_t)htons(0x10)) +#define NI_NODEADDR_FLAG_GLOBAL ((uint16_t)htons(0x20)) +#define NI_NODEADDR_FLAG_ANYCAST ((uint16_t)htons(0x40)) /* just experimental. not in spec */ struct ni_reply_fqdn { - u_int32_t ni_fqdn_ttl; /* TTL */ - u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */ - u_int8_t ni_fqdn_name[3]; /* XXX: alignment */ + uint32_t ni_fqdn_ttl; /* TTL */ + uint8_t ni_fqdn_namelen; /* length in octets of the FQDN */ + uint8_t ni_fqdn_name[3]; /* XXX: alignment */ }; /* @@ -414,10 +414,10 @@ struct ni_reply_fqdn { */ struct icmp6_router_renum { /* router renumbering header */ struct icmp6_hdr rr_hdr; - u_int8_t rr_segnum; - u_int8_t rr_flags; - u_int16_t rr_maxdelay; - u_int32_t rr_reserved; + uint8_t rr_segnum; + uint8_t rr_flags; + uint16_t rr_maxdelay; + uint32_t rr_reserved; }; #define ICMP6_RR_FLAGS_TEST 0x80 #define ICMP6_RR_FLAGS_REQRESULT 0x40 @@ -431,13 +431,13 @@ struct icmp6_router_renum { /* router renumbering header */ #define rr_seqnum rr_hdr.icmp6_data32[0] struct rr_pco_match { /* match prefix part */ - u_int8_t rpm_code; - u_int8_t rpm_len; - u_int8_t rpm_ordinal; - u_int8_t rpm_matchlen; - u_int8_t rpm_minlen; - u_int8_t rpm_maxlen; - u_int16_t rpm_reserved; + uint8_t rpm_code; + uint8_t rpm_len; + uint8_t rpm_ordinal; + uint8_t rpm_matchlen; + uint8_t rpm_minlen; + uint8_t rpm_maxlen; + uint16_t rpm_reserved; struct in6_addr rpm_prefix; }; @@ -447,35 +447,35 @@ struct rr_pco_match { /* match prefix part */ #define RPM_PCO_MAX 4 struct rr_pco_use { /* use prefix part */ - u_int8_t rpu_uselen; - u_int8_t rpu_keeplen; - u_int8_t rpu_ramask; - u_int8_t rpu_raflags; - u_int32_t rpu_vltime; - u_int32_t rpu_pltime; - u_int32_t rpu_flags; + uint8_t rpu_uselen; + uint8_t rpu_keeplen; + uint8_t rpu_ramask; + uint8_t rpu_raflags; + uint32_t rpu_vltime; + uint32_t rpu_pltime; + uint32_t rpu_flags; struct in6_addr rpu_prefix; }; #define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80 #define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40 /* network endian */ -#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME ((u_int32_t)htonl(0x80000000)) -#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME ((u_int32_t)htonl(0x40000000)) +#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME ((uint32_t)htonl(0x80000000)) +#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME ((uint32_t)htonl(0x40000000)) struct rr_result { /* router renumbering result message */ - u_int16_t rrr_flags; - u_int8_t rrr_ordinal; - u_int8_t rrr_matchedlen; - u_int32_t rrr_ifid; + uint16_t rrr_flags; + uint8_t rrr_ordinal; + uint8_t rrr_matchedlen; + uint32_t rrr_ifid; struct in6_addr rrr_prefix; }; /* network endian */ -#define ICMP6_RR_RESULT_FLAGS_OOB ((u_int16_t)htons(0x0002)) -#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN ((u_int16_t)htons(0x0001)) +#define ICMP6_RR_RESULT_FLAGS_OOB ((uint16_t)htons(0x0002)) +#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN ((uint16_t)htons(0x0001)) static const char *get_rtpref(u_int); -static const char *get_lifetime(u_int32_t); +static const char *get_lifetime(uint32_t); static void print_lladdr(netdissect_options *ndo, const u_char *, size_t); static void icmp6_opt_print(netdissect_options *ndo, const u_char *, int); static void mld6_print(netdissect_options *ndo, const u_char *); @@ -595,11 +595,11 @@ get_rtpref(u_int v) } static const char * -get_lifetime(u_int32_t v) +get_lifetime(uint32_t v) { static char buf[20]; - if (v == (u_int32_t)~0UL) + if (v == (uint32_t)~0UL) return "infinity"; else { snprintf(buf, sizeof(buf), "%us", v); @@ -608,9 +608,9 @@ get_lifetime(u_int32_t v) } static void -print_lladdr(netdissect_options *ndo, const u_int8_t *p, size_t l) +print_lladdr(netdissect_options *ndo, const uint8_t *p, size_t l) { - const u_int8_t *ep, *q; + const uint8_t *ep, *q; q = p; ep = p + l; @@ -625,7 +625,7 @@ print_lladdr(netdissect_options *ndo, const u_int8_t *p, size_t l) static int icmp6_cksum(const struct ip6_hdr *ip6, const struct icmp6_hdr *icp, u_int len) { - return nextproto6_cksum(ip6, (const u_int8_t *)(void *)icp, len, len, + return nextproto6_cksum(ip6, (const uint8_t *)(void *)icp, len, len, IPPROTO_ICMPV6); } @@ -694,7 +694,7 @@ rpl_dio_printopt(netdissect_options *ndo, if(paylen > length) paylen = length; hex_print(ndo, " ", - ((u_int8_t *)opt) + RPL_DIO_GENOPTION_LEN, /* content of DIO option */ + ((uint8_t *)opt) + RPL_DIO_GENOPTION_LEN, /* content of DIO option */ paylen); } } @@ -903,7 +903,7 @@ icmp6_print(netdissect_options *ndo, ND_TCHECK(dp->icmp6_cksum); if (ndo->ndo_vflag && !fragmented) { - u_int16_t sum, udp_sum; + uint16_t sum, udp_sum; if (ND_TTEST2(bp[0], length)) { udp_sum = EXTRACT_16BITS(&dp->icmp6_cksum); @@ -1781,7 +1781,7 @@ icmp6_nodeinfo_print(netdissect_options *ndo, u_int icmp6len, const u_char *bp, } else dnsname_print(ndo, cp, ep); if ((EXTRACT_16BITS(&ni6->ni_flags) & 0x01) != 0) - ND_PRINT((ndo," [TTL=%u]", *(u_int32_t *)(ni6 + 1))); + ND_PRINT((ndo," [TTL=%u]", *(uint32_t *)(ni6 + 1))); break; case NI_QTYPE_NODEADDR: if (needcomma) diff --git a/print-igmp.c b/print-igmp.c index 728fcaf1..e4808a77 100644 --- a/print-igmp.c +++ b/print-igmp.c @@ -42,10 +42,10 @@ static const char tstr[] = "[|igmp]"; * The packet format for a traceroute request. */ struct tr_query { - u_int32_t tr_src; /* traceroute source */ - u_int32_t tr_dst; /* traceroute destination */ - u_int32_t tr_raddr; /* traceroute response address */ - u_int32_t tr_rttlqid; /* response ttl and qid */ + uint32_t tr_src; /* traceroute source */ + uint32_t tr_dst; /* traceroute destination */ + uint32_t tr_raddr; /* traceroute response address */ + uint32_t tr_rttlqid; /* response ttl and qid */ }; #define TR_GETTTL(x) (int)(((x) >> 24) & 0xff) @@ -56,17 +56,17 @@ struct tr_query { * beginning, followed by one tr_resp for each hop taken. */ struct tr_resp { - u_int32_t tr_qarr; /* query arrival time */ - u_int32_t tr_inaddr; /* incoming interface address */ - u_int32_t tr_outaddr; /* outgoing interface address */ - u_int32_t tr_rmtaddr; /* parent address in source tree */ - u_int32_t tr_vifin; /* input packet count on interface */ - u_int32_t tr_vifout; /* output packet count on interface */ - u_int32_t tr_pktcnt; /* total incoming packets for src-grp */ - u_int8_t tr_rproto; /* routing proto deployed on router */ - u_int8_t tr_fttl; /* ttl required to forward on outvif */ - u_int8_t tr_smask; /* subnet mask for src addr */ - u_int8_t tr_rflags; /* forwarding error codes */ + uint32_t tr_qarr; /* query arrival time */ + uint32_t tr_inaddr; /* incoming interface address */ + uint32_t tr_outaddr; /* outgoing interface address */ + uint32_t tr_rmtaddr; /* parent address in source tree */ + uint32_t tr_vifin; /* input packet count on interface */ + uint32_t tr_vifout; /* output packet count on interface */ + uint32_t tr_pktcnt; /* total incoming packets for src-grp */ + uint8_t tr_rproto; /* routing proto deployed on router */ + uint8_t tr_fttl; /* ttl required to forward on outvif */ + uint8_t tr_smask; /* subnet mask for src addr */ + uint8_t tr_rflags; /* forwarding error codes */ }; /* defs within mtrace */ diff --git a/print-igrp.c b/print-igrp.c index 794f0c52..fbb31342 100644 --- a/print-igrp.c +++ b/print-igrp.c @@ -36,15 +36,15 @@ /* IGRP Header */ struct igrphdr { - u_int8_t ig_vop; /* protocol version number / opcode */ + uint8_t ig_vop; /* protocol version number / opcode */ #define IGRP_V(x) (((x) & 0xf0) >> 4) #define IGRP_OP(x) ((x) & 0x0f) - u_int8_t ig_ed; /* edition number */ - u_int16_t ig_as; /* autonomous system number */ - u_int16_t ig_ni; /* number of subnet in local net */ - u_int16_t ig_ns; /* number of networks in AS */ - u_int16_t ig_nx; /* number of networks ouside AS */ - u_int16_t ig_sum; /* checksum of IGRP header & data */ + uint8_t ig_ed; /* edition number */ + uint16_t ig_as; /* autonomous system number */ + uint16_t ig_ni; /* number of subnet in local net */ + uint16_t ig_ns; /* number of networks in AS */ + uint16_t ig_nx; /* number of networks ouside AS */ + uint16_t ig_sum; /* checksum of IGRP header & data */ }; #define IGRP_UPDATE 1 @@ -53,13 +53,13 @@ struct igrphdr { /* IGRP routing entry */ struct igrprte { - u_int8_t igr_net[3]; /* 3 significant octets of IP address */ - u_int8_t igr_dly[3]; /* delay in tens of microseconds */ - u_int8_t igr_bw[3]; /* bandwidth in units of 1 kb/s */ - u_int8_t igr_mtu[2]; /* MTU in octets */ - u_int8_t igr_rel; /* percent packets successfully tx/rx */ - u_int8_t igr_ld; /* percent of channel occupied */ - u_int8_t igr_hct; /* hop count */ + uint8_t igr_net[3]; /* 3 significant octets of IP address */ + uint8_t igr_dly[3]; /* delay in tens of microseconds */ + uint8_t igr_bw[3]; /* bandwidth in units of 1 kb/s */ + uint8_t igr_mtu[2]; /* MTU in octets */ + uint8_t igr_rel; /* percent packets successfully tx/rx */ + uint8_t igr_ld; /* percent of channel occupied */ + uint8_t igr_hct; /* hop count */ }; #define IGRP_RTE_SIZE 14 /* don't believe sizeof ! */ diff --git a/print-ip.c b/print-ip.c index f18c7e57..362465e6 100644 --- a/print-ip.c +++ b/print-ip.c @@ -84,14 +84,14 @@ ip_printroute(netdissect_options *ndo, * This is used for UDP and TCP pseudo-header in the checksum * calculation. */ -static u_int32_t +static uint32_t ip_finddst(netdissect_options *ndo, const struct ip *ip) { int length; int len; const u_char *cp; - u_int32_t retval; + uint32_t retval; cp = (const u_char *)(ip + 1); length = (IP_HL(ip) << 2) - sizeof(struct ip); @@ -123,7 +123,7 @@ ip_finddst(netdissect_options *ndo, } } trunc: - UNALIGNED_MEMCPY(&retval, &ip->ip_dst.s_addr, sizeof(u_int32_t)); + UNALIGNED_MEMCPY(&retval, &ip->ip_dst.s_addr, sizeof(uint32_t)); return retval; } @@ -132,29 +132,29 @@ trunc: */ int nextproto4_cksum(netdissect_options *ndo, - const struct ip *ip, const u_int8_t *data, + const struct ip *ip, const uint8_t *data, u_int len, u_int covlen, u_int next_proto) { struct phdr { - u_int32_t src; - u_int32_t dst; + uint32_t src; + uint32_t dst; u_char mbz; u_char proto; - u_int16_t len; + uint16_t len; } ph; struct cksum_vec vec[2]; /* pseudo-header.. */ - ph.len = htons((u_int16_t)len); + ph.len = htons((uint16_t)len); ph.mbz = 0; ph.proto = next_proto; - UNALIGNED_MEMCPY(&ph.src, &ip->ip_src.s_addr, sizeof(u_int32_t)); + UNALIGNED_MEMCPY(&ph.src, &ip->ip_src.s_addr, sizeof(uint32_t)); if (IP_HL(ip) == 5) - UNALIGNED_MEMCPY(&ph.dst, &ip->ip_dst.s_addr, sizeof(u_int32_t)); + UNALIGNED_MEMCPY(&ph.dst, &ip->ip_dst.s_addr, sizeof(uint32_t)); else ph.dst = ip_finddst(ndo, ip); - vec[0].ptr = (const u_int8_t *)(void *)&ph; + vec[0].ptr = (const uint8_t *)(void *)&ph; vec[0].len = sizeof(ph); vec[1].ptr = data; vec[1].len = covlen; @@ -525,7 +525,7 @@ ip_print(netdissect_options *ndo, const u_char *ipend; u_int hlen; struct cksum_vec vec[1]; - u_int16_t sum, ip_sum; + uint16_t sum, ip_sum; struct protoent *proto; ipds->ip = (const struct ip *)bp; @@ -623,7 +623,7 @@ ip_print(netdissect_options *ndo, } if (!ndo->ndo_Kflag && (u_char *)ipds->ip + hlen <= ndo->ndo_snapend) { - vec[0].ptr = (const u_int8_t *)(void *)ipds->ip; + vec[0].ptr = (const uint8_t *)(void *)ipds->ip; vec[0].len = hlen; sum = in_cksum(vec, 1); if (sum != 0) { diff --git a/print-ip6.c b/print-ip6.c index 219db53f..7311c8ff 100644 --- a/print-ip6.c +++ b/print-ip6.c @@ -41,15 +41,15 @@ * Compute a V6-style checksum by building a pseudoheader. */ int -nextproto6_cksum(const struct ip6_hdr *ip6, const u_int8_t *data, +nextproto6_cksum(const struct ip6_hdr *ip6, const uint8_t *data, u_int len, u_int covlen, u_int next_proto) { struct { struct in6_addr ph_src; struct in6_addr ph_dst; - u_int32_t ph_len; - u_int8_t ph_zero[3]; - u_int8_t ph_nxt; + uint32_t ph_len; + uint8_t ph_zero[3]; + uint8_t ph_nxt; } ph; struct cksum_vec vec[2]; @@ -60,7 +60,7 @@ nextproto6_cksum(const struct ip6_hdr *ip6, const u_int8_t *data, ph.ph_len = htonl(len); ph.ph_nxt = next_proto; - vec[0].ptr = (const u_int8_t *)(void *)&ph; + vec[0].ptr = (const uint8_t *)(void *)&ph; vec[0].len = sizeof(ph); vec[1].ptr = data; vec[1].len = covlen; diff --git a/print-ipcomp.c b/print-ipcomp.c index caa42327..1ba687e8 100644 --- a/print-ipcomp.c +++ b/print-ipcomp.c @@ -27,9 +27,9 @@ #include struct ipcomp { - u_int8_t comp_nxt; /* Next Header */ - u_int8_t comp_flags; /* Length of data, in 32bit */ - u_int16_t comp_cpi; /* Compression parameter index */ + uint8_t comp_nxt; /* Next Header */ + uint8_t comp_flags; /* Length of data, in 32bit */ + uint16_t comp_cpi; /* Compression parameter index */ }; #if defined(HAVE_LIBZ) && defined(HAVE_ZLIB_H) @@ -44,7 +44,7 @@ ipcomp_print(netdissect_options *ndo, register const u_char *bp, int *nhdr _U_) { register const struct ipcomp *ipcomp; register const u_char *ep; - u_int16_t cpi; + uint16_t cpi; #if defined(HAVE_LIBZ) && defined(HAVE_ZLIB_H) int advance; #endif diff --git a/print-ipx.c b/print-ipx.c index ea5a6545..93f5d595 100644 --- a/print-ipx.c +++ b/print-ipx.c @@ -46,21 +46,21 @@ /* IPX transport header */ struct ipxHdr { - u_int16_t cksum; /* Checksum */ - u_int16_t length; /* Length, in bytes, including header */ - u_int8_t tCtl; /* Transport Control (i.e. hop count) */ - u_int8_t pType; /* Packet Type (i.e. level 2 protocol) */ - u_int16_t dstNet[2]; /* destination net */ - u_int8_t dstNode[6]; /* destination node */ - u_int16_t dstSkt; /* destination socket */ - u_int16_t srcNet[2]; /* source net */ - u_int8_t srcNode[6]; /* source node */ - u_int16_t srcSkt; /* source socket */ + uint16_t cksum; /* Checksum */ + uint16_t length; /* Length, in bytes, including header */ + uint8_t tCtl; /* Transport Control (i.e. hop count) */ + uint8_t pType; /* Packet Type (i.e. level 2 protocol) */ + uint16_t dstNet[2]; /* destination net */ + uint8_t dstNode[6]; /* destination node */ + uint16_t dstSkt; /* destination socket */ + uint16_t srcNet[2]; /* source net */ + uint8_t srcNode[6]; /* source node */ + uint16_t srcSkt; /* source socket */ }; #define ipxSize 30 -static const char *ipxaddr_string(u_int32_t, const u_char *); +static const char *ipxaddr_string(uint32_t, const u_char *); static void ipx_decode(netdissect_options *, const struct ipxHdr *, const u_char *, u_int); static void ipx_sap_print(netdissect_options *, const u_short *, u_int); static void ipx_rip_print(netdissect_options *, const u_short *, u_int); @@ -96,7 +96,7 @@ trunc: } static const char * -ipxaddr_string(u_int32_t net, const u_char *node) +ipxaddr_string(uint32_t net, const u_char *node) { static char line[256]; diff --git a/print-isakmp.c b/print-isakmp.c index 9fe567d1..33a0cefa 100644 --- a/print-isakmp.c +++ b/print-isakmp.c @@ -79,16 +79,16 @@ typedef u_char msgid_t[4]; struct isakmp { cookie_t i_ck; /* Initiator Cookie */ cookie_t r_ck; /* Responder Cookie */ - u_int8_t np; /* Next Payload Type */ - u_int8_t vers; + uint8_t np; /* Next Payload Type */ + uint8_t vers; #define ISAKMP_VERS_MAJOR 0xf0 #define ISAKMP_VERS_MAJOR_SHIFT 4 #define ISAKMP_VERS_MINOR 0x0f #define ISAKMP_VERS_MINOR_SHIFT 0 - u_int8_t etype; /* Exchange Type */ - u_int8_t flags; /* Flags */ + uint8_t etype; /* Exchange Type */ + uint8_t flags; /* Flags */ msgid_t msgid; - u_int32_t len; /* Length */ + uint32_t len; /* Length */ }; /* Next Payload Type */ @@ -132,9 +132,9 @@ struct isakmp { +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct isakmp_gen { - u_int8_t np; /* Next Payload */ - u_int8_t critical; /* bit 7 - critical, rest is RESERVED */ - u_int16_t len; /* Payload Length */ + uint8_t np; /* Next Payload */ + uint8_t critical; /* bit 7 - critical, rest is RESERVED */ + uint16_t len; /* Payload Length */ }; /* 3.3 Data Attributes @@ -148,8 +148,8 @@ struct isakmp_gen { +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct isakmp_data { - u_int16_t type; /* defined by DOI-spec, and Attribute Format */ - u_int16_t lorv; /* if f equal 1, Attribute Length */ + uint16_t type; /* defined by DOI-spec, and Attribute Format */ + uint16_t lorv; /* if f equal 1, Attribute Length */ /* if f equal 0, Attribute Value */ /* if f equal 1, Attribute Value */ }; @@ -168,8 +168,8 @@ struct isakmp_data { */ struct ikev1_pl_sa { struct isakmp_gen h; - u_int32_t doi; /* Domain of Interpretation */ - u_int32_t sit; /* Situation */ + uint32_t doi; /* Domain of Interpretation */ + uint32_t sit; /* Situation */ }; /* 3.5 Proposal Payload */ @@ -182,10 +182,10 @@ struct ikev1_pl_sa { */ struct ikev1_pl_p { struct isakmp_gen h; - u_int8_t p_no; /* Proposal # */ - u_int8_t prot_id; /* Protocol */ - u_int8_t spi_size; /* SPI Size */ - u_int8_t num_t; /* Number of Transforms */ + uint8_t p_no; /* Proposal # */ + uint8_t prot_id; /* Protocol */ + uint8_t spi_size; /* SPI Size */ + uint8_t num_t; /* Number of Transforms */ /* SPI */ }; @@ -198,9 +198,9 @@ struct ikev1_pl_p { */ struct ikev1_pl_t { struct isakmp_gen h; - u_int8_t t_no; /* Transform # */ - u_int8_t t_id; /* Transform-Id */ - u_int16_t reserved; /* RESERVED2 */ + uint8_t t_no; /* Transform # */ + uint8_t t_id; /* Transform-Id */ + uint16_t reserved; /* RESERVED2 */ /* SA Attributes */ }; @@ -215,8 +215,8 @@ struct ikev1_pl_ke { struct ikev1_pl_id { struct isakmp_gen h; union { - u_int8_t id_type; /* ID Type */ - u_int32_t doi_data; /* DOI Specific ID Data */ + uint8_t id_type; /* ID Type */ + uint32_t doi_data; /* DOI Specific ID Data */ } d; /* Identification Data */ }; @@ -224,7 +224,7 @@ struct ikev1_pl_id { /* 3.9 Certificate Payload */ struct ikev1_pl_cert { struct isakmp_gen h; - u_int8_t encode; /* Cert Encoding */ + uint8_t encode; /* Cert Encoding */ char cert; /* Certificate Data */ /* This field indicates the type of @@ -236,7 +236,7 @@ struct ikev1_pl_cert { /* 3.10 Certificate Request Payload */ struct ikev1_pl_cr { struct isakmp_gen h; - u_int8_t num_cert; /* # Cert. Types */ + uint8_t num_cert; /* # Cert. Types */ /* Certificate Types (variable length) -- Contains a list of the types of certificates requested, @@ -271,10 +271,10 @@ struct ikev1_pl_nonce { /* 3.14 Notification Payload */ struct ikev1_pl_n { struct isakmp_gen h; - u_int32_t doi; /* Domain of Interpretation */ - u_int8_t prot_id; /* Protocol-ID */ - u_int8_t spi_size; /* SPI Size */ - u_int16_t type; /* Notify Message Type */ + uint32_t doi; /* Domain of Interpretation */ + uint8_t prot_id; /* Protocol-ID */ + uint8_t spi_size; /* SPI Size */ + uint16_t type; /* Notify Message Type */ /* SPI */ /* Notification Data */ }; @@ -311,10 +311,10 @@ struct ikev1_pl_n { /* 3.15 Delete Payload */ struct ikev1_pl_d { struct isakmp_gen h; - u_int32_t doi; /* Domain of Interpretation */ - u_int8_t prot_id; /* Protocol-Id */ - u_int8_t spi_size; /* SPI Size */ - u_int16_t num_spi; /* # of SPIs */ + uint32_t doi; /* Domain of Interpretation */ + uint8_t prot_id; /* Protocol-Id */ + uint8_t spi_size; /* SPI Size */ + uint16_t num_spi; /* # of SPIs */ /* SPI(es) */ }; @@ -336,18 +336,18 @@ struct isakmp_ph2tab { /* 3.3.1. Proposal Substructure */ struct ikev2_p { struct isakmp_gen h; - u_int8_t p_no; /* Proposal # */ - u_int8_t prot_id; /* Protocol */ - u_int8_t spi_size; /* SPI Size */ - u_int8_t num_t; /* Number of Transforms */ + uint8_t p_no; /* Proposal # */ + uint8_t prot_id; /* Protocol */ + uint8_t spi_size; /* SPI Size */ + uint8_t num_t; /* Number of Transforms */ }; /* 3.3.2. Transform Substructure */ struct ikev2_t { struct isakmp_gen h; - u_int8_t t_type; /* Transform Type (ENCR,PRF,INTEG,etc.*/ - u_int8_t res2; /* reserved byte */ - u_int16_t t_id; /* Transform ID */ + uint8_t t_type; /* Transform Type (ENCR,PRF,INTEG,etc.*/ + uint8_t res2; /* reserved byte */ + uint16_t t_id; /* Transform ID */ }; enum ikev2_t_type { @@ -361,8 +361,8 @@ enum ikev2_t_type { /* 3.4. Key Exchange Payload */ struct ikev2_ke { struct isakmp_gen h; - u_int16_t ke_group; - u_int16_t ke_res1; + uint16_t ke_group; + uint16_t ke_res1; /* KE data */ }; @@ -379,9 +379,9 @@ enum ikev2_id_type { }; struct ikev2_id { struct isakmp_gen h; - u_int8_t type; /* ID type */ - u_int8_t res1; - u_int16_t res2; + uint8_t type; /* ID type */ + uint8_t res1; + uint16_t res2; /* SPI */ /* Notification Data */ }; @@ -389,9 +389,9 @@ struct ikev2_id { /* 3.10 Notification Payload */ struct ikev2_n { struct isakmp_gen h; - u_int8_t prot_id; /* Protocol-ID */ - u_int8_t spi_size; /* SPI Size */ - u_int16_t type; /* Notify Message Type */ + uint8_t prot_id; /* Protocol-ID */ + uint8_t spi_size; /* SPI Size */ + uint16_t type; /* Notify Message Type */ }; enum ikev2_n_type { @@ -424,15 +424,15 @@ enum ikev2_n_type { }; struct notify_messages { - u_int16_t type; + uint16_t type; char *msg; }; /* 3.8 Notification Payload */ struct ikev2_auth { struct isakmp_gen h; - u_int8_t auth_method; /* Protocol-ID */ - u_int8_t reserved[3]; + uint8_t auth_method; /* Protocol-ID */ + uint8_t reserved[3]; /* authentication data */ }; @@ -447,15 +447,15 @@ enum ikev2_auth_type { #if 0 /* isakmp sa structure */ struct oakley_sa { - u_int8_t proto_id; /* OAKLEY */ + uint8_t proto_id; /* OAKLEY */ vchar_t *spi; /* spi */ - u_int8_t dhgrp; /* DH; group */ - u_int8_t auth_t; /* method of authentication */ - u_int8_t prf_t; /* type of prf */ - u_int8_t hash_t; /* type of hash */ - u_int8_t enc_t; /* type of cipher */ - u_int8_t life_t; /* type of duration of lifetime */ - u_int32_t ldur; /* life duration */ + uint8_t dhgrp; /* DH; group */ + uint8_t auth_t; /* method of authentication */ + uint8_t prf_t; /* type of prf */ + uint8_t hash_t; /* type of hash */ + uint8_t enc_t; /* type of cipher */ + uint8_t life_t; /* type of duration of lifetime */ + uint32_t ldur; /* life duration */ }; #endif @@ -540,21 +540,21 @@ struct oakley_sa { /* 4.6.1 Security Association Payload */ struct ipsecdoi_sa { struct isakmp_gen h; - u_int32_t doi; /* Domain of Interpretation */ - u_int32_t sit; /* Situation */ + uint32_t doi; /* Domain of Interpretation */ + uint32_t sit; /* Situation */ }; struct ipsecdoi_secrecy_h { - u_int16_t len; - u_int16_t reserved; + uint16_t len; + uint16_t reserved; }; /* 4.6.2.1 Identification Type Values */ struct ipsecdoi_id { struct isakmp_gen h; - u_int8_t type; /* ID Type */ - u_int8_t proto_id; /* Protocol ID */ - u_int16_t port; /* Port */ + uint8_t type; /* ID Type */ + uint8_t proto_id; /* Protocol ID */ + uint16_t port; /* Port */ /* Identification Data */ }; @@ -581,9 +581,9 @@ struct ipsecdoi_id { const struct isakmp_gen *ext, \ u_int item_len, \ const u_char *end_pointer, \ - u_int32_t phase,\ - u_int32_t doi0, \ - u_int32_t proto0, int depth) + uint32_t phase,\ + uint32_t doi0, \ + uint32_t proto0, int depth) DECLARE_PRINTER(v1_sa); DECLARE_PRINTER(v1_p); @@ -619,21 +619,21 @@ static const u_char *ikev2_e_print(netdissect_options *ndo, const struct isakmp_gen *ext, u_int item_len, const u_char *end_pointer, - u_int32_t phase, - u_int32_t doi0, - u_int32_t proto0, int depth); + uint32_t phase, + uint32_t doi0, + uint32_t proto0, int depth); static const u_char *ike_sub0_print(netdissect_options *ndo,u_char, const struct isakmp_gen *, - const u_char *, u_int32_t, u_int32_t, u_int32_t, int); + const u_char *, uint32_t, uint32_t, uint32_t, int); static const u_char *ikev1_sub_print(netdissect_options *ndo,u_char, const struct isakmp_gen *, - const u_char *, u_int32_t, u_int32_t, u_int32_t, int); + const u_char *, uint32_t, uint32_t, uint32_t, int); static const u_char *ikev2_sub_print(netdissect_options *ndo, struct isakmp *base, u_char np, const struct isakmp_gen *ext, - const u_char *ep, u_int32_t phase, - u_int32_t doi, u_int32_t proto, + const u_char *ep, uint32_t phase, + uint32_t doi, uint32_t proto, int depth); @@ -684,9 +684,9 @@ 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, - u_int32_t phase, - u_int32_t doi0, - u_int32_t proto0, int depth) = { + uint32_t phase, + uint32_t doi0, + uint32_t proto0, int depth) = { NULL, ikev1_sa_print, ikev1_p_print, @@ -926,7 +926,7 @@ ikev1_attrmap_print(netdissect_options *ndo, const struct attrmap *map, size_t nmap) { int totlen; - u_int32_t t, v; + uint32_t t, v; if (p[0] & 0x80) totlen = 4; @@ -962,7 +962,7 @@ static const u_char * ikev1_attr_print(netdissect_options *ndo, const u_char *p, const u_char *ep) { int totlen; - u_int32_t t; + uint32_t t; if (p[0] & 0x80) totlen = 4; @@ -992,12 +992,12 @@ static const u_char * ikev1_sa_print(netdissect_options *ndo, u_char tpay _U_, const struct isakmp_gen *ext, u_int item_len _U_, - const u_char *ep, u_int32_t phase, u_int32_t doi0 _U_, - u_int32_t proto0, int depth) + const u_char *ep, uint32_t phase, uint32_t doi0 _U_, + uint32_t proto0, int depth) { const struct ikev1_pl_sa *p; struct ikev1_pl_sa sa; - u_int32_t doi, sit, ident; + uint32_t doi, sit, ident; const u_char *cp, *np; int t; @@ -1010,7 +1010,7 @@ ikev1_sa_print(netdissect_options *ndo, u_char tpay _U_, sit = ntohl(sa.sit); if (doi != 1) { ND_PRINT((ndo," doi=%d", doi)); - ND_PRINT((ndo," situation=%u", (u_int32_t)ntohl(sa.sit))); + ND_PRINT((ndo," situation=%u", (uint32_t)ntohl(sa.sit))); return (u_char *)(p + 1); } @@ -1032,7 +1032,7 @@ ikev1_sa_print(netdissect_options *ndo, u_char tpay _U_, if (sit != 0x01) { ND_TCHECK2(*(ext + 1), sizeof(ident)); UNALIGNED_MEMCPY(&ident, ext + 1, sizeof(ident)); - ND_PRINT((ndo," ident=%u", (u_int32_t)ntohl(ident))); + ND_PRINT((ndo," ident=%u", (uint32_t)ntohl(ident))); np += sizeof(ident); } @@ -1051,8 +1051,8 @@ trunc: static const u_char * ikev1_p_print(netdissect_options *ndo, u_char tpay _U_, const struct isakmp_gen *ext, u_int item_len _U_, - const u_char *ep, u_int32_t phase, u_int32_t doi0, - u_int32_t proto0 _U_, int depth) + const u_char *ep, uint32_t phase, uint32_t doi0, + uint32_t proto0 _U_, int depth) { const struct ikev1_pl_p *p; struct ikev1_pl_p prop; @@ -1214,8 +1214,8 @@ static const struct attrmap oakley_t_map[] = { static const u_char * ikev1_t_print(netdissect_options *ndo, u_char tpay _U_, const struct isakmp_gen *ext, u_int item_len, - const u_char *ep, u_int32_t phase _U_, u_int32_t doi _U_, - u_int32_t proto, int depth _U_) + const u_char *ep, uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto, int depth _U_) { const struct ikev1_pl_t *p; struct ikev1_pl_t t; @@ -1283,8 +1283,8 @@ trunc: static const u_char * ikev1_ke_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_, - u_int32_t proto _U_, int depth _U_) + const u_char *ep _U_, uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { struct isakmp_gen e; @@ -1307,8 +1307,8 @@ trunc: static const u_char * ikev1_id_print(netdissect_options *ndo, u_char tpay _U_, const struct isakmp_gen *ext, u_int item_len, - const u_char *ep _U_, u_int32_t phase, u_int32_t doi _U_, - u_int32_t proto _U_, int depth _U_) + const u_char *ep _U_, uint32_t phase, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { #define USE_IPSECDOI_IN_PHASE1 1 const struct ikev1_pl_id *p; @@ -1347,7 +1347,7 @@ ikev1_id_print(netdissect_options *ndo, u_char tpay _U_, default: ND_PRINT((ndo," idtype=%s", STR_OR_ID(id.d.id_type, idtypestr))); ND_PRINT((ndo," doi_data=%u", - (u_int32_t)(ntohl(id.d.doi_data) & 0xffffff))); + (uint32_t)(ntohl(id.d.doi_data) & 0xffffff))); break; #ifdef USE_IPSECDOI_IN_PHASE1 @@ -1489,9 +1489,9 @@ trunc: static const u_char * ikev1_cert_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 doi0 _U_, - u_int32_t proto0 _U_, int depth _U_) + const u_char *ep _U_, uint32_t phase _U_, + uint32_t doi0 _U_, + uint32_t proto0 _U_, int depth _U_) { const struct ikev1_pl_cert *p; struct ikev1_pl_cert cert; @@ -1522,8 +1522,8 @@ trunc: static const u_char * ikev1_cr_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 doi0 _U_, - u_int32_t proto0 _U_, int depth _U_) + const u_char *ep _U_, uint32_t phase _U_, uint32_t doi0 _U_, + uint32_t proto0 _U_, int depth _U_) { const struct ikev1_pl_cert *p; struct ikev1_pl_cert cert; @@ -1554,8 +1554,8 @@ trunc: static const u_char * ikev1_hash_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_, - u_int32_t proto _U_, int depth _U_) + const u_char *ep _U_, uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { struct isakmp_gen e; @@ -1578,8 +1578,8 @@ trunc: static const u_char * ikev1_sig_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_, - u_int32_t proto _U_, int depth _U_) + const u_char *ep _U_, uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { struct isakmp_gen e; @@ -1604,8 +1604,8 @@ ikev1_nonce_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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { struct isakmp_gen e; @@ -1632,14 +1632,14 @@ trunc: static const u_char * ikev1_n_print(netdissect_options *ndo, u_char tpay _U_, const struct isakmp_gen *ext, u_int item_len, - const u_char *ep, u_int32_t phase, u_int32_t doi0 _U_, - u_int32_t proto0 _U_, int depth) + const u_char *ep, uint32_t phase, uint32_t doi0 _U_, + uint32_t proto0 _U_, int depth) { struct ikev1_pl_n *p, n; const u_char *cp; u_char *ep2; - u_int32_t doi; - u_int32_t proto; + uint32_t doi; + uint32_t proto; static const char *notify_error_str[] = { NULL, "INVALID-PAYLOAD-TYPE", "DOI-NOT-SUPPORTED", "SITUATION-NOT-SUPPORTED", @@ -1773,14 +1773,14 @@ trunc: static const u_char * ikev1_d_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 doi0 _U_, - u_int32_t proto0 _U_, int depth _U_) + const u_char *ep _U_, uint32_t phase _U_, uint32_t doi0 _U_, + uint32_t proto0 _U_, int depth _U_) { const struct ikev1_pl_d *p; struct ikev1_pl_d d; - const u_int8_t *q; - u_int32_t doi; - u_int32_t proto; + const uint8_t *q; + uint32_t doi; + uint32_t proto; int i; ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_D))); @@ -1800,7 +1800,7 @@ ikev1_d_print(netdissect_options *ndo, u_char tpay _U_, ND_PRINT((ndo," spilen=%u", d.spi_size)); ND_PRINT((ndo," nspi=%u", ntohs(d.num_spi))); ND_PRINT((ndo," spi=")); - q = (u_int8_t *)(p + 1); + q = (uint8_t *)(p + 1); for (i = 0; i < ntohs(d.num_spi); i++) { if (i != 0) ND_PRINT((ndo,",")); @@ -1818,8 +1818,8 @@ static const u_char * ikev1_vid_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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { struct isakmp_gen e; @@ -1876,12 +1876,12 @@ trunc: static const u_char * ikev2_t_print(netdissect_options *ndo, u_char tpay _U_, int pcount, const struct isakmp_gen *ext, u_int item_len, - const u_char *ep, u_int32_t phase _U_, u_int32_t doi _U_, - u_int32_t proto _U_, int depth _U_) + const u_char *ep, uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { const struct ikev2_t *p; struct ikev2_t t; - u_int16_t t_id; + uint16_t t_id; const u_char *cp; const char *idstr; const struct attrmap *map; @@ -1954,8 +1954,8 @@ trunc: static const u_char * ikev2_p_print(netdissect_options *ndo, u_char tpay _U_, int pcount _U_, const struct isakmp_gen *ext, u_int item_len _U_, - const u_char *ep, u_int32_t phase, u_int32_t doi0, - u_int32_t proto0 _U_, int depth) + const u_char *ep, uint32_t phase, uint32_t doi0, + uint32_t proto0 _U_, int depth) { const struct ikev2_p *p; struct ikev2_p prop; @@ -1991,8 +1991,8 @@ static const u_char * 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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { struct isakmp_gen e; int osa_length, sa_length; @@ -2019,8 +2019,8 @@ static const u_char * 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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { struct ikev2_ke ke; struct ikev2_ke *k; @@ -2048,8 +2048,8 @@ static const u_char * 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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { struct ikev2_id id; int id_len, idtype_len, i; @@ -2130,8 +2130,8 @@ static const u_char * 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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { return ikev2_gen_print(ndo, tpay, ext); } @@ -2140,8 +2140,8 @@ static const u_char * 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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { return ikev2_gen_print(ndo, tpay, ext); } @@ -2150,8 +2150,8 @@ static const u_char * 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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { struct ikev2_auth a; const char *v2_auth[]={ "invalid", "rsasig", @@ -2186,8 +2186,8 @@ static const u_char * 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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { struct isakmp_gen e; @@ -2216,14 +2216,14 @@ static const u_char * 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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { struct ikev2_n *p, n; const u_char *cp; u_char showspi, showdata, showsomedata; const char *notify_name; - u_int32_t type; + uint32_t type; p = (struct ikev2_n *)ext; ND_TCHECK(*p); @@ -2423,8 +2423,8 @@ static const u_char * 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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { return ikev2_gen_print(ndo, tpay, ext); } @@ -2433,8 +2433,8 @@ static const u_char * 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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { struct isakmp_gen e; const u_char *vid; @@ -2467,8 +2467,8 @@ static const u_char * 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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { return ikev2_gen_print(ndo, tpay, ext); } @@ -2485,15 +2485,15 @@ ikev2_e_print(netdissect_options *ndo, #ifndef HAVE_LIBCRYPTO _U_ #endif - u_int32_t phase, + uint32_t phase, #ifndef HAVE_LIBCRYPTO _U_ #endif - u_int32_t doi, + uint32_t doi, #ifndef HAVE_LIBCRYPTO _U_ #endif - u_int32_t proto, + uint32_t proto, #ifndef HAVE_LIBCRYPTO _U_ #endif @@ -2548,8 +2548,8 @@ static const u_char * 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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { return ikev2_gen_print(ndo, tpay, ext); } @@ -2558,8 +2558,8 @@ static const u_char * 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_, - u_int32_t proto _U_, int depth _U_) + uint32_t phase _U_, uint32_t doi _U_, + uint32_t proto _U_, int depth _U_) { return ikev2_gen_print(ndo, tpay, ext); } @@ -2568,7 +2568,7 @@ static const u_char * ike_sub0_print(netdissect_options *ndo, u_char np, const struct isakmp_gen *ext, const u_char *ep, - u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth) + uint32_t phase, uint32_t doi, uint32_t proto, int depth) { const u_char *cp; struct isakmp_gen e; @@ -2608,7 +2608,7 @@ trunc: static const u_char * ikev1_sub_print(netdissect_options *ndo, u_char np, const struct isakmp_gen *ext, const u_char *ep, - u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth) + uint32_t phase, uint32_t doi, uint32_t proto, int depth) { const u_char *cp; int i; @@ -2723,7 +2723,7 @@ done: if (ndo->ndo_vflag) { if (ntohl(base->len) != length) { ND_PRINT((ndo," (len mismatch: isakmp %u/ip %u)", - (u_int32_t)ntohl(base->len), length)); + (uint32_t)ntohl(base->len), length)); } } } @@ -2732,7 +2732,7 @@ static const u_char * ikev2_sub0_print(netdissect_options *ndo, struct isakmp *base, u_char np, int pcount, const struct isakmp_gen *ext, const u_char *ep, - u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth) + uint32_t phase, uint32_t doi, uint32_t proto, int depth) { const u_char *cp; struct isakmp_gen e; @@ -2783,7 +2783,7 @@ static const u_char * ikev2_sub_print(netdissect_options *ndo, struct isakmp *base, u_char np, const struct isakmp_gen *ext, const u_char *ep, - u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth) + uint32_t phase, uint32_t doi, uint32_t proto, int depth) { const u_char *cp; int i; @@ -2877,7 +2877,7 @@ done: if (ndo->ndo_vflag) { if (ntohl(base->len) != length) { ND_PRINT((ndo, " (len mismatch: isakmp %u/ip %u)", - (u_int32_t)ntohl(base->len), length)); + (uint32_t)ntohl(base->len), length)); } } } diff --git a/print-isoclns.c b/print-isoclns.c index 80bd3ce5..bc710e4a 100644 --- a/print-isoclns.c +++ b/print-isoclns.c @@ -446,10 +446,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 revision_lvl[2]; - u_int8_t digest[16]; + uint8_t format_id; + uint8_t name[32]; + uint8_t revision_lvl[2]; + uint8_t digest[16]; }; struct isis_subtlv_spb_mcid { @@ -458,11 +458,11 @@ struct isis_subtlv_spb_mcid { }; struct isis_subtlv_spb_instance { - u_int8_t cist_root_id[8]; - 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; + uint8_t cist_root_id[8]; + uint8_t cist_external_root_path_cost[4]; + uint8_t bridge_priority[2]; + uint8_t spsourceid[4]; + uint8_t no_of_trees; }; #define CLNP_SEGMENT_PART 0x80 @@ -553,39 +553,39 @@ static const struct tok isis_ptp_adjancey_values[] = { }; struct isis_tlv_ptp_adj { - u_int8_t adjacency_state; - u_int8_t extd_local_circuit_id[4]; - u_int8_t neighbor_sysid[SYSTEM_ID_LEN]; - u_int8_t neighbor_extd_local_circuit_id[4]; + uint8_t adjacency_state; + uint8_t extd_local_circuit_id[4]; + uint8_t neighbor_sysid[SYSTEM_ID_LEN]; + uint8_t neighbor_extd_local_circuit_id[4]; }; -static void osi_print_cksum(netdissect_options *, const u_int8_t *pptr, u_int16_t checksum, +static void osi_print_cksum(netdissect_options *, const uint8_t *pptr, uint16_t checksum, u_int checksum_offset, u_int length); -static int clnp_print(netdissect_options *, const u_int8_t *, u_int); -static void esis_print(netdissect_options *, const u_int8_t *, u_int); -static int isis_print(netdissect_options *, const u_int8_t *, u_int); +static int clnp_print(netdissect_options *, const uint8_t *, u_int); +static void esis_print(netdissect_options *, const uint8_t *, u_int); +static int isis_print(netdissect_options *, const uint8_t *, u_int); struct isis_metric_block { - u_int8_t metric_default; - u_int8_t metric_delay; - u_int8_t metric_expense; - u_int8_t metric_error; + uint8_t metric_default; + uint8_t metric_delay; + uint8_t metric_expense; + uint8_t metric_error; }; struct isis_tlv_is_reach { struct isis_metric_block isis_metric_block; - u_int8_t neighbor_nodeid[NODE_ID_LEN]; + uint8_t neighbor_nodeid[NODE_ID_LEN]; }; struct isis_tlv_es_reach { struct isis_metric_block isis_metric_block; - u_int8_t neighbor_sysid[SYSTEM_ID_LEN]; + uint8_t neighbor_sysid[SYSTEM_ID_LEN]; }; struct isis_tlv_ip_reach { struct isis_metric_block isis_metric_block; - u_int8_t prefix[4]; - u_int8_t mask[4]; + uint8_t prefix[4]; + uint8_t mask[4]; }; static const struct tok isis_is_reach_virtual_values[] = { @@ -602,59 +602,59 @@ static const struct tok isis_restart_flag_values[] = { }; struct isis_common_header { - u_int8_t nlpid; - u_int8_t fixed_len; - u_int8_t version; /* Protocol version */ - u_int8_t id_length; - u_int8_t pdu_type; /* 3 MSbits are reserved */ - u_int8_t pdu_version; /* Packet format version */ - u_int8_t reserved; - u_int8_t max_area; + uint8_t nlpid; + uint8_t fixed_len; + uint8_t version; /* Protocol version */ + uint8_t id_length; + uint8_t pdu_type; /* 3 MSbits are reserved */ + uint8_t pdu_version; /* Packet format version */ + uint8_t reserved; + uint8_t max_area; }; struct isis_iih_lan_header { - u_int8_t circuit_type; - u_int8_t source_id[SYSTEM_ID_LEN]; - u_int8_t holding_time[2]; - u_int8_t pdu_len[2]; - u_int8_t priority; - u_int8_t lan_id[NODE_ID_LEN]; + uint8_t circuit_type; + uint8_t source_id[SYSTEM_ID_LEN]; + uint8_t holding_time[2]; + uint8_t pdu_len[2]; + uint8_t priority; + uint8_t lan_id[NODE_ID_LEN]; }; struct isis_iih_ptp_header { - u_int8_t circuit_type; - u_int8_t source_id[SYSTEM_ID_LEN]; - u_int8_t holding_time[2]; - u_int8_t pdu_len[2]; - u_int8_t circuit_id; + uint8_t circuit_type; + uint8_t source_id[SYSTEM_ID_LEN]; + uint8_t holding_time[2]; + uint8_t pdu_len[2]; + uint8_t circuit_id; }; struct isis_lsp_header { - u_int8_t pdu_len[2]; - u_int8_t remaining_lifetime[2]; - u_int8_t lsp_id[LSP_ID_LEN]; - u_int8_t sequence_number[4]; - u_int8_t checksum[2]; - u_int8_t typeblock; + uint8_t pdu_len[2]; + uint8_t remaining_lifetime[2]; + uint8_t lsp_id[LSP_ID_LEN]; + uint8_t sequence_number[4]; + uint8_t checksum[2]; + uint8_t typeblock; }; struct isis_csnp_header { - u_int8_t pdu_len[2]; - u_int8_t source_id[NODE_ID_LEN]; - u_int8_t start_lsp_id[LSP_ID_LEN]; - u_int8_t end_lsp_id[LSP_ID_LEN]; + uint8_t pdu_len[2]; + uint8_t source_id[NODE_ID_LEN]; + uint8_t start_lsp_id[LSP_ID_LEN]; + uint8_t end_lsp_id[LSP_ID_LEN]; }; struct isis_psnp_header { - u_int8_t pdu_len[2]; - u_int8_t source_id[NODE_ID_LEN]; + uint8_t pdu_len[2]; + uint8_t source_id[NODE_ID_LEN]; }; struct isis_tlv_lsp { - u_int8_t remaining_lifetime[2]; - u_int8_t lsp_id[LSP_ID_LEN]; - u_int8_t sequence_number[4]; - u_int8_t checksum[2]; + uint8_t remaining_lifetime[2]; + uint8_t lsp_id[LSP_ID_LEN]; + uint8_t sequence_number[4]; + uint8_t checksum[2]; }; #define ISIS_COMMON_HEADER_SIZE (sizeof(struct isis_common_header)) @@ -665,7 +665,7 @@ struct isis_tlv_lsp { #define ISIS_PSNP_HEADER_SIZE (sizeof(struct isis_psnp_header)) void isoclns_print(netdissect_options *ndo, - const u_int8_t *p, u_int length, u_int caplen) + const uint8_t *p, u_int length, u_int caplen) { if (caplen <= 1) { /* enough bytes on the wire ? */ ND_PRINT((ndo, "|OSI")); @@ -739,19 +739,19 @@ static const struct tok clnp_pdu_values[] = { }; struct clnp_header_t { - u_int8_t nlpid; - u_int8_t length_indicator; - u_int8_t version; - u_int8_t lifetime; /* units of 500ms */ - u_int8_t type; - u_int8_t segment_length[2]; - u_int8_t cksum[2]; + uint8_t nlpid; + uint8_t length_indicator; + uint8_t version; + uint8_t lifetime; /* units of 500ms */ + uint8_t type; + uint8_t segment_length[2]; + uint8_t cksum[2]; }; struct clnp_segment_header_t { - u_int8_t data_unit_id[2]; - u_int8_t segment_offset[2]; - u_int8_t total_length[2]; + uint8_t data_unit_id[2]; + uint8_t segment_offset[2]; + uint8_t total_length[2]; }; /* @@ -761,13 +761,13 @@ struct clnp_segment_header_t { static int clnp_print(netdissect_options *ndo, - const u_int8_t *pptr, u_int length) + const uint8_t *pptr, u_int length) { - const u_int8_t *optr,*source_address,*dest_address; + const uint8_t *optr,*source_address,*dest_address; u_int li,tlen,nsap_offset,source_address_length,dest_address_length, clnp_pdu_type, clnp_flags; const struct clnp_header_t *clnp_header; const struct clnp_segment_header_t *clnp_segment_header; - u_int8_t rfd_error_major,rfd_error_minor; + uint8_t rfd_error_major,rfd_error_minor; clnp_header = (const struct clnp_header_t *) pptr; ND_TCHECK(*clnp_header); @@ -851,7 +851,7 @@ clnp_print(netdissect_options *ndo, /* now walk the options */ while (li >= 2) { u_int op, opli; - const u_int8_t *tptr; + const uint8_t *tptr; ND_TCHECK2(*pptr, 2); if (li < 2) { @@ -1006,20 +1006,20 @@ static const struct tok esis_pdu_values[] = { }; struct esis_header_t { - u_int8_t nlpid; - u_int8_t length_indicator; - u_int8_t version; - u_int8_t reserved; - u_int8_t type; - u_int8_t holdtime[2]; - u_int8_t cksum[2]; + uint8_t nlpid; + uint8_t length_indicator; + uint8_t version; + uint8_t reserved; + uint8_t type; + uint8_t holdtime[2]; + uint8_t cksum[2]; }; static void esis_print(netdissect_options *ndo, - const u_int8_t *pptr, u_int length) + const uint8_t *pptr, u_int length) { - const u_int8_t *optr; + const uint8_t *optr; u_int li,esis_pdu_type,source_address_length, source_address_number; const struct esis_header_t *esis_header; @@ -1093,7 +1093,7 @@ esis_print(netdissect_options *ndo, switch (esis_pdu_type) { case ESIS_PDU_REDIRECT: { - const u_int8_t *dst, *snpa, *neta; + const uint8_t *dst, *snpa, *neta; u_int dstl, snpal, netal; ND_TCHECK(*pptr); @@ -1221,7 +1221,7 @@ esis_print(netdissect_options *ndo, /* now walk the options */ while (li != 0) { u_int op, opli; - const u_int8_t *tptr; + const uint8_t *tptr; if (li < 2) { ND_PRINT((ndo, ", bad opts/li")); @@ -1316,7 +1316,7 @@ isis_print_mcid(netdissect_options *ndo, static int isis_print_mt_port_cap_subtlv(netdissect_options *ndo, - const u_int8_t *tptr, int len) + const uint8_t *tptr, int len) { int stlv_type, stlv_len; const struct isis_subtlv_spb_mcid *subtlv_spb_mcid; @@ -1429,7 +1429,7 @@ isis_print_mt_port_cap_subtlv(netdissect_options *ndo, static int isis_print_mt_capability_subtlv(netdissect_options *ndo, - const u_int8_t *tptr, int len) + const uint8_t *tptr, int len) { int stlv_type, stlv_len, tmp; @@ -1545,7 +1545,7 @@ isis_print_mt_capability_subtlv(netdissect_options *ndo, /* shared routine for printing system, node and lsp-ids */ static char * -isis_print_id(const u_int8_t *cp, int id_len) +isis_print_id(const uint8_t *cp, int id_len) { int i; static char id[sizeof("xxxx.xxxx.xxxx.yy-zz")]; @@ -1592,7 +1592,7 @@ isis_print_metric_block(netdissect_options *ndo, static int isis_print_tlv_ip_reach(netdissect_options *ndo, - const u_int8_t *cp, const char *ident, int length) + const uint8_t *cp, const char *ident, int length) { int prefix_len; const struct isis_tlv_ip_reach *tlv_ip_reach; @@ -1659,7 +1659,7 @@ isis_print_tlv_ip_reach(netdissect_options *ndo, static int isis_print_ip_reach_subtlv(netdissect_options *ndo, - const u_int8_t *tptr, int subt, int subl, + const uint8_t *tptr, int subt, int subl, const char *ident) { /* first lets see if we know the subTLVs name*/ @@ -1709,13 +1709,13 @@ trunctlv: static int isis_print_is_reach_subtlv(netdissect_options *ndo, - const u_int8_t *tptr, u_int subt, u_int subl, + const uint8_t *tptr, u_int subt, u_int subl, const char *ident) { u_int te_class,priority_level,gmpls_switch_cap; union { /* int to float conversion buffer for several subTLVs */ float f; - u_int32_t i; + uint32_t i; } bw; /* first lets see if we know the subTLVs name*/ @@ -1870,7 +1870,7 @@ trunctlv: static int isis_print_ext_is_reach(netdissect_options *ndo, - const u_int8_t *tptr, const char *ident, int tlv_type) { + const uint8_t *tptr, const char *ident, int tlv_type) { char ident_buffer[20]; int subtlv_type,subtlv_len,subtlv_sum_len; @@ -1920,7 +1920,7 @@ isis_print_ext_is_reach(netdissect_options *ndo, static int isis_print_mtid(netdissect_options *ndo, - const u_int8_t *tptr, const char *ident) { + const uint8_t *tptr, const char *ident) { if (!ND_TTEST2(*tptr, 2)) return(0); @@ -1947,13 +1947,13 @@ isis_print_mtid(netdissect_options *ndo, static int isis_print_extd_ip_reach(netdissect_options *ndo, - const u_int8_t *tptr, const char *ident, u_int16_t afi) { + const uint8_t *tptr, const char *ident, uint16_t afi) { char ident_buffer[20]; #ifdef INET6 - u_int8_t prefix[sizeof(struct in6_addr)]; /* shared copy buffer for IPv4 and IPv6 prefixes */ + uint8_t prefix[sizeof(struct in6_addr)]; /* shared copy buffer for IPv4 and IPv6 prefixes */ #else - u_int8_t prefix[sizeof(struct in_addr)]; /* shared copy buffer for IPv4 prefixes */ + uint8_t prefix[sizeof(struct in_addr)]; /* shared copy buffer for IPv4 prefixes */ #endif u_int metric, status_byte, bit_length, byte_length, sublen, processed, subtlvtype, subtlvlen; @@ -2065,7 +2065,7 @@ isis_print_extd_ip_reach(netdissect_options *ndo, static int isis_print(netdissect_options *ndo, - const u_int8_t *p, u_int length) + const uint8_t *p, u_int length) { const struct isis_common_header *isis_header; @@ -2080,9 +2080,9 @@ isis_print(netdissect_options *ndo, const struct isis_tlv_is_reach *tlv_is_reach; const struct isis_tlv_es_reach *tlv_es_reach; - u_int8_t pdu_type, max_area, id_length, tlv_type, tlv_len, tmp, alen, lan_alen, prefix_len; - u_int8_t ext_is_len, ext_ip_len, mt_len; - const u_int8_t *optr, *pptr, *tptr; + uint8_t pdu_type, max_area, id_length, tlv_type, tlv_len, tmp, alen, lan_alen, prefix_len; + uint8_t ext_is_len, ext_ip_len, mt_len; + const uint8_t *optr, *pptr, *tptr; u_short packet_len,pdu_len, key_id; u_int i,vendor_id; int sigcheck; @@ -2319,7 +2319,7 @@ isis_print(netdissect_options *ndo, EXTRACT_16BITS(header_lsp->checksum))); - osi_print_cksum(ndo, (u_int8_t *)header_lsp->lsp_id, + osi_print_cksum(ndo, (uint8_t *)header_lsp->lsp_id, EXTRACT_16BITS(header_lsp->checksum), 12, length-12); /* @@ -2686,7 +2686,7 @@ isis_print(netdissect_options *ndo, case ISIS_SUBTLV_AUTH_GENERIC: key_id = EXTRACT_16BITS((tptr+1)); ND_PRINT((ndo, "%u, password: ", key_id)); - for(i=1 + sizeof(u_int16_t);i 2) { /* Error Code (opt) */ @@ -320,7 +320,7 @@ l2tp_result_code_print(netdissect_options *ndo, const u_char *dat, u_int length) } static void -l2tp_proto_ver_print(netdissect_options *ndo, const u_int16_t *dat) +l2tp_proto_ver_print(netdissect_options *ndo, const uint16_t *dat) { ND_PRINT((ndo, "%u.%u", (EXTRACT_16BITS(dat) >> 8), (EXTRACT_16BITS(dat) & 0xff))); @@ -329,7 +329,7 @@ l2tp_proto_ver_print(netdissect_options *ndo, const u_int16_t *dat) static void l2tp_framing_cap_print(netdissect_options *ndo, const u_char *dat) { - u_int32_t *ptr = (u_int32_t *)dat; + uint32_t *ptr = (uint32_t *)dat; if (EXTRACT_32BITS(ptr) & L2TP_FRAMING_CAP_ASYNC_MASK) { ND_PRINT((ndo, "A")); @@ -342,7 +342,7 @@ l2tp_framing_cap_print(netdissect_options *ndo, const u_char *dat) static void l2tp_bearer_cap_print(netdissect_options *ndo, const u_char *dat) { - u_int32_t *ptr = (u_int32_t *)dat; + uint32_t *ptr = (uint32_t *)dat; if (EXTRACT_32BITS(ptr) & L2TP_BEARER_CAP_ANALOG_MASK) { ND_PRINT((ndo, "A")); @@ -355,7 +355,7 @@ l2tp_bearer_cap_print(netdissect_options *ndo, const u_char *dat) static void l2tp_q931_cc_print(netdissect_options *ndo, const u_char *dat, u_int length) { - print_16bits_val(ndo, (u_int16_t *)dat); + print_16bits_val(ndo, (uint16_t *)dat); ND_PRINT((ndo, ", %02x", dat[2])); if (length > 3) { ND_PRINT((ndo, " ")); @@ -366,7 +366,7 @@ l2tp_q931_cc_print(netdissect_options *ndo, const u_char *dat, u_int length) static void l2tp_bearer_type_print(netdissect_options *ndo, const u_char *dat) { - u_int32_t *ptr = (u_int32_t *)dat; + uint32_t *ptr = (uint32_t *)dat; if (EXTRACT_32BITS(ptr) & L2TP_BEARER_TYPE_ANALOG_MASK) { ND_PRINT((ndo, "A")); @@ -379,7 +379,7 @@ l2tp_bearer_type_print(netdissect_options *ndo, const u_char *dat) static void l2tp_framing_type_print(netdissect_options *ndo, const u_char *dat) { - u_int32_t *ptr = (u_int32_t *)dat; + uint32_t *ptr = (uint32_t *)dat; if (EXTRACT_32BITS(ptr) & L2TP_FRAMING_TYPE_ASYNC_MASK) { ND_PRINT((ndo, "A")); @@ -398,7 +398,7 @@ l2tp_packet_proc_delay_print(netdissect_options *ndo) static void l2tp_proxy_auth_type_print(netdissect_options *ndo, const u_char *dat) { - u_int16_t *ptr = (u_int16_t *)dat; + uint16_t *ptr = (uint16_t *)dat; ND_PRINT((ndo, "%s", tok2str(l2tp_authentype2str, "AuthType-#%u", EXTRACT_16BITS(ptr)))); @@ -407,7 +407,7 @@ l2tp_proxy_auth_type_print(netdissect_options *ndo, const u_char *dat) static void l2tp_proxy_auth_id_print(netdissect_options *ndo, const u_char *dat) { - u_int16_t *ptr = (u_int16_t *)dat; + uint16_t *ptr = (uint16_t *)dat; ND_PRINT((ndo, "%u", EXTRACT_16BITS(ptr) & L2TP_PROXY_AUTH_ID_MASK)); } @@ -415,8 +415,8 @@ l2tp_proxy_auth_id_print(netdissect_options *ndo, const u_char *dat) static void l2tp_call_errors_print(netdissect_options *ndo, const u_char *dat) { - u_int16_t *ptr = (u_int16_t *)dat; - u_int16_t val_h, val_l; + uint16_t *ptr = (uint16_t *)dat; + uint16_t val_h, val_l; ptr++; /* skip "Reserved" */ @@ -448,8 +448,8 @@ l2tp_call_errors_print(netdissect_options *ndo, const u_char *dat) static void l2tp_accm_print(netdissect_options *ndo, const u_char *dat) { - u_int16_t *ptr = (u_int16_t *)dat; - u_int16_t val_h, val_l; + uint16_t *ptr = (uint16_t *)dat; + uint16_t val_h, val_l; ptr++; /* skip "Reserved" */ @@ -465,7 +465,7 @@ l2tp_accm_print(netdissect_options *ndo, const u_char *dat) static void l2tp_ppp_discon_cc_print(netdissect_options *ndo, const u_char *dat, u_int length) { - u_int16_t *ptr = (u_int16_t *)dat; + uint16_t *ptr = (uint16_t *)dat; ND_PRINT((ndo, "%04x, ", EXTRACT_16BITS(ptr))); ptr++; /* Disconnect Code */ ND_PRINT((ndo, "%04x ", EXTRACT_16BITS(ptr))); ptr++; /* Control Protocol Number */ @@ -482,8 +482,8 @@ static void l2tp_avp_print(netdissect_options *ndo, const u_char *dat, int length) { u_int len; - const u_int16_t *ptr = (u_int16_t *)dat; - u_int16_t attr_type; + const uint16_t *ptr = (uint16_t *)dat; + uint16_t attr_type; int hidden = FALSE; if (length <= 0) { @@ -589,7 +589,7 @@ l2tp_avp_print(netdissect_options *ndo, const u_char *dat, int length) case L2TP_AVP_TX_CONN_SPEED: case L2TP_AVP_PHY_CHANNEL_ID: case L2TP_AVP_RX_CONN_SPEED: - print_32bits_val(ndo, (u_int32_t *)ptr); + print_32bits_val(ndo, (uint32_t *)ptr); break; case L2TP_AVP_BEARER_TYPE: l2tp_bearer_type_print(ndo, (u_char *)ptr); @@ -637,9 +637,9 @@ l2tp_print(netdissect_options *ndo, const u_char *dat, u_int length) { const u_char *ptr = dat; u_int cnt = 0; /* total octets consumed */ - u_int16_t pad; + uint16_t pad; int flag_t, flag_l, flag_s, flag_o; - u_int16_t l2tp_len; + uint16_t l2tp_len; flag_t = flag_l = flag_s = flag_o = FALSE; diff --git a/print-lane.c b/print-lane.c index c8d919e1..c1e0b2e8 100644 --- a/print-lane.c +++ b/print-lane.c @@ -32,17 +32,17 @@ #include "ether.h" struct lecdatahdr_8023 { - u_int16_t le_header; - u_int8_t h_dest[ETHER_ADDR_LEN]; - u_int8_t h_source[ETHER_ADDR_LEN]; - u_int16_t h_type; + uint16_t le_header; + uint8_t h_dest[ETHER_ADDR_LEN]; + uint8_t h_source[ETHER_ADDR_LEN]; + uint16_t h_type; }; struct lane_controlhdr { - u_int16_t lec_header; - u_int8_t lec_proto; - u_int8_t lec_vers; - u_int16_t lec_opcode; + uint16_t lec_header; + uint8_t lec_proto; + uint8_t lec_vers; + uint16_t lec_opcode; }; static const struct tok lecop2str[] = { diff --git a/print-ldp.c b/print-ldp.c index 98256659..fc5ff42e 100644 --- a/print-ldp.c +++ b/print-ldp.c @@ -44,10 +44,10 @@ */ struct ldp_common_header { - u_int8_t version[2]; - u_int8_t pdu_length[2]; - u_int8_t lsr_id[4]; - u_int8_t label_space[2]; + uint8_t version[2]; + uint8_t pdu_length[2]; + uint8_t lsr_id[4]; + uint8_t label_space[2]; }; #define LDP_VERSION 1 @@ -77,9 +77,9 @@ struct ldp_common_header { */ struct ldp_msg_header { - u_int8_t type[2]; - u_int8_t length[2]; - u_int8_t id[4]; + uint8_t type[2]; + uint8_t length[2]; + uint8_t id[4]; }; #define LDP_MASK_MSG_TYPE(x) ((x)&0x7fff) @@ -236,8 +236,8 @@ ldp_tlv_print(netdissect_options *ndo, register const u_char *tptr) { struct ldp_tlv_header { - u_int8_t type[2]; - u_int8_t length[2]; + uint8_t type[2]; + uint8_t length[2]; }; const struct ldp_tlv_header *ldp_tlv_header; diff --git a/print-llc.c b/print-llc.c index 00d9268b..e78378d0 100644 --- a/print-llc.c +++ b/print-llc.c @@ -124,7 +124,7 @@ static const struct tok null_values[] = { }; struct oui_tok { - u_int32_t oui; + uint32_t oui; const struct tok *tok; }; @@ -144,8 +144,8 @@ int llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, const u_char *esrc, const u_char *edst, u_short *extracted_ethertype) { - u_int8_t dsap_field, dsap, ssap_field, ssap; - u_int16_t control; + uint8_t dsap_field, dsap, ssap_field, ssap; + uint16_t control; int is_u; register int ret; @@ -363,7 +363,7 @@ llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, int snap_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, u_int bridge_pad) { - u_int32_t orgcode; + uint32_t orgcode; register u_short et; register int ret; diff --git a/print-lldp.c b/print-lldp.c index 3829bd5b..3564e568 100644 --- a/print-lldp.c +++ b/print-lldp.c @@ -643,7 +643,7 @@ lldp_private_8021_print(netdissect_options *ndo, int subtype, hexdump = FALSE; u_int sublen; u_int tval; - u_int8_t i; + uint8_t i; if (tlv_len < 4) { return hexdump; @@ -904,10 +904,10 @@ lldp_private_8023_print(netdissect_options *ndo, /* * Extract 34bits of latitude/longitude coordinates. */ -static u_int64_t +static uint64_t lldp_extract_latlon(const u_char *tptr) { - u_int64_t latlon; + uint64_t latlon; latlon = *tptr & 0x3; latlon = (latlon << 32) | EXTRACT_32BITS(tptr+1); @@ -923,10 +923,10 @@ lldp_private_tia_print(netdissect_options *ndo, const u_char *tptr, u_int tlv_len) { int subtype, hexdump = FALSE; - u_int8_t location_format; - u_int16_t power_val; + uint8_t location_format; + uint16_t power_val; u_int lci_len; - u_int8_t ca_type, ca_len; + uint8_t ca_type, ca_len; if (tlv_len < 4) { return hexdump; @@ -1105,9 +1105,9 @@ lldp_private_dcbx_print(netdissect_options *ndo, const u_char *pptr, u_int len) { int subtype, hexdump = FALSE; - u_int8_t tval; - u_int16_t tlv; - u_int32_t i, pgval, uval; + uint8_t tval; + uint16_t tlv; + uint32_t i, pgval, uval; u_int tlen, tlv_type, tlv_len; const u_char *tptr, *mptr; @@ -1264,7 +1264,7 @@ lldp_private_dcbx_print(netdissect_options *ndo, static char * lldp_network_addr_print(netdissect_options *ndo, const u_char *tptr, u_int len) { - u_int8_t af; + uint8_t af; static char buf[BUFSIZE]; const char * (*pfunc)(netdissect_options *, const u_char *); @@ -1310,7 +1310,7 @@ static int lldp_mgmt_addr_tlv_print(netdissect_options *ndo, const u_char *pptr, u_int len) { - u_int8_t mgmt_addr_len, intf_num_subtype, oid_len; + uint8_t mgmt_addr_len, intf_num_subtype, oid_len; const u_char *tptr; u_int tlen; char *mgmt_addr; @@ -1372,8 +1372,8 @@ void lldp_print(netdissect_options *ndo, register const u_char *pptr, register u_int len) { - u_int8_t subtype; - u_int16_t tlv, cap, ena_cap; + uint8_t subtype; + uint16_t tlv, cap, ena_cap; u_int oui, tlen, hexdump, tlv_type, tlv_len; const u_char *tptr; char *network_addr; diff --git a/print-lmp.c b/print-lmp.c index 396ce48b..27649977 100644 --- a/print-lmp.c +++ b/print-lmp.c @@ -42,11 +42,11 @@ */ struct lmp_common_header { - u_int8_t version_res[2]; - u_int8_t flags; - u_int8_t msg_type; - u_int8_t length[2]; - u_int8_t reserved[2]; + uint8_t version_res[2]; + uint8_t flags; + uint8_t msg_type; + uint8_t length[2]; + uint8_t reserved[2]; }; #define LMP_VERSION 1 @@ -212,9 +212,9 @@ static const struct tok lmp_msg_type_values[] = { */ struct lmp_object_header { - u_int8_t ctype; - u_int8_t class_num; - u_int8_t length[2]; + uint8_t ctype; + uint8_t class_num; + uint8_t length[2]; }; #define LMP_OBJ_CC_ID 1 @@ -366,7 +366,7 @@ lmp_print(netdissect_options *ndo, union { /* int to float conversion buffer */ float f; - u_int32_t i; + uint32_t i; } bw; tptr=pptr; diff --git a/print-lspping.c b/print-lspping.c index 6ecac823..d745700a 100644 --- a/print-lspping.c +++ b/print-lspping.c @@ -56,18 +56,18 @@ */ 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 sender_handle[4]; - u_int8_t seq_number[4]; - u_int8_t ts_sent_sec[4]; - u_int8_t ts_sent_usec[4]; - u_int8_t ts_rcvd_sec[4]; - u_int8_t ts_rcvd_usec[4]; + uint8_t version[2]; + uint8_t reserved[2]; + uint8_t msg_type; + uint8_t reply_mode; + uint8_t return_code; + uint8_t return_subcode; + uint8_t sender_handle[4]; + uint8_t seq_number[4]; + uint8_t ts_sent_sec[4]; + uint8_t ts_sent_usec[4]; + uint8_t ts_rcvd_sec[4]; + uint8_t ts_rcvd_usec[4]; }; #define LSPPING_VERSION 1 @@ -119,8 +119,8 @@ static const struct tok lspping_return_code_values[] = { */ struct lspping_tlv_header { - u_int8_t type[2]; - u_int8_t length[2]; + uint8_t type[2]; + uint8_t length[2]; }; #define LSPPING_TLV_TARGET_FEC_STACK 1 @@ -186,8 +186,8 @@ static const struct tok lspping_tlvtargetfec_subtlv_values[] = { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t { - u_int8_t prefix [4]; - u_int8_t prefix_len; + uint8_t prefix [4]; + uint8_t prefix_len; }; /* @@ -203,8 +203,8 @@ struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t { - u_int8_t prefix [16]; - u_int8_t prefix_len; + uint8_t prefix [16]; + uint8_t prefix_len; }; /* @@ -218,9 +218,9 @@ struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t { - u_int8_t sender_id [4]; - u_int8_t prefix [4]; - u_int8_t prefix_len; + uint8_t sender_id [4]; + uint8_t prefix [4]; + uint8_t prefix_len; }; /* @@ -240,9 +240,9 @@ struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t { - u_int8_t sender_id [16]; - u_int8_t prefix [16]; - u_int8_t prefix_len; + uint8_t sender_id [16]; + uint8_t prefix [16]; + uint8_t prefix_len; }; /* @@ -261,13 +261,13 @@ struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t { - u_int8_t tunnel_endpoint [4]; - u_int8_t res[2]; - u_int8_t tunnel_id[2]; - u_int8_t extended_tunnel_id[4]; - u_int8_t tunnel_sender [4]; - u_int8_t res2[2]; - u_int8_t lsp_id [2]; + uint8_t tunnel_endpoint [4]; + uint8_t res[2]; + uint8_t tunnel_id[2]; + uint8_t extended_tunnel_id[4]; + uint8_t tunnel_sender [4]; + uint8_t res2[2]; + uint8_t lsp_id [2]; }; /* @@ -295,13 +295,13 @@ struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t { - u_int8_t tunnel_endpoint [16]; - u_int8_t res[2]; - u_int8_t tunnel_id[2]; - u_int8_t extended_tunnel_id[16]; - u_int8_t tunnel_sender [16]; - u_int8_t res2[2]; - u_int8_t lsp_id [2]; + uint8_t tunnel_endpoint [16]; + uint8_t res[2]; + uint8_t tunnel_id[2]; + uint8_t extended_tunnel_id[16]; + uint8_t tunnel_sender [16]; + uint8_t res2[2]; + uint8_t lsp_id [2]; }; /* @@ -317,9 +317,9 @@ struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t { - u_int8_t rd [8]; - u_int8_t prefix [4]; - u_int8_t prefix_len; + uint8_t rd [8]; + uint8_t prefix [4]; + uint8_t prefix_len; }; /* @@ -338,9 +338,9 @@ struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t { - u_int8_t rd [8]; - u_int8_t prefix [16]; - u_int8_t prefix_len; + uint8_t rd [8]; + uint8_t prefix [16]; + uint8_t prefix_len; }; /* @@ -357,10 +357,10 @@ struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t { * 0 1 2 3 */ struct lspping_tlv_targetfec_subtlv_l2vpn_endpt_t { - u_int8_t rd [8]; - u_int8_t sender_ce_id [2]; - u_int8_t receiver_ce_id [2]; - u_int8_t encapsulation[2]; + uint8_t rd [8]; + uint8_t sender_ce_id [2]; + uint8_t receiver_ce_id [2]; + uint8_t encapsulation[2]; }; /* @@ -374,9 +374,9 @@ struct lspping_tlv_targetfec_subtlv_l2vpn_endpt_t { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_old_t { - u_int8_t remote_pe_address [4]; - u_int8_t vc_id [4]; - u_int8_t encapsulation[2]; + uint8_t remote_pe_address [4]; + uint8_t vc_id [4]; + uint8_t encapsulation[2]; }; /* @@ -392,10 +392,10 @@ struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_old_t { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_t { - u_int8_t sender_pe_address [4]; - u_int8_t remote_pe_address [4]; - u_int8_t vc_id [4]; - u_int8_t encapsulation[2]; + uint8_t sender_pe_address [4]; + uint8_t remote_pe_address [4]; + uint8_t vc_id [4]; + uint8_t encapsulation[2]; }; /* @@ -424,25 +424,25 @@ struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_t { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct lspping_tlv_downstream_map_ipv4_t { - u_int8_t mtu [2]; - u_int8_t address_type; - u_int8_t res; - u_int8_t downstream_ip[4]; - u_int8_t downstream_interface[4]; + uint8_t mtu [2]; + uint8_t address_type; + uint8_t res; + uint8_t downstream_ip[4]; + uint8_t downstream_interface[4]; }; struct lspping_tlv_downstream_map_ipv6_t { - u_int8_t mtu [2]; - u_int8_t address_type; - u_int8_t res; - u_int8_t downstream_ip[16]; - u_int8_t downstream_interface[16]; + uint8_t mtu [2]; + uint8_t address_type; + uint8_t res; + uint8_t downstream_ip[16]; + uint8_t downstream_interface[16]; }; struct lspping_tlv_downstream_map_info_t { - u_int8_t hash_key_type; - u_int8_t depth_limit; - u_int8_t multipath_length [2]; + uint8_t hash_key_type; + uint8_t depth_limit; + uint8_t multipath_length [2]; }; #define LSPPING_AFI_IPV4 1 @@ -844,7 +844,7 @@ lspping_print(netdissect_options *ndo, case LSPPING_TLV_VENDOR_ENTERPRISE: { - u_int32_t vendor_id; + uint32_t vendor_id; if (!ND_TTEST2(*tptr, LSPPING_TLV_VENDOR_ENTERPRISE_LEN)) goto trunc; diff --git a/print-lwapp.c b/print-lwapp.c index ffd67690..84201ddb 100644 --- a/print-lwapp.c +++ b/print-lwapp.c @@ -41,10 +41,10 @@ */ struct lwapp_transport_header { - u_int8_t version; - u_int8_t frag_id; - u_int8_t length[2]; - u_int16_t status; + uint8_t version; + uint8_t frag_id; + uint8_t length[2]; + uint16_t status; }; /* @@ -61,10 +61,10 @@ struct lwapp_transport_header { */ struct lwapp_control_header { - u_int8_t msg_type; - u_int8_t seq_num; - u_int8_t len[2]; - u_int8_t session_id[4]; + uint8_t msg_type; + uint8_t seq_num; + uint8_t len[2]; + uint8_t session_id[4]; }; #define LWAPP_VERSION 0 @@ -156,8 +156,8 @@ static const struct tok lwapp_msg_type_values[] = { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct lwapp_message_header { - u_int8_t type; - u_int8_t length[2]; + uint8_t type; + uint8_t length[2]; }; void diff --git a/print-lwres.c b/print-lwres.c index 59e18649..d78c9a90 100644 --- a/print-lwres.c +++ b/print-lwres.c @@ -44,9 +44,9 @@ #include "extract.h" /* must come after interface.h */ /* BIND9 lib/lwres/include/lwres */ -typedef u_int32_t lwres_uint32_t; -typedef u_int16_t lwres_uint16_t; -typedef u_int8_t lwres_uint8_t; +typedef uint32_t lwres_uint32_t; +typedef uint16_t lwres_uint16_t; +typedef uint8_t lwres_uint8_t; struct lwres_lwpacket { lwres_uint32_t length; @@ -210,7 +210,7 @@ static int lwres_printnamelen(netdissect_options *ndo, const char *p) { - u_int16_t l; + uint16_t l; int advance; if (p + 2 > (const char *)ndo->ndo_snapend) @@ -230,7 +230,7 @@ lwres_printbinlen(netdissect_options *ndo, const char *p0) { const char *p; - u_int16_t l; + uint16_t l; int i; p = p0; @@ -252,7 +252,7 @@ static int lwres_printaddr(netdissect_options *ndo, lwres_addr_t *ap) { - u_int16_t l; + uint16_t l; const char *p; int i; @@ -294,7 +294,7 @@ lwres_print(netdissect_options *ndo, register const u_char *bp, u_int length) { const struct lwres_lwpacket *np; - u_int32_t v; + uint32_t v; const char *s; int response; int advance; @@ -346,7 +346,7 @@ lwres_print(netdissect_options *ndo, lwres_gabnrequest_t *gabn; lwres_gnbarequest_t *gnba; lwres_grbnrequest_t *grbn; - u_int32_t l; + uint32_t l; gabn = NULL; gnba = NULL; @@ -445,8 +445,8 @@ lwres_print(netdissect_options *ndo, lwres_gabnresponse_t *gabn; lwres_gnbaresponse_t *gnba; lwres_grbnresponse_t *grbn; - u_int32_t l, na; - u_int32_t i; + uint32_t l, na; + uint32_t i; gabn = NULL; gnba = NULL; diff --git a/print-m3ua.c b/print-m3ua.c index f3dbfbf5..33f87779 100644 --- a/print-m3ua.c +++ b/print-m3ua.c @@ -40,16 +40,16 @@ static const char cstr[] = " (corrupt)"; #define M3UA_REL_1_0 1 struct m3ua_common_header { - u_int8_t v; - u_int8_t reserved; - u_int8_t msg_class; - u_int8_t msg_type; - u_int32_t len; + uint8_t v; + uint8_t reserved; + uint8_t msg_class; + uint8_t msg_type; + uint32_t len; }; struct m3ua_param_header { - u_int16_t tag; - u_int16_t len; + uint16_t tag; + uint16_t len; }; /* message classes */ @@ -210,7 +210,7 @@ static const struct tok ParamName[] = { static void tag_value_print(netdissect_options *ndo, - const u_char *buf, const u_int16_t tag, const u_int16_t size) + const u_char *buf, const uint16_t tag, const uint16_t size) { switch (tag) { case M3UA_PARAM_NETWORK_APPEARANCE: diff --git a/print-mobile.c b/print-mobile.c index 42f0aa1f..df412eeb 100644 --- a/print-mobile.c +++ b/print-mobile.c @@ -50,10 +50,10 @@ #define MOBILE_SIZE (8) struct mobile_ip { - u_int16_t proto; - u_int16_t hcheck; - u_int32_t odst; - u_int32_t osrc; + uint16_t proto; + uint16_t hcheck; + uint32_t odst; + uint32_t osrc; }; #define OSRC_PRES 0x0080 /* old source is present */ @@ -94,7 +94,7 @@ mobile_print(netdissect_options *ndo, const u_char *bp, u_int length) ND_PRINT((ndo, "> %s ", ipaddr_string(ndo, &mob->odst))); ND_PRINT((ndo, "(oproto=%d)", proto>>8)); } - vec[0].ptr = (const u_int8_t *)(void *)mob; + vec[0].ptr = (const uint8_t *)(void *)mob; vec[0].len = osp ? 12 : 8; if (in_cksum(vec, 1)!=0) { ND_PRINT((ndo, " (bad checksum %d)", crc)); diff --git a/print-mobility.c b/print-mobility.c index 9dfb6eb2..806346c5 100644 --- a/print-mobility.c +++ b/print-mobility.c @@ -42,14 +42,14 @@ /* Mobility header */ struct ip6_mobility { - u_int8_t ip6m_pproto; /* following payload protocol (for PG) */ - u_int8_t ip6m_len; /* length in units of 8 octets */ - u_int8_t ip6m_type; /* message type */ - u_int8_t reserved; /* reserved */ - u_int16_t ip6m_cksum; /* sum of IPv6 pseudo-header and MH */ + uint8_t ip6m_pproto; /* following payload protocol (for PG) */ + uint8_t ip6m_len; /* length in units of 8 octets */ + uint8_t ip6m_type; /* message type */ + uint8_t reserved; /* reserved */ + uint16_t ip6m_cksum; /* sum of IPv6 pseudo-header and MH */ union { - u_int16_t ip6m_un_data16[1]; /* type-specific field */ - u_int8_t ip6m_un_data8[2]; /* type-specific fiedl */ + uint16_t ip6m_un_data16[1]; /* type-specific field */ + uint8_t ip6m_un_data8[2]; /* type-specific fiedl */ } ip6m_dataun; }; @@ -174,7 +174,7 @@ mobility_print(netdissect_options *ndo, const struct ip6_mobility *mh; const u_char *ep; unsigned mhlen, hlen; - u_int8_t type; + uint8_t type; mh = (struct ip6_mobility *)bp; diff --git a/print-mpcp.c b/print-mpcp.c index 85423d1c..175aa758 100644 --- a/print-mpcp.c +++ b/print-mpcp.c @@ -31,8 +31,8 @@ #define MPCP_TIMESTAMP_DURATION_LEN 2 struct mpcp_common_header_t { - u_int8_t opcode[2]; - u_int8_t timestamp[MPCP_TIMESTAMP_LEN]; + uint8_t opcode[2]; + uint8_t timestamp[MPCP_TIMESTAMP_LEN]; }; #define MPCP_OPCODE_PAUSE 0x0001 @@ -64,13 +64,13 @@ static const struct tok mpcp_grant_flag_values[] = { }; struct mpcp_grant_t { - u_int8_t starttime[MPCP_TIMESTAMP_LEN]; - u_int8_t duration[MPCP_TIMESTAMP_DURATION_LEN]; + uint8_t starttime[MPCP_TIMESTAMP_LEN]; + uint8_t duration[MPCP_TIMESTAMP_DURATION_LEN]; }; struct mpcp_reg_req_t { - u_int8_t flags; - u_int8_t pending_grants; + uint8_t flags; + uint8_t pending_grants; }; @@ -81,10 +81,10 @@ static const struct tok mpcp_reg_req_flag_values[] = { }; struct mpcp_reg_t { - u_int8_t assigned_port[2]; - u_int8_t flags; - u_int8_t sync_time[MPCP_TIMESTAMP_DURATION_LEN]; - u_int8_t echoed_pending_grants; + uint8_t assigned_port[2]; + uint8_t flags; + uint8_t sync_time[MPCP_TIMESTAMP_DURATION_LEN]; + uint8_t echoed_pending_grants; }; static const struct tok mpcp_reg_flag_values[] = { @@ -110,9 +110,9 @@ static const struct tok mpcp_report_bitmap_values[] = { }; struct mpcp_reg_ack_t { - u_int8_t flags; - u_int8_t echoed_assigned_port[2]; - u_int8_t echoed_sync_time[MPCP_TIMESTAMP_DURATION_LEN]; + uint8_t flags; + uint8_t echoed_assigned_port[2]; + uint8_t echoed_sync_time[MPCP_TIMESTAMP_DURATION_LEN]; }; static const struct tok mpcp_reg_ack_flag_values[] = { @@ -134,9 +134,9 @@ mpcp_print(netdissect_options *ndo, register const u_char *pptr, register u_int const u_char *tptr; - u_int16_t opcode; - u_int8_t grant_numbers, grant; - u_int8_t queue_sets, queue_set, report_bitmap, report; + uint16_t opcode; + uint8_t grant_numbers, grant; + uint8_t queue_sets, queue_set, report_bitmap, report; tptr=pptr; mpcp.common_header = (const struct mpcp_common_header_t *)pptr; diff --git a/print-mpls.c b/print-mpls.c index bf232ae3..039781ad 100644 --- a/print-mpls.c +++ b/print-mpls.c @@ -59,8 +59,8 @@ void mpls_print(netdissect_options *ndo, const u_char *bp, u_int length) { const u_char *p; - u_int32_t label_entry; - u_int16_t label_stack_depth = 0; + uint32_t label_entry; + uint16_t label_stack_depth = 0; enum mpls_packet_type pt = PT_UNKNOWN; p = bp; diff --git a/print-mptcp.c b/print-mptcp.c index 6d763d57..f85f1d24 100644 --- a/print-mptcp.c +++ b/print-mptcp.c @@ -55,20 +55,20 @@ #define MPTCP_SUB_FCLOSE 0x7 struct mptcp_option { - u_int8_t kind; - u_int8_t len; - u_int8_t sub_etc; /* subtype upper 4 bits, other stuff lower 4 bits */ + uint8_t kind; + uint8_t len; + uint8_t sub_etc; /* subtype upper 4 bits, other stuff lower 4 bits */ }; #define MPTCP_OPT_SUBTYPE(sub_etc) (((sub_etc) >> 4) & 0xF) struct mp_capable { - u_int8_t kind; - u_int8_t len; - u_int8_t sub_ver; - u_int8_t flags; - u_int8_t sender_key[8]; - u_int8_t receiver_key[8]; + uint8_t kind; + uint8_t len; + uint8_t sub_ver; + uint8_t flags; + uint8_t sender_key[8]; + uint8_t receiver_key[8]; }; #define MP_CAPABLE_OPT_VERSION(sub_ver) (((sub_ver) >> 0) & 0xF) @@ -76,21 +76,21 @@ struct mp_capable { #define MP_CAPABLE_S 0x01 struct mp_join { - u_int8_t kind; - u_int8_t len; - u_int8_t sub_b; - u_int8_t addr_id; + uint8_t kind; + uint8_t len; + uint8_t sub_b; + uint8_t addr_id; union { struct { - u_int8_t token[4]; - u_int8_t nonce[4]; + uint8_t token[4]; + uint8_t nonce[4]; } syn; struct { - u_int8_t mac[8]; - u_int8_t nonce[4]; + uint8_t mac[8]; + uint8_t nonce[4]; } synack; struct { - u_int8_t mac[20]; + uint8_t mac[20]; } ack; } u; }; @@ -98,10 +98,10 @@ struct mp_join { #define MP_JOIN_B 0x01 struct mp_dss { - u_int8_t kind; - u_int8_t len; - u_int8_t sub; - u_int8_t flags; + uint8_t kind; + uint8_t len; + uint8_t sub; + uint8_t flags; }; #define MP_DSS_F 0x10 @@ -111,18 +111,18 @@ struct mp_dss { #define MP_DSS_A 0x01 struct mp_add_addr { - u_int8_t kind; - u_int8_t len; - u_int8_t sub_ipver; - u_int8_t addr_id; + uint8_t kind; + uint8_t len; + uint8_t sub_ipver; + uint8_t addr_id; union { struct { - u_int8_t addr[4]; - u_int8_t port[2]; + uint8_t addr[4]; + uint8_t port[2]; } v4; struct { - u_int8_t addr[16]; - u_int8_t port[2]; + uint8_t addr[16]; + uint8_t port[2]; } v6; } u; }; @@ -130,34 +130,34 @@ struct mp_add_addr { #define MP_ADD_ADDR_IPVER(sub_ipver) (((sub_ipver) >> 0) & 0xF) struct mp_remove_addr { - u_int8_t kind; - u_int8_t len; - u_int8_t sub; + uint8_t kind; + uint8_t len; + uint8_t sub; /* list of addr_id */ - u_int8_t addrs_id; + uint8_t addrs_id; }; struct mp_fail { - u_int8_t kind; - u_int8_t len; - u_int8_t sub; - u_int8_t resv; - u_int8_t data_seq[8]; + uint8_t kind; + uint8_t len; + uint8_t sub; + uint8_t resv; + uint8_t data_seq[8]; }; struct mp_close { - u_int8_t kind; - u_int8_t len; - u_int8_t sub; - u_int8_t rsv; - u_int8_t key[8]; + uint8_t kind; + uint8_t len; + uint8_t sub; + uint8_t rsv; + uint8_t key[8]; }; struct mp_prio { - u_int8_t kind; - u_int8_t len; - u_int8_t sub_b; - u_int8_t addr_id; + uint8_t kind; + uint8_t len; + uint8_t sub_b; + uint8_t addr_id; }; #define MP_PRIO_B 0x01 @@ -343,7 +343,7 @@ remove_addr_print(netdissect_options *ndo, const u_char *opt, u_int opt_len, u_char flags _U_) { struct mp_remove_addr *remove_addr = (struct mp_remove_addr *) opt; - u_int8_t *addr_id = &remove_addr->addrs_id; + uint8_t *addr_id = &remove_addr->addrs_id; if (opt_len < 4) return 0; diff --git a/print-msnlb.c b/print-msnlb.c index 7cb0bf90..fcd00064 100644 --- a/print-msnlb.c +++ b/print-msnlb.c @@ -38,11 +38,11 @@ #include "extract.h" struct msnlb_heartbeat_pkt { - u_int32_t unknown1; - u_int32_t unknown2; - u_int32_t host_prio; /* little-endian */ - u_int32_t virtual_ip; - u_int32_t host_ip; + uint32_t unknown1; + uint32_t unknown2; + uint32_t host_prio; /* little-endian */ + uint32_t virtual_ip; + uint32_t host_ip; /* the protocol is undocumented so we ignore the rest */ }; diff --git a/print-nflog.c b/print-nflog.c index bb375c10..b0046be0 100644 --- a/print-nflog.c +++ b/print-nflog.c @@ -69,8 +69,8 @@ nflog_if_print(netdissect_options *ndo, { const nflog_hdr_t *hdr = (const nflog_hdr_t *)p; const nflog_tlv_t *tlv; - u_int16_t size; - u_int16_t h_size = sizeof(nflog_hdr_t); + uint16_t size; + uint16_t h_size = sizeof(nflog_hdr_t); u_int caplen = h->caplen; u_int length = h->len; diff --git a/print-nfs.c b/print-nfs.c index 6848d937..cf3d71eb 100644 --- a/print-nfs.c +++ b/print-nfs.c @@ -45,17 +45,17 @@ static const char tstr[] = " [|nfs]"; -static void nfs_printfh(netdissect_options *, const u_int32_t *, const u_int); +static void nfs_printfh(netdissect_options *, const uint32_t *, const u_int); static int xid_map_enter(netdissect_options *, const struct sunrpc_msg *, const u_char *); static int xid_map_find(const struct sunrpc_msg *, const u_char *, - u_int32_t *, u_int32_t *); -static void interp_reply(netdissect_options *, const struct sunrpc_msg *, u_int32_t, u_int32_t, int); -static const u_int32_t *parse_post_op_attr(netdissect_options *, const u_int32_t *, int); + uint32_t *, uint32_t *); +static void interp_reply(netdissect_options *, const struct sunrpc_msg *, uint32_t, uint32_t, int); +static const uint32_t *parse_post_op_attr(netdissect_options *, const uint32_t *, int); /* * Mapping of old NFS Version 2 RPC numbers to generic numbers. */ -u_int32_t nfsv3_procid[NFS_NPROCS] = { +uint32_t nfsv3_procid[NFS_NPROCS] = { NFSPROC_NULL, NFSPROC_GETATTR, NFSPROC_SETATTR, @@ -239,9 +239,9 @@ print_nfsaddr(netdissect_options *ndo, ND_PRINT((ndo, "%s.%s > %s.%s: ", srcaddr, s, dstaddr, d)); } -static const u_int32_t * +static const uint32_t * parse_sattr3(netdissect_options *ndo, - const u_int32_t *dp, struct nfsv3_sattr *sa3) + const uint32_t *dp, struct nfsv3_sattr *sa3) { ND_TCHECK(dp[0]); sa3->sa_modeset = EXTRACT_32BITS(dp); @@ -365,10 +365,10 @@ nfsreply_print_noaddr(netdissect_options *ndo, register const u_char *bp2) { register const struct sunrpc_msg *rp; - u_int32_t proc, vers, reply_stat; + uint32_t proc, vers, reply_stat; enum sunrpc_reject_stat rstat; - u_int32_t rlow; - u_int32_t rhigh; + uint32_t rlow; + uint32_t rhigh; enum sunrpc_auth_stat rwhy; nfserr = 0; /* assume no error */ @@ -424,17 +424,17 @@ trunc: * Return a pointer to the first file handle in the packet. * If the packet was truncated, return 0. */ -static const u_int32_t * +static const uint32_t * parsereq(netdissect_options *ndo, register const struct sunrpc_msg *rp, register u_int length) { - register const u_int32_t *dp; + register const uint32_t *dp; register u_int len; /* * find the start of the req data (if we captured it) */ - dp = (u_int32_t *)&rp->rm_call.cb_cred; + dp = (uint32_t *)&rp->rm_call.cb_cred; ND_TCHECK(dp[1]); len = EXTRACT_32BITS(&dp[1]); if (len < length) { @@ -455,9 +455,9 @@ trunc: * Print out an NFS file handle and return a pointer to following word. * If packet was truncated, return 0. */ -static const u_int32_t * +static const uint32_t * parsefh(netdissect_options *ndo, - register const u_int32_t *dp, int v3) + register const uint32_t *dp, int v3) { u_int len; @@ -480,11 +480,11 @@ trunc: * Print out a file name and return pointer to 32-bit word past it. * If packet was truncated, return 0. */ -static const u_int32_t * +static const uint32_t * parsefn(netdissect_options *ndo, - register const u_int32_t *dp) + register const uint32_t *dp) { - register u_int32_t len; + register uint32_t len; register const u_char *cp; /* Bail if we don't have the string length */ @@ -516,9 +516,9 @@ trunc: * Return pointer to 32-bit word past file name. * If packet was truncated (or there was some other error), return 0. */ -static const u_int32_t * +static const uint32_t * parsefhn(netdissect_options *ndo, - register const u_int32_t *dp, int v3) + register const uint32_t *dp, int v3) { dp = parsefh(ndo, dp, v3); if (dp == NULL) @@ -533,11 +533,11 @@ nfsreq_print_noaddr(netdissect_options *ndo, register const u_char *bp2) { register const struct sunrpc_msg *rp; - register const u_int32_t *dp; + register const uint32_t *dp; nfs_type type; int v3; - u_int32_t proc; - u_int32_t access_flags; + uint32_t proc; + uint32_t access_flags; struct nfsv3_sattr sa3; ND_PRINT((ndo, "%d", length)); @@ -795,10 +795,10 @@ trunc: */ static void nfs_printfh(netdissect_options *ndo, - register const u_int32_t *dp, const u_int len) + register const uint32_t *dp, const u_int len) { my_fsid fsid; - u_int32_t ino; + uint32_t ino; const char *sfsname = NULL; char *spacep; @@ -849,7 +849,7 @@ nfs_printfh(netdissect_options *ndo, */ struct xid_map_entry { - u_int32_t xid; /* transaction ID (net order) */ + uint32_t xid; /* transaction ID (net order) */ int ipver; /* IP version (4 or 6) */ #ifdef INET6 struct in6_addr client; /* client IP address (net order) */ @@ -858,8 +858,8 @@ struct xid_map_entry { struct in_addr client; /* client IP address (net order) */ struct in_addr server; /* server IP address (net order) */ #endif - u_int32_t proc; /* call proc number (host order) */ - u_int32_t vers; /* program version (host order) */ + uint32_t proc; /* call proc number (host order) */ + uint32_t vers; /* program version (host order) */ }; /* @@ -928,12 +928,12 @@ xid_map_enter(netdissect_options *ndo, * version in vers return, or returns -1 on failure */ static int -xid_map_find(const struct sunrpc_msg *rp, const u_char *bp, u_int32_t *proc, - u_int32_t *vers) +xid_map_find(const struct sunrpc_msg *rp, const u_char *bp, uint32_t *proc, + uint32_t *vers) { int i; struct xid_map_entry *xmep; - u_int32_t xid = rp->rm_xid; + uint32_t xid = rp->rm_xid; struct ip *ip = (struct ip *)bp; #ifdef INET6 struct ip6_hdr *ip6 = (struct ip6_hdr *)bp; @@ -994,11 +994,11 @@ xid_map_find(const struct sunrpc_msg *rp, const u_char *bp, u_int32_t *proc, * Return a pointer to the beginning of the actual results. * If the packet was truncated, return 0. */ -static const u_int32_t * +static const uint32_t * parserep(netdissect_options *ndo, register const struct sunrpc_msg *rp, register u_int length) { - register const u_int32_t *dp; + register const uint32_t *dp; u_int len; enum sunrpc_accept_stat astat; @@ -1006,7 +1006,7 @@ parserep(netdissect_options *ndo, * Portability note: * Here we find the address of the ar_verf credentials. * Originally, this calculation was - * dp = (u_int32_t *)&rp->rm_reply.rp_acpt.ar_verf + * dp = (uint32_t *)&rp->rm_reply.rp_acpt.ar_verf * On the wire, the rp_acpt field starts immediately after * the (32 bit) rp_stat field. However, rp_acpt (which is a * "struct accepted_reply") contains a "struct opaque_auth", @@ -1017,7 +1017,7 @@ parserep(netdissect_options *ndo, * representation. Instead, we skip past the rp_stat field, * which is an "enum" and so occupies one 32-bit word. */ - dp = ((const u_int32_t *)&rp->rm_reply) + 1; + dp = ((const uint32_t *)&rp->rm_reply) + 1; ND_TCHECK(dp[1]); len = EXTRACT_32BITS(&dp[1]); if (len >= length) @@ -1025,7 +1025,7 @@ parserep(netdissect_options *ndo, /* * skip past the ar_verf credentials. */ - dp += (len + (2*sizeof(u_int32_t) + 3)) / sizeof(u_int32_t); + dp += (len + (2*sizeof(uint32_t) + 3)) / sizeof(uint32_t); ND_TCHECK2(dp[0], 0); /* @@ -1039,14 +1039,14 @@ parserep(netdissect_options *ndo, } /* successful return */ ND_TCHECK2(*dp, sizeof(astat)); - return ((u_int32_t *) (sizeof(astat) + ((char *)dp))); + return ((uint32_t *) (sizeof(astat) + ((char *)dp))); trunc: return (0); } -static const u_int32_t * +static const uint32_t * parsestatus(netdissect_options *ndo, - const u_int32_t *dp, int *er) + const uint32_t *dp, int *er) { int errnum; @@ -1066,9 +1066,9 @@ trunc: return NULL; } -static const u_int32_t * +static const uint32_t * parsefattr(netdissect_options *ndo, - const u_int32_t *dp, int verbose, int v3) + const uint32_t *dp, int verbose, int v3) { const struct nfs_fattr *fap; @@ -1084,7 +1084,7 @@ parsefattr(netdissect_options *ndo, if (v3) { ND_TCHECK(fap->fa3_size); ND_PRINT((ndo, " sz %" PRIu64, - EXTRACT_64BITS((u_int32_t *)&fap->fa3_size))); + EXTRACT_64BITS((uint32_t *)&fap->fa3_size))); } else { ND_TCHECK(fap->fa2_size); ND_PRINT((ndo, " sz %d", EXTRACT_32BITS(&fap->fa2_size))); @@ -1099,9 +1099,9 @@ parsefattr(netdissect_options *ndo, EXTRACT_32BITS(&fap->fa3_rdev.specdata1), EXTRACT_32BITS(&fap->fa3_rdev.specdata2))); ND_PRINT((ndo, " fsid %" PRIx64, - EXTRACT_64BITS((u_int32_t *)&fap->fa3_fsid))); + EXTRACT_64BITS((uint32_t *)&fap->fa3_fsid))); ND_PRINT((ndo, " fileid %" PRIx64, - EXTRACT_64BITS((u_int32_t *)&fap->fa3_fileid))); + EXTRACT_64BITS((uint32_t *)&fap->fa3_fileid))); ND_PRINT((ndo, " a/m/ctime %u.%06u", EXTRACT_32BITS(&fap->fa3_atime.nfsv3_sec), EXTRACT_32BITS(&fap->fa3_atime.nfsv3_nsec))); @@ -1129,7 +1129,7 @@ parsefattr(netdissect_options *ndo, EXTRACT_32BITS(&fap->fa2_ctime.nfsv2_usec))); } } - return ((const u_int32_t *)((unsigned char *)dp + + return ((const uint32_t *)((unsigned char *)dp + (v3 ? NFSX_V3FATTR : NFSX_V2FATTR))); trunc: return (NULL); @@ -1137,7 +1137,7 @@ trunc: static int parseattrstat(netdissect_options *ndo, - const u_int32_t *dp, int verbose, int v3) + const uint32_t *dp, int verbose, int v3) { int er; @@ -1152,7 +1152,7 @@ parseattrstat(netdissect_options *ndo, static int parsediropres(netdissect_options *ndo, - const u_int32_t *dp) + const uint32_t *dp) { int er; @@ -1170,7 +1170,7 @@ parsediropres(netdissect_options *ndo, static int parselinkres(netdissect_options *ndo, - const u_int32_t *dp, int v3) + const uint32_t *dp, int v3) { int er; @@ -1187,7 +1187,7 @@ parselinkres(netdissect_options *ndo, static int parsestatfs(netdissect_options *ndo, - const u_int32_t *dp, int v3) + const uint32_t *dp, int v3) { const struct nfs_statfs *sfsp; int er; @@ -1214,14 +1214,14 @@ parsestatfs(netdissect_options *ndo, if (v3) { ND_PRINT((ndo, " tbytes %" PRIu64 " fbytes %" PRIu64 " abytes %" PRIu64, - EXTRACT_64BITS((u_int32_t *)&sfsp->sf_tbytes), - EXTRACT_64BITS((u_int32_t *)&sfsp->sf_fbytes), - EXTRACT_64BITS((u_int32_t *)&sfsp->sf_abytes))); + EXTRACT_64BITS((uint32_t *)&sfsp->sf_tbytes), + EXTRACT_64BITS((uint32_t *)&sfsp->sf_fbytes), + EXTRACT_64BITS((uint32_t *)&sfsp->sf_abytes))); if (ndo->ndo_vflag) { ND_PRINT((ndo, " tfiles %" PRIu64 " ffiles %" PRIu64 " afiles %" PRIu64 " invar %u", - EXTRACT_64BITS((u_int32_t *)&sfsp->sf_tfiles), - EXTRACT_64BITS((u_int32_t *)&sfsp->sf_ffiles), - EXTRACT_64BITS((u_int32_t *)&sfsp->sf_afiles), + EXTRACT_64BITS((uint32_t *)&sfsp->sf_tfiles), + EXTRACT_64BITS((uint32_t *)&sfsp->sf_ffiles), + EXTRACT_64BITS((uint32_t *)&sfsp->sf_afiles), EXTRACT_32BITS(&sfsp->sf_invarsec))); } } else { @@ -1240,7 +1240,7 @@ trunc: static int parserddires(netdissect_options *ndo, - const u_int32_t *dp) + const uint32_t *dp) { int er; @@ -1263,9 +1263,9 @@ trunc: return (0); } -static const u_int32_t * +static const uint32_t * parse_wcc_attr(netdissect_options *ndo, - const u_int32_t *dp) + const uint32_t *dp) { ND_PRINT((ndo, " sz %" PRIu64, EXTRACT_64BITS(&dp[0]))); ND_PRINT((ndo, " mtime %u.%06u ctime %u.%06u", @@ -1277,9 +1277,9 @@ parse_wcc_attr(netdissect_options *ndo, /* * Pre operation attributes. Print only if vflag > 1. */ -static const u_int32_t * +static const uint32_t * parse_pre_op_attr(netdissect_options *ndo, - const u_int32_t *dp, int verbose) + const uint32_t *dp, int verbose) { ND_TCHECK(dp[0]); if (!EXTRACT_32BITS(&dp[0])) @@ -1299,9 +1299,9 @@ trunc: /* * Post operation attributes are printed if vflag >= 1 */ -static const u_int32_t * +static const uint32_t * parse_post_op_attr(netdissect_options *ndo, - const u_int32_t *dp, int verbose) + const uint32_t *dp, int verbose) { ND_TCHECK(dp[0]); if (!EXTRACT_32BITS(&dp[0])) @@ -1310,14 +1310,14 @@ parse_post_op_attr(netdissect_options *ndo, if (verbose) { return parsefattr(ndo, dp, verbose, 1); } else - return (dp + (NFSX_V3FATTR / sizeof (u_int32_t))); + return (dp + (NFSX_V3FATTR / sizeof (uint32_t))); trunc: return (NULL); } -static const u_int32_t * +static const uint32_t * parse_wcc_data(netdissect_options *ndo, - const u_int32_t *dp, int verbose) + const uint32_t *dp, int verbose) { if (verbose > 1) ND_PRINT((ndo, " PRE:")); @@ -1329,9 +1329,9 @@ parse_wcc_data(netdissect_options *ndo, return parse_post_op_attr(ndo, dp, verbose); } -static const u_int32_t * +static const uint32_t * parsecreateopres(netdissect_options *ndo, - const u_int32_t *dp, int verbose) + const uint32_t *dp, int verbose) { int er; @@ -1362,7 +1362,7 @@ trunc: static int parsewccres(netdissect_options *ndo, - const u_int32_t *dp, int verbose) + const uint32_t *dp, int verbose) { int er; @@ -1371,9 +1371,9 @@ parsewccres(netdissect_options *ndo, return parse_wcc_data(ndo, dp, verbose) != 0; } -static const u_int32_t * +static const uint32_t * parsev3rddirres(netdissect_options *ndo, - const u_int32_t *dp, int verbose) + const uint32_t *dp, int verbose) { int er; @@ -1397,7 +1397,7 @@ trunc: static int parsefsinfo(netdissect_options *ndo, - const u_int32_t *dp) + const uint32_t *dp) { struct nfsv3_fsinfo *sfp; int er; @@ -1423,7 +1423,7 @@ parsefsinfo(netdissect_options *ndo, ND_PRINT((ndo, " rtmult %u wtmult %u maxfsz %" PRIu64, EXTRACT_32BITS(&sfp->fs_rtmult), EXTRACT_32BITS(&sfp->fs_wtmult), - EXTRACT_64BITS((u_int32_t *)&sfp->fs_maxfilesize))); + EXTRACT_64BITS((uint32_t *)&sfp->fs_maxfilesize))); ND_PRINT((ndo, " delta %u.%06u ", EXTRACT_32BITS(&sfp->fs_timedelta.nfsv3_sec), EXTRACT_32BITS(&sfp->fs_timedelta.nfsv3_nsec))); @@ -1435,7 +1435,7 @@ trunc: static int parsepathconf(netdissect_options *ndo, - const u_int32_t *dp) + const uint32_t *dp) { int er; struct nfsv3_pathconf *spp; @@ -1466,9 +1466,9 @@ trunc: static void interp_reply(netdissect_options *ndo, - const struct sunrpc_msg *rp, u_int32_t proc, u_int32_t vers, int length) + const struct sunrpc_msg *rp, uint32_t proc, uint32_t vers, int length) { - register const u_int32_t *dp; + register const uint32_t *dp; register int v3; int er; diff --git a/print-ntp.c b/print-ntp.c index d2f51460..e83d47a7 100644 --- a/print-ntp.c +++ b/print-ntp.c @@ -66,13 +66,13 @@ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct l_fixedpt { - u_int32_t int_part; - u_int32_t fraction; + uint32_t int_part; + uint32_t fraction; }; struct s_fixedpt { - u_int16_t int_part; - u_int16_t fraction; + uint16_t int_part; + uint16_t fraction; }; /* rfc2030 @@ -120,13 +120,13 @@ struct ntpdata { int precision:8; struct s_fixedpt root_delay; struct s_fixedpt root_dispersion; - u_int32_t refid; + uint32_t refid; struct l_fixedpt ref_timestamp; struct l_fixedpt org_timestamp; struct l_fixedpt rec_timestamp; struct l_fixedpt xmt_timestamp; - u_int32_t key_id; - u_int8_t message_digest[16]; + uint32_t key_id; + uint8_t message_digest[16]; }; /* * Leap Second Codes (high order two bits) @@ -343,8 +343,8 @@ p_ntp_time(netdissect_options *ndo, register const struct l_fixedpt *lfp) { register int32_t i; - register u_int32_t uf; - register u_int32_t f; + register uint32_t uf; + register uint32_t f; register float ff; i = EXTRACT_32BITS(&lfp->int_part); @@ -379,9 +379,9 @@ p_ntp_delta(netdissect_options *ndo, register const struct l_fixedpt *lfp) { register int32_t i; - register u_int32_t u, uf; - register u_int32_t ou, ouf; - register u_int32_t f; + register uint32_t u, uf; + register uint32_t ou, ouf; + register uint32_t f; register float ff; int signbit; diff --git a/print-olsr.c b/print-olsr.c index f1b90032..fb5f699e 100644 --- a/print-olsr.c +++ b/print-olsr.c @@ -62,8 +62,8 @@ */ struct olsr_common { - u_int8_t packet_len[2]; - u_int8_t packet_seq[2]; + uint8_t packet_len[2]; + uint8_t packet_seq[2]; }; #define OLSR_HELLO_MSG 1 /* rfc3626 */ @@ -88,50 +88,50 @@ static const struct tok olsr_msg_values[] = { }; struct olsr_msg4 { - u_int8_t msg_type; - u_int8_t vtime; - u_int8_t msg_len[2]; - u_int8_t originator[4]; - u_int8_t ttl; - u_int8_t hopcount; - u_int8_t msg_seq[2]; + uint8_t msg_type; + uint8_t vtime; + uint8_t msg_len[2]; + uint8_t originator[4]; + uint8_t ttl; + uint8_t hopcount; + uint8_t msg_seq[2]; }; struct olsr_msg6 { - u_int8_t msg_type; - u_int8_t vtime; - u_int8_t msg_len[2]; - u_int8_t originator[16]; - u_int8_t ttl; - u_int8_t hopcount; - u_int8_t msg_seq[2]; + uint8_t msg_type; + uint8_t vtime; + uint8_t msg_len[2]; + uint8_t originator[16]; + uint8_t ttl; + uint8_t hopcount; + uint8_t msg_seq[2]; }; struct olsr_hello { - u_int8_t res[2]; - u_int8_t htime; - u_int8_t will; + uint8_t res[2]; + uint8_t htime; + uint8_t will; }; struct olsr_hello_link { - u_int8_t link_code; - u_int8_t res; - u_int8_t len[2]; + uint8_t link_code; + uint8_t res; + uint8_t len[2]; }; struct olsr_tc { - u_int8_t ans_seq[2]; - u_int8_t res[2]; + uint8_t ans_seq[2]; + uint8_t res[2]; }; struct olsr_hna4 { - u_int8_t network[4]; - u_int8_t mask[4]; + uint8_t network[4]; + uint8_t mask[4]; }; struct olsr_hna6 { - u_int8_t network[16]; - u_int8_t mask[16]; + uint8_t network[16]; + uint8_t mask[16]; }; @@ -154,17 +154,17 @@ static const struct tok olsr_neighbor_type_values[] = { }; struct olsr_lq_neighbor4 { - u_int8_t neighbor[4]; - u_int8_t link_quality; - u_int8_t neighbor_link_quality; - u_int8_t res[2]; + uint8_t neighbor[4]; + uint8_t link_quality; + uint8_t neighbor_link_quality; + uint8_t res[2]; }; struct olsr_lq_neighbor6 { - u_int8_t neighbor[16]; - u_int8_t link_quality; - u_int8_t neighbor_link_quality; - u_int8_t res[2]; + uint8_t neighbor[16]; + uint8_t link_quality; + uint8_t neighbor_link_quality; + uint8_t res[2]; }; /* @@ -262,9 +262,9 @@ olsr_print(netdissect_options *ndo, } ptr; u_int msg_type, msg_len, msg_tlen, hello_len; - u_int16_t name_entry_type, name_entry_len; + uint16_t name_entry_type, name_entry_len; u_int name_entry_padding; - u_int8_t link_type, neighbor_type; + uint8_t link_type, neighbor_type; const u_char *tptr, *msg_data; tptr = pptr; diff --git a/print-ospf.c b/print-ospf.c index e8bd31b9..b64438fa 100644 --- a/print-ospf.c +++ b/print-ospf.c @@ -181,7 +181,7 @@ static const struct tok ospf_lls_eo_options[] = { int ospf_print_grace_lsa(netdissect_options *ndo, - const u_int8_t *tptr, u_int ls_length) { + const uint8_t *tptr, u_int ls_length) { u_int tlv_type, tlv_length; @@ -264,13 +264,13 @@ trunc: int ospf_print_te_lsa(netdissect_options *ndo, - const u_int8_t *tptr, u_int ls_length) { + const uint8_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; - u_int32_t i; + uint32_t i; } bw; while (ls_length != 0) { @@ -545,25 +545,25 @@ ospf_print_tos_metrics(netdissect_options *ndo, * field is less than the length of the LSA header, return NULl, else * return pointer to data past end of LSA. */ -static const u_int8_t * +static const uint8_t * ospf_print_lsa(netdissect_options *ndo, register const struct lsa *lsap) { - register const u_int8_t *ls_end; + register const uint8_t *ls_end; register const struct rlalink *rlp; register const struct in_addr *ap; register const struct aslametric *almp; register const struct mcla *mcp; - register const u_int32_t *lp; + register const uint32_t *lp; register int j, tlv_type, tlv_length, topology; register int ls_length; - const u_int8_t *tptr; + const uint8_t *tptr; - tptr = (u_int8_t *)lsap->lsa_un.un_unknown; /* squelch compiler warnings */ + tptr = (uint8_t *)lsap->lsa_un.un_unknown; /* squelch compiler warnings */ ls_length = ospf_print_lshdr(ndo, &lsap->ls_hdr); if (ls_length == -1) return(NULL); - ls_end = (u_int8_t *)lsap + ls_length; + ls_end = (uint8_t *)lsap + ls_length; ls_length -= sizeof(struct lsa_hdr); switch (lsap->ls_hdr.ls_type) { @@ -637,7 +637,7 @@ ospf_print_lsa(netdissect_options *ndo, ND_TCHECK(lsap->lsa_un.un_sla.sla_tosmetric); lp = lsap->lsa_un.un_sla.sla_tosmetric; while ((u_char *)lp < ls_end) { - register u_int32_t ul; + register uint32_t ul; ND_TCHECK(*lp); ul = EXTRACT_32BITS(lp); @@ -654,7 +654,7 @@ ospf_print_lsa(netdissect_options *ndo, ND_TCHECK(lsap->lsa_un.un_sla.sla_tosmetric); lp = lsap->lsa_un.un_sla.sla_tosmetric; while ((u_char *)lp < ls_end) { - register u_int32_t ul; + register uint32_t ul; ND_TCHECK(*lp); ul = EXTRACT_32BITS(lp); @@ -676,7 +676,7 @@ ospf_print_lsa(netdissect_options *ndo, ND_TCHECK(lsap->lsa_un.un_sla.sla_tosmetric); almp = lsap->lsa_un.un_asla.asla_metric; while ((u_char *)almp < ls_end) { - register u_int32_t ul; + register uint32_t ul; ND_TCHECK(almp->asla_tosmetric); ul = EXTRACT_32BITS(&almp->asla_tosmetric); @@ -734,7 +734,7 @@ ospf_print_lsa(netdissect_options *ndo, switch (*(&lsap->ls_hdr.un_lsa_id.opaque_field.opaque_type)) { case LS_OPAQUE_TYPE_RI: - tptr = (u_int8_t *)(&lsap->lsa_un.un_ri_tlv.type); + tptr = (uint8_t *)(&lsap->lsa_un.un_ri_tlv.type); while (ls_length != 0) { ND_TCHECK2(*tptr, 4); @@ -782,14 +782,14 @@ ospf_print_lsa(netdissect_options *ndo, break; case LS_OPAQUE_TYPE_GRACE: - if (ospf_print_grace_lsa(ndo, (u_int8_t *)(&lsap->lsa_un.un_grace_tlv.type), + if (ospf_print_grace_lsa(ndo, (uint8_t *)(&lsap->lsa_un.un_grace_tlv.type), ls_length) == -1) { return(ls_end); } break; case LS_OPAQUE_TYPE_TE: - if (ospf_print_te_lsa(ndo, (u_int8_t *)(&lsap->lsa_un.un_te_lsa_tlv.type), + if (ospf_print_te_lsa(ndo, (uint8_t *)(&lsap->lsa_un.un_te_lsa_tlv.type), ls_length) == -1) { return(ls_end); } @@ -797,7 +797,7 @@ ospf_print_lsa(netdissect_options *ndo, default: if (ndo->ndo_vflag <= 1) { - if (!print_unknown_data(ndo, (u_int8_t *)lsap->lsa_un.un_unknown, + if (!print_unknown_data(ndo, (uint8_t *)lsap->lsa_un.un_unknown, "\n\t ", ls_length)) return(ls_end); } @@ -807,7 +807,7 @@ ospf_print_lsa(netdissect_options *ndo, /* do we want to see an additionally hexdump ? */ if (ndo->ndo_vflag> 1) - if (!print_unknown_data(ndo, (u_int8_t *)lsap->lsa_un.un_unknown, + if (!print_unknown_data(ndo, (uint8_t *)lsap->lsa_un.un_unknown, "\n\t ", ls_length)) { return(ls_end); } @@ -824,8 +824,8 @@ ospf_decode_lls(netdissect_options *ndo, register const u_char *dptr; register const u_char *dataend; register u_int length2; - register u_int16_t lls_type, lls_len; - register u_int32_t lls_flags; + register uint16_t lls_type, lls_len; + register uint32_t lls_flags; switch (op->ospf_type) { @@ -917,7 +917,7 @@ ospf_decode_v2(netdissect_options *ndo, register const struct lsr *lsrp; register const struct lsa_hdr *lshp; register const struct lsa *lsap; - register u_int32_t lsa_count,lsa_count_max; + register uint32_t lsa_count,lsa_count_max; switch (op->ospf_type) { diff --git a/print-ospf6.c b/print-ospf6.c index fcc910bd..b85cfaa0 100644 --- a/print-ospf6.c +++ b/print-ospf6.c @@ -117,27 +117,27 @@ #define OSPF6_AT_HDRLEN 16U #define OSPF6_AUTH_TYPE_HMAC 0x0001 -typedef u_int32_t rtrid_t; +typedef uint32_t rtrid_t; /* link state advertisement header */ struct lsa6_hdr { - u_int16_t ls_age; - u_int16_t ls_type; + uint16_t ls_age; + uint16_t ls_type; rtrid_t ls_stateid; rtrid_t ls_router; - u_int32_t ls_seq; - u_int16_t ls_chksum; - u_int16_t ls_length; + uint32_t ls_seq; + uint16_t ls_chksum; + uint16_t ls_length; }; /* Length of an IPv6 address, in bytes. */ #define IPV6_ADDR_LEN_BYTES (128/8) struct lsa6_prefix { - u_int8_t lsa_p_len; - u_int8_t lsa_p_opt; - u_int16_t lsa_p_metric; - u_int8_t lsa_p_prefix[IPV6_ADDR_LEN_BYTES]; /* maximum length */ + uint8_t lsa_p_len; + uint8_t lsa_p_opt; + uint16_t lsa_p_metric; + uint8_t lsa_p_prefix[IPV6_ADDR_LEN_BYTES]; /* maximum length */ }; /* link state advertisement */ @@ -149,36 +149,36 @@ struct lsa6 { /* Router links advertisements */ struct { union { - u_int8_t flg; - u_int32_t opt; + uint8_t flg; + uint32_t opt; } rla_flgandopt; #define rla_flags rla_flgandopt.flg #define rla_options rla_flgandopt.opt struct rlalink6 { - u_int8_t link_type; - u_int8_t link_zero[1]; - u_int16_t link_metric; - u_int32_t link_ifid; - u_int32_t link_nifid; + uint8_t link_type; + uint8_t link_zero[1]; + uint16_t link_metric; + uint32_t link_ifid; + uint32_t link_nifid; rtrid_t link_nrtid; } rla_link[1]; /* may repeat */ } un_rla; /* Network links advertisements */ struct { - u_int32_t nla_options; + uint32_t nla_options; rtrid_t nla_router[1]; /* may repeat */ } un_nla; /* Inter Area Prefix LSA */ struct { - u_int32_t inter_ap_metric; + uint32_t inter_ap_metric; struct lsa6_prefix inter_ap_prefix[1]; } un_inter_ap; /* AS external links advertisements */ struct { - u_int32_t asla_metric; + uint32_t asla_metric; struct lsa6_prefix asla_prefix[1]; /* some optional fields follow */ } un_asla; @@ -187,12 +187,12 @@ struct lsa6 { /* Summary links advertisements */ struct { struct in_addr sla_mask; - u_int32_t sla_tosmetric[1]; /* may repeat */ + uint32_t sla_tosmetric[1]; /* may repeat */ } un_sla; /* Multicast group membership */ struct mcla { - u_int32_t mcla_vtype; + uint32_t mcla_vtype; struct in_addr mcla_vid; } un_mcla[1]; #endif @@ -202,20 +202,20 @@ struct lsa6 { /* Link LSA */ struct llsa { union { - u_int8_t pri; - u_int32_t opt; + uint8_t pri; + uint32_t opt; } llsa_priandopt; #define llsa_priority llsa_priandopt.pri #define llsa_options llsa_priandopt.opt struct in6_addr llsa_lladdr; - u_int32_t llsa_nprefix; + uint32_t llsa_nprefix; struct lsa6_prefix llsa_prefix[1]; } un_llsa; /* Intra-Area-Prefix */ struct { - u_int16_t intra_ap_nprefix; - u_int16_t intra_ap_lstype; + uint16_t intra_ap_nprefix; + uint16_t intra_ap_lstype; rtrid_t intra_ap_lsid; rtrid_t intra_ap_rtid; struct lsa6_prefix intra_ap_prefix[1]; @@ -227,27 +227,27 @@ struct lsa6 { * the main header */ struct ospf6hdr { - u_int8_t ospf6_version; - u_int8_t ospf6_type; - u_int16_t ospf6_len; + uint8_t ospf6_version; + uint8_t ospf6_type; + uint16_t ospf6_len; rtrid_t ospf6_routerid; rtrid_t ospf6_areaid; - u_int16_t ospf6_chksum; - u_int8_t ospf6_instanceid; - u_int8_t ospf6_rsvd; + uint16_t ospf6_chksum; + uint8_t ospf6_instanceid; + uint8_t ospf6_rsvd; union { /* Hello packet */ struct { - u_int32_t hello_ifid; + uint32_t hello_ifid; union { - u_int8_t pri; - u_int32_t opt; + uint8_t pri; + uint32_t opt; } hello_priandopt; #define hello_priority hello_priandopt.pri #define hello_options hello_priandopt.opt - u_int16_t hello_helloint; - u_int16_t hello_deadint; + uint16_t hello_helloint; + uint16_t hello_deadint; rtrid_t hello_dr; rtrid_t hello_bdr; rtrid_t hello_neighbor[1]; /* may repeat */ @@ -255,25 +255,25 @@ struct ospf6hdr { /* Database Description packet */ struct { - u_int32_t db_options; - u_int16_t db_mtu; - u_int8_t db_mbz; - u_int8_t db_flags; - u_int32_t db_seq; + uint32_t db_options; + uint16_t db_mtu; + uint8_t db_mbz; + uint8_t db_flags; + uint32_t db_seq; struct lsa6_hdr db_lshdr[1]; /* may repeat */ } un_db; /* Link State Request */ struct lsr6 { - u_int16_t ls_mbz; - u_int16_t ls_type; + uint16_t ls_mbz; + uint16_t ls_type; rtrid_t ls_stateid; rtrid_t ls_router; } un_lsr[1]; /* may repeat */ /* Link State Update */ struct { - u_int32_t lsu_count; + uint32_t lsu_count; struct lsa6 lsu_lsa[1]; /* may repeat */ } un_lsu; @@ -413,7 +413,7 @@ trunc: static int ospf6_print_lsaprefix(netdissect_options *ndo, - const u_int8_t *tptr, u_int lsa_length) + const uint8_t *tptr, u_int lsa_length) { const struct lsa6_prefix *lsapp = (struct lsa6_prefix *)tptr; u_int wordlen; @@ -468,13 +468,13 @@ ospf6_print_lsa(netdissect_options *ndo, register const struct llsa *llsap; register const struct lsa6_prefix *lsapp; #if 0 - register const u_int32_t *lp; + register const uint32_t *lp; #endif register u_int prefixes; register int bytelen; register u_int length, lsa_length; - u_int32_t flags32; - const u_int8_t *tptr; + uint32_t flags32; + const uint8_t *tptr; if (ospf6_print_lshdr(ndo, &lsap->ls_hdr, dataend)) return (1); @@ -490,7 +490,7 @@ ospf6_print_lsa(netdissect_options *ndo, if (length < sizeof(struct lsa6_hdr) || (u_char *)lsap + length > dataend) return (1); lsa_length = length - sizeof(struct lsa6_hdr); - tptr = (u_int8_t *)lsap+sizeof(struct lsa6_hdr); + tptr = (uint8_t *)lsap+sizeof(struct lsa6_hdr); switch (EXTRACT_16BITS(&lsap->ls_hdr.ls_type)) { case LS_TYPE_ROUTER | LS_SCOPE_AREA: @@ -576,7 +576,7 @@ ospf6_print_lsa(netdissect_options *ndo, ND_PRINT((ndo, ", metric %u", EXTRACT_32BITS(&lsap->lsa_un.un_inter_ap.inter_ap_metric) & SLA_MASK_METRIC)); - tptr = (u_int8_t *)lsap->lsa_un.un_inter_ap.inter_ap_prefix; + tptr = (uint8_t *)lsap->lsa_un.un_inter_ap.inter_ap_prefix; while (lsa_length != 0) { bytelen = ospf6_print_lsaprefix(ndo, tptr, lsa_length); if (bytelen < 0) @@ -598,7 +598,7 @@ ospf6_print_lsa(netdissect_options *ndo, EXTRACT_32BITS(&lsap->lsa_un.un_asla.asla_metric) & ASLA_MASK_METRIC)); - tptr = (u_int8_t *)lsap->lsa_un.un_asla.asla_prefix; + tptr = (uint8_t *)lsap->lsa_un.un_asla.asla_prefix; lsapp = (struct lsa6_prefix *)tptr; bytelen = ospf6_print_lsaprefix(ndo, tptr, lsa_length); if (bytelen < 0) @@ -620,23 +620,23 @@ ospf6_print_lsa(netdissect_options *ndo, } if ((flags32 & ASLA_FLAG_ROUTETAG) != 0) { - if (lsa_length < sizeof (u_int32_t)) + if (lsa_length < sizeof (uint32_t)) return (1); - lsa_length -= sizeof (u_int32_t); - ND_TCHECK(*(u_int32_t *)tptr); + lsa_length -= sizeof (uint32_t); + ND_TCHECK(*(uint32_t *)tptr); ND_PRINT((ndo, " tag %s", - ipaddr_string(ndo, (u_int32_t *)tptr))); - tptr += sizeof(u_int32_t); + ipaddr_string(ndo, (uint32_t *)tptr))); + tptr += sizeof(uint32_t); } if (lsapp->lsa_p_metric) { - if (lsa_length < sizeof (u_int32_t)) + if (lsa_length < sizeof (uint32_t)) return (1); - lsa_length -= sizeof (u_int32_t); - ND_TCHECK(*(u_int32_t *)tptr); + lsa_length -= sizeof (uint32_t); + ND_TCHECK(*(uint32_t *)tptr); ND_PRINT((ndo, " RefLSID: %s", - ipaddr_string(ndo, (u_int32_t *)tptr))); - tptr += sizeof(u_int32_t); + ipaddr_string(ndo, (uint32_t *)tptr))); + tptr += sizeof(uint32_t); } break; @@ -660,7 +660,7 @@ ospf6_print_lsa(netdissect_options *ndo, ip6addr_string(ndo, &llsap->llsa_lladdr), prefixes)); - tptr = (u_int8_t *)llsap->llsa_prefix; + tptr = (uint8_t *)llsap->llsa_prefix; while (prefixes > 0) { bytelen = ospf6_print_lsaprefix(ndo, tptr, lsa_length); if (bytelen < 0) @@ -688,7 +688,7 @@ ospf6_print_lsa(netdissect_options *ndo, prefixes = EXTRACT_16BITS(&lsap->lsa_un.un_intra_ap.intra_ap_nprefix); ND_PRINT((ndo, "\n\t Prefixes %d:", prefixes)); - tptr = (u_int8_t *)lsap->lsa_un.un_intra_ap.intra_ap_prefix; + tptr = (uint8_t *)lsap->lsa_un.un_intra_ap.intra_ap_prefix; while (prefixes > 0) { bytelen = ospf6_print_lsaprefix(ndo, tptr, lsa_length); if (bytelen < 0) diff --git a/print-otv.c b/print-otv.c index 6daec446..53a79dea 100644 --- a/print-otv.c +++ b/print-otv.c @@ -38,9 +38,9 @@ void otv_print(netdissect_options *ndo, const u_char *bp, u_int len) { - u_int8_t flags; - u_int32_t overlay_id; - u_int32_t instance_id; + uint8_t flags; + uint32_t overlay_id; + uint32_t instance_id; if (len < 8) { ND_PRINT((ndo, "[|OTV]")); diff --git a/print-pflog.c b/print-pflog.c index a2fba179..4263a469 100644 --- a/print-pflog.c +++ b/print-pflog.c @@ -87,11 +87,11 @@ static const struct tok pf_directions[] = { static void pflog_print(netdissect_options *ndo, const struct pfloghdr *hdr) { - u_int32_t rulenr, subrulenr; + uint32_t rulenr, subrulenr; rulenr = EXTRACT_32BITS(&hdr->rulenr); subrulenr = EXTRACT_32BITS(&hdr->subrulenr); - if (subrulenr == (u_int32_t)-1) + if (subrulenr == (uint32_t)-1) ND_PRINT((ndo, "rule %u/", rulenr)); else ND_PRINT((ndo, "rule %u.%s.%u/", rulenr, hdr->ruleset, subrulenr)); @@ -111,10 +111,10 @@ pflog_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, u_int hdrlen; u_int caplen = h->caplen; const struct pfloghdr *hdr; - u_int8_t af; + uint8_t af; /* check length */ - if (caplen < sizeof(u_int8_t)) { + if (caplen < sizeof(uint8_t)) { ND_PRINT((ndo, "%s", tstr)); return (caplen); } diff --git a/print-pgm.c b/print-pgm.c index d4c3b610..6a834253 100644 --- a/print-pgm.c +++ b/print-pgm.c @@ -35,62 +35,62 @@ * PGM header (RFC 3208) */ struct pgm_header { - u_int16_t pgm_sport; - u_int16_t pgm_dport; - u_int8_t pgm_type; - u_int8_t pgm_options; - u_int16_t pgm_sum; - u_int8_t pgm_gsid[6]; - u_int16_t pgm_length; + uint16_t pgm_sport; + uint16_t pgm_dport; + uint8_t pgm_type; + uint8_t pgm_options; + uint16_t pgm_sum; + uint8_t pgm_gsid[6]; + uint16_t pgm_length; }; struct pgm_spm { - u_int32_t pgms_seq; - u_int32_t pgms_trailseq; - u_int32_t pgms_leadseq; - u_int16_t pgms_nla_afi; - u_int16_t pgms_reserved; - /* ... u_int8_t pgms_nla[0]; */ + uint32_t pgms_seq; + uint32_t pgms_trailseq; + uint32_t pgms_leadseq; + uint16_t pgms_nla_afi; + uint16_t pgms_reserved; + /* ... uint8_t pgms_nla[0]; */ /* ... options */ }; struct pgm_nak { - u_int32_t pgmn_seq; - u_int16_t pgmn_source_afi; - u_int16_t pgmn_reserved; - /* ... u_int8_t pgmn_source[0]; */ - /* ... u_int16_t pgmn_group_afi */ - /* ... u_int16_t pgmn_reserved2; */ - /* ... u_int8_t pgmn_group[0]; */ + uint32_t pgmn_seq; + uint16_t pgmn_source_afi; + uint16_t pgmn_reserved; + /* ... uint8_t pgmn_source[0]; */ + /* ... uint16_t pgmn_group_afi */ + /* ... uint16_t pgmn_reserved2; */ + /* ... uint8_t pgmn_group[0]; */ /* ... options */ }; struct pgm_ack { - u_int32_t pgma_rx_max_seq; - u_int32_t pgma_bitmap; + uint32_t pgma_rx_max_seq; + uint32_t pgma_bitmap; /* ... options */ }; struct pgm_poll { - u_int32_t pgmp_seq; - u_int16_t pgmp_round; - u_int16_t pgmp_reserved; + uint32_t pgmp_seq; + uint16_t pgmp_round; + uint16_t pgmp_reserved; /* ... options */ }; struct pgm_polr { - u_int32_t pgmp_seq; - u_int16_t pgmp_round; - u_int16_t pgmp_subtype; - u_int16_t pgmp_nla_afi; - u_int16_t pgmp_reserved; - /* ... u_int8_t pgmp_nla[0]; */ + uint32_t pgmp_seq; + uint16_t pgmp_round; + uint16_t pgmp_subtype; + uint16_t pgmp_nla_afi; + uint16_t pgmp_reserved; + /* ... uint8_t pgmp_nla[0]; */ /* ... options */ }; struct pgm_data { - u_int32_t pgmd_seq; - u_int32_t pgmd_trailseq; + uint32_t pgmd_seq; + uint32_t pgmd_trailseq; /* ... options */ }; @@ -150,7 +150,7 @@ pgm_print(netdissect_options *ndo, register const struct pgm_header *pgm; register const struct ip *ip; register char ch; - u_int16_t sport, dport; + uint16_t sport, dport; int addr_size; const void *nla; int nla_af; @@ -160,8 +160,8 @@ pgm_print(netdissect_options *ndo, #else char nla_buf[INET_ADDRSTRLEN]; #endif - u_int8_t opt_type, opt_len; - u_int32_t seq, opts_len, len, offset; + uint8_t opt_type, opt_len; + uint32_t seq, opts_len, len, offset; pgm = (struct pgm_header *)bp; ip = (struct ip *)bp2; @@ -287,7 +287,7 @@ pgm_print(netdissect_options *ndo, } case PGM_POLR: { struct pgm_polr *polr; - u_int32_t ivl, rnd, mask; + uint32_t ivl, rnd, mask; polr = (struct pgm_polr *)(pgm + 1); ND_TCHECK(*polr); @@ -314,17 +314,17 @@ pgm_print(netdissect_options *ndo, inet_ntop(nla_af, nla, nla_buf, sizeof(nla_buf)); - ND_TCHECK2(*bp, sizeof(u_int32_t)); + ND_TCHECK2(*bp, sizeof(uint32_t)); ivl = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); - ND_TCHECK2(*bp, sizeof(u_int32_t)); + ND_TCHECK2(*bp, sizeof(uint32_t)); rnd = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); - ND_TCHECK2(*bp, sizeof(u_int32_t)); + ND_TCHECK2(*bp, sizeof(uint32_t)); mask = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); ND_PRINT((ndo, "POLR seq %u round %u nla %s ivl %u rnd 0x%08x " "mask 0x%08x", EXTRACT_32BITS(&polr->pgmp_seq), @@ -413,7 +413,7 @@ pgm_print(netdissect_options *ndo, goto trunc; break; } - bp += (2 * sizeof(u_int16_t)); + bp += (2 * sizeof(uint16_t)); ND_TCHECK2(*bp, addr_size); group = bp; bp += addr_size; @@ -490,7 +490,7 @@ pgm_print(netdissect_options *ndo, ND_PRINT((ndo, "[Bad total option length %u < 4]", opts_len)); return; } - bp += sizeof(u_int16_t); + bp += sizeof(uint16_t); ND_PRINT((ndo, " OPTS LEN %d", opts_len)); opts_len -= 4; @@ -522,7 +522,7 @@ pgm_print(netdissect_options *ndo, return; } ND_PRINT((ndo, " OPTS LEN (extra?) %d", EXTRACT_16BITS(bp))); - bp += sizeof(u_int16_t); + bp += sizeof(uint16_t); opts_len -= 4; break; @@ -533,29 +533,29 @@ pgm_print(netdissect_options *ndo, } bp += 2; seq = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); offset = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); len = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); ND_PRINT((ndo, " FRAG seq %u off %u len %u", seq, offset, len)); opts_len -= 16; break; case PGM_OPT_NAK_LIST: bp += 2; - opt_len -= sizeof(u_int32_t); /* option header */ + opt_len -= sizeof(uint32_t); /* option header */ ND_PRINT((ndo, " NAK LIST")); while (opt_len) { - if (opt_len < sizeof(u_int32_t)) { + if (opt_len < sizeof(uint32_t)) { ND_PRINT((ndo, "[Option length not a multiple of 4]")); return; } - ND_TCHECK2(*bp, sizeof(u_int32_t)); + ND_TCHECK2(*bp, sizeof(uint32_t)); ND_PRINT((ndo, " %u", EXTRACT_32BITS(bp))); - bp += sizeof(u_int32_t); - opt_len -= sizeof(u_int32_t); - opts_len -= sizeof(u_int32_t); + bp += sizeof(uint32_t); + opt_len -= sizeof(uint32_t); + opts_len -= sizeof(uint32_t); } break; @@ -566,7 +566,7 @@ pgm_print(netdissect_options *ndo, } bp += 2; seq = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); ND_PRINT((ndo, " JOIN %u", seq)); opts_len -= 8; break; @@ -578,9 +578,9 @@ pgm_print(netdissect_options *ndo, } bp += 2; offset = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); seq = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); ND_PRINT((ndo, " BACKOFF ivl %u ivlseq %u", offset, seq)); opts_len -= 12; break; @@ -592,9 +592,9 @@ pgm_print(netdissect_options *ndo, } bp += 2; offset = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); seq = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); ND_PRINT((ndo, " BACKOFF max %u min %u", offset, seq)); opts_len -= 12; break; @@ -616,7 +616,7 @@ pgm_print(netdissect_options *ndo, goto trunc; break; } - bp += (2 * sizeof(u_int16_t)); + bp += (2 * sizeof(uint16_t)); if (opt_len != 4 + addr_size) { ND_PRINT((ndo, "[Bad OPT_REDIRECT option, length %u != 4 + address size]", opt_len)); return; @@ -637,7 +637,7 @@ pgm_print(netdissect_options *ndo, } bp += 2; len = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); ND_PRINT((ndo, " PARITY MAXTGS %u", len)); opts_len -= 8; break; @@ -649,7 +649,7 @@ pgm_print(netdissect_options *ndo, } bp += 2; seq = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); ND_PRINT((ndo, " PARITY GROUP %u", seq)); opts_len -= 8; break; @@ -661,7 +661,7 @@ pgm_print(netdissect_options *ndo, } bp += 2; len = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); ND_PRINT((ndo, " PARITY ATGS %u", len)); opts_len -= 8; break; @@ -731,7 +731,7 @@ pgm_print(netdissect_options *ndo, case PGM_OPT_PGMCC_DATA: bp += 2; offset = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); switch (EXTRACT_16BITS(bp)) { case AFNUM_INET: addr_size = sizeof(struct in_addr); @@ -747,7 +747,7 @@ pgm_print(netdissect_options *ndo, goto trunc; break; } - bp += (2 * sizeof(u_int16_t)); + bp += (2 * sizeof(uint16_t)); if (opt_len != 12 + addr_size) { ND_PRINT((ndo, "[Bad OPT_PGMCC_DATA option, length %u != 12 + address size]", opt_len)); return; @@ -764,7 +764,7 @@ pgm_print(netdissect_options *ndo, case PGM_OPT_PGMCC_FEEDBACK: bp += 2; offset = EXTRACT_32BITS(bp); - bp += sizeof(u_int32_t); + bp += sizeof(uint32_t); switch (EXTRACT_16BITS(bp)) { case AFNUM_INET: addr_size = sizeof(struct in_addr); @@ -780,7 +780,7 @@ pgm_print(netdissect_options *ndo, goto trunc; break; } - bp += (2 * sizeof(u_int16_t)); + bp += (2 * sizeof(uint16_t)); if (opt_len != 12 + addr_size) { ND_PRINT((ndo, "[Bad OPT_PGMCC_FEEDBACK option, length %u != 12 + address size]", opt_len)); return; diff --git a/print-pim.c b/print-pim.c index 9fc94394..72a6166d 100644 --- a/print-pim.c +++ b/print-pim.c @@ -121,7 +121,7 @@ static const struct tok pimv2_register_flag_values[] = { */ struct pim { - u_int8_t pim_typever; + uint8_t pim_typever; /* upper 4bit: PIM version number; 2 for PIMv2 */ /* lower 4bit: the PIM message type, currently they are: * Hello, Register, Register-Stop, Join/Prune, @@ -648,7 +648,7 @@ pimv2_print(netdissect_options *ndo, switch (PIM_TYPE(pim->pim_typever)) { case PIMV2_TYPE_HELLO: { - u_int16_t otype, olen; + uint16_t otype, olen; bp += 4; while (bp < ep) { ND_TCHECK2(bp[0], 4); @@ -671,7 +671,7 @@ pimv2_print(netdissect_options *ndo, ND_PRINT((ndo, "ERROR: Option Length != 4 Bytes (%u)", olen)); } else { char t_bit; - u_int16_t lan_delay, override_interval; + uint16_t lan_delay, override_interval; lan_delay = EXTRACT_16BITS(bp); override_interval = EXTRACT_16BITS(bp+2); t_bit = (lan_delay & 0x8000)? 1 : 0; @@ -842,10 +842,10 @@ pimv2_print(netdissect_options *ndo, */ { - u_int8_t ngroup; - u_int16_t holdtime; - u_int16_t njoin; - u_int16_t nprune; + uint8_t ngroup; + uint16_t holdtime; + uint16_t njoin; + uint16_t nprune; int i, j; bp += 4; len -= 4; @@ -916,9 +916,9 @@ pimv2_print(netdissect_options *ndo, bp += 4; /* Fragment Tag, Hash Mask len, and BSR-priority */ - if (bp + sizeof(u_int16_t) >= ep) break; + if (bp + sizeof(uint16_t) >= ep) break; ND_PRINT((ndo, " tag=%x", EXTRACT_16BITS(bp))); - bp += sizeof(u_int16_t); + bp += sizeof(uint16_t); if (bp >= ep) break; ND_PRINT((ndo, " hashmlen=%d", bp[0])); if (bp + 1 >= ep) break; diff --git a/print-ppi.c b/print-ppi.c index 16815720..ab721176 100644 --- a/print-ppi.c +++ b/print-ppi.c @@ -26,8 +26,8 @@ static inline void ppi_header_print(netdissect_options *ndo, const u_char *bp, u_int length) { const ppi_header_t *hdr; - u_int32_t dlt; - u_int16_t len; + uint32_t dlt; + uint16_t len; hdr = (const ppi_header_t *)bp; @@ -54,7 +54,7 @@ ppi_print(netdissect_options *ndo, ppi_header_t *hdr; u_int caplen = h->caplen; u_int length = h->len; - u_int32_t dlt; + uint32_t dlt; if (caplen < sizeof(ppi_header_t)) { ND_PRINT((ndo, "[|ppi]")); diff --git a/print-ppp.c b/print-ppp.c index 5a59195e..b92abf27 100644 --- a/print-ppp.c +++ b/print-ppp.c @@ -1359,7 +1359,7 @@ ppp_hdlc(netdissect_options *ndo, if (length <= 0) return; - b = (u_int8_t *)malloc(length); + b = (uint8_t *)malloc(length); if (b == NULL) return; @@ -1703,7 +1703,7 @@ ppp_bsdos_if_print(netdissect_options *ndo _U_, #ifdef __bsdi__ register u_int length = h->len; register u_int caplen = h->caplen; - u_int16_t ptype; + uint16_t ptype; const u_char *q; int i; diff --git a/print-pppoe.c b/print-pppoe.c index d8edc496..1624c5e5 100644 --- a/print-pppoe.c +++ b/print-pppoe.c @@ -92,7 +92,7 @@ pppoe_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register co u_int pppoe_print(netdissect_options *ndo, register const u_char *bp, u_int length) { - u_int16_t pppoe_ver, pppoe_type, pppoe_code, pppoe_sessionid; + uint16_t pppoe_ver, pppoe_type, pppoe_code, pppoe_sessionid; u_int pppoe_length; const u_char *pppoe_packet, *pppoe_payload; diff --git a/print-pptp.c b/print-pptp.c index 4674e203..c77868d4 100644 --- a/print-pptp.c +++ b/print-pptp.c @@ -84,147 +84,147 @@ static const char *pptp_message_type_string[] = { /* common for all PPTP control messages */ struct pptp_hdr { - u_int16_t length; - u_int16_t msg_type; - u_int32_t magic_cookie; - u_int16_t ctrl_msg_type; - u_int16_t reserved0; + uint16_t length; + uint16_t msg_type; + uint32_t magic_cookie; + uint16_t ctrl_msg_type; + uint16_t reserved0; }; struct pptp_msg_sccrq { - u_int16_t proto_ver; - u_int16_t reserved1; - u_int32_t framing_cap; - u_int32_t bearer_cap; - u_int16_t max_channel; - u_int16_t firm_rev; + uint16_t proto_ver; + uint16_t reserved1; + uint32_t framing_cap; + uint32_t bearer_cap; + uint16_t max_channel; + uint16_t firm_rev; u_char hostname[64]; u_char vendor[64]; }; struct pptp_msg_sccrp { - u_int16_t proto_ver; - u_int8_t result_code; - u_int8_t err_code; - u_int32_t framing_cap; - u_int32_t bearer_cap; - u_int16_t max_channel; - u_int16_t firm_rev; + uint16_t proto_ver; + uint8_t result_code; + uint8_t err_code; + uint32_t framing_cap; + uint32_t bearer_cap; + uint16_t max_channel; + uint16_t firm_rev; u_char hostname[64]; u_char vendor[64]; }; struct pptp_msg_stopccrq { - u_int8_t reason; - u_int8_t reserved1; - u_int16_t reserved2; + uint8_t reason; + uint8_t reserved1; + uint16_t reserved2; }; struct pptp_msg_stopccrp { - u_int8_t result_code; - u_int8_t err_code; - u_int16_t reserved1; + uint8_t result_code; + uint8_t err_code; + uint16_t reserved1; }; struct pptp_msg_echorq { - u_int32_t id; + uint32_t id; }; struct pptp_msg_echorp { - u_int32_t id; - u_int8_t result_code; - u_int8_t err_code; - u_int16_t reserved1; + uint32_t id; + uint8_t result_code; + uint8_t err_code; + uint16_t reserved1; }; struct pptp_msg_ocrq { - u_int16_t call_id; - u_int16_t call_ser; - u_int32_t min_bps; - u_int32_t max_bps; - u_int32_t bearer_type; - u_int32_t framing_type; - u_int16_t recv_winsiz; - u_int16_t pkt_proc_delay; - u_int16_t phone_no_len; - u_int16_t reserved1; + uint16_t call_id; + uint16_t call_ser; + uint32_t min_bps; + uint32_t max_bps; + uint32_t bearer_type; + uint32_t framing_type; + uint16_t recv_winsiz; + uint16_t pkt_proc_delay; + uint16_t phone_no_len; + uint16_t reserved1; u_char phone_no[64]; u_char subaddr[64]; }; struct pptp_msg_ocrp { - u_int16_t call_id; - u_int16_t peer_call_id; - u_int8_t result_code; - u_int8_t err_code; - u_int16_t cause_code; - u_int32_t conn_speed; - u_int16_t recv_winsiz; - u_int16_t pkt_proc_delay; - u_int32_t phy_chan_id; + uint16_t call_id; + uint16_t peer_call_id; + uint8_t result_code; + uint8_t err_code; + uint16_t cause_code; + uint32_t conn_speed; + uint16_t recv_winsiz; + uint16_t pkt_proc_delay; + uint32_t phy_chan_id; }; struct pptp_msg_icrq { - u_int16_t call_id; - u_int16_t call_ser; - u_int32_t bearer_type; - u_int32_t phy_chan_id; - u_int16_t dialed_no_len; - u_int16_t dialing_no_len; + uint16_t call_id; + uint16_t call_ser; + uint32_t bearer_type; + uint32_t phy_chan_id; + uint16_t dialed_no_len; + uint16_t dialing_no_len; u_char dialed_no[64]; /* DNIS */ u_char dialing_no[64]; /* CLID */ u_char subaddr[64]; }; struct pptp_msg_icrp { - u_int16_t call_id; - u_int16_t peer_call_id; - u_int8_t result_code; - u_int8_t err_code; - u_int16_t recv_winsiz; - u_int16_t pkt_proc_delay; - u_int16_t reserved1; + uint16_t call_id; + uint16_t peer_call_id; + uint8_t result_code; + uint8_t err_code; + uint16_t recv_winsiz; + uint16_t pkt_proc_delay; + uint16_t reserved1; }; struct pptp_msg_iccn { - u_int16_t peer_call_id; - u_int16_t reserved1; - u_int32_t conn_speed; - u_int16_t recv_winsiz; - u_int16_t pkt_proc_delay; - u_int32_t framing_type; + uint16_t peer_call_id; + uint16_t reserved1; + uint32_t conn_speed; + uint16_t recv_winsiz; + uint16_t pkt_proc_delay; + uint32_t framing_type; }; struct pptp_msg_ccrq { - u_int16_t call_id; - u_int16_t reserved1; + uint16_t call_id; + uint16_t reserved1; }; struct pptp_msg_cdn { - u_int16_t call_id; - u_int8_t result_code; - u_int8_t err_code; - u_int16_t cause_code; - u_int16_t reserved1; + uint16_t call_id; + uint8_t result_code; + uint8_t err_code; + uint16_t cause_code; + uint16_t reserved1; u_char call_stats[128]; }; struct pptp_msg_wen { - u_int16_t peer_call_id; - u_int16_t reserved1; - u_int32_t crc_err; - u_int32_t framing_err; - u_int32_t hardware_overrun; - u_int32_t buffer_overrun; - u_int32_t timeout_err; - u_int32_t align_err; + uint16_t peer_call_id; + uint16_t reserved1; + uint32_t crc_err; + uint32_t framing_err; + uint32_t hardware_overrun; + uint32_t buffer_overrun; + uint32_t timeout_err; + uint32_t align_err; }; struct pptp_msg_sli { - u_int16_t peer_call_id; - u_int16_t reserved1; - u_int32_t send_accm; - u_int32_t recv_accm; + uint16_t peer_call_id; + uint16_t reserved1; + uint32_t send_accm; + uint32_t recv_accm; }; /* attributes that appear more than once in above messages: @@ -232,27 +232,27 @@ struct pptp_msg_sli { Number of occurence attributes -------------------------------------- - 2 u_int32_t bearer_cap; - 2 u_int32_t bearer_type; - 6 u_int16_t call_id; - 2 u_int16_t call_ser; - 2 u_int16_t cause_code; - 2 u_int32_t conn_speed; - 6 u_int8_t err_code; - 2 u_int16_t firm_rev; - 2 u_int32_t framing_cap; - 2 u_int32_t framing_type; + 2 uint32_t bearer_cap; + 2 uint32_t bearer_type; + 6 uint16_t call_id; + 2 uint16_t call_ser; + 2 uint16_t cause_code; + 2 uint32_t conn_speed; + 6 uint8_t err_code; + 2 uint16_t firm_rev; + 2 uint32_t framing_cap; + 2 uint32_t framing_type; 2 u_char hostname[64]; - 2 u_int32_t id; - 2 u_int16_t max_channel; - 5 u_int16_t peer_call_id; - 2 u_int32_t phy_chan_id; - 4 u_int16_t pkt_proc_delay; - 2 u_int16_t proto_ver; - 4 u_int16_t recv_winsiz; - 2 u_int8_t reserved1; - 9 u_int16_t reserved1; - 6 u_int8_t result_code; + 2 uint32_t id; + 2 uint16_t max_channel; + 5 uint16_t peer_call_id; + 2 uint32_t phy_chan_id; + 4 uint16_t pkt_proc_delay; + 2 uint16_t proto_ver; + 4 uint16_t recv_winsiz; + 2 uint8_t reserved1; + 9 uint16_t reserved1; + 6 uint8_t result_code; 2 u_char subaddr[64]; 2 u_char vendor[64]; @@ -270,7 +270,7 @@ struct pptp_msg_sli { static void pptp_bearer_cap_print(netdissect_options *ndo, - const u_int32_t *bearer_cap) + const uint32_t *bearer_cap) { ND_PRINT((ndo, " BEARER_CAP(%s%s)", EXTRACT_32BITS(bearer_cap) & PPTP_BEARER_CAP_DIGITAL_MASK ? "D" : "", @@ -286,7 +286,7 @@ static const struct tok pptp_btype_str[] = { static void pptp_bearer_type_print(netdissect_options *ndo, - const u_int32_t *bearer_type) + const uint32_t *bearer_type) { ND_PRINT((ndo, " BEARER_TYPE(%s)", tok2str(pptp_btype_str, "?", EXTRACT_32BITS(bearer_type)))); @@ -294,28 +294,28 @@ pptp_bearer_type_print(netdissect_options *ndo, static void pptp_call_id_print(netdissect_options *ndo, - const u_int16_t *call_id) + const uint16_t *call_id) { ND_PRINT((ndo, " CALL_ID(%u)", EXTRACT_16BITS(call_id))); } static void pptp_call_ser_print(netdissect_options *ndo, - const u_int16_t *call_ser) + const uint16_t *call_ser) { ND_PRINT((ndo, " CALL_SER_NUM(%u)", EXTRACT_16BITS(call_ser))); } static void pptp_cause_code_print(netdissect_options *ndo, - const u_int16_t *cause_code) + const uint16_t *cause_code) { ND_PRINT((ndo, " CAUSE_CODE(%u)", EXTRACT_16BITS(cause_code))); } static void pptp_conn_speed_print(netdissect_options *ndo, - const u_int32_t *conn_speed) + const uint32_t *conn_speed) { ND_PRINT((ndo, " CONN_SPEED(%u)", EXTRACT_32BITS(conn_speed))); } @@ -333,7 +333,7 @@ static const struct tok pptp_errcode_str[] = { static void pptp_err_code_print(netdissect_options *ndo, - const u_int8_t *err_code) + const uint8_t *err_code) { ND_PRINT((ndo, " ERR_CODE(%u", *err_code)); if (ndo->ndo_vflag) { @@ -344,14 +344,14 @@ pptp_err_code_print(netdissect_options *ndo, static void pptp_firm_rev_print(netdissect_options *ndo, - const u_int16_t *firm_rev) + const uint16_t *firm_rev) { ND_PRINT((ndo, " FIRM_REV(%u)", EXTRACT_16BITS(firm_rev))); } static void pptp_framing_cap_print(netdissect_options *ndo, - const u_int32_t *framing_cap) + const uint32_t *framing_cap) { ND_PRINT((ndo, " FRAME_CAP(")); if (EXTRACT_32BITS(framing_cap) & PPTP_FRAMING_CAP_ASYNC_MASK) { @@ -372,7 +372,7 @@ static const struct tok pptp_ftype_str[] = { static void pptp_framing_type_print(netdissect_options *ndo, - const u_int32_t *framing_type) + const uint32_t *framing_type) { ND_PRINT((ndo, " FRAME_TYPE(%s)", tok2str(pptp_ftype_str, "?", EXTRACT_32BITS(framing_type)))); @@ -387,42 +387,42 @@ pptp_hostname_print(netdissect_options *ndo, static void pptp_id_print(netdissect_options *ndo, - const u_int32_t *id) + const uint32_t *id) { ND_PRINT((ndo, " ID(%u)", EXTRACT_32BITS(id))); } static void pptp_max_channel_print(netdissect_options *ndo, - const u_int16_t *max_channel) + const uint16_t *max_channel) { ND_PRINT((ndo, " MAX_CHAN(%u)", EXTRACT_16BITS(max_channel))); } static void pptp_peer_call_id_print(netdissect_options *ndo, - const u_int16_t *peer_call_id) + const uint16_t *peer_call_id) { ND_PRINT((ndo, " PEER_CALL_ID(%u)", EXTRACT_16BITS(peer_call_id))); } static void pptp_phy_chan_id_print(netdissect_options *ndo, - const u_int32_t *phy_chan_id) + const uint32_t *phy_chan_id) { ND_PRINT((ndo, " PHY_CHAN_ID(%u)", EXTRACT_32BITS(phy_chan_id))); } static void pptp_pkt_proc_delay_print(netdissect_options *ndo, - const u_int16_t *pkt_proc_delay) + const uint16_t *pkt_proc_delay) { ND_PRINT((ndo, " PROC_DELAY(%u)", EXTRACT_16BITS(pkt_proc_delay))); } static void pptp_proto_ver_print(netdissect_options *ndo, - const u_int16_t *proto_ver) + const uint16_t *proto_ver) { ND_PRINT((ndo, " PROTO_VER(%u.%u)", /* Version.Revision */ EXTRACT_16BITS(proto_ver) >> 8, @@ -431,7 +431,7 @@ pptp_proto_ver_print(netdissect_options *ndo, static void pptp_recv_winsiz_print(netdissect_options *ndo, - const u_int16_t *recv_winsiz) + const uint16_t *recv_winsiz) { ND_PRINT((ndo, " RECV_WIN(%u)", EXTRACT_16BITS(recv_winsiz))); } @@ -479,7 +479,7 @@ static const struct tok pptp_cdn_str[] = { static void pptp_result_code_print(netdissect_options *ndo, - const u_int8_t *result_code, int ctrl_msg_type) + const uint8_t *result_code, int ctrl_msg_type) { ND_PRINT((ndo, " RESULT_CODE(%u", *result_code)); if (ndo->ndo_vflag) { @@ -901,8 +901,8 @@ pptp_print(netdissect_options *ndo, const u_char *dat) { const struct pptp_hdr *hdr; - u_int32_t mc; - u_int16_t ctrl_msg_type; + uint32_t mc; + uint16_t ctrl_msg_type; ND_PRINT((ndo, ": pptp")); diff --git a/print-radius.c b/print-radius.c index 0c3880ef..46bb7e15 100644 --- a/print-radius.c +++ b/print-radius.c @@ -140,16 +140,16 @@ static void print_attr_time(netdissect_options *, register u_char *, u_int, u_sh static void print_attr_strange(netdissect_options *, register u_char *, u_int, u_short); -struct radius_hdr { u_int8_t code; /* Radius packet code */ - u_int8_t id; /* Radius packet id */ - u_int16_t len; /* Radius total length */ - u_int8_t auth[16]; /* Authenticator */ +struct radius_hdr { uint8_t code; /* Radius packet code */ + uint8_t id; /* Radius packet id */ + uint16_t len; /* Radius total length */ + uint8_t auth[16]; /* Authenticator */ }; #define MIN_RADIUS_LEN 20 -struct radius_attr { u_int8_t type; /* Attribute type */ - u_int8_t len; /* Attribute length */ +struct radius_attr { uint8_t type; /* Attribute type */ + uint8_t len; /* Attribute length */ }; @@ -565,8 +565,8 @@ static void print_attr_num(netdissect_options *ndo, register u_char *data, u_int length, u_short attr_code) { - u_int8_t tag; - u_int32_t timeout; + uint8_t tag; + uint32_t timeout; if (length != 4) { @@ -579,7 +579,7 @@ print_attr_num(netdissect_options *ndo, if (attr_type[attr_code].siz_subtypes) { static const char **table; - u_int32_t data_value; + uint32_t data_value; table = attr_type[attr_code].subtypes; if ( (attr_code == TUNNEL_TYPE) || (attr_code == TUNNEL_MEDIUM) ) @@ -595,7 +595,7 @@ print_attr_num(netdissect_options *ndo, { data_value = EXTRACT_32BITS(data); } - if ( data_value <= (u_int32_t)(attr_type[attr_code].siz_subtypes - 1 + + if ( data_value <= (uint32_t)(attr_type[attr_code].siz_subtypes - 1 + attr_type[attr_code].first_subtype) && data_value >= attr_type[attr_code].first_subtype ) ND_PRINT((ndo, "%s", table[data_value])); diff --git a/print-rip.c b/print-rip.c index 1fb6dd65..c1b036e4 100644 --- a/print-rip.c +++ b/print-rip.c @@ -37,9 +37,9 @@ static const char tstr[] = "[|rip]"; struct rip { - u_int8_t rip_cmd; /* request/response */ - u_int8_t rip_vers; /* protocol version # */ - u_int8_t unused[2]; /* unused */ + uint8_t rip_cmd; /* request/response */ + uint8_t rip_vers; /* protocol version # */ + uint8_t unused[2]; /* unused */ }; #define RIPCMD_REQUEST 1 /* want info */ @@ -84,12 +84,12 @@ static const struct tok rip_cmd_values[] = { */ struct rip_netinfo { - u_int16_t rip_family; - u_int16_t rip_tag; - u_int32_t rip_dest; - u_int32_t rip_dest_mask; - u_int32_t rip_router; - u_int32_t rip_metric; /* cost of route */ + uint16_t rip_family; + uint16_t rip_tag; + uint32_t rip_dest; + uint32_t rip_dest_mask; + uint32_t rip_router; + uint32_t rip_metric; /* cost of route */ }; static void @@ -102,14 +102,14 @@ rip_entry_print_v1(netdissect_options *ndo, family = EXTRACT_16BITS(&ni->rip_family); if (family != BSD_AFNUM_INET && family != 0) { ND_PRINT((ndo, "\n\t AFI %s, ", tok2str(bsd_af_values, "Unknown (%u)", family))); - print_unknown_data(ndo, (u_int8_t *)&ni->rip_family, "\n\t ", RIP_ROUTELEN); + print_unknown_data(ndo, (uint8_t *)&ni->rip_family, "\n\t ", RIP_ROUTELEN); return; } if (EXTRACT_16BITS(&ni->rip_tag) || EXTRACT_32BITS(&ni->rip_dest_mask) || EXTRACT_32BITS(&ni->rip_router)) { /* MBZ fields not zero */ - print_unknown_data(ndo, (u_int8_t *)&ni->rip_family, "\n\t ", RIP_ROUTELEN); + print_unknown_data(ndo, (uint8_t *)&ni->rip_family, "\n\t ", RIP_ROUTELEN); return; } if (family == 0) { @@ -131,7 +131,7 @@ rip_entry_print_v2(netdissect_options *ndo, family = EXTRACT_16BITS(&ni->rip_family); if (family == 0xFFFF) { /* variable-sized authentication structures */ - u_int16_t auth_type = EXTRACT_16BITS(&ni->rip_tag); + uint16_t auth_type = EXTRACT_16BITS(&ni->rip_tag); if (auth_type == 2) { register u_char *p = (u_char *)&ni->rip_dest; u_int i = 0; @@ -140,24 +140,24 @@ rip_entry_print_v2(netdissect_options *ndo, ND_PRINT((ndo, "%c", ND_ISPRINT(*p) ? *p : '.')); } else if (auth_type == 3) { ND_PRINT((ndo, "\n\t Auth header:")); - ND_PRINT((ndo, " Packet Len %u,", EXTRACT_16BITS((u_int8_t *)ni + 4))); - ND_PRINT((ndo, " Key-ID %u,", *((u_int8_t *)ni + 6))); - ND_PRINT((ndo, " Auth Data Len %u,", *((u_int8_t *)ni + 7))); + ND_PRINT((ndo, " Packet Len %u,", EXTRACT_16BITS((uint8_t *)ni + 4))); + ND_PRINT((ndo, " Key-ID %u,", *((uint8_t *)ni + 6))); + ND_PRINT((ndo, " Auth Data Len %u,", *((uint8_t *)ni + 7))); ND_PRINT((ndo, " SeqNo %u,", EXTRACT_32BITS(&ni->rip_dest_mask))); ND_PRINT((ndo, " MBZ %u,", EXTRACT_32BITS(&ni->rip_router))); ND_PRINT((ndo, " MBZ %u", EXTRACT_32BITS(&ni->rip_metric))); } else if (auth_type == 1) { ND_PRINT((ndo, "\n\t Auth trailer:")); - print_unknown_data(ndo, (u_int8_t *)&ni->rip_dest, "\n\t ", remaining); + print_unknown_data(ndo, (uint8_t *)&ni->rip_dest, "\n\t ", remaining); return remaining; /* AT spans till the packet end */ } else { ND_PRINT((ndo, "\n\t Unknown (%u) Authentication data:", EXTRACT_16BITS(&ni->rip_tag))); - print_unknown_data(ndo, (u_int8_t *)&ni->rip_dest, "\n\t ", remaining); + print_unknown_data(ndo, (uint8_t *)&ni->rip_dest, "\n\t ", remaining); } } else if (family != BSD_AFNUM_INET && family != 0) { ND_PRINT((ndo, "\n\t AFI %s", tok2str(bsd_af_values, "Unknown (%u)", family))); - print_unknown_data(ndo, (u_int8_t *)&ni->rip_tag, "\n\t ", RIP_ROUTELEN-2); + print_unknown_data(ndo, (uint8_t *)&ni->rip_tag, "\n\t ", RIP_ROUTELEN-2); } else { /* BSD_AFNUM_INET or AFI 0 */ ND_PRINT((ndo, "\n\t AFI %s, %15s/%-2d, tag 0x%04x, metric: %u, next-hop: ", tok2str(bsd_af_values, "%u", family), @@ -213,7 +213,7 @@ rip_print(netdissect_options *ndo, * * so perhaps we should just dump the packet, in hex. */ - print_unknown_data(ndo, (u_int8_t *)&rp->rip_cmd, "\n\t", length); + print_unknown_data(ndo, (uint8_t *)&rp->rip_cmd, "\n\t", length); break; default: /* dump version and lets see if we know the commands name*/ @@ -256,14 +256,14 @@ rip_print(netdissect_options *ndo, /* fall through */ default: if (ndo->ndo_vflag <= 1) { - if(!print_unknown_data(ndo, (u_int8_t *)rp, "\n\t", length)) + if(!print_unknown_data(ndo, (uint8_t *)rp, "\n\t", length)) return; } break; } /* do we want to see an additionally hexdump ? */ if (ndo->ndo_vflag> 1) { - if(!print_unknown_data(ndo, (u_int8_t *)rp, "\n\t", length)) + if(!print_unknown_data(ndo, (uint8_t *)rp, "\n\t", length)) return; } } diff --git a/print-ripng.c b/print-ripng.c index 9a5dba43..99694c33 100644 --- a/print-ripng.c +++ b/print-ripng.c @@ -67,15 +67,15 @@ struct netinfo6 { struct in6_addr rip6_dest; - u_int16_t rip6_tag; - u_int8_t rip6_plen; - u_int8_t rip6_metric; + uint16_t rip6_tag; + uint8_t rip6_plen; + uint8_t rip6_metric; }; struct rip6 { - u_int8_t rip6_cmd; - u_int8_t rip6_vers; - u_int8_t rip6_res1[2]; + uint8_t rip6_cmd; + uint8_t rip6_vers; + uint8_t rip6_res1[2]; union { struct netinfo6 ru6_nets[1]; char ru6_tracefile[1]; diff --git a/print-rrcp.c b/print-rrcp.c index 7c6ca25f..2370d9c2 100644 --- a/print-rrcp.c +++ b/print-rrcp.c @@ -75,8 +75,8 @@ rrcp_print(netdissect_options *ndo, u_int length _U_) { const u_char *rrcp; - u_int8_t rrcp_proto; - u_int8_t rrcp_opcode; + uint8_t rrcp_proto; + uint8_t rrcp_opcode; register const struct ether_header *ep; char proto_str[16]; char opcode_str[32]; diff --git a/print-rsvp.c b/print-rsvp.c index 4edb90ee..3f96cb25 100644 --- a/print-rsvp.c +++ b/print-rsvp.c @@ -43,12 +43,12 @@ */ struct rsvp_common_header { - u_int8_t version_flags; - u_int8_t msg_type; - u_int8_t checksum[2]; - u_int8_t ttl; - u_int8_t reserved; - u_int8_t length[2]; + uint8_t version_flags; + uint8_t msg_type; + uint8_t checksum[2]; + uint8_t ttl; + uint8_t reserved; + uint8_t length[2]; }; /* @@ -66,9 +66,9 @@ struct rsvp_common_header { */ struct rsvp_object_header { - u_int8_t length[2]; - u_int8_t class_num; - u_int8_t ctype; + uint8_t length[2]; + uint8_t class_num; + uint8_t ctype; }; #define RSVP_VERSION 1 @@ -292,11 +292,11 @@ static const struct tok rsvp_ctype_values[] = { }; struct rsvp_obj_integrity_t { - u_int8_t flags; - u_int8_t res; - u_int8_t key_id[6]; - u_int8_t sequence[8]; - u_int8_t digest[16]; + uint8_t flags; + uint8_t res; + uint8_t key_id[6]; + uint8_t sequence[8]; + uint8_t digest[16]; }; static const struct tok rsvp_obj_integrity_flag_values[] = { @@ -305,14 +305,14 @@ static const struct tok rsvp_obj_integrity_flag_values[] = { }; struct rsvp_obj_frr_t { - u_int8_t setup_prio; - u_int8_t hold_prio; - u_int8_t hop_limit; - u_int8_t flags; - u_int8_t bandwidth[4]; - u_int8_t include_any[4]; - u_int8_t exclude_any[4]; - u_int8_t include_all[4]; + uint8_t setup_prio; + uint8_t hold_prio; + uint8_t hop_limit; + uint8_t flags; + uint8_t bandwidth[4]; + uint8_t include_any[4]; + uint8_t exclude_any[4]; + uint8_t include_all[4]; }; @@ -491,7 +491,7 @@ rsvp_intserv_print(netdissect_options *ndo, int parameter_id,parameter_length; union { float f; - u_int32_t i; + uint32_t i; } bw; if (obj_tlen < 4) @@ -650,9 +650,9 @@ _U_ int hexdump,processed,padbytes,error_code,error_value,i,sigcheck; union { float f; - u_int32_t i; + uint32_t i; } bw; - u_int8_t namelen; + uint8_t namelen; u_int action, subchannel; diff --git a/print-rx.c b/print-rx.c index 24045755..8a9babbc 100644 --- a/print-rx.c +++ b/print-rx.c @@ -73,12 +73,12 @@ #define PRSFS_ADMINISTER 64 /* Change ACL's */ struct rx_header { - u_int32_t epoch; - u_int32_t cid; - u_int32_t callNumber; - u_int32_t seq; - u_int32_t serial; - u_int8_t type; + uint32_t epoch; + uint32_t cid; + uint32_t callNumber; + uint32_t seq; + uint32_t serial; + uint8_t type; #define RX_PACKET_TYPE_DATA 1 #define RX_PACKET_TYPE_ACK 2 #define RX_PACKET_TYPE_BUSY 3 @@ -89,7 +89,7 @@ struct rx_header { #define RX_PACKET_TYPE_DEBUG 8 #define RX_PACKET_TYPE_PARAMS 9 #define RX_PACKET_TYPE_VERSION 13 - u_int8_t flags; + uint8_t flags; #define RX_CLIENT_INITIATED 1 #define RX_REQUEST_ACK 2 #define RX_LAST_PACKET 4 @@ -97,10 +97,10 @@ struct rx_header { #define RX_FREE_PACKET 16 #define RX_SLOW_START_OK 32 #define RX_JUMBO_PACKET 32 - u_int8_t userStatus; - u_int8_t securityIndex; - u_int16_t spare; /* How clever: even though the AFS */ - u_int16_t serviceId; /* header files indicate that the */ + uint8_t userStatus; + uint8_t securityIndex; + uint16_t spare; /* How clever: even though the AFS */ + uint16_t serviceId; /* header files indicate that the */ }; /* serviceId is first, it's really */ /* encoded _after_ the spare field */ /* I wasted a day figuring that out! */ @@ -110,15 +110,15 @@ struct rx_header { #define RX_MAXACKS 255 struct rx_ackPacket { - u_int16_t bufferSpace; /* Number of packet buffers available */ - u_int16_t maxSkew; /* Max diff between ack'd packet and */ + uint16_t bufferSpace; /* Number of packet buffers available */ + uint16_t maxSkew; /* Max diff between ack'd packet and */ /* highest packet received */ - u_int32_t firstPacket; /* The first packet in ack list */ - u_int32_t previousPacket; /* Previous packet recv'd (obsolete) */ - u_int32_t serial; /* # of packet that prompted the ack */ - u_int8_t reason; /* Reason for acknowledgement */ - u_int8_t nAcks; /* Number of acknowledgements */ - u_int8_t acks[RX_MAXACKS]; /* Up to RX_MAXACKS acknowledgements */ + uint32_t firstPacket; /* The first packet in ack list */ + uint32_t previousPacket; /* Previous packet recv'd (obsolete) */ + uint32_t serial; /* # of packet that prompted the ack */ + uint8_t reason; /* Reason for acknowledgement */ + uint8_t nAcks; /* Number of acknowledgements */ + uint8_t acks[RX_MAXACKS]; /* Up to RX_MAXACKS acknowledgements */ }; /* @@ -474,12 +474,12 @@ static const struct tok rx_ack_reasons[] = { */ struct rx_cache_entry { - u_int32_t callnum; /* Call number (net order) */ + uint32_t callnum; /* Call number (net order) */ struct in_addr client; /* client IP address (net order) */ struct in_addr server; /* server IP address (net order) */ int dport; /* server port (host order) */ u_short serviceId; /* Service identifier (net order) */ - u_int32_t opcode; /* RX opcode (host order) */ + uint32_t opcode; /* RX opcode (host order) */ }; #define RX_CACHE_SIZE 64 @@ -512,7 +512,7 @@ static void ubik_reply_print(netdissect_options *, const u_char *, int, int32_t) static void rx_ack_print(netdissect_options *, const u_char *, int); -static int is_ubik(u_int32_t); +static int is_ubik(uint32_t); /* * Handle the rx-level packet. See if we know what port it's going to so @@ -709,8 +709,8 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, int sport, { int i; struct rx_cache_entry *rxent; - u_int32_t clip = ip->ip_dst.s_addr; - u_int32_t sip = ip->ip_src.s_addr; + uint32_t clip = ip->ip_dst.s_addr; + uint32_t sip = ip->ip_src.s_addr; /* Start the search where we last left off */ @@ -779,10 +779,10 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, int sport, ND_PRINT((ndo, " %lu", i)); \ } -#define UINT64OUT() { u_int64_t i; \ - ND_TCHECK2(bp[0], sizeof(u_int64_t)); \ +#define UINT64OUT() { uint64_t i; \ + ND_TCHECK2(bp[0], sizeof(uint64_t)); \ i = EXTRACT_64BITS(bp); \ - bp += sizeof(u_int64_t); \ + bp += sizeof(uint64_t); \ ND_PRINT((ndo, " %" PRIu64, i)); \ } @@ -822,20 +822,20 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, int sport, ND_PRINT((ndo, " %d.%d", epoch, counter)); \ } -#define AFSUUIDOUT() {u_int32_t temp; int i; \ - ND_TCHECK2(bp[0], 11*sizeof(u_int32_t)); \ +#define AFSUUIDOUT() {uint32_t temp; int i; \ + ND_TCHECK2(bp[0], 11*sizeof(uint32_t)); \ temp = EXTRACT_32BITS(bp); \ - bp += sizeof(u_int32_t); \ + bp += sizeof(uint32_t); \ ND_PRINT((ndo, " %08x", temp)); \ temp = EXTRACT_32BITS(bp); \ - bp += sizeof(u_int32_t); \ + bp += sizeof(uint32_t); \ ND_PRINT((ndo, "%04x", temp)); \ temp = EXTRACT_32BITS(bp); \ - bp += sizeof(u_int32_t); \ + bp += sizeof(uint32_t); \ ND_PRINT((ndo, "%04x", temp)); \ for (i = 0; i < 8; i++) { \ temp = EXTRACT_32BITS(bp); \ - bp += sizeof(u_int32_t); \ + bp += sizeof(uint32_t); \ ND_PRINT((ndo, "%02x", (unsigned char) temp)); \ } \ } @@ -2505,7 +2505,7 @@ trunc: */ static int -is_ubik(u_int32_t opcode) +is_ubik(uint32_t opcode) { if ((opcode >= VOTE_LOW && opcode <= VOTE_HIGH) || (opcode >= DISK_LOW && opcode <= DISK_HIGH)) @@ -2698,7 +2698,7 @@ rx_ack_print(netdissect_options *ndo, { struct rx_ackPacket *rxa; int i, start, last; - u_int32_t firstPacket; + uint32_t firstPacket; if (length < (int)sizeof(struct rx_header)) return; diff --git a/print-sctp.c b/print-sctp.c index 566a8d1a..4b595f2e 100644 --- a/print-sctp.c +++ b/print-sctp.c @@ -154,36 +154,36 @@ static const struct tok sctp_chunkid_str[] = { /* the sctp common header */ struct sctpHeader{ - u_int16_t source; - u_int16_t destination; - u_int32_t verificationTag; - u_int32_t adler32; + uint16_t source; + uint16_t destination; + uint32_t verificationTag; + uint32_t adler32; }; /* various descriptor parsers */ struct sctpChunkDesc{ - u_int8_t chunkID; - u_int8_t chunkFlg; - u_int16_t chunkLength; + uint8_t chunkID; + uint8_t chunkFlg; + uint16_t chunkLength; }; struct sctpParamDesc{ - u_int16_t paramType; - u_int16_t paramLength; + uint16_t paramType; + uint16_t paramLength; }; struct sctpRelChunkDesc{ struct sctpChunkDesc chk; - u_int32_t serialNumber; + uint32_t serialNumber; }; struct sctpVendorSpecificParam { struct sctpParamDesc p; /* type must be 0xfffe */ - u_int32_t vendorId; /* vendor ID from RFC 1700 */ - u_int16_t vendorSpecificType; - u_int16_t vendorSpecificLen; + uint32_t vendorId; /* vendor ID from RFC 1700 */ + uint16_t vendorSpecificType; + uint16_t vendorSpecificLen; }; @@ -195,53 +195,53 @@ struct sctpVendorSpecificParam { /* this is used for init ack, too */ struct sctpInitiation{ - u_int32_t initTag; /* tag of mine */ - u_int32_t rcvWindowCredit; /* rwnd */ - u_int16_t NumPreopenStreams; /* OS */ - u_int16_t MaxInboundStreams; /* MIS */ - u_int32_t initialTSN; + uint32_t initTag; /* tag of mine */ + uint32_t rcvWindowCredit; /* rwnd */ + uint16_t NumPreopenStreams; /* OS */ + uint16_t MaxInboundStreams; /* MIS */ + uint32_t initialTSN; /* optional param's follow in sctpParamDesc form */ }; struct sctpV4IpAddress{ struct sctpParamDesc p; /* type is set to SCTP_IPV4_PARAM_TYPE, len=10 */ - u_int32_t ipAddress; + uint32_t ipAddress; }; struct sctpV6IpAddress{ struct sctpParamDesc p; /* type is set to SCTP_IPV6_PARAM_TYPE, len=22 */ - u_int8_t ipAddress[16]; + uint8_t ipAddress[16]; }; struct sctpDNSName{ struct sctpParamDesc param; - u_int8_t name[1]; + uint8_t name[1]; }; struct sctpCookiePreserve{ struct sctpParamDesc p; /* type is set to SCTP_COOKIE_PRESERVE, len=8 */ - u_int32_t extraTime; + uint32_t extraTime; }; struct sctpTimeStamp{ - u_int32_t ts_sec; - u_int32_t ts_usec; + uint32_t ts_sec; + uint32_t ts_usec; }; /* wire structure of my cookie */ struct cookieMessage{ - u_int32_t TieTag_curTag; /* copied from assoc if present */ - u_int32_t TieTag_hisTag; /* copied from assoc if present */ + uint32_t TieTag_curTag; /* copied from assoc if present */ + uint32_t TieTag_hisTag; /* copied from assoc if present */ int32_t cookieLife; /* life I will award this cookie */ struct sctpTimeStamp timeEnteringState; /* the time I built cookie */ struct sctpInitiation initAckISent; /* the INIT-ACK that I sent to my peer */ - u_int32_t addressWhereISent[4]; /* I make this 4 ints so I get 128bits for future */ + uint32_t addressWhereISent[4]; /* I make this 4 ints so I get 128bits for future */ int32_t addrtype; /* address type */ - u_int16_t locScope; /* V6 local scope flag */ - u_int16_t siteScope; /* V6 site scope flag */ + uint16_t locScope; /* V6 local scope flag */ + uint16_t siteScope; /* V6 site scope flag */ /* at the end is tacked on the INIT chunk sent in * its entirety and of course our * signature. @@ -273,15 +273,15 @@ struct sctpSendableInit{ */ struct sctpSelectiveAck{ - u_int32_t highestConseqTSN; - u_int32_t updatedRwnd; - u_int16_t numberOfdesc; - u_int16_t numDupTsns; + uint32_t highestConseqTSN; + uint32_t updatedRwnd; + uint16_t numberOfdesc; + uint16_t numDupTsns; }; struct sctpSelectiveFrag{ - u_int16_t fragmentStart; - u_int16_t fragmentEnd; + uint16_t fragmentStart; + uint16_t fragmentEnd; }; @@ -295,8 +295,8 @@ struct sctpUnifiedSack{ */ struct sctpHBrequest { - u_int32_t time_value_1; - u_int32_t time_value_2; + uint32_t time_value_1; + uint32_t time_value_2; }; /* here is what I read and respond with to. */ @@ -312,7 +312,7 @@ struct sctpHBsender{ struct sctpParamDesc hb; struct sctpHBrequest rtt; int8_t addrFmt[SCTP_ADDRMAX]; - u_int16_t userreq; + uint16_t userreq; }; @@ -333,15 +333,15 @@ struct sctpUnifiedAbortLight{ struct sctpUnifiedAbortHeavy{ struct sctpHeader mh; struct sctpChunkDesc uh; - u_int16_t causeCode; - u_int16_t causeLen; + uint16_t causeCode; + uint16_t causeLen; }; /* For the graceful shutdown we must carry * the tag (in common header) and the highest consequitive acking value */ struct sctpShutdown { - u_int32_t TSN_Seen; + uint32_t TSN_Seen; }; struct sctpUnifiedShutdown{ @@ -354,8 +354,8 @@ struct sctpUnifiedShutdown{ * that is defined as a operation error. */ struct sctpOpErrorCause{ - u_int16_t cause; - u_int16_t causeLen; + uint16_t cause; + uint16_t causeLen; }; struct sctpUnifiedOpError{ @@ -367,15 +367,15 @@ struct sctpUnifiedStreamError{ struct sctpHeader mh; struct sctpChunkDesc uh; struct sctpOpErrorCause c; - u_int16_t strmNum; - u_int16_t reserved; + uint16_t strmNum; + uint16_t reserved; }; struct staleCookieMsg{ struct sctpHeader mh; struct sctpChunkDesc uh; struct sctpOpErrorCause c; - u_int32_t moretime; + uint32_t moretime; }; /* the following is used in all sends @@ -388,10 +388,10 @@ struct sctpUnifiedSingleMsg{ }; struct sctpDataPart{ - u_int32_t TSN; - u_int16_t streamId; - u_int16_t sequence; - u_int32_t payloadtype; + uint32_t TSN; + uint16_t streamId; + uint16_t sequence; + uint32_t payloadtype; }; struct sctpUnifiedDatagram{ @@ -401,13 +401,13 @@ struct sctpUnifiedDatagram{ struct sctpECN_echo{ struct sctpChunkDesc uh; - u_int32_t Lowest_TSN; + uint32_t Lowest_TSN; }; struct sctpCWR{ struct sctpChunkDesc uh; - u_int32_t TSN_reduced_at; + uint32_t TSN_reduced_at; }; static const struct tok ForCES_channels[] = { @@ -578,9 +578,9 @@ void sctp_print(netdissect_options *ndo, chunkDescPtr = (const struct sctpChunkDesc *) nextChunk, chunkCount++) { - u_int16_t chunkLength; + uint16_t chunkLength; const u_char *chunkEnd; - u_int16_t align; + uint16_t align; ND_TCHECK(*chunkDescPtr); chunkLength = EXTRACT_16BITS(&chunkDescPtr->chunkLength); @@ -589,7 +589,7 @@ void sctp_print(netdissect_options *ndo, break; } - ND_TCHECK2(*((u_int8_t *)chunkDescPtr), chunkLength); + ND_TCHECK2(*((uint8_t *)chunkDescPtr), chunkLength); chunkEnd = ((const u_char*)chunkDescPtr + chunkLength); align=chunkLength % 4; @@ -606,7 +606,7 @@ void sctp_print(netdissect_options *ndo, case SCTP_DATA : { const struct sctpDataPart *dataHdrPtr; - u_int32_t ppid; + uint32_t ppid; const u_char *payloadPtr; u_int payload_size; diff --git a/print-sflow.c b/print-sflow.c index cad42c12..da72848d 100644 --- a/print-sflow.c +++ b/print-sflow.c @@ -54,18 +54,18 @@ */ struct sflow_datagram_t { - u_int8_t version[4]; - u_int8_t ip_version[4]; - u_int8_t agent[4]; - u_int8_t agent_id[4]; - u_int8_t seqnum[4]; - u_int8_t uptime[4]; - u_int8_t samples[4]; + uint8_t version[4]; + uint8_t ip_version[4]; + uint8_t agent[4]; + uint8_t agent_id[4]; + uint8_t seqnum[4]; + uint8_t uptime[4]; + uint8_t samples[4]; }; struct sflow_sample_header { - u_int8_t format[4]; - u_int8_t len[4]; + uint8_t format[4]; + uint8_t len[4]; }; #define SFLOW_FLOW_SAMPLE 1 @@ -82,29 +82,29 @@ static const struct tok sflow_format_values[] = { }; struct sflow_flow_sample_t { - u_int8_t seqnum[4]; - u_int8_t typesource[4]; - u_int8_t rate[4]; - u_int8_t pool[4]; - u_int8_t drops[4]; - u_int8_t in_interface[4]; - u_int8_t out_interface[4]; - u_int8_t records[4]; + uint8_t seqnum[4]; + uint8_t typesource[4]; + uint8_t rate[4]; + uint8_t pool[4]; + uint8_t drops[4]; + uint8_t in_interface[4]; + uint8_t out_interface[4]; + uint8_t records[4]; }; struct sflow_expanded_flow_sample_t { - u_int8_t seqnum[4]; - u_int8_t type[4]; - u_int8_t index[4]; - u_int8_t rate[4]; - u_int8_t pool[4]; - u_int8_t drops[4]; - u_int8_t in_interface_format[4]; - u_int8_t in_interface_value[4]; - u_int8_t out_interface_format[4]; - u_int8_t out_interface_value[4]; - u_int8_t records[4]; + uint8_t seqnum[4]; + uint8_t type[4]; + uint8_t index[4]; + uint8_t rate[4]; + uint8_t pool[4]; + uint8_t drops[4]; + uint8_t in_interface_format[4]; + uint8_t in_interface_value[4]; + uint8_t out_interface_format[4]; + uint8_t out_interface_value[4]; + uint8_t records[4]; }; #define SFLOW_FLOW_RAW_PACKET 1 @@ -156,47 +156,47 @@ static const struct tok sflow_flow_raw_protocol_values[] = { }; struct sflow_expanded_flow_raw_t { - u_int8_t protocol[4]; - u_int8_t length[4]; - u_int8_t stripped_bytes[4]; - u_int8_t header_size[4]; + uint8_t protocol[4]; + uint8_t length[4]; + uint8_t stripped_bytes[4]; + uint8_t header_size[4]; }; struct sflow_ethernet_frame_t { - u_int8_t length[4]; - u_int8_t src_mac[8]; - u_int8_t dst_mac[8]; - u_int8_t type[4]; + uint8_t length[4]; + uint8_t src_mac[8]; + uint8_t dst_mac[8]; + uint8_t type[4]; }; struct sflow_extended_switch_data_t { - u_int8_t src_vlan[4]; - u_int8_t src_pri[4]; - u_int8_t dst_vlan[4]; - u_int8_t dst_pri[4]; + uint8_t src_vlan[4]; + uint8_t src_pri[4]; + uint8_t dst_vlan[4]; + uint8_t dst_pri[4]; }; struct sflow_counter_record_t { - u_int8_t format[4]; - u_int8_t length[4]; + uint8_t format[4]; + uint8_t length[4]; }; struct sflow_flow_record_t { - u_int8_t format[4]; - u_int8_t length[4]; + uint8_t format[4]; + uint8_t length[4]; }; struct sflow_counter_sample_t { - u_int8_t seqnum[4]; - u_int8_t typesource[4]; - u_int8_t records[4]; + uint8_t seqnum[4]; + uint8_t typesource[4]; + uint8_t records[4]; }; struct sflow_expanded_counter_sample_t { - u_int8_t seqnum[4]; - u_int8_t type[4]; - u_int8_t index[4]; - u_int8_t records[4]; + uint8_t seqnum[4]; + uint8_t type[4]; + uint8_t index[4]; + uint8_t records[4]; }; #define SFLOW_COUNTER_GENERIC 1 @@ -232,67 +232,67 @@ static const struct tok sflow_iface_direction_values[] = { }; 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 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 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]; + uint8_t ifindex[4]; + uint8_t iftype[4]; + uint8_t ifspeed[8]; + uint8_t ifdirection[4]; + uint8_t ifstatus[4]; + uint8_t ifinoctets[8]; + uint8_t ifinunicastpkts[4]; + uint8_t ifinmulticastpkts[4]; + uint8_t ifinbroadcastpkts[4]; + uint8_t ifindiscards[4]; + uint8_t ifinerrors[4]; + uint8_t ifinunkownprotos[4]; + uint8_t ifoutoctets[8]; + uint8_t ifoutunicastpkts[4]; + uint8_t ifoutmulticastpkts[4]; + uint8_t ifoutbroadcastpkts[4]; + uint8_t ifoutdiscards[4]; + uint8_t ifouterrors[4]; + uint8_t ifpromiscmode[4]; }; struct sflow_ethernet_counter_t { - u_int8_t alignerrors[4]; - u_int8_t fcserrors[4]; - u_int8_t single_collision_frames[4]; - u_int8_t multiple_collision_frames[4]; - u_int8_t test_errors[4]; - u_int8_t deferred_transmissions[4]; - u_int8_t late_collisions[4]; - u_int8_t excessive_collisions[4]; - u_int8_t mac_transmit_errors[4]; - u_int8_t carrier_sense_errors[4]; - u_int8_t frame_too_longs[4]; - u_int8_t mac_receive_errors[4]; - u_int8_t symbol_errors[4]; + uint8_t alignerrors[4]; + uint8_t fcserrors[4]; + uint8_t single_collision_frames[4]; + uint8_t multiple_collision_frames[4]; + uint8_t test_errors[4]; + uint8_t deferred_transmissions[4]; + uint8_t late_collisions[4]; + uint8_t excessive_collisions[4]; + uint8_t mac_transmit_errors[4]; + uint8_t carrier_sense_errors[4]; + uint8_t frame_too_longs[4]; + uint8_t mac_receive_errors[4]; + uint8_t symbol_errors[4]; }; struct sflow_100basevg_counter_t { - u_int8_t in_highpriority_frames[4]; - 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_data_errors[4]; - u_int8_t in_null_addressed_frames[4]; - u_int8_t out_highpriority_frames[4]; - u_int8_t out_highpriority_octets[8]; - u_int8_t transitioninto_frames[4]; - u_int8_t hc_in_highpriority_octets[8]; - u_int8_t hc_in_normpriority_octets[8]; - u_int8_t hc_out_highpriority_octets[8]; + uint8_t in_highpriority_frames[4]; + uint8_t in_highpriority_octets[8]; + uint8_t in_normpriority_frames[4]; + uint8_t in_normpriority_octets[8]; + uint8_t in_ipmerrors[4]; + uint8_t in_oversized[4]; + uint8_t in_data_errors[4]; + uint8_t in_null_addressed_frames[4]; + uint8_t out_highpriority_frames[4]; + uint8_t out_highpriority_octets[8]; + uint8_t transitioninto_frames[4]; + uint8_t hc_in_highpriority_octets[8]; + uint8_t hc_in_normpriority_octets[8]; + uint8_t hc_out_highpriority_octets[8]; }; struct sflow_vlan_counter_t { - u_int8_t vlan_id[4]; - u_int8_t octets[8]; - u_int8_t unicast_pkt[4]; - u_int8_t multicast_pkt[4]; - u_int8_t broadcast_pkt[4]; - u_int8_t discards[4]; + uint8_t vlan_id[4]; + uint8_t octets[8]; + uint8_t unicast_pkt[4]; + uint8_t multicast_pkt[4]; + uint8_t broadcast_pkt[4]; + uint8_t discards[4]; }; static int @@ -437,11 +437,11 @@ print_sflow_counter_vlan(netdissect_options *ndo, } struct sflow_processor_counter_t { - u_int8_t five_sec_util[4]; - u_int8_t one_min_util[4]; - u_int8_t five_min_util[4]; - u_int8_t total_memory[8]; - u_int8_t free_memory[8]; + uint8_t five_sec_util[4]; + uint8_t one_min_util[4]; + uint8_t five_min_util[4]; + uint8_t total_memory[8]; + uint8_t free_memory[8]; }; static int @@ -825,8 +825,8 @@ sflow_print(netdissect_options *ndo, const u_char *tptr; u_int tlen; - u_int32_t sflow_sample_type, sflow_sample_len; - u_int32_t nsamples; + uint32_t sflow_sample_type, sflow_sample_len; + uint32_t nsamples; tptr = pptr; diff --git a/print-sll.c b/print-sll.c index bddcab38..17d5320d 100644 --- a/print-sll.c +++ b/print-sll.c @@ -78,11 +78,11 @@ #define SLL_ADDRLEN 8 /* length of address field */ struct sll_header { - u_int16_t sll_pkttype; /* packet type */ - u_int16_t sll_hatype; /* link-layer address type */ - u_int16_t sll_halen; /* link-layer address length */ - u_int8_t sll_addr[SLL_ADDRLEN]; /* link-layer address */ - u_int16_t sll_protocol; /* protocol */ + uint16_t sll_pkttype; /* packet type */ + uint16_t sll_hatype; /* link-layer address type */ + uint16_t sll_halen; /* link-layer address length */ + uint8_t sll_addr[SLL_ADDRLEN]; /* link-layer address */ + uint16_t sll_protocol; /* protocol */ }; /* @@ -278,7 +278,7 @@ recurse: return (SLL_HDR_LEN); } if (ndo->ndo_eflag) { - u_int16_t tag = EXTRACT_16BITS(p); + uint16_t tag = EXTRACT_16BITS(p); ND_PRINT((ndo, "vlan %u, p %u%s, ", tag & 0xfff, diff --git a/print-slow.c b/print-slow.c index c5746f12..fec76cab 100644 --- a/print-slow.c +++ b/print-slow.c @@ -32,8 +32,8 @@ #include "oui.h" struct slow_common_header_t { - u_int8_t proto_subtype; - u_int8_t version; + uint8_t proto_subtype; + uint8_t version; }; #define SLOW_PROTO_LACP 1 @@ -79,15 +79,15 @@ static const struct tok slow_oam_code_values[] = { }; struct slow_oam_info_t { - u_int8_t info_type; - u_int8_t info_length; - u_int8_t oam_version; - u_int8_t revision[2]; - u_int8_t state; - u_int8_t oam_config; - u_int8_t oam_pdu_config[2]; - u_int8_t oui[3]; - u_int8_t vendor_private[4]; + uint8_t info_type; + uint8_t info_length; + uint8_t oam_version; + uint8_t revision[2]; + uint8_t state; + uint8_t oam_config; + uint8_t oam_pdu_config[2]; + uint8_t oui[3]; + uint8_t vendor_private[4]; }; #define SLOW_OAM_INFO_TYPE_END_OF_TLV 0x00 @@ -149,29 +149,29 @@ static const struct tok slow_oam_link_event_values[] = { }; struct slow_oam_link_event_t { - u_int8_t event_type; - u_int8_t event_length; - u_int8_t time_stamp[2]; - u_int8_t window[8]; - u_int8_t threshold[8]; - u_int8_t errors[8]; - u_int8_t errors_running_total[8]; - u_int8_t event_running_total[4]; + uint8_t event_type; + uint8_t event_length; + uint8_t time_stamp[2]; + uint8_t window[8]; + uint8_t threshold[8]; + uint8_t errors[8]; + uint8_t errors_running_total[8]; + uint8_t event_running_total[4]; }; struct slow_oam_variablerequest_t { - u_int8_t branch; - u_int8_t leaf[2]; + uint8_t branch; + uint8_t leaf[2]; }; struct slow_oam_variableresponse_t { - u_int8_t branch; - u_int8_t leaf[2]; - u_int8_t length; + uint8_t branch; + uint8_t leaf[2]; + uint8_t length; }; struct slow_oam_loopbackctrl_t { - u_int8_t command; + uint8_t command; }; static const struct tok slow_oam_loopbackctrl_cmd_values[] = { @@ -181,8 +181,8 @@ static const struct tok slow_oam_loopbackctrl_cmd_values[] = { }; struct tlv_header_t { - u_int8_t type; - u_int8_t length; + uint8_t type; + uint8_t length; }; #define LACP_TLV_TERMINATOR 0x00 @@ -205,13 +205,13 @@ static const struct tok slow_tlv_values[] = { }; struct lacp_tlv_actor_partner_info_t { - u_int8_t sys_pri[2]; - u_int8_t sys[ETHER_ADDR_LEN]; - u_int8_t key[2]; - u_int8_t port_pri[2]; - u_int8_t port[2]; - u_int8_t state; - u_int8_t pad[3]; + uint8_t sys_pri[2]; + uint8_t sys[ETHER_ADDR_LEN]; + uint8_t key[2]; + uint8_t port_pri[2]; + uint8_t port[2]; + uint8_t state; + uint8_t pad[3]; }; static const struct tok lacp_tlv_actor_partner_info_state_values[] = { @@ -227,19 +227,19 @@ 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]; + uint8_t max_delay[2]; + uint8_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]; + uint8_t req_port[2]; + uint8_t req_sys[ETHER_ADDR_LEN]; + uint8_t req_trans_id[4]; + uint8_t pad[2]; }; struct lacp_marker_tlv_terminator_t { - u_int8_t pad[50]; + uint8_t pad[50]; }; static void slow_marker_lacp_print(netdissect_options *, register const u_char *, register u_int); @@ -455,13 +455,13 @@ slow_oam_print(netdissect_options *ndo, u_int hexdump; struct slow_oam_common_header_t { - u_int8_t flags[2]; - u_int8_t code; + uint8_t flags[2]; + uint8_t code; }; struct slow_oam_tlv_header_t { - u_int8_t type; - u_int8_t length; + uint8_t type; + uint8_t length; }; union { diff --git a/print-smb.c b/print-smb.c index c686245c..6bffa7cb 100644 --- a/print-smb.c +++ b/print-smb.c @@ -793,10 +793,10 @@ static void print_smb(netdissect_options *ndo, const u_char *buf, const u_char *maxbuf) { - u_int16_t flags2; + uint16_t flags2; int nterrcodes; int command; - u_int32_t nterror; + uint32_t nterror; const u_char *words, *maxwords, *data; const struct smbfns *fn; const char *fmt_smbheader = diff --git a/print-snmp.c b/print-snmp.c index ba326018..40d559da 100644 --- a/print-snmp.c +++ b/print-snmp.c @@ -323,15 +323,15 @@ static const struct obj_abrev { * temporary internal representation while decoding an ASN.1 data stream. */ struct be { - u_int32_t asnlen; + uint32_t asnlen; union { caddr_t raw; int32_t integer; - u_int32_t uns; + uint32_t uns; const u_char *str; struct { - u_int32_t high; - u_int32_t low; + uint32_t high; + uint32_t low; } uns64; } data; u_short id; @@ -472,7 +472,7 @@ asn1_parse(netdissect_options *ndo, elem->asnlen = *p; p++; len--; hdr++; if (elem->asnlen & ASN_BIT8) { - u_int32_t noct = elem->asnlen % ASN_BIT8; + uint32_t noct = elem->asnlen % ASN_BIT8; elem->asnlen = 0; if (len < noct) { ND_PRINT((ndo, "[asnlen? %d<%d]", len, noct)); @@ -551,7 +551,7 @@ asn1_parse(netdissect_options *ndo, case COUNTER: case GAUGE: case TIMETICKS: { - register u_int32_t data; + register uint32_t data; ND_TCHECK2(*p, elem->asnlen); elem->type = BE_UNS; data = 0; @@ -562,7 +562,7 @@ asn1_parse(netdissect_options *ndo, } case COUNTER64: { - register u_int32_t high, low; + register uint32_t high, low; ND_TCHECK2(*p, elem->asnlen); elem->type = BE_UNS64; high = 0, low = 0; @@ -662,8 +662,8 @@ asn1_print(netdissect_options *ndo, struct be *elem) { u_char *p = (u_char *)elem->data.raw; - u_int32_t asnlen = elem->asnlen; - u_int32_t i; + uint32_t asnlen = elem->asnlen; + uint32_t i; switch (elem->type) { @@ -896,7 +896,7 @@ smi_decode_oid(netdissect_options *ndo, unsigned int oidsize, unsigned int *oidlen) { u_char *p = (u_char *)elem->data.raw; - u_int32_t asnlen = elem->asnlen; + uint32_t asnlen = elem->asnlen; int o = 0, first = -1, i = asnlen; for (*oidlen = 0; ndo->ndo_sflag && i-- > 0; p++) { diff --git a/print-stp.c b/print-stp.c index 5cbf5d75..93bb6000 100644 --- a/print-stp.c +++ b/print-stp.c @@ -27,19 +27,19 @@ #define STP_BPDU_MSTP_MIN_LEN 102 struct stp_bpdu_ { - u_int8_t protocol_id[2]; - u_int8_t protocol_version; - u_int8_t bpdu_type; - u_int8_t flags; - u_int8_t root_id[8]; - u_int8_t root_path_cost[4]; - u_int8_t bridge_id[8]; - u_int8_t port_id[2]; - u_int8_t message_age[2]; - u_int8_t max_age[2]; - u_int8_t hello_time[2]; - u_int8_t forward_delay[2]; - u_int8_t v1_length; + uint8_t protocol_id[2]; + uint8_t protocol_version; + uint8_t bpdu_type; + uint8_t flags; + uint8_t root_id[8]; + uint8_t root_path_cost[4]; + uint8_t bridge_id[8]; + uint8_t port_id[2]; + uint8_t message_age[2]; + uint8_t max_age[2]; + uint8_t hello_time[2]; + uint8_t forward_delay[2]; + uint8_t v1_length; }; #define STP_PROTO_REGULAR 0x00 @@ -232,9 +232,9 @@ stp_print_mstp_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu, u_int length) { const u_char *ptr; - u_int16_t v3len; - u_int16_t len; - u_int16_t msti; + uint16_t v3len; + uint16_t len; + uint16_t msti; u_int offset; ptr = (const u_char *)stp_bpdu; diff --git a/print-sunrpc.c b/print-sunrpc.c index e7b1d8ae..bc7138de 100644 --- a/print-sunrpc.c +++ b/print-sunrpc.c @@ -133,23 +133,23 @@ * The service supports remote procedure calls on udp/ip or tcp/ip socket 111. */ -#define SUNRPC_PMAPPORT ((u_int16_t)111) -#define SUNRPC_PMAPPROG ((u_int32_t)100000) -#define SUNRPC_PMAPVERS ((u_int32_t)2) -#define SUNRPC_PMAPVERS_PROTO ((u_int32_t)2) -#define SUNRPC_PMAPVERS_ORIG ((u_int32_t)1) -#define SUNRPC_PMAPPROC_NULL ((u_int32_t)0) -#define SUNRPC_PMAPPROC_SET ((u_int32_t)1) -#define SUNRPC_PMAPPROC_UNSET ((u_int32_t)2) -#define SUNRPC_PMAPPROC_GETPORT ((u_int32_t)3) -#define SUNRPC_PMAPPROC_DUMP ((u_int32_t)4) -#define SUNRPC_PMAPPROC_CALLIT ((u_int32_t)5) +#define SUNRPC_PMAPPORT ((uint16_t)111) +#define SUNRPC_PMAPPROG ((uint32_t)100000) +#define SUNRPC_PMAPVERS ((uint32_t)2) +#define SUNRPC_PMAPVERS_PROTO ((uint32_t)2) +#define SUNRPC_PMAPVERS_ORIG ((uint32_t)1) +#define SUNRPC_PMAPPROC_NULL ((uint32_t)0) +#define SUNRPC_PMAPPROC_SET ((uint32_t)1) +#define SUNRPC_PMAPPROC_UNSET ((uint32_t)2) +#define SUNRPC_PMAPPROC_GETPORT ((uint32_t)3) +#define SUNRPC_PMAPPROC_DUMP ((uint32_t)4) +#define SUNRPC_PMAPPROC_CALLIT ((uint32_t)5) struct sunrpc_pmap { - u_int32_t pm_prog; - u_int32_t pm_vers; - u_int32_t pm_prot; - u_int32_t pm_port; + uint32_t pm_prog; + uint32_t pm_vers; + uint32_t pm_prot; + uint32_t pm_port; }; static const struct tok proc2str[] = { @@ -163,7 +163,7 @@ static const struct tok proc2str[] = { }; /* Forwards */ -static char *progstr(u_int32_t); +static char *progstr(uint32_t); void sunrpcrequest_print(netdissect_options *ndo, register const u_char *bp, @@ -174,7 +174,7 @@ sunrpcrequest_print(netdissect_options *ndo, register const u_char *bp, #ifdef INET6 register const struct ip6_hdr *ip6; #endif - u_int32_t x; + uint32_t x; char srcid[20], dstid[20]; /*fits 32bit*/ rp = (struct sunrpc_msg *)bp; @@ -232,13 +232,13 @@ sunrpcrequest_print(netdissect_options *ndo, register const u_char *bp, } static char * -progstr(u_int32_t prog) +progstr(uint32_t prog) { #if defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H) register struct rpcent *rp; #endif static char buf[32]; - static u_int32_t lastprog = 0; + static uint32_t lastprog = 0; if (lastprog != 0 && prog == lastprog) return (buf); diff --git a/print-symantec.c b/print-symantec.c index 39d8b651..dcff2a66 100644 --- a/print-symantec.c +++ b/print-symantec.c @@ -33,16 +33,16 @@ #include "ether.h" struct symantec_header { - u_int8_t stuff1[6]; - u_int16_t ether_type; - u_int8_t stuff2[36]; + uint8_t stuff1[6]; + uint16_t ether_type; + uint8_t stuff2[36]; }; static inline void symantec_hdr_print(netdissect_options *ndo, register const u_char *bp, u_int length) { register const struct symantec_header *sp; - u_int16_t etype; + uint16_t etype; sp = (const struct symantec_header *)bp; diff --git a/print-syslog.c b/print-syslog.c index 87ce1dc7..5e3cd4f7 100644 --- a/print-syslog.c +++ b/print-syslog.c @@ -79,9 +79,9 @@ void syslog_print(netdissect_options *ndo, register const u_char *pptr, register u_int len) { - u_int16_t msg_off = 0; - u_int16_t pri = 0; - u_int16_t facility,severity; + uint16_t msg_off = 0; + uint16_t pri = 0; + uint16_t facility,severity; /* extract decimal figures that are * encapsulated within < > tags diff --git a/print-tcp.c b/print-tcp.c index f91ba208..5b1133a6 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -145,7 +145,7 @@ tcp_cksum(netdissect_options *ndo, register const struct tcphdr *tp, register u_int len) { - return nextproto4_cksum(ndo, ip, (const u_int8_t *)tp, len, len, + return nextproto4_cksum(ndo, ip, (const uint8_t *)tp, len, len, IPPROTO_TCP); } @@ -159,10 +159,10 @@ tcp_print(netdissect_options *ndo, register u_char flags; register u_int hlen; register char ch; - u_int16_t sport, dport, win, urp; - u_int32_t seq, ack, thseq, thack; + uint16_t sport, dport, win, urp; + uint32_t seq, ack, thseq, thack; u_int utoval; - u_int16_t magic; + uint16_t magic; register int rev; #ifdef INET6 register const struct ip6_hdr *ip6; @@ -372,7 +372,7 @@ tcp_print(netdissect_options *ndo, if (ndo->ndo_vflag && !ndo->ndo_Kflag && !fragmented) { /* Check the checksum, if possible. */ - u_int16_t sum, tcp_sum; + uint16_t sum, tcp_sum; if (IP_V(ip) == 4) { if (ND_TTEST2(tp->th_sport, length)) { @@ -390,7 +390,7 @@ tcp_print(netdissect_options *ndo, #ifdef INET6 else if (IP_V(ip) == 6 && ip6->ip6_plen) { if (ND_TTEST2(tp->th_sport, length)) { - sum = nextproto6_cksum(ip6, (const u_int8_t *)tp, + sum = nextproto6_cksum(ip6, (const uint8_t *)tp, length, length, IPPROTO_TCP); tcp_sum = EXTRACT_16BITS(&tp->th_sum); @@ -476,7 +476,7 @@ tcp_print(netdissect_options *ndo, if (datalen % 8 != 0) { ND_PRINT((ndo, "malformed sack")); } else { - u_int32_t s, e; + uint32_t s, e; ND_PRINT((ndo, " %d ", datalen / 8)); for (i = 0; i < datalen; i += 8) { @@ -715,7 +715,7 @@ tcp_print(netdissect_options *ndo, * Pass offset of data plus 4 bytes for RPC TCP msg length * to NFS print routines. */ - u_int32_t fraglen; + uint32_t fraglen; register struct sunrpc_msg *rp; enum sunrpc_msg_type direction; @@ -795,11 +795,11 @@ tcp_verify_signature(netdissect_options *ndo, u_char sig[TCP_SIGLEN]; char zero_proto = 0; MD5_CTX ctx; - u_int16_t savecsum, tlen; + uint16_t savecsum, tlen; #ifdef INET6 struct ip6_hdr *ip6; - u_int32_t len32; - u_int8_t nxt; + uint32_t len32; + uint8_t nxt; #endif if (data + length > ndo->ndo_snapend) { diff --git a/print-timed.c b/print-timed.c index b3f53216..dc2b24a4 100644 --- a/print-timed.c +++ b/print-timed.c @@ -34,14 +34,14 @@ */ struct tsp_timeval { - u_int32_t tv_sec; - u_int32_t tv_usec; + uint32_t tv_sec; + uint32_t tv_usec; }; struct tsp { - u_int8_t tsp_type; - u_int8_t tsp_vers; - u_int16_t tsp_seq; + uint8_t tsp_type; + uint8_t tsp_vers; + uint16_t tsp_seq; union { struct tsp_timeval tspu_time; int8_t tspu_hopcnt; diff --git a/print-tipc.c b/print-tipc.c index 809c50db..b883fba9 100644 --- a/print-tipc.c +++ b/print-tipc.c @@ -63,8 +63,8 @@ static const char tstr[] = "[|TIPC]"; #define TIPC_NODE(addr) (((addr) >> 0) & 0xFFF) struct tipc_pkthdr { - u_int32_t w0; - u_int32_t w1; + uint32_t w0; + uint32_t w1; }; #define TIPC_VER(w0) (((w0) >> 29) & 0x07) @@ -107,30 +107,30 @@ static const struct tok tipc_linkconf_mtype_values[] = { }; struct payload_tipc_pkthdr { - u_int32_t w0; - u_int32_t w1; - u_int32_t w2; - u_int32_t prev_node; - u_int32_t orig_port; - u_int32_t dest_port; - u_int32_t orig_node; - u_int32_t dest_node; - u_int32_t name_type; - u_int32_t w9; - u_int32_t wA; + uint32_t w0; + uint32_t w1; + uint32_t w2; + uint32_t prev_node; + uint32_t orig_port; + uint32_t dest_port; + uint32_t orig_node; + uint32_t dest_node; + uint32_t name_type; + uint32_t w9; + uint32_t wA; }; struct internal_tipc_pkthdr { - u_int32_t w0; - u_int32_t w1; - u_int32_t w2; - u_int32_t prev_node; - u_int32_t w4; - u_int32_t w5; - u_int32_t orig_node; - u_int32_t dest_node; - u_int32_t trans_seq; - u_int32_t w9; + uint32_t w0; + uint32_t w1; + uint32_t w2; + uint32_t prev_node; + uint32_t w4; + uint32_t w5; + uint32_t orig_node; + uint32_t dest_node; + uint32_t trans_seq; + uint32_t w9; }; #define TIPC_SEQ_GAP(w1) (((w1) >> 16) & 0x1FFF) @@ -143,13 +143,13 @@ struct internal_tipc_pkthdr { #define TIPC_LINK_TOL(w9) (((w9) >> 0) & 0xFFFF) struct link_conf_tipc_pkthdr { - u_int32_t w0; - u_int32_t w1; - u_int32_t dest_domain; - u_int32_t prev_node; - u_int32_t ntwrk_id; - u_int32_t w5; - u_int8_t media_address[16]; + uint32_t w0; + uint32_t w1; + uint32_t dest_domain; + uint32_t prev_node; + uint32_t ntwrk_id; + uint32_t w5; + uint8_t media_address[16]; }; #define TIPC_NODE_SIG(w1) (((w1) >> 0) & 0xFFFF) @@ -158,7 +158,7 @@ struct link_conf_tipc_pkthdr { static void print_payload(netdissect_options *ndo, const struct payload_tipc_pkthdr *ap) { - u_int32_t w0, w1, w2; + uint32_t w0, w1, w2; u_int user; u_int hsize; u_int msize; @@ -223,7 +223,7 @@ trunc: static void print_internal(netdissect_options *ndo, const struct internal_tipc_pkthdr *ap) { - u_int32_t w0, w1, w2, w4, w5, w9; + uint32_t w0, w1, w2, w4, w5, w9; u_int user; u_int hsize; u_int msize; @@ -291,7 +291,7 @@ trunc: static void print_link_conf(netdissect_options *ndo, const struct link_conf_tipc_pkthdr *ap) { - u_int32_t w0, w1, w5; + uint32_t w0, w1, w5; u_int user; u_int hsize; u_int msize; @@ -339,7 +339,7 @@ tipc_print(netdissect_options *ndo, const u_char *bp, u_int length _U_, u_int caplen _U_) { const struct tipc_pkthdr *ap; - u_int32_t w0; + uint32_t w0; u_int user; ap = (struct tipc_pkthdr *)bp; diff --git a/print-token.c b/print-token.c index 027fb69f..b88bcf79 100644 --- a/print-token.c +++ b/print-token.c @@ -82,12 +82,12 @@ #define SEGMENT_COUNT(trp) ((int)((RIF_LENGTH(trp) - 2) / 2)) struct token_header { - u_int8_t token_ac; - u_int8_t token_fc; - u_int8_t token_dhost[TOKEN_RING_MAC_LEN]; - u_int8_t token_shost[TOKEN_RING_MAC_LEN]; - u_int16_t token_rcf; - u_int16_t token_rseg[ROUTING_SEGMENT_MAX]; + uint8_t token_ac; + uint8_t token_fc; + uint8_t token_dhost[TOKEN_RING_MAC_LEN]; + uint8_t token_shost[TOKEN_RING_MAC_LEN]; + uint16_t token_rcf; + uint16_t token_rseg[ROUTING_SEGMENT_MAX]; }; static const char tstr[] = "[|token-ring]"; diff --git a/print-udp.c b/print-udp.c index a567cefc..f3da50c9 100644 --- a/print-udp.c +++ b/print-udp.c @@ -46,14 +46,14 @@ #include "bootp.h" struct rtcphdr { - u_int16_t rh_flags; /* T:2 P:1 CNT:5 PT:8 */ - u_int16_t rh_len; /* length of message (in words) */ - u_int32_t rh_ssrc; /* synchronization src id */ + uint16_t rh_flags; /* T:2 P:1 CNT:5 PT:8 */ + uint16_t rh_len; /* length of message (in words) */ + uint32_t rh_ssrc; /* synchronization src id */ }; typedef struct { - u_int32_t upper; /* more significant 32 bits */ - u_int32_t lower; /* less significant 32 bits */ + uint32_t upper; /* more significant 32 bits */ + uint32_t lower; /* less significant 32 bits */ } ntp64; /* @@ -61,9 +61,9 @@ typedef struct { */ struct rtcp_sr { ntp64 sr_ntp; /* 64-bit ntp timestamp */ - u_int32_t sr_ts; /* reference media timestamp */ - u_int32_t sr_np; /* no. packets sent */ - u_int32_t sr_nb; /* no. bytes sent */ + uint32_t sr_ts; /* reference media timestamp */ + uint32_t sr_np; /* no. packets sent */ + uint32_t sr_nb; /* no. bytes sent */ }; /* @@ -71,12 +71,12 @@ struct rtcp_sr { * Time stamps are middle 32-bits of ntp timestamp. */ struct rtcp_rr { - u_int32_t rr_srcid; /* sender being reported */ - u_int32_t rr_nl; /* no. packets lost */ - u_int32_t rr_ls; /* extended last seq number received */ - u_int32_t rr_dv; /* jitter (delay variance) */ - u_int32_t rr_lsr; /* orig. ts from last rr from this src */ - u_int32_t rr_dlsr; /* time from recpt of last rr to xmit time */ + uint32_t rr_srcid; /* sender being reported */ + uint32_t rr_nl; /* no. packets lost */ + uint32_t rr_ls; /* extended last seq number received */ + uint32_t rr_dv; /* jitter (delay variance) */ + uint32_t rr_lsr; /* orig. ts from last rr from this src */ + uint32_t rr_dlsr; /* time from recpt of last rr to xmit time */ }; /*XXX*/ @@ -98,18 +98,18 @@ static void vat_print(netdissect_options *ndo, const void *hdr, register const struct udphdr *up) { /* vat/vt audio */ - u_int ts = *(u_int16_t *)hdr; + u_int ts = *(uint16_t *)hdr; if ((ts & 0xf060) != 0) { /* probably vt */ ND_PRINT((ndo, "udp/vt %u %d / %d", - (u_int32_t)(EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up)), + (uint32_t)(EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up)), ts & 0x3ff, ts >> 10)); } else { /* probably vat */ - u_int32_t i0 = EXTRACT_32BITS(&((u_int *)hdr)[0]); - u_int32_t i1 = EXTRACT_32BITS(&((u_int *)hdr)[1]); + uint32_t i0 = EXTRACT_32BITS(&((u_int *)hdr)[0]); + uint32_t i1 = EXTRACT_32BITS(&((u_int *)hdr)[1]); ND_PRINT((ndo, "udp/vat %u c%d %u%s", - (u_int32_t)(EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up) - 8), + (uint32_t)(EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up) - 8), i0 & 0xffff, i1, i0 & 0x800000? "*" : "")); /* audio format */ @@ -127,8 +127,8 @@ rtp_print(netdissect_options *ndo, const void *hdr, u_int len, /* rtp v1 or v2 */ u_int *ip = (u_int *)hdr; u_int hasopt, hasext, contype, hasmarker; - u_int32_t i0 = EXTRACT_32BITS(&((u_int *)hdr)[0]); - u_int32_t i1 = EXTRACT_32BITS(&((u_int *)hdr)[1]); + uint32_t i0 = EXTRACT_32BITS(&((u_int *)hdr)[0]); + uint32_t i1 = EXTRACT_32BITS(&((u_int *)hdr)[1]); u_int dlen = EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up) - 8; const char * ptype; @@ -199,7 +199,7 @@ rtcp_print(netdissect_options *ndo, const u_char *hdr, const u_char *ep) struct rtcp_sr *sr; struct rtcphdr *rh = (struct rtcphdr *)hdr; u_int len; - u_int16_t flags; + uint16_t flags; int cnt; double ts, dts; if ((u_char *)(rh + 1) > ep) { @@ -276,7 +276,7 @@ static int udp_cksum(netdissect_options *ndo, register const struct ip *ip, register const struct udphdr *up, register u_int len) { - return nextproto4_cksum(ndo, ip, (const u_int8_t *)(void *)up, len, len, + return nextproto4_cksum(ndo, ip, (const uint8_t *)(void *)up, len, len, IPPROTO_UDP); } @@ -284,7 +284,7 @@ static int udp_cksum(netdissect_options *ndo, register const struct ip *ip, static int udp6_cksum(const struct ip6_hdr *ip6, const struct udphdr *up, u_int len) { - return nextproto6_cksum(ip6, (const u_int8_t *)(void *)up, len, len, + return nextproto6_cksum(ip6, (const uint8_t *)(void *)up, len, len, IPPROTO_UDP); } #endif @@ -353,7 +353,7 @@ udp_print(netdissect_options *ndo, register const u_char *bp, u_int length, register const struct ip *ip; register const u_char *cp; register const u_char *ep = bp + length; - u_int16_t sport, dport, ulen; + uint16_t sport, dport, ulen; #ifdef INET6 register const struct ip6_hdr *ip6; #endif @@ -522,7 +522,7 @@ udp_print(netdissect_options *ndo, register const u_char *bp, u_int length, if (ndo->ndo_vflag && !ndo->ndo_Kflag && !fragmented) { /* Check the checksum, if possible. */ - u_int16_t sum, udp_sum; + uint16_t sum, udp_sum; /* * XXX - do this even if vflag == 1? @@ -678,10 +678,10 @@ udp_print(netdissect_options *ndo, register const u_char *bp, u_int length, vxlan_print(ndo, (const u_char *)(up + 1), length); else ND_PRINT((ndo, "UDP, length %u", - (u_int32_t)(ulen - sizeof(*up)))); + (uint32_t)(ulen - sizeof(*up)))); #undef ISPORT } else - ND_PRINT((ndo, "UDP, length %u", (u_int32_t)(ulen - sizeof(*up)))); + ND_PRINT((ndo, "UDP, length %u", (uint32_t)(ulen - sizeof(*up)))); } diff --git a/print-vqp.c b/print-vqp.c index a316b0cd..04dbcc2e 100644 --- a/print-vqp.c +++ b/print-vqp.c @@ -44,16 +44,16 @@ */ struct vqp_common_header_t { - u_int8_t version; - u_int8_t msg_type; - u_int8_t error_code; - u_int8_t nitems; - u_int8_t sequence[4]; + uint8_t version; + uint8_t msg_type; + uint8_t error_code; + uint8_t nitems; + uint8_t sequence[4]; }; struct vqp_obj_tlv_t { - u_int8_t obj_type[4]; - u_int8_t obj_length[2]; + uint8_t obj_type[4]; + uint8_t obj_length[2]; }; #define VQP_OBJ_REQ_JOIN_PORT 0x01 @@ -104,10 +104,10 @@ vqp_print(netdissect_options *ndo, register const u_char *pptr, register u_int l const struct vqp_obj_tlv_t *vqp_obj_tlv; const u_char *tptr; - u_int16_t vqp_obj_len; - u_int32_t vqp_obj_type; + uint16_t vqp_obj_len; + uint32_t vqp_obj_type; int tlen; - u_int8_t nitems; + uint8_t nitems; tptr=pptr; tlen = len; diff --git a/print-vrrp.c b/print-vrrp.c index 4e5da145..f739d1ed 100644 --- a/print-vrrp.c +++ b/print-vrrp.c @@ -127,7 +127,7 @@ vrrp_print(netdissect_options *ndo, ND_PRINT((ndo, ", authtype %s", tok2str(auth2str, NULL, auth_type))); ND_PRINT((ndo, ", intvl %us, length %u", bp[5], len)); } else { /* version == 3 */ - u_int16_t intvl = (bp[4] & 0x0f) << 8 | bp[5]; + uint16_t intvl = (bp[4] & 0x0f) << 8 | bp[5]; ND_PRINT((ndo, ", intvl %ucs, length %u", intvl, len)); } @@ -147,7 +147,7 @@ vrrp_print(netdissect_options *ndo, } if (version == 3 && ND_TTEST2(bp[0], len)) { - u_int16_t cksum = nextproto4_cksum(ndo, (struct ip *)bp2, bp, + uint16_t cksum = nextproto4_cksum(ndo, (struct ip *)bp2, bp, len, len, IPPROTO_VRRP); if (cksum) ND_PRINT((ndo, ", (bad vrrp cksum %x)", diff --git a/print-vtp.c b/print-vtp.c index 2d331c0a..08f3bdc9 100644 --- a/print-vtp.c +++ b/print-vtp.c @@ -45,13 +45,13 @@ #define VTP_JOIN_MESSAGE 0x04 struct vtp_vlan_ { - u_int8_t len; - u_int8_t status; - u_int8_t type; - u_int8_t name_len; - u_int16_t vlanid; - u_int16_t mtu; - u_int32_t index; + uint8_t len; + uint8_t status; + uint8_t type; + uint8_t name_len; + uint16_t vlanid; + uint16_t mtu; + uint32_t index; }; static const struct tok vtp_message_type_values[] = { diff --git a/print-vxlan.c b/print-vxlan.c index a86e9cfa..62b4b2ba 100644 --- a/print-vxlan.c +++ b/print-vxlan.c @@ -38,8 +38,8 @@ void vxlan_print(netdissect_options *ndo, const u_char *bp, u_int len) { - u_int8_t flags; - u_int32_t vni; + uint8_t flags; + uint32_t vni; if (len < 8) { ND_PRINT((ndo, "[|VXLAN]")); diff --git a/print-wb.c b/print-wb.c index 29e82910..49100fa4 100644 --- a/print-wb.c +++ b/print-wb.c @@ -56,9 +56,9 @@ static const char tstr[] = "[|wb]"; * The transport level header. */ struct pkt_hdr { - u_int32_t ph_src; /* site id of source */ - u_int32_t ph_ts; /* time stamp (for skew computation) */ - u_int16_t ph_version; /* version number */ + uint32_t ph_src; /* site id of source */ + uint32_t ph_ts; /* time stamp (for skew computation) */ + uint16_t ph_version; /* version number */ u_char ph_type; /* message type */ u_char ph_flags; /* message flags */ }; @@ -81,13 +81,13 @@ struct pkt_hdr { #define PF_VIS 0x02 /* only visible ops wanted */ struct PageID { - u_int32_t p_sid; /* session id of initiator */ - u_int32_t p_uid; /* page number */ + uint32_t p_sid; /* session id of initiator */ + uint32_t p_uid; /* page number */ }; struct dophdr { - u_int32_t dh_ts; /* sender's timestamp */ - u_int16_t dh_len; /* body length */ + uint32_t dh_ts; /* sender's timestamp */ + uint16_t dh_len; /* body length */ u_char dh_flags; u_char dh_type; /* body type */ /* body follows */ @@ -116,8 +116,8 @@ struct dophdr { */ struct pkt_dop { struct PageID pd_page; /* page that operations apply to */ - u_int32_t pd_sseq; /* start sequence number */ - u_int32_t pd_eseq; /* end sequence number */ + uint32_t pd_sseq; /* start sequence number */ + uint32_t pd_eseq; /* end sequence number */ /* drawing ops follow */ }; @@ -125,31 +125,31 @@ struct pkt_dop { * A repair request. */ struct pkt_rreq { - u_int32_t pr_id; /* source id of drawops to be repaired */ + uint32_t pr_id; /* source id of drawops to be repaired */ struct PageID pr_page; /* page of drawops */ - u_int32_t pr_sseq; /* start seqno */ - u_int32_t pr_eseq; /* end seqno */ + uint32_t pr_sseq; /* start seqno */ + uint32_t pr_eseq; /* end seqno */ }; /* * A repair reply. */ struct pkt_rrep { - u_int32_t pr_id; /* original site id of ops */ + uint32_t pr_id; /* original site id of ops */ struct pkt_dop pr_dop; /* drawing ops follow */ }; struct id_off { - u_int32_t id; - u_int32_t off; + uint32_t id; + uint32_t off; }; struct pgstate { - u_int32_t slot; + uint32_t slot; struct PageID page; - u_int16_t nid; - u_int16_t rsvd; + uint16_t nid; + uint16_t rsvd; /* seqptr's */ }; @@ -157,7 +157,7 @@ struct pgstate { * An announcement packet. */ struct pkt_id { - u_int32_t pi_mslot; + uint32_t pi_mslot; struct PageID pi_mpage; /* current page */ struct pgstate pi_ps; /* seqptr's */ @@ -166,12 +166,12 @@ struct pkt_id { struct pkt_preq { struct PageID pp_page; - u_int32_t pp_low; - u_int32_t pp_high; + uint32_t pp_low; + uint32_t pp_high; }; struct pkt_prep { - u_int32_t pp_n; /* size of pageid array */ + uint32_t pp_n; /* size of pageid array */ /* pgstate's follow */ }; @@ -309,7 +309,7 @@ static const char *dopstr[] = { static int wb_dops(netdissect_options *ndo, - const struct dophdr *dh, u_int32_t ss, u_int32_t es) + const struct dophdr *dh, uint32_t ss, uint32_t es) { ND_PRINT((ndo, " <")); for ( ; ss <= es; ++ss) { @@ -320,7 +320,7 @@ wb_dops(netdissect_options *ndo, else { ND_PRINT((ndo, " %s", dopstr[t])); if (t == DT_SKIP || t == DT_HOLE) { - u_int32_t ts = EXTRACT_32BITS(&dh->dh_ts); + uint32_t ts = EXTRACT_32BITS(&dh->dh_ts); ND_PRINT((ndo, "%d", ts - ss + 1)); if (ss > ts || ts > es) { ND_PRINT((ndo, "[|]")); diff --git a/print-zeromq.c b/print-zeromq.c index 9c5bb354..0ef30517 100644 --- a/print-zeromq.c +++ b/print-zeromq.c @@ -77,8 +77,8 @@ static const char tstr[] = " [|zmtp1]"; static const u_char * zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep) { - u_int64_t body_len_declared, body_len_captured, header_len; - u_int8_t flags; + uint64_t body_len_declared, body_len_captured, header_len; + uint8_t flags; ND_PRINT((ndo, "\n\t")); ND_TCHECK2(*cp, 1); /* length/0xFF */ @@ -109,7 +109,7 @@ zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep) { ND_PRINT((ndo, ", flags 0x%02x", flags)); if (ndo->ndo_vflag) { - u_int64_t body_len_printed = min(body_len_captured, body_len_declared); + uint64_t body_len_printed = min(body_len_captured, body_len_declared); ND_PRINT((ndo, " (%s|%s|%s|%s|%s|%s|%s|%s)", flags & 0x80 ? "MBZ" : "-", @@ -166,7 +166,7 @@ zmtp1_print(netdissect_options *ndo, const u_char *cp, u_int len) { static const u_char * zmtp1_print_intermediate_part(netdissect_options *ndo, const u_char *cp, const u_int len) { u_int frame_offset; - u_int64_t remaining_len; + uint64_t remaining_len; ND_TCHECK2(*cp, 2); frame_offset = EXTRACT_16BITS(cp); @@ -187,7 +187,7 @@ zmtp1_print_intermediate_part(netdissect_options *ndo, const u_char *cp, const u if (frame_offset > remaining_len) ND_PRINT((ndo, " (%"PRIu64" captured)", remaining_len)); if (ndo->ndo_vflag) { - u_int64_t len_printed = min(frame_offset, remaining_len); + uint64_t len_printed = min(frame_offset, remaining_len); if (ndo->ndo_vflag == 1) len_printed = min(VBYTES, len_printed); diff --git a/signature.c b/signature.c index c3520a08..324035fb 100644 --- a/signature.c +++ b/signature.c @@ -46,8 +46,8 @@ const struct tok signature_check_values[] = { */ USES_APPLE_DEPRECATED_API static void -signature_compute_hmac_md5(const u_int8_t *text, int text_len, unsigned char *key, - unsigned int key_len, u_int8_t *digest) +signature_compute_hmac_md5(const uint8_t *text, int text_len, unsigned char *key, + unsigned int key_len, uint8_t *digest) { MD5_CTX context; unsigned char k_ipad[65]; /* inner padding - key XORd with ipad */ @@ -119,8 +119,8 @@ int signature_verify(netdissect_options *ndo, const u_char *pptr, u_int plen, u_char *sig_ptr) { - u_int8_t rcvsig[16]; - u_int8_t sig[16]; + uint8_t rcvsig[16]; + uint8_t sig[16]; unsigned int i; /* diff --git a/smbutil.c b/smbutil.c index 95740daa..1c1742c2 100644 --- a/smbutil.c +++ b/smbutil.c @@ -21,16 +21,16 @@ #include "extract.h" #include "smb.h" -static u_int32_t stringlen; +static uint32_t stringlen; extern const u_char *startbuf; /* * interpret a 32 bit dos packed date/time to some parameters */ static void -interpret_dos_date(u_int32_t date, struct tm *tp) +interpret_dos_date(uint32_t date, struct tm *tp) { - u_int32_t p0, p1, p2, p3; + uint32_t p0, p1, p2, p3; p0 = date & 0xFF; p1 = ((date & 0xFF00) >> 8) & 0xFF; @@ -50,7 +50,7 @@ interpret_dos_date(u_int32_t date, struct tm *tp) * create a unix date from a dos date */ static time_t -int_unix_date(u_int32_t dos_date) +int_unix_date(uint32_t dos_date) { struct tm t; @@ -72,7 +72,7 @@ int_unix_date(u_int32_t dos_date) static time_t make_unix_date(const u_char *date_ptr) { - u_int32_t dos_date = 0; + uint32_t dos_date = 0; dos_date = EXTRACT_LE_32BITS(date_ptr); @@ -86,7 +86,7 @@ make_unix_date(const u_char *date_ptr) static time_t make_unix_date2(const u_char *date_ptr) { - u_int32_t x, x2; + uint32_t x, x2; x = EXTRACT_LE_32BITS(date_ptr); x2 = ((x & 0xFFFF) << 16) | ((x & 0xFFFF0000) >> 16); @@ -181,7 +181,7 @@ name_ptr(netdissect_options *ndo, /* XXX - this should use the same code that the DNS dissector does */ if ((c & 0xC0) == 0xC0) { - u_int16_t l; + uint16_t l; ND_TCHECK2(*p, 2); if ((p + 1) >= maxbuf) @@ -341,11 +341,11 @@ write_bits(netdissect_options *ndo, #define MAX_UNISTR_SIZE 1000 static const char * unistr(netdissect_options *ndo, - const u_char *s, u_int32_t *len, int use_unicode) + const u_char *s, uint32_t *len, int use_unicode) { static char buf[MAX_UNISTR_SIZE+1]; size_t l = 0; - u_int32_t strsize; + uint32_t strsize; const u_char *sp; if (use_unicode) { @@ -525,7 +525,7 @@ smb_fdata1(netdissect_options *ndo, } case 'L': { - u_int64_t x; + uint64_t x; ND_TCHECK2(buf[0], 8); x = reverse ? EXTRACT_64BITS(buf) : EXTRACT_LE_64BITS(buf); @@ -537,14 +537,14 @@ smb_fdata1(netdissect_options *ndo, case 'M': { /* Weird mixed-endian length values in 64-bit locks */ - u_int32_t x1, x2; - u_int64_t x; + uint32_t x1, x2; + uint64_t x; ND_TCHECK2(buf[0], 8); x1 = reverse ? EXTRACT_32BITS(buf) : EXTRACT_LE_32BITS(buf); x2 = reverse ? EXTRACT_32BITS(buf + 4) : EXTRACT_LE_32BITS(buf + 4); - x = (((u_int64_t)x1) << 32) | x2; + x = (((uint64_t)x1) << 32) | x2; ND_PRINT((ndo, "%" PRIu64 " (0x%" PRIx64 ")", x, x)); buf += 8; fmt++; @@ -618,7 +618,7 @@ smb_fdata1(netdissect_options *ndo, { /*XXX unistr() */ const char *s; - u_int32_t len; + uint32_t len; len = 0; s = unistr(ndo, buf, &len, (*fmt == 'R') ? 0 : unicodestr); @@ -633,7 +633,7 @@ smb_fdata1(netdissect_options *ndo, case 'Y': /* like 'Z', but always ASCII */ { const char *s; - u_int32_t len; + uint32_t len; ND_TCHECK(*buf); if (*buf != 4 && *buf != 2) { @@ -730,7 +730,7 @@ smb_fdata1(netdissect_options *ndo, time_t t; struct tm *lt; const char *tstring; - u_int32_t x; + uint32_t x; switch (atoi(fmt + 1)) { case 1: @@ -1013,7 +1013,7 @@ smb_errstr(int class, int num) } typedef struct { - u_int32_t code; + uint32_t code; const char *name; } nt_err_code_struct; @@ -1877,7 +1877,7 @@ static const nt_err_code_struct nt_errors[] = { * return an NT error string from a SMB buffer */ const char * -nt_errstr(u_int32_t err) +nt_errstr(uint32_t err) { static char ret[128]; int i; diff --git a/tcpdump-stdinc.h b/tcpdump-stdinc.h index d971341c..0a94bb59 100644 --- a/tcpdump-stdinc.h +++ b/tcpdump-stdinc.h @@ -104,14 +104,9 @@ typedef char* caddr_t; #include #if HAVE_INTTYPES_H #include -#else -#if HAVE_STDINT_H +#elif HAVE_STDINT_H #include #endif -#endif -#ifdef HAVE_SYS_BITYPES_H -#include -#endif #include #include /* concession to AIX */ #include diff --git a/util.c b/util.c index c07bc3a7..13c87225 100644 --- a/util.c +++ b/util.c @@ -409,9 +409,9 @@ tok2strary_internal(register const char **lp, int n, register const char *fmt, */ int -mask2plen(u_int32_t mask) +mask2plen(uint32_t mask) { - u_int32_t bitmasks[33] = { + uint32_t bitmasks[33] = { 0x00000000, 0x80000000, 0xc0000000, 0xe0000000, 0xf0000000, 0xf8000000, 0xfc000000, 0xfe000000, 0xff000000, -- 2.39.5