diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2010-10-28 19:06:17 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2010-10-28 19:06:17 +0000 |
commit | 1e8ad3bd802d66bed71b4c6405ff5d801a913e4a (patch) | |
tree | df5e0d876c3ec2ff0e3d9c6795cb5c1e20b7d5c4 /contrib/tcpdump/print-dccp.c | |
parent | 7ab661360c2131496bd3c111b5b3b2462fe3d2be (diff) | |
parent | 5f4de8e61a87fc21b6ffecf7ef9444827c09ee69 (diff) | |
download | FreeBSD-src-1e8ad3bd802d66bed71b4c6405ff5d801a913e4a.zip FreeBSD-src-1e8ad3bd802d66bed71b4c6405ff5d801a913e4a.tar.gz |
Merge tcpdump-4.1.1.
Diffstat (limited to 'contrib/tcpdump/print-dccp.c')
-rw-r--r-- | contrib/tcpdump/print-dccp.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/contrib/tcpdump/print-dccp.c b/contrib/tcpdump/print-dccp.c index b7377cf..fee4a6e 100644 --- a/contrib/tcpdump/print-dccp.c +++ b/contrib/tcpdump/print-dccp.c @@ -9,7 +9,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-dccp.c,v 1.7.2.1 2007-11-09 00:45:16 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-dccp.c,v 1.8 2007-11-09 00:44:09 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -394,9 +394,6 @@ trunc2: static int dccp_print_option(const u_char *option) { u_int8_t optlen, i; - u_int32_t *ts; - u_int16_t *var16; - u_int32_t *var32; TCHECK(*option); @@ -470,22 +467,17 @@ static int dccp_print_option(const u_char *option) for (i = 0; i < optlen -2; i ++) printf("%02x", *(option +2 + i)); break; case 41: - ts = (u_int32_t *)(option + 2); - printf("timestamp %u", (u_int32_t)ntohl(*ts)); + printf("timestamp %u", EXTRACT_32BITS(option + 2)); break; case 42: - ts = (u_int32_t *)(option + 2); - printf("timestamp_echo %u", (u_int32_t)ntohl(*ts)); + printf("timestamp_echo %u", EXTRACT_32BITS(option + 2)); break; case 43: printf("elapsed_time "); - if (optlen == 6){ - ts = (u_int32_t *)(option + 2); - printf("%u", (u_int32_t)ntohl(*ts)); - } else { - var16 = (u_int16_t *)(option + 2); - printf("%u", ntohs(*var16)); - } + if (optlen == 6) + printf("%u", EXTRACT_32BITS(option + 2)); + else + printf("%u", EXTRACT_16BITS(option + 2)); break; case 44: printf("data_checksum "); @@ -496,12 +488,10 @@ static int dccp_print_option(const u_char *option) printf("CCID option %d",*option); switch (optlen) { case 4: - var16 = (u_int16_t *)(option + 2); - printf(" %u",ntohs(*var16)); + printf(" %u", EXTRACT_16BITS(option + 2)); break; case 6: - var32 = (u_int32_t *)(option + 2); - printf(" %u",(u_int32_t)ntohl(*var32)); + printf(" %u", EXTRACT_32BITS(option + 2)); break; default: break; |