[[
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
-# endif
-# ifdef HAVE_SYS_BITYPES_H
- #include <sys/bitypes.h>
# endif
#include <stdio.h>
#include <sys/types.h>
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)
#define HASHNAMESIZE 4096
struct hnamemem {
- u_int32_t addr;
+ uint32_t addr;
const char *name;
struct hnamemem *nxt;
};
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;
* A faster replacement for inet_ntoa().
*/
const char *
-intoa(u_int32_t addr)
+intoa(uint32_t addr)
{
register char *cp;
register u_int byte;
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
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));
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() */
{
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)
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)
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)
{
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)
* 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;
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,
{
#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++ )
{
#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;
* 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;
/* Define to 1 if the system has the type `struct ether_addr'. */
#undef HAVE_STRUCT_ETHER_ADDR
-/* Define to 1 if you have the <sys/bitypes.h> header file. */
-#undef HAVE_SYS_BITYPES_H
-
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
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
#
-# 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 <sys/bitypes.h>
-#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 <sys/bitypes.h>
-#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 <sys/bitypes.h>
-#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 <sys/bitypes.h>
-#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
#
#include <inttypes.h>
#include <stdio.h>
#include <sys/types.h>
- #ifdef HAVE_SYS_BITYPES_H
- #include <sys/bitypes.h>
- #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);
}
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
-# endif
-# ifdef HAVE_SYS_BITYPES_H
- #include <sys/bitypes.h>
# endif
#include <stdio.h>
#include <sys/types.h>
main()
{
- u_int64_t t = 1;
+ uint64_t t = 1;
char strbuf[16+1];
sprintf(strbuf, "%016lx", t << 32);
if (strcmp(strbuf, "0000000100000000") == 0)
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
-# endif
-# ifdef HAVE_SYS_BITYPES_H
- #include <sys/bitypes.h>
# endif
#include <stdio.h>
#include <sys/types.h>
main()
{
- u_int64_t t = 1;
+ uint64_t t = 1;
char strbuf[16+1];
sprintf(strbuf, "%016llx", t << 32);
if (strcmp(strbuf, "0000000100000000") == 0)
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
-# endif
-# ifdef HAVE_SYS_BITYPES_H
- #include <sys/bitypes.h>
# endif
#include <stdio.h>
#include <sys/types.h>
main()
{
- u_int64_t t = 1;
+ uint64_t t = 1;
char strbuf[16+1];
sprintf(strbuf, "%016Lx", t << 32);
if (strcmp(strbuf, "0000000100000000") == 0)
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
-# endif
-# ifdef HAVE_SYS_BITYPES_H
- #include <sys/bitypes.h>
# endif
#include <stdio.h>
#include <sys/types.h>
main()
{
- u_int64_t t = 1;
+ uint64_t t = 1;
char strbuf[16+1];
sprintf(strbuf, "%016qx", t << 32);
if (strcmp(strbuf, "0000000100000000") == 0)
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 <sys/bitypes.h>
-#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 <sys/bitypes.h>
-#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 <sys/bitypes.h>
-#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 <sys/bitypes.h>
-#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 <inttypes.h>
#include <inttypes.h>
#include <stdio.h>
#include <sys/types.h>
- #ifdef HAVE_SYS_BITYPES_H
- #include <sys/bitypes.h>
- #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);
}
]])
],
#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;
* 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);
}
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));
/* 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)
*u = *cs->c_next;
- /* Move pointer past the u_int8_t. */
+ /* Move pointer past the uint8_t. */
cs->c_next++;
return 0;
}
#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
* 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;
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;
}
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
* 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
#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
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;
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 */
#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+\
#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
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;
};
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+\
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)
* 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.
/* 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.
* 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
* 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
* 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
/* 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) \
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;
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]
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))));
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)) {
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);
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;
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;
static int
extract_header_length(netdissect_options *ndo,
- u_int16_t fc)
+ uint16_t fc)
{
int len;
*/
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))
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;
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;
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;
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;
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) &&
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));
{
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));
};
static int
-extract_header_length(u_int16_t fc)
+extract_header_length(uint16_t fc)
{
int len = 0;
{
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));
p+= hdrlen;
caplen -= hdrlen;
} else {
- u_int16_t panid = 0;
+ uint16_t panid = 0;
switch ((fc >> 10) & 0x3) {
case 0x00:
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. */
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 */
};
#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
#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
#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 {
#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 */
};
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;
* 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
* 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
};
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);
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. */
{
u_int caplen = h->caplen;
u_int length = h->len;
- u_int32_t llchdr;
+ uint32_t llchdr;
u_int hdrlen = 0;
if (caplen < 8) {
}
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;
}
static const char *
-format_interval(const u_int16_t i)
+format_interval(const uint16_t i)
{
static char buf[sizeof("000.00s")];
}
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);
}
*/
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];
};
/*
*/
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[] = {
{
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) {
#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 */
};
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
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;
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]);
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);
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]);
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]);
*/
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;
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;
break;
}
while (tlen>0) {
- u_int32_t comm;
+ uint32_t comm;
ND_TCHECK2(tptr[0], 4);
comm = EXTRACT_32BITS(tptr);
switch (comm) {
break;
}
while (tlen>0) {
- u_int16_t extd_comm;
+ uint16_t extd_comm;
ND_TCHECK2(tptr[0], 2);
extd_comm=EXTRACT_16BITS(tptr);
case BGPTYPE_PMSI_TUNNEL:
{
- u_int8_t tunnel_type, flags;
+ uint8_t tunnel_type, flags;
tunnel_type = *(tptr+1);
flags = *tptr;
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
struct bgp bgp;
- u_int16_t hlen;
+ uint16_t hlen;
char tokbuf[TOKBUFSIZE];
ep = dat + length;
/* 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)
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"));
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!)",
#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
* 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];
};
/*
};
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[] = {
};
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[] = {
*/
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 */
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;
* 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;
};
#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)*/
};
* @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;
/**
* @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)
* @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;
/**
* @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;
/**
* @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;
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;
{
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);
/* 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));
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);
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
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;
};
#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 */
};
/*
/* 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 */
};
/* 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 */
};
};
struct dhcp6opt {
- u_int16_t dh6opt_type;
- u_int16_t dh6opt_len;
+ uint16_t dh6opt_type;
+ uint16_t dh6opt_len;
/* type-dependent data follows */
};
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;
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);
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,
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;
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;
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)) {
#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
#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
#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
#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
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;
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) {
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)));
}
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;
*/
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
};
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
};
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[] = {
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;
#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) \
*/
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 */
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];
if (spikey) {
char *spistr, *foo;
- u_int32_t spino;
+ uint32_t spino;
spistr = strsep(&spikey, "@");
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;
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,
#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 {
};
#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)
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";
* 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)
};
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
/* 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];
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);
};
#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)
}
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) )
}
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)
{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++) {
}
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 {
};
#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;
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) {
#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},
{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++) {
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);
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
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;
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)
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);
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) {
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",
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",
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;
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))
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);
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;
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);
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;
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);
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);
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;
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);
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);
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);
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;
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;
{
const struct forcesh *fhdr;
u_int mlen;
- u_int32_t flg_raw;
+ uint32_t flg_raw;
const struct tom_h *tops;
int rc = 0;
* 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;
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));
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: ",
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"));
#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
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;
/*
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];
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));
}
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)));
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";
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)
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)
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;
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;
if (flags & GRE_KP) {
- u_int32_t k;
+ uint32_t k;
if (len < 4)
goto 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:
}
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;
}
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;
/* 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;
* 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
#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
*/
#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)
/* 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;
};
/*
*/
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[] = {
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;
}
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) {
* 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;
}
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),
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)) {
*/
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;
};
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 */
};
#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*/
};
#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;
};
#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 */
};
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 */
};
*/
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 */
};
#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 */
};
/*
*/
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
#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;
};
#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 *);
}
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);
}
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;
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);
}
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);
}
}
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);
} 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)
* 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)
* 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 */
/* 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
/* 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 ! */
* 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);
}
}
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;
}
*/
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;
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;
}
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) {
* 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];
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;
#include <tcpdump-stdinc.h>
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)
{
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
/* 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);
}
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];
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 */
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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 */
};
*/
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 */
*/
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 */
};
*/
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 */
};
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 */
};
/* 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
/* 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,
/* 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 */
};
/* 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) */
};
/* 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 {
/* 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 */
};
};
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 */
};
/* 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 {
};
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 */
};
#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
/* 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 */
};
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);
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);
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,
const struct attrmap *map, size_t nmap)
{
int totlen;
- u_int32_t t, v;
+ uint32_t t, v;
if (p[0] & 0x80)
totlen = 4;
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;
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;
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);
}
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);
}
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;
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;
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;
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;
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
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;
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;
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;
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;
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;
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",
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)));
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,","));
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;
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;
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;
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;
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;
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;
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);
}
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);
}
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",
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;
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);
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);
}
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;
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);
}
#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
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);
}
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);
}
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;
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;
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));
}
}
}
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;
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;
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));
}
}
}
};
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 {
};
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
};
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[] = {
};
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))
#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"));
};
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];
};
/*
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);
/* 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) {
};
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;
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);
/* 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"));
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;
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;
/* 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")];
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;
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*/
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*/
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;
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);
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;
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;
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;
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);
/*
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<tlv_len;i++) {
+ for(i=1 + sizeof(uint16_t);i<tlv_len;i++) {
if (!ND_TTEST2(*(tptr + i), 1))
goto trunctlv;
ND_PRINT((ndo, "%02x", *(tptr + i)));
static void
osi_print_cksum(netdissect_options *ndo,
- const u_int8_t *pptr, u_int16_t checksum,
+ const uint8_t *pptr, uint16_t checksum,
u_int checksum_offset, u_int length)
{
- u_int16_t calculated_checksum;
+ uint16_t calculated_checksum;
/* do not attempt to verify the checksum if it is zero */
if (!checksum) {
};
struct juniper_cookie_table_t {
- u_int32_t pictype; /* pic type */
- u_int8_t cookie_len; /* cookie len */
+ uint32_t pictype; /* pic type */
+ uint8_t cookie_len; /* cookie len */
const char *s; /* pic name */
};
};
struct juniper_l2info_t {
- u_int32_t length;
- u_int32_t caplen;
- u_int32_t pictype;
- u_int8_t direction;
- u_int8_t header_len;
- u_int8_t cookie_len;
- u_int8_t cookie_type;
- u_int8_t cookie[8];
- u_int8_t bundle;
- u_int16_t proto;
- u_int8_t flags;
+ uint32_t length;
+ uint32_t caplen;
+ uint32_t pictype;
+ uint8_t direction;
+ uint8_t header_len;
+ uint8_t cookie_len;
+ uint8_t cookie_type;
+ uint8_t cookie[8];
+ uint8_t bundle;
+ uint16_t proto;
+ uint8_t flags;
};
#define LS_COOKIE_ID 0x54
{
struct juniper_l2info_t l2info;
struct juniper_ggsn_header {
- u_int8_t svc_id;
- u_int8_t flags_len;
- u_int8_t proto;
- u_int8_t flags;
- u_int8_t vlan_id[2];
- u_int8_t res[2];
+ uint8_t svc_id;
+ uint8_t flags_len;
+ uint8_t proto;
+ uint8_t flags;
+ uint8_t vlan_id[2];
+ uint8_t res[2];
};
const struct juniper_ggsn_header *gh;
{
struct juniper_l2info_t l2info;
struct juniper_ipsec_header {
- u_int8_t sa_index[2];
- u_int8_t ttl;
- u_int8_t type;
- u_int8_t spi[4];
- u_int8_t src_ip[4];
- u_int8_t dst_ip[4];
+ uint8_t sa_index[2];
+ uint8_t ttl;
+ uint8_t type;
+ uint8_t spi[4];
+ uint8_t src_ip[4];
+ uint8_t dst_ip[4];
};
u_int rewrite_len,es_type_bundle;
const struct juniper_ipsec_header *ih;
{
struct juniper_l2info_t l2info;
struct juniper_monitor_header {
- u_int8_t pkt_type;
- u_int8_t padding;
- u_int8_t iif[2];
- u_int8_t service_id[4];
+ uint8_t pkt_type;
+ uint8_t padding;
+ uint8_t iif[2];
+ uint8_t service_id[4];
};
const struct juniper_monitor_header *mh;
{
struct juniper_l2info_t l2info;
struct juniper_services_header {
- u_int8_t svc_id;
- u_int8_t flags_len;
- u_int8_t svc_set_id[2];
- u_int8_t dir_iif[4];
+ uint8_t svc_id;
+ uint8_t flags_len;
+ uint8_t svc_set_id[2];
+ uint8_t dir_iif[4];
};
const struct juniper_services_header *sh;
const struct pcap_pkthdr *h, register const u_char *p)
{
struct juniper_l2info_t l2info;
- u_int16_t extracted_ethertype;
+ uint16_t extracted_ethertype;
l2info.pictype = DLT_JUNIPER_PPPOE_ATM;
if (juniper_parse_header(ndo, p, h, &l2info) == 0)
juniper_atm1_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, register const u_char *p)
{
- u_int16_t extracted_ethertype;
+ uint16_t extracted_ethertype;
struct juniper_l2info_t l2info;
juniper_atm2_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, register const u_char *p)
{
- u_int16_t extracted_ethertype;
+ uint16_t extracted_ethertype;
struct juniper_l2info_t l2info;
const struct juniper_cookie_table_t *lp = juniper_cookie_table;
u_int idx, jnx_ext_len, jnx_header_len = 0;
- u_int8_t tlv_type,tlv_len;
- u_int32_t control_word;
+ uint8_t tlv_type,tlv_len;
+ uint32_t control_word;
int tlv_value;
const u_char *tptr;
#define KERB_ERR_NULL_KEY 10
struct krb {
- u_int8_t pvno; /* Protocol Version */
- u_int8_t type; /* Type+B */
+ uint8_t pvno; /* Protocol Version */
+ uint8_t type; /* Type+B */
};
static const struct tok type2str[] = {
}
static void
-print_16bits_val(netdissect_options *ndo, const u_int16_t *dat)
+print_16bits_val(netdissect_options *ndo, const uint16_t *dat)
{
ND_PRINT((ndo, "%u", EXTRACT_16BITS(dat)));
}
static void
-print_32bits_val(netdissect_options *ndo, const u_int32_t *dat)
+print_32bits_val(netdissect_options *ndo, const uint32_t *dat)
{
ND_PRINT((ndo, "%lu", (u_long)EXTRACT_32BITS(dat)));
}
static void
l2tp_msgtype_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_msgtype2str, "MSGTYPE-#%u",
EXTRACT_16BITS(ptr))));
static void
l2tp_result_code_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, "%u", EXTRACT_16BITS(ptr))); ptr++; /* Result Code */
if (length > 2) { /* Error Code (opt) */
}
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)));
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"));
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"));
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, " "));
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"));
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"));
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))));
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));
}
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" */
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" */
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 */
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) {
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);
{
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;
#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[] = {
*/
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
*/
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)
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;
};
struct oui_tok {
- u_int32_t oui;
+ uint32_t oui;
const struct tok *tok;
};
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;
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;
int subtype, hexdump = FALSE;
u_int sublen;
u_int tval;
- u_int8_t i;
+ uint8_t i;
if (tlv_len < 4) {
return hexdump;
/*
* 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);
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;
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;
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 *);
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;
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;
*/
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
*/
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
union { /* int to float conversion buffer */
float f;
- u_int32_t i;
+ uint32_t i;
} bw;
tptr=pptr;
*/
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
*/
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
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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;
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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;
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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;
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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;
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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];
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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];
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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;
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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;
};
/*
* 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];
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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];
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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];
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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
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;
*/
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;
};
/*
*/
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
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct lwapp_message_header {
- u_int8_t type;
- u_int8_t length[2];
+ uint8_t type;
+ uint8_t length[2];
};
void
#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;
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)
const char *p0)
{
const char *p;
- u_int16_t l;
+ uint16_t l;
int i;
p = p0;
lwres_printaddr(netdissect_options *ndo,
lwres_addr_t *ap)
{
- u_int16_t l;
+ uint16_t l;
const char *p;
int i;
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;
lwres_gabnrequest_t *gabn;
lwres_gnbarequest_t *gnba;
lwres_grbnrequest_t *grbn;
- u_int32_t l;
+ uint32_t l;
gabn = NULL;
gnba = NULL;
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;
#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 */
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:
#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 */
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));
/* 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;
};
const struct ip6_mobility *mh;
const u_char *ep;
unsigned mhlen, hlen;
- u_int8_t type;
+ uint8_t type;
mh = (struct ip6_mobility *)bp;
#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
};
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;
};
};
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[] = {
};
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[] = {
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;
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;
#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)
#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;
};
#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
#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;
};
#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
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;
#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 */
};
{
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;
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,
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);
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 */
* 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) {
* 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;
* 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 */
* 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)
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));
*/
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;
*/
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) */
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) */
};
/*
* 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;
* 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;
* 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",
* 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)
/*
* 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);
/*
}
/* 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;
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;
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)));
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)));
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);
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;
static int
parsediropres(netdissect_options *ndo,
- const u_int32_t *dp)
+ const uint32_t *dp)
{
int er;
static int
parselinkres(netdissect_options *ndo,
- const u_int32_t *dp, int v3)
+ const uint32_t *dp, int v3)
{
int er;
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;
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 {
static int
parserddires(netdissect_options *ndo,
- const u_int32_t *dp)
+ const uint32_t *dp)
{
int er;
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",
/*
* 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]))
/*
* 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]))
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:"));
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;
static int
parsewccres(netdissect_options *ndo,
- const u_int32_t *dp, int verbose)
+ const uint32_t *dp, int verbose)
{
int er;
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;
static int
parsefsinfo(netdissect_options *ndo,
- const u_int32_t *dp)
+ const uint32_t *dp)
{
struct nfsv3_fsinfo *sfp;
int er;
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)));
static int
parsepathconf(netdissect_options *ndo,
- const u_int32_t *dp)
+ const uint32_t *dp)
{
int er;
struct nfsv3_pathconf *spp;
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;
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
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
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)
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);
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;
*/
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 */
};
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];
};
};
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];
};
/*
} 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;
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;
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) {
* 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) {
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);
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);
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);
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);
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);
}
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);
}
/* 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);
}
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) {
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) {
#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 */
/* 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;
/* 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
/* 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];
* 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 */
/* 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;
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;
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);
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:
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)
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)
}
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;
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)
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)
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]"));
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));
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);
}
* 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 */
};
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;
#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;
}
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);
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),
goto trunc;
break;
}
- bp += (2 * sizeof(u_int16_t));
+ bp += (2 * sizeof(uint16_t));
ND_TCHECK2(*bp, addr_size);
group = bp;
bp += addr_size;
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;
return;
}
ND_PRINT((ndo, " OPTS LEN (extra?) %d", EXTRACT_16BITS(bp)));
- bp += sizeof(u_int16_t);
+ bp += sizeof(uint16_t);
opts_len -= 4;
break;
}
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;
}
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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;
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);
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;
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);
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;
*/
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,
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);
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;
*/
{
- 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;
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;
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;
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]"));
if (length <= 0)
return;
- b = (u_int8_t *)malloc(length);
+ b = (uint8_t *)malloc(length);
if (b == NULL)
return;
#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;
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;
/* 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:
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];
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" : "",
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))));
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)));
}
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) {
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) {
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))));
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,
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)));
}
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) {
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"));
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 */
};
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)
{
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) )
{
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]));
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 */
*/
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
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) {
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;
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),
*
* 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*/
/* 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;
}
}
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];
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];
*/
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];
};
/*
*/
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
};
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[] = {
};
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];
};
int parameter_id,parameter_length;
union {
float f;
- u_int32_t i;
+ uint32_t i;
} bw;
if (obj_tlen < 4)
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;
#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
#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
#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! */
#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 */
};
/*
*/
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
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
{
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 */
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)); \
}
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)); \
} \
}
*/
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))
{
struct rx_ackPacket *rxa;
int i, start, last;
- u_int32_t firstPacket;
+ uint32_t firstPacket;
if (length < (int)sizeof(struct rx_header))
return;
/* 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;
};
/* 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.
*/
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;
};
*/
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. */
struct sctpParamDesc hb;
struct sctpHBrequest rtt;
int8_t addrFmt[SCTP_ADDRMAX];
- u_int16_t userreq;
+ uint16_t userreq;
};
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{
* 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{
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
};
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{
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[] = {
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);
break;
}
- ND_TCHECK2(*((u_int8_t *)chunkDescPtr), chunkLength);
+ ND_TCHECK2(*((uint8_t *)chunkDescPtr), chunkLength);
chunkEnd = ((const u_char*)chunkDescPtr + chunkLength);
align=chunkLength % 4;
case SCTP_DATA :
{
const struct sctpDataPart *dataHdrPtr;
- u_int32_t ppid;
+ uint32_t ppid;
const u_char *payloadPtr;
u_int payload_size;
*/
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
};
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
};
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
};
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
}
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
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;
#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 */
};
/*
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,
#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
};
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
};
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[] = {
};
struct tlv_header_t {
- u_int8_t type;
- u_int8_t length;
+ uint8_t type;
+ uint8_t length;
};
#define LACP_TLV_TERMINATOR 0x00
};
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[] = {
};
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);
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 {
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 =
* 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;
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));
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;
}
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;
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) {
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++) {
#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
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;
* 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[] = {
};
/* Forwards */
-static char *progstr(u_int32_t);
+static char *progstr(uint32_t);
void
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;
}
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);
#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;
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
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);
}
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;
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)) {
#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);
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) {
* 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;
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) {
*/
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;
#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)
};
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)
#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)
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;
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;
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;
u_int caplen _U_)
{
const struct tipc_pkthdr *ap;
- u_int32_t w0;
+ uint32_t w0;
u_int user;
ap = (struct tipc_pkthdr *)bp;
#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]";
#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;
/*
*/
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 */
};
/*
* 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*/
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 */
/* 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;
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) {
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);
}
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
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
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?
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))));
}
*/
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
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;
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));
}
}
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)",
#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[] = {
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]"));
* 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 */
};
#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 */
*/
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 */
};
* 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 */
};
* 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 */
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 */
};
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) {
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, "[|]"));
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 */
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" : "-",
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);
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);
*/
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 */
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;
/*
#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;
* 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;
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);
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);
/* 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)
#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) {
}
case 'L':
{
- u_int64_t x;
+ uint64_t x;
ND_TCHECK2(buf[0], 8);
x = reverse ? EXTRACT_64BITS(buf) :
EXTRACT_LE_64BITS(buf);
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++;
{
/*XXX unistr() */
const char *s;
- u_int32_t len;
+ uint32_t len;
len = 0;
s = unistr(ndo, buf, &len, (*fmt == 'R') ? 0 : unicodestr);
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) {
time_t t;
struct tm *lt;
const char *tstring;
- u_int32_t x;
+ uint32_t x;
switch (atoi(fmt + 1)) {
case 1:
}
typedef struct {
- u_int32_t code;
+ uint32_t code;
const char *name;
} nt_err_code_struct;
* 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;
#include <netdb.h>
#if HAVE_INTTYPES_H
#include <inttypes.h>
-#else
-#if HAVE_STDINT_H
+#elif HAVE_STDINT_H
#include <stdint.h>
#endif
-#endif
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
#include <sys/param.h>
#include <sys/types.h> /* concession to AIX */
#include <sys/time.h>
*/
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,