diff options
author | itojun <itojun> | 2002-11-09 17:19:16 +0000 |
---|---|---|
committer | itojun <itojun> | 2002-11-09 17:19:16 +0000 |
commit | 10afb02ac804db7fa41a776fd61eff922c09c4df (patch) | |
tree | 7853d4c0ef4bed1104cf17690a35df64acf49dfe /print-bgp.c | |
parent | dcc101488006c0dce19f4a4386b3cd936d9b6d87 (diff) | |
download | tcpdump-10afb02ac804db7fa41a776fd61eff922c09c4df.tar.gz |
put __attribute__((packed)) to packet headers. s/u_short/u_int16_t/ and so
forth while i'm here
Diffstat (limited to 'print-bgp.c')
-rw-r--r-- | print-bgp.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/print-bgp.c b/print-bgp.c index 638f9f05..94f458ae 100644 --- a/print-bgp.c +++ b/print-bgp.c @@ -36,7 +36,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.54 2002-10-19 12:31:47 hannes Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.55 2002-11-09 17:19:24 itojun Exp $"; #endif #include <tcpdump-stdinc.h> @@ -52,7 +52,7 @@ struct bgp { u_int8_t bgp_marker[16]; u_int16_t bgp_len; u_int8_t bgp_type; -}; +} __attribute__((packed)); #define BGP_SIZE 19 /* unaligned */ #define BGP_OPEN 1 @@ -80,14 +80,14 @@ struct bgp_open { u_int32_t bgpo_id; u_int8_t bgpo_optlen; /* options should follow */ -}; +} __attribute__((packed)); #define BGP_OPEN_SIZE 29 /* unaligned */ struct bgp_opt { u_int8_t bgpopt_type; u_int8_t bgpopt_len; /* variable length */ -}; +} __attribute__((packed)); #define BGP_OPT_SIZE 2 /* some compilers may pad to 4 bytes */ struct bgp_notification { @@ -97,7 +97,7 @@ struct bgp_notification { u_int8_t bgpn_major; u_int8_t bgpn_minor; /* data should follow */ -}; +} __attribute__((packed)); #define BGP_NOTIFICATION_SIZE 21 /* unaligned */ struct bgp_route_refresh { @@ -107,7 +107,7 @@ struct bgp_route_refresh { u_int8_t afi[2]; /* the compiler messes this structure up */ u_int8_t res; /* when doing misaligned sequences of int8 and int16 */ u_int8_t safi; /* afi should be int16 - so we have to access it using */ -}; /* EXTRACT_16BITS(&bgp_route_refresh->afi) (sigh) */ +} __attribute__((packed)); /* EXTRACT_16BITS(&bgp_route_refresh->afi) (sigh) */ #define BGP_ROUTE_REFRESH_SIZE 23 struct bgp_attr { @@ -122,7 +122,7 @@ struct bgp_attr { ntohs((p)->bgpa_len.elen) : (p)->bgpa_len.len) #define bgp_attr_off(p) \ (((p)->bgpa_flags & 0x10) ? 4 : 3) -}; +} __attribute__((packed)); #define BGPTYPE_ORIGIN 1 #define BGPTYPE_AS_PATH 2 |