summaryrefslogtreecommitdiff
path: root/ip.h
diff options
context:
space:
mode:
authorguy <guy>2000-09-29 05:05:47 +0000
committerguy <guy>2000-09-29 05:05:47 +0000
commit6de29a031460967d9b26716a6b7a7369e7713137 (patch)
tree52d21ff23e41b319a117184902a8331fad969591 /ip.h
parentcf53dc05f1c854cc8cb94afd3409bbf033a055ed (diff)
downloadtcpdump-6de29a031460967d9b26716a6b7a7369e7713137.tar.gz
Declare bitfields as "u_int", not "u_char"; ANSI C doesn't guarantee
that bitfields other than "int" or "unsigned int" are allowed, some compilers warn about them, and, given that the declaration of a bit field says how many bits it is wide, declaring them "u_char" doesn't have any advantage (other than making it a bit clearer, when reading the header, that the bitfields in question are part of a single byte).
Diffstat (limited to 'ip.h')
-rw-r--r--ip.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/ip.h b/ip.h
index 028e9670..9be7544a 100644
--- a/ip.h
+++ b/ip.h
@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ip.h,v 1.3 2000-09-29 04:58:33 guy Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ip.h,v 1.4 2000-09-29 05:05:47 guy Exp $ (LBL) */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
@@ -72,11 +72,11 @@
*/
struct ip {
#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ip_hl:4, /* header length */
+ u_int ip_hl:4, /* header length */
ip_v:4; /* version */
#endif
#if BYTE_ORDER == BIG_ENDIAN
- u_char ip_v:4, /* version */
+ u_int ip_v:4, /* version */
ip_hl:4; /* header length */
#endif
u_char ip_tos; /* type of service */
@@ -151,11 +151,11 @@ struct ip_timestamp {
u_char ipt_len; /* size of structure (variable) */
u_char ipt_ptr; /* index of current entry */
#if BYTE_ORDER == LITTLE_ENDIAN
- u_char ipt_flg:4, /* flags, see below */
+ u_int ipt_flg:4, /* flags, see below */
ipt_oflw:4; /* overflow counter */
#endif
#if BYTE_ORDER == BIG_ENDIAN
- u_char ipt_oflw:4, /* overflow counter */
+ u_int ipt_oflw:4, /* overflow counter */
ipt_flg:4; /* flags, see below */
#endif
union ipt_timestamp {