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 | |
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
-rw-r--r-- | ah.h | 4 | ||||
-rw-r--r-- | appletalk.h | 18 | ||||
-rw-r--r-- | bootp.h | 6 | ||||
-rw-r--r-- | decnet.h | 54 | ||||
-rw-r--r-- | esp.h | 6 | ||||
-rw-r--r-- | ether.h | 4 | ||||
-rw-r--r-- | fddi.h | 4 | ||||
-rw-r--r-- | icmp6.h | 44 | ||||
-rw-r--r-- | ieee802_11.h | 32 | ||||
-rw-r--r-- | igrp.h | 6 | ||||
-rw-r--r-- | ip.h | 6 | ||||
-rw-r--r-- | ip6.h | 16 | ||||
-rw-r--r-- | ipfc.h | 4 | ||||
-rw-r--r-- | ipsec_doi.h | 8 | ||||
-rw-r--r-- | ipx.h | 4 | ||||
-rw-r--r-- | isakmp.h | 36 | ||||
-rw-r--r-- | lane.h | 6 | ||||
-rw-r--r-- | llc.h | 4 | ||||
-rw-r--r-- | nameser.h | 4 | ||||
-rw-r--r-- | netbios.h | 4 | ||||
-rw-r--r-- | nfs.h | 24 | ||||
-rw-r--r-- | ntp.h | 8 | ||||
-rw-r--r-- | oakley.h | 4 | ||||
-rw-r--r-- | ospf.h | 10 | ||||
-rw-r--r-- | ospf6.h | 12 | ||||
-rw-r--r-- | print-arp.c | 6 | ||||
-rw-r--r-- | print-atalk.c | 4 | ||||
-rw-r--r-- | print-bgp.c | 14 | ||||
-rw-r--r-- | print-chdlc.c | 4 | ||||
-rw-r--r-- | print-cnfp.c | 6 | ||||
-rw-r--r-- | print-egp.c | 32 | ||||
-rw-r--r-- | print-fr.c | 14 | ||||
-rw-r--r-- | print-hsrp.c | 24 | ||||
-rw-r--r-- | print-icmp.c | 10 | ||||
-rw-r--r-- | print-igmp.c | 36 | ||||
-rw-r--r-- | print-ipcomp.c | 4 | ||||
-rw-r--r-- | print-isoclns.c | 182 | ||||
-rw-r--r-- | print-krb.c | 8 | ||||
-rw-r--r-- | print-lwres.c | 20 | ||||
-rw-r--r-- | print-mobile.c | 4 | ||||
-rw-r--r-- | print-mobility.c | 4 | ||||
-rw-r--r-- | print-pim.c | 4 | ||||
-rw-r--r-- | print-pptp.c | 34 | ||||
-rw-r--r-- | print-radius.c | 6 | ||||
-rw-r--r-- | print-rip.c | 16 | ||||
-rw-r--r-- | print-rsvp.c | 24 | ||||
-rw-r--r-- | print-udp.c | 10 | ||||
-rw-r--r-- | print-wb.c | 32 | ||||
-rw-r--r-- | route6d.h | 6 | ||||
-rw-r--r-- | rx.h | 6 | ||||
-rw-r--r-- | sctpHeader.h | 180 | ||||
-rw-r--r-- | sll.h | 4 | ||||
-rw-r--r-- | tcp.h | 4 | ||||
-rw-r--r-- | timed.h | 14 | ||||
-rw-r--r-- | token.h | 4 | ||||
-rw-r--r-- | udp.h | 4 |
56 files changed, 524 insertions, 524 deletions
@@ -43,7 +43,7 @@ struct ah { u_int16_t ah_reserve; /* Reserved for future use */ u_int32_t ah_spi; /* Security parameter index */ /* variable size, 32bit bound*/ /* Authentication data */ -}; +} __attribute__((packed)); struct newah { u_int8_t ah_nxt; /* Next Header */ @@ -52,6 +52,6 @@ struct newah { u_int32_t ah_spi; /* Security parameter index */ u_int32_t ah_seq; /* Sequence number field */ /* variable size, 32bit bound*/ /* Authentication data */ -}; +} __attribute__((packed)); #endif /*_NETINET6_AH_H_*/ diff --git a/appletalk.h b/appletalk.h index 3d1688fd..056be22f 100644 --- a/appletalk.h +++ b/appletalk.h @@ -20,14 +20,14 @@ * * AppleTalk protocol formats (courtesy Bill Croft of Stanford/SUMEX). * - * @(#) $Header: /tcpdump/master/tcpdump/appletalk.h,v 1.13 2000-10-03 02:54:54 itojun Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/appletalk.h,v 1.14 2002-11-09 17:19:17 itojun Exp $ (LBL) */ struct LAP { u_int8_t dst; u_int8_t src; u_int8_t type; -}; +} __attribute__((packed)); #define lapShortDDP 1 /* short DDP type */ #define lapDDP 2 /* DDP type */ #define lapKLAP 'K' /* Kinetics KLAP type */ @@ -44,14 +44,14 @@ struct atDDP { u_int8_t dstSkt; u_int8_t srcSkt; u_int8_t type; -}; +} __attribute__((packed)); struct atShortDDP { u_int16_t length; u_int8_t dstSkt; u_int8_t srcSkt; u_int8_t type; -}; +} __attribute__((packed)); #define ddpMaxWKS 0x7F #define ddpMaxData 586 @@ -77,7 +77,7 @@ struct atATP { u_int8_t bitmap; u_int16_t transID; int32_t userData; -}; +} __attribute__((packed)); #define atpReqCode 0x40 #define atpRspCode 0x80 @@ -96,7 +96,7 @@ struct atATP { struct atEcho { u_int8_t echoFunction; u_int8_t *echoData; -}; +} __attribute__((packed)); #define echoSkt 4 /* the echoer socket */ #define echoSize 1 /* size of echo header */ @@ -109,14 +109,14 @@ struct atEcho { struct atNBP { u_int8_t control; u_int8_t id; -}; +} __attribute__((packed)); struct atNBPtuple { u_int16_t net; u_int8_t node; u_int8_t skt; u_int8_t enumerator; -}; +} __attribute__((packed)); #define nbpBrRq 0x10 #define nbpLkUp 0x20 @@ -143,7 +143,7 @@ struct atNBPtuple { struct zipHeader { u_int8_t command; u_int8_t netcount; -}; +} __attribute__((packed)); #define zipHeaderSize 2 #define zipQuery 1 @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/bootp.h,v 1.11 2001-01-09 07:39:13 fenner Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/bootp.h,v 1.12 2002-11-09 17:19:17 itojun Exp $ (LBL) */ /* * Bootstrap Protocol (BOOTP). RFC951 and RFC1048. * @@ -36,7 +36,7 @@ struct bootp { u_int8_t bp_sname[64]; /* server host name */ u_int8_t bp_file[128]; /* boot file name */ u_int8_t bp_vend[64]; /* vendor-specific area */ -}; +} __attribute__((packed)); /* * UDP port numbers, server and client. @@ -214,7 +214,7 @@ struct cmu_vend { struct in_addr v_ins1, v_ins2; /* IEN-116 name servers */ struct in_addr v_ts1, v_ts2; /* Time servers */ u_int8_t v_unused[24]; /* currently unused */ -}; +} __attribute__((packed)); /* v_flags values */ @@ -18,7 +18,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/tcpdump/decnet.h,v 1.9 2002-08-02 04:35:57 guy Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/decnet.h,v 1.10 2002-11-09 17:19:17 itojun Exp $ (LBL) */ #ifndef WIN32 @@ -42,7 +42,7 @@ union etheraddress { u_int8_t dne_hiord[4]; /* DECnet HIORD prefix */ u_int8_t dne_nodeaddr[2]; /* DECnet node address */ } dne_remote; -}; +} __attribute__((packed)); typedef union etheraddress etheraddr; /* Ethernet address */ @@ -56,7 +56,7 @@ typedef union etheraddress etheraddr; /* Ethernet address */ struct dn_naddr { u_int16_t a_len; /* length of address */ u_int8_t a_addr[DN_MAXADDL]; /* address as bytes */ -}; +} __attribute__((packed)); /* * Define long and short header formats. @@ -67,7 +67,7 @@ struct shorthdr word sh_dst; /* destination node address */ word sh_src; /* source node address */ byte sh_visits; /* visit count */ - }; + } __attribute__((packed)); struct longhdr { @@ -82,13 +82,13 @@ struct longhdr byte lg_visits; /* visit count */ byte lg_service; /* service class (reserved) */ byte lg_pt; /* protocol type (reserved) */ - }; + } __attribute__((packed)); union routehdr { struct shorthdr rh_short; /* short route header */ struct longhdr rh_long; /* long route header */ - }; + } __attribute__((packed)); /* * Define the values of various fields in the protocol messages. @@ -160,7 +160,7 @@ struct initmsgIII /* phase III initialization message */ byte inIII_eco; /* ECO number */ byte inIII_ueco; /* user ECO number */ byte inIII_rsvd; /* reserved image field */ - }; + } __attribute__((packed)); struct initmsg /* initialization message */ { @@ -173,35 +173,35 @@ struct initmsg /* initialization message */ byte in_ueco; /* user ECO number */ word in_hello; /* hello timer */ byte in_rsvd; /* reserved image field */ - }; + } __attribute__((packed)); struct verifmsg /* verification message */ { byte ve_flags; /* route flags */ word ve_src; /* source node address */ byte ve_fcnval; /* function value image field */ - }; + } __attribute__((packed)); struct testmsg /* hello and test message */ { byte te_flags; /* route flags */ word te_src; /* source node address */ byte te_data; /* test data image field */ - }; + } __attribute__((packed)); struct l1rout /* level 1 routing message */ { byte r1_flags; /* route flags */ word r1_src; /* source node address */ byte r1_rsvd; /* reserved field */ - }; + } __attribute__((packed)); struct l2rout /* level 2 routing message */ { byte r2_flags; /* route flags */ word r2_src; /* source node address */ byte r2_rsvd; /* reserved field */ - }; + } __attribute__((packed)); struct rhellomsg /* router hello message */ { @@ -216,7 +216,7 @@ struct rhellomsg /* router hello message */ byte rh_area; /* reserved */ word rh_hello; /* hello timer */ byte rh_mpd; /* reserved */ - }; + } __attribute__((packed)); struct ehellomsg /* endnode hello message */ { @@ -233,7 +233,7 @@ struct ehellomsg /* endnode hello message */ word eh_hello; /* hello timer */ byte eh_mpd; /* (reserved) */ byte eh_data; /* test data image field */ - }; + } __attribute__((packed)); union controlmsg { @@ -244,7 +244,7 @@ union controlmsg struct l2rout cm_l2rout; /* level 2 routing message */ struct rhellomsg cm_rhello; /* router hello message */ struct ehellomsg cm_ehello; /* endnode hello message */ - }; + } __attribute__((packed)); /* Macros for decoding routing-info fields */ #define RI_COST(x) ((x)&0777) @@ -366,7 +366,7 @@ struct nsphdr /* general nsp header */ byte nh_flags; /* message flags */ word nh_dst; /* destination link address */ word nh_src; /* source link address */ - }; + } __attribute__((packed)); struct seghdr /* data segment header */ { @@ -374,7 +374,7 @@ struct seghdr /* data segment header */ word sh_dst; /* destination link address */ word sh_src; /* source link address */ word sh_seq[3]; /* sequence numbers */ - }; + } __attribute__((packed)); struct minseghdr /* minimum data segment header */ { @@ -382,13 +382,13 @@ struct minseghdr /* minimum data segment header */ word ms_dst; /* destination link address */ word ms_src; /* source link address */ word ms_seq; /* sequence number */ - }; + } __attribute__((packed)); struct lsmsg /* link service message (after hdr) */ { byte ls_lsflags; /* link service flags */ byte ls_fcval; /* flow control value */ - }; + } __attribute__((packed)); struct ackmsg /* acknowledgement message */ { @@ -396,7 +396,7 @@ struct ackmsg /* acknowledgement message */ word ak_dst; /* destination link address */ word ak_src; /* source link address */ word ak_acknum[2]; /* acknowledgement numbers */ - }; + } __attribute__((packed)); struct minackmsg /* minimum acknowledgement message */ { @@ -404,13 +404,13 @@ struct minackmsg /* minimum acknowledgement message */ word mk_dst; /* destination link address */ word mk_src; /* source link address */ word mk_acknum; /* acknowledgement number */ - }; + } __attribute__((packed)); struct ciackmsg /* connect acknowledgement message */ { byte ck_flags; /* message flags */ word ck_dst; /* destination link address */ - }; + } __attribute__((packed)); struct cimsg /* connect initiate message */ { @@ -420,7 +420,7 @@ struct cimsg /* connect initiate message */ byte ci_services; /* requested services */ byte ci_info; /* information */ word ci_segsize; /* maximum segment size */ - }; + } __attribute__((packed)); struct ccmsg /* connect confirm message */ { @@ -431,7 +431,7 @@ struct ccmsg /* connect confirm message */ byte cc_info; /* information */ word cc_segsize; /* maximum segment size */ byte cc_optlen; /* optional data length */ - }; + } __attribute__((packed)); struct cnmsg /* generic connect message */ { @@ -441,7 +441,7 @@ struct cnmsg /* generic connect message */ byte cn_services; /* requested services */ byte cn_info; /* information */ word cn_segsize; /* maximum segment size */ - }; + } __attribute__((packed)); struct dimsg /* disconnect initiate message */ { @@ -450,7 +450,7 @@ struct dimsg /* disconnect initiate message */ word di_src; /* source link address */ word di_reason; /* reason code */ byte di_optlen; /* optional data length */ - }; + } __attribute__((packed)); struct dcmsg /* disconnect confirm message */ { @@ -458,4 +458,4 @@ struct dcmsg /* disconnect confirm message */ word dc_dst; /* destination link address */ word dc_src; /* source link address */ word dc_reason; /* reason code */ - }; + } __attribute__((packed)); @@ -46,7 +46,7 @@ struct esp { /*8bit*/ /* next header */ /*8bit*/ /* next header */ /*variable size, 32bit bound*/ /* Authentication data (new IPsec) */ -}; +} __attribute__((packed)); struct newesp { u_int32_t esp_spi; /* ESP */ @@ -57,12 +57,12 @@ struct newesp { /*8bit*/ /* next header */ /*8bit*/ /* next header */ /*variable size, 32bit bound*/ /* Authentication data */ -}; +} __attribute__((packed)); struct esptail { u_int8_t esp_padlen; /* pad length */ u_int8_t esp_nxt; /* Next header */ /*variable size, 32bit bound*/ /* Authentication data (new IPsec)*/ -}; +} __attribute__((packed)); #endif /*_NETINET6_ESP_H_*/ @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/ether.h,v 1.6 2000-10-09 03:24:24 guy Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/ether.h,v 1.7 2002-11-09 17:19:18 itojun Exp $ (LBL) */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -48,7 +48,7 @@ struct ether_header { u_int8_t ether_dhost[ETHER_ADDR_LEN]; u_int8_t ether_shost[ETHER_ADDR_LEN]; u_int16_t ether_type; -}; +} __attribute__((packed)); /* * Length of a DEC/Intel/Xerox or 802.3 Ethernet header; note that some @@ -18,7 +18,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/tcpdump/fddi.h,v 1.9 2000-10-09 02:59:39 guy Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/fddi.h,v 1.10 2002-11-09 17:19:18 itojun Exp $ (LBL) */ /* @@ -35,7 +35,7 @@ struct fddi_header { u_char fddi_fc; /* frame control */ u_char fddi_dhost[6]; u_char fddi_shost[6]; -}; +} __attribute__((packed)); /* * Length of an FDDI header; note that some compilers may pad @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/icmp6.h,v 1.12 2002-03-28 10:02:34 guy Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/icmp6.h,v 1.13 2002-11-09 17:19:18 itojun Exp $ (LBL) */ /* $NetBSD: icmp6.h,v 1.13 2000/08/03 16:30:37 itojun Exp $ */ /* $KAME: icmp6.h,v 1.22 2000/08/03 15:25:16 jinmei Exp $ */ @@ -78,7 +78,7 @@ struct icmp6_hdr { u_int16_t icmp6_un_data16[2]; /* type-specific field */ u_int8_t icmp6_un_data8[4]; /* type-specific field */ } icmp6_dataun; -}; +} __attribute__((packed)); #define icmp6_data32 icmp6_dataun.icmp6_un_data32 #define icmp6_data16 icmp6_dataun.icmp6_un_data16 @@ -168,7 +168,7 @@ struct icmp6_hdr { struct mld6_hdr { struct icmp6_hdr mld6_hdr; struct in6_addr mld6_addr; /* multicast address */ -}; +} __attribute__((packed)); #define mld6_type mld6_hdr.icmp6_type #define mld6_code mld6_hdr.icmp6_code @@ -183,7 +183,7 @@ struct mld6_hdr { struct nd_router_solicit { /* router solicitation */ struct icmp6_hdr nd_rs_hdr; /* could be followed by options */ -}; +} __attribute__((packed)); #define nd_rs_type nd_rs_hdr.icmp6_type #define nd_rs_code nd_rs_hdr.icmp6_code @@ -195,7 +195,7 @@ struct nd_router_advert { /* router advertisement */ u_int32_t nd_ra_reachable; /* reachable time */ u_int32_t nd_ra_retransmit; /* retransmit timer */ /* could be followed by options */ -}; +} __attribute__((packed)); #define nd_ra_type nd_ra_hdr.icmp6_type #define nd_ra_code nd_ra_hdr.icmp6_code @@ -223,7 +223,7 @@ struct nd_neighbor_solicit { /* neighbor solicitation */ struct icmp6_hdr nd_ns_hdr; struct in6_addr nd_ns_target; /*target address */ /* could be followed by options */ -}; +} __attribute__((packed)); #define nd_ns_type nd_ns_hdr.icmp6_type #define nd_ns_code nd_ns_hdr.icmp6_code @@ -234,7 +234,7 @@ struct nd_neighbor_advert { /* neighbor advertisement */ struct icmp6_hdr nd_na_hdr; struct in6_addr nd_na_target; /* target address */ /* could be followed by options */ -}; +} __attribute__((packed)); #define nd_na_type nd_na_hdr.icmp6_type #define nd_na_code nd_na_hdr.icmp6_code @@ -250,7 +250,7 @@ struct nd_redirect { /* redirect */ struct in6_addr nd_rd_target; /* target address */ struct in6_addr nd_rd_dst; /* destination address */ /* could be followed by options */ -}; +} __attribute__((packed)); #define nd_rd_type nd_rd_hdr.icmp6_type #define nd_rd_code nd_rd_hdr.icmp6_code @@ -261,7 +261,7 @@ struct nd_opt_hdr { /* Neighbor discovery option header */ u_int8_t nd_opt_type; u_int8_t nd_opt_len; /* followed by option specific data*/ -}; +} __attribute__((packed)); #define ND_OPT_SOURCE_LINKADDR 1 #define ND_OPT_TARGET_LINKADDR 2 @@ -282,7 +282,7 @@ struct nd_opt_prefix_info { /* prefix information */ u_int32_t nd_opt_pi_preferred_time; u_int32_t nd_opt_pi_reserved2; struct in6_addr nd_opt_pi_prefix; -}; +} __attribute__((packed)); #define ND_OPT_PI_FLAG_ONLINK 0x80 #define ND_OPT_PI_FLAG_AUTO 0x40 @@ -294,21 +294,21 @@ struct nd_opt_rd_hdr { /* redirected header */ u_int16_t nd_opt_rh_reserved1; u_int32_t nd_opt_rh_reserved2; /* followed by IP header and data */ -}; +} __attribute__((packed)); 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; -}; +} __attribute__((packed)); 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; -}; +} __attribute__((packed)); struct nd_opt_homeagent_info { /* Home Agent info */ u_int8_t nd_opt_hai_type; @@ -316,7 +316,7 @@ struct nd_opt_homeagent_info { /* Home Agent info */ u_int16_t nd_opt_hai_reserved; int16_t nd_opt_hai_preference; u_int16_t nd_opt_hai_lifetime; -}; +} __attribute__((packed)); struct nd_opt_route_info { /* route info */ u_int8_t nd_opt_rti_type; @@ -325,7 +325,7 @@ struct nd_opt_route_info { /* route info */ u_int8_t nd_opt_rti_flags; u_int32_t nd_opt_rti_lifetime; /* prefix follows */ -}; +} __attribute__((packed)); /* * icmp6 namelookup @@ -340,7 +340,7 @@ struct icmp6_namelookup { u_int8_t icmp6_nl_name[3]; #endif /* could be followed by options */ -}; +} __attribute__((packed)); /* * icmp6 node information @@ -349,7 +349,7 @@ struct icmp6_nodeinfo { struct icmp6_hdr icmp6_ni_hdr; u_int8_t icmp6_ni_nonce[8]; /* could be followed by reply data */ -}; +} __attribute__((packed)); #define ni_type icmp6_ni_hdr.icmp6_type #define ni_code icmp6_ni_hdr.icmp6_code @@ -381,7 +381,7 @@ 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 */ -}; +} __attribute__((packed)); /* * Router Renumbering. as router-renum-08.txt @@ -392,7 +392,7 @@ struct icmp6_router_renum { /* router renumbering header */ u_int8_t rr_flags; u_int16_t rr_maxdelay; u_int32_t rr_reserved; -}; +} __attribute__((packed)); #define ICMP6_RR_FLAGS_TEST 0x80 #define ICMP6_RR_FLAGS_REQRESULT 0x40 #define ICMP6_RR_FLAGS_FORCEAPPLY 0x20 @@ -413,7 +413,7 @@ struct rr_pco_match { /* match prefix part */ u_int8_t rpm_maxlen; u_int16_t rpm_reserved; struct in6_addr rpm_prefix; -}; +} __attribute__((packed)); #define RPM_PCO_ADD 1 #define RPM_PCO_CHANGE 2 @@ -429,7 +429,7 @@ struct rr_pco_use { /* use prefix part */ u_int32_t rpu_pltime; u_int32_t rpu_flags; struct in6_addr rpu_prefix; -}; +} __attribute__((packed)); #define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80 #define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40 @@ -443,7 +443,7 @@ struct rr_result { /* router renumbering result message */ u_int8_t rrr_matchedlen; u_int32_t rrr_ifid; struct in6_addr rrr_prefix; -}; +} __attribute__((packed)); /* network endian */ #define ICMP6_RR_RESULT_FLAGS_OOB ((u_int16_t)htons(0x0002)) #define ICMP6_RR_RESULT_FLAGS_FORBIDDEN ((u_int16_t)htons(0x0001)) diff --git a/ieee802_11.h b/ieee802_11.h index 42b35b1e..903d4e3d 100644 --- a/ieee802_11.h +++ b/ieee802_11.h @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.4 2002-06-11 17:08:38 itojun Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.5 2002-11-09 17:19:18 itojun Exp $ (LBL) */ /* * Copyright (c) 2001 * Fortress Technologies @@ -75,7 +75,7 @@ struct mgmt_header_t { u_int8_t sa[6]; u_int8_t bssid[6]; u_int16_t seq_ctrl; -}; +} __attribute__((packed)); #define MGMT_HEADER_LEN (2+2+6+6+6+2) @@ -89,19 +89,19 @@ struct ssid_t { u_int8_t element_id; u_int8_t length; u_char ssid[33]; /* 32 + 1 for null */ -} ; +} __attribute__((packed)); struct rates_t { u_int8_t element_id; u_int8_t length; u_int8_t rate[8]; -}; +} __attribute__((packed)); struct challenge_t { u_int8_t element_id; u_int8_t length; u_int8_t text[254]; /* 1-253 + 1 for null */ -}; +} __attribute__((packed)); struct fh_t { u_int8_t element_id; u_int8_t length; @@ -109,13 +109,13 @@ struct fh_t { u_int8_t hop_set; u_int8_t hop_pattern; u_int8_t hop_index; -}; +} __attribute__((packed)); struct ds_t { u_int8_t element_id; u_int8_t length; u_int8_t channel; -}; +} __attribute__((packed)); struct cf_t { u_int8_t element_id; @@ -124,7 +124,7 @@ struct cf_t { u_int8_t period; u_int16_t max_duration; u_int16_t dur_remaing; -}; +} __attribute__((packed)); struct tim_t { u_int8_t element_id; @@ -133,7 +133,7 @@ struct tim_t { u_int8_t period; u_int8_t bitmap_control; u_int8_t bitmap[251]; -}; +} __attribute__((packed)); #define E_SSID 0 #define E_RATES 1 @@ -179,7 +179,7 @@ struct mgmt_body_t { struct cf_t cf; struct fh_t fh; struct tim_t tim; -}; +} __attribute__((packed)); struct ctrl_rts_t { u_int16_t fc; @@ -187,7 +187,7 @@ struct ctrl_rts_t { u_int8_t ra[6]; u_int8_t ta[6]; u_int8_t fcs[4]; -}; +} __attribute__((packed)); #define CTRL_RTS_LEN (2+2+6+6+4) @@ -196,7 +196,7 @@ struct ctrl_cts_t { u_int16_t duration; u_int8_t ra[6]; u_int8_t fcs[4]; -}; +} __attribute__((packed)); #define CTRL_CTS_LEN (2+2+6+4) @@ -205,7 +205,7 @@ struct ctrl_ack_t { u_int16_t duration; u_int8_t ra[6]; u_int8_t fcs[4]; -}; +} __attribute__((packed)); #define CTRL_ACK_LEN (2+2+6+4) @@ -215,7 +215,7 @@ struct ctrl_ps_poll_t { u_int8_t bssid[6]; u_int8_t ta[6]; u_int8_t fcs[4]; -}; +} __attribute__((packed)); #define CTRL_PS_POLL_LEN (2+2+6+6+4) @@ -225,7 +225,7 @@ struct ctrl_end_t { u_int8_t ra[6]; u_int8_t bssid[6]; u_int8_t fcs[4]; -}; +} __attribute__((packed)); #define CTRL_END_LEN (2+2+6+6+4) @@ -235,7 +235,7 @@ struct ctrl_end_ack_t { u_int8_t ra[6]; u_int8_t bssid[6]; u_int8_t fcs[4]; -}; +} __attribute__((packed)); #define CTRL_END_ACK_LEN (2+2+6+6+4) @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/igrp.h,v 1.4 2000-12-17 23:07:49 guy Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/igrp.h,v 1.5 2002-11-09 17:19:19 itojun Exp $ (LBL) */ /* Cisco IGRP definitions */ /* IGRP Header */ @@ -13,7 +13,7 @@ struct igrphdr { 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 */ -}; +} __attribute__((packed)); #define IGRP_UPDATE 1 #define IGRP_REQUEST 2 @@ -28,6 +28,6 @@ struct igrprte { 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 */ -}; +} __attribute__((packed)); #define IGRP_RTE_SIZE 14 /* don't believe sizeof ! */ @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/ip.h,v 1.8 2002-07-28 04:14:21 fenner Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/ip.h,v 1.9 2002-11-09 17:19:19 itojun Exp $ (LBL) */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -62,7 +62,7 @@ struct ip { u_int8_t ip_p; /* protocol */ u_int16_t ip_sum; /* checksum */ struct in_addr ip_src,ip_dst; /* source and dest address */ -}; +} __attribute__((packed)); #define IP_MAXPACKET 65535 /* maximum packet size */ @@ -132,7 +132,7 @@ struct ip_timestamp { u_int32_t ipt_time; } ipt_ta[1]; } ipt_timestamp; -}; +} __attribute__((packed)); /* flag bits for ipt_flg */ #define IPOPT_TS_TSONLY 0 /* timestamps only */ @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/ip6.h,v 1.3 2000-12-17 23:07:48 guy Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/ip6.h,v 1.4 2002-11-09 17:19:19 itojun Exp $ (LBL) */ /* $NetBSD: ip6.h,v 1.9 2000/07/13 05:34:21 itojun Exp $ */ /* $KAME: ip6.h,v 1.9 2000/07/02 21:01:32 itojun Exp $ */ @@ -86,7 +86,7 @@ struct ip6_hdr { } ip6_ctlun; struct in6_addr ip6_src; /* source address */ struct in6_addr ip6_dst; /* destination address */ -}; +} __attribute__((packed)); #define ip6_vfc ip6_ctlun.ip6_un2_vfc #define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow @@ -114,7 +114,7 @@ struct ip6_hdr { struct ip6_ext { u_char ip6e_nxt; u_char ip6e_len; -}; +} __attribute__((packed)); /* Hop-by-Hop options header */ /* XXX should we pad it to force alignment on an 8-byte boundary? */ @@ -122,7 +122,7 @@ struct ip6_hbh { u_int8_t ip6h_nxt; /* next header */ u_int8_t ip6h_len; /* length in units of 8 octets */ /* followed by options */ -}; +} __attribute__((packed)); /* Destination options header */ /* XXX should we pad it to force alignment on an 8-byte boundary? */ @@ -130,7 +130,7 @@ struct ip6_dest { u_int8_t ip6d_nxt; /* next header */ u_int8_t ip6d_len; /* length in units of 8 octets */ /* followed by options */ -}; +} __attribute__((packed)); /* Option types and related macros */ #define IP6OPT_PAD1 0x00 /* 00 0 00000 */ @@ -166,7 +166,7 @@ struct ip6_rthdr { u_int8_t ip6r_type; /* routing type */ u_int8_t ip6r_segleft; /* segments left */ /* followed by routing type specific data */ -}; +} __attribute__((packed)); /* Type 0 Routing header */ struct ip6_rthdr0 { @@ -177,7 +177,7 @@ struct ip6_rthdr0 { u_int8_t ip6r0_reserved; /* reserved field */ u_int8_t ip6r0_slmap[3]; /* strict/loose bit map */ struct in6_addr ip6r0_addr[1]; /* up to 23 addresses */ -}; +} __attribute__((packed)); /* Fragment header */ struct ip6_frag { @@ -185,7 +185,7 @@ struct ip6_frag { u_int8_t ip6f_reserved; /* reserved field */ u_int16_t ip6f_offlg; /* offset, reserved, and flag */ u_int32_t ip6f_ident; /* identification */ -}; +} __attribute__((packed)); /* network endian */ #define IP6F_OFF_MASK ((u_int16_t)htons(0xfff8)) /* mask out offset from _offlg */ @@ -18,13 +18,13 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/tcpdump/ipfc.h,v 1.1 2002-10-18 09:17:47 guy Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/ipfc.h,v 1.2 2002-11-09 17:19:19 itojun Exp $ (LBL) */ struct ipfc_header { u_char ipfc_dhost[8]; u_char ipfc_shost[8]; -}; +} __attribute__((packed)); #define IPFC_HDRLEN 16 diff --git a/ipsec_doi.h b/ipsec_doi.h index e1b4d862..151ed739 100644 --- a/ipsec_doi.h +++ b/ipsec_doi.h @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -/* YIPS @(#)$Id: ipsec_doi.h,v 1.5 2002-06-11 17:08:39 itojun Exp $ */ +/* YIPS @(#)$Id: ipsec_doi.h,v 1.6 2002-11-09 17:19:20 itojun Exp $ */ /* refer to RFC 2407 */ @@ -114,12 +114,12 @@ struct ipsecdoi_sa { struct isakmp_gen h; u_int32_t doi; /* Domain of Interpretation */ u_int32_t sit; /* Situation */ -}; +} __attribute__((packed)); struct ipsecdoi_secrecy_h { u_int16_t len; u_int16_t reserved; -}; +} __attribute__((packed)); /* 4.6.2.1 Identification Type Values */ struct ipsecdoi_id { @@ -128,7 +128,7 @@ struct ipsecdoi_id { u_int8_t proto_id; /* Protocol ID */ u_int16_t port; /* Port */ /* Identification Data */ -}; +} __attribute__((packed)); #define IPSECDOI_ID_IPV4_ADDR 1 #define IPSECDOI_ID_FQDN 2 @@ -1,7 +1,7 @@ /* * IPX protocol formats * - * @(#) $Header: /tcpdump/master/tcpdump/ipx.h,v 1.6 2002-06-11 17:08:39 itojun Exp $ + * @(#) $Header: /tcpdump/master/tcpdump/ipx.h,v 1.7 2002-11-09 17:19:20 itojun Exp $ */ /* well-known sockets */ @@ -25,7 +25,7 @@ struct ipxHdr { u_int16_t srcNet[2]; /* source net */ u_int8_t srcNode[6]; /* source node */ u_int16_t srcSkt; /* source socket */ -}; +} __attribute__((packed)); #define ipxSize 30 @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -/* YIPS @(#)$Id: isakmp.h,v 1.8 2002-06-11 17:08:39 itojun Exp $ */ +/* YIPS @(#)$Id: isakmp.h,v 1.9 2002-11-09 17:19:21 itojun Exp $ */ /* refer to RFC 2408 */ @@ -110,7 +110,7 @@ struct isakmp { u_int8_t flags; /* Flags */ msgid_t msgid; u_int32_t len; /* Length */ -}; +} __attribute__((packed)); /* Next Payload Type */ #define ISAKMP_NPTYPE_NONE 0 /* NONE*/ @@ -153,7 +153,7 @@ struct isakmp_gen { u_int8_t np; /* Next Payload */ u_int8_t reserved; /* RESERVED, unused, must set to 0 */ u_int16_t len; /* Payload Length */ -}; +} __attribute__((packed)); /* 3.3 Data Attributes 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 @@ -170,7 +170,7 @@ struct isakmp_data { u_int16_t lorv; /* if f equal 1, Attribute Length */ /* if f equal 0, Attribute Value */ /* if f equal 1, Attribute Value */ -}; +} __attribute__((packed)); #define ISAKMP_GEN_TLV 0x0000 #define ISAKMP_GEN_TV 0x8000 /* mask for type of attribute format */ @@ -192,7 +192,7 @@ struct isakmp_pl_sa { struct isakmp_gen h; u_int32_t doi; /* Domain of Interpretation */ u_int32_t sit; /* Situation */ -}; +} __attribute__((packed)); /* 3.5 Proposal Payload */ /* @@ -209,7 +209,7 @@ struct isakmp_pl_p { u_int8_t spi_size; /* SPI Size */ u_int8_t num_t; /* Number of Transforms */ /* SPI */ -}; +} __attribute__((packed)); /* 3.6 Transform Payload */ /* @@ -224,13 +224,13 @@ struct isakmp_pl_t { u_int8_t t_id; /* Transform-Id */ u_int16_t reserved; /* RESERVED2 */ /* SA Attributes */ -}; +} __attribute__((packed)); /* 3.7 Key Exchange Payload */ struct isakmp_pl_ke { struct isakmp_gen h; /* Key Exchange Data */ -}; +} __attribute__((packed)); /* 3.8 Identification Payload */ /* MUST NOT to be used, because of being defined in ipsec-doi. */ @@ -241,7 +241,7 @@ struct isakmp_pl_id { u_int32_t doi_data; /* DOI Specific ID Data */ } d; /* Identification Data */ -}; +} __attribute__((packed)); /* 3.9 Certificate Payload */ struct isakmp_pl_cert { @@ -253,7 +253,7 @@ struct isakmp_pl_cert { certificate or certificate-related information contained in the Certificate Data field. */ -}; +} __attribute__((packed)); /* Certificate Type */ #define ISAKMP_CERT_NONE 0 @@ -279,28 +279,28 @@ struct isakmp_pl_cr { */ /* # Certificate Authorities (1 octet) */ /* Certificate Authorities (variable length) */ -}; +} __attribute__((packed)); /* 3.11 Hash Payload */ /* may not be used, because of having only data. */ struct isakmp_pl_hash { struct isakmp_gen h; /* Hash Data */ -}; +} __attribute__((packed)); /* 3.12 Signature Payload */ /* may not be used, because of having only data. */ struct isakmp_pl_sig { struct isakmp_gen h; /* Signature Data */ -}; +} __attribute__((packed)); /* 3.13 Nonce Payload */ /* may not be used, because of having only data. */ struct isakmp_pl_nonce { struct isakmp_gen h; /* Nonce Data */ -}; +} __attribute__((packed)); /* 3.14 Notification Payload */ struct isakmp_pl_n { @@ -311,7 +311,7 @@ struct isakmp_pl_n { u_int16_t type; /* Notify Message Type */ /* SPI */ /* Notification Data */ -}; +} __attribute__((packed)); /* 3.14.1 Notify Message Types */ /* NOTIFY MESSAGES - ERROR TYPES */ @@ -354,20 +354,20 @@ struct isakmp_pl_d { u_int8_t spi_size; /* SPI Size */ u_int16_t num_spi; /* # of SPIs */ /* SPI(es) */ -}; +} __attribute__((packed)); struct isakmp_ph1tab { struct isakmp_ph1 *head; struct isakmp_ph1 *tail; int len; -}; +} __attribute__((packed)); struct isakmp_ph2tab { struct isakmp_ph2 *head; struct isakmp_ph2 *tail; int len; -}; +} __attribute__((packed)); #define EXCHANGE_PROXY 1 #define EXCHANGE_MYSELF 0 @@ -20,7 +20,7 @@ * */ -/* $Id: lane.h,v 1.5 2002-07-11 09:17:23 guy Exp $ */ +/* $Id: lane.h,v 1.6 2002-11-09 17:19:21 itojun Exp $ */ #ifndef ETHER_ADDR_LEN #define ETHER_ADDR_LEN 6 @@ -31,11 +31,11 @@ struct lecdatahdr_8023 { u_int8_t h_dest[ETHER_ADDR_LEN]; u_int8_t h_source[ETHER_ADDR_LEN]; u_int16_t h_type; -}; +} __attribute__((packed)); struct lane_controlhdr { u_int16_t lec_header; u_int8_t lec_proto; u_int8_t lec_vers; u_int16_t lec_opcode; -}; +} __attribute__((packed)); @@ -18,7 +18,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/tcpdump/llc.h,v 1.14 2002-04-07 09:50:30 guy Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/llc.h,v 1.15 2002-11-09 17:19:21 itojun Exp $ (LBL) */ /* @@ -47,7 +47,7 @@ struct llc { u_int8_t snap_ethertype[2]; } snap_ether; } ctl; -}; +} __attribute__((packed)); #define llcui ctl.snap.snap_ui #define llcpi ctl.snap.snap_pi @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/nameser.h,v 1.11 2002-08-16 22:40:33 itojun Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/nameser.h,v 1.12 2002-11-09 17:19:21 itojun Exp $ (LBL) */ /* * Copyright (c) 1983, 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -211,7 +211,7 @@ typedef struct { u_int16_t ancount; /* number of answer entries */ u_int16_t nscount; /* number of authority entries */ u_int16_t arcount; /* number of resource entries */ -} HEADER; +} HEADER __attribute__((packed)); /* * Macros for subfields of flag fields. @@ -1,14 +1,14 @@ /* * NETBIOS protocol formats * - * @(#) $Header: /tcpdump/master/tcpdump/netbios.h,v 1.1 1999-10-07 23:47:10 mcr Exp $ + * @(#) $Header: /tcpdump/master/tcpdump/netbios.h,v 1.2 2002-11-09 17:19:22 itojun Exp $ */ struct p8022Hdr { u_char dsap; u_char ssap; u_char flags; -}; +} __attribute__((packed)); #define p8022Size 3 /* min 802.2 header size */ @@ -261,19 +261,19 @@ typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5, union nfsfh { /* fhandle_t fh_generic; */ u_char fh_bytes[NFS_SMALLFH]; -}; +} __attribute__((packed)); typedef union nfsfh nfsfh_t; struct nfsv2_time { u_int32_t nfsv2_sec; u_int32_t nfsv2_usec; -}; +} __attribute__((packed)); typedef struct nfsv2_time nfstime2; struct nfsv3_time { u_int32_t nfsv3_sec; u_int32_t nfsv3_nsec; -}; +} __attribute__((packed)); typedef struct nfsv3_time nfstime3; /* @@ -282,7 +282,7 @@ typedef struct nfsv3_time nfstime3; */ struct nfs_uquad { u_int32_t nfsuquad[2]; -}; +} __attribute__((packed)); typedef struct nfs_uquad nfsuint64; #if 0 /* XXX - this doesn't seemed to be used and it doesn't work @@ -295,7 +295,7 @@ typedef struct nfs_uquad nfsuint64; union nfs_quadconvert { u_int32_t lval[2]; u_int64_t qval; -}; +} __attribute__((packed)); typedef union nfs_quadconvert nfsquad_t; #endif @@ -306,7 +306,7 @@ typedef union nfs_quadconvert nfsquad_t; struct nfsv3_spec { u_int32_t specdata1; u_int32_t specdata2; -}; +} __attribute__((packed)); typedef struct nfsv3_spec nfsv3spec; /* @@ -347,7 +347,7 @@ struct nfs_fattr { nfstime3 nfsv3fa_ctime; } fa_nfsv3; } fa_un; -}; +} __attribute__((packed)); /* and some ugly defines for accessing union components */ #define fa2_size fa_un.fa_nfsv2.nfsv2fa_size @@ -375,7 +375,7 @@ struct nfsv2_sattr { u_int32_t sa_size; nfstime2 sa_atime; nfstime2 sa_mtime; -}; +} __attribute__((packed)); /* * NFS Version 3 sattr structure for the new node creation case. @@ -393,7 +393,7 @@ struct nfsv3_sattr { nfstime3 sa_atime; u_int32_t sa_mtimetype; nfstime3 sa_mtime; -}; +} __attribute__((packed)); struct nfs_statfs { union { @@ -414,7 +414,7 @@ struct nfs_statfs { u_int32_t nfsv3sf_invarsec; } sf_nfsv3; } sf_un; -}; +} __attribute__((packed)); #define sf_tsize sf_un.sf_nfsv2.nfsv2sf_tsize #define sf_bsize sf_un.sf_nfsv2.nfsv2sf_bsize @@ -440,7 +440,7 @@ struct nfsv3_fsinfo { nfsuint64 fs_maxfilesize; nfstime3 fs_timedelta; u_int32_t fs_properties; -}; +} __attribute__((packed)); struct nfsv3_pathconf { u_int32_t pc_linkmax; @@ -449,4 +449,4 @@ struct nfsv3_pathconf { u_int32_t pc_chownrestricted; u_int32_t pc_caseinsensitive; u_int32_t pc_casepreserving; -}; +} __attribute__((packed)); @@ -1,4 +1,4 @@ -/* $Header: /tcpdump/master/tcpdump/ntp.h,v 1.4 2000-10-03 02:54:57 itojun Exp $ */ +/* $Header: /tcpdump/master/tcpdump/ntp.h,v 1.5 2002-11-09 17:19:22 itojun Exp $ */ /* * Based on ntp.h from the U of MD implementation @@ -30,12 +30,12 @@ struct l_fixedpt { u_int32_t int_part; u_int32_t fraction; -}; +} __attribute__((packed)); struct s_fixedpt { u_int16_t int_part; u_int16_t fraction; -}; +} __attribute__((packed)); /* ================= Table 3.3. Packet Variables ================= */ /* @@ -79,7 +79,7 @@ struct ntpdata { struct l_fixedpt org; struct l_fixedpt rec; struct l_fixedpt xmt; -}; +} __attribute__((packed)); /* * Leap Second Codes (high order two bits) */ @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -/* YIPS @(#)$Id: oakley.h,v 1.2 2002-06-11 17:08:40 itojun Exp $ */ +/* YIPS @(#)$Id: oakley.h,v 1.3 2002-11-09 17:19:22 itojun Exp $ */ /* refer to RFC 2409 */ @@ -120,7 +120,7 @@ struct oakley_sa { u_int8_t enc_t; /* type of cipher */ u_int8_t life_t; /* type of duration of lifetime */ u_int32_t ldur; /* life duration */ -}; +} __attribute__((packed)); #endif #endif /* !defined(_ISAKMP_OAKLEY_H_) */ @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/ospf.h,v 1.4 2002-11-07 23:46:23 hannes Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/ospf.h,v 1.5 2002-11-09 17:19:23 itojun Exp $ (LBL) */ /* * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. @@ -112,7 +112,7 @@ struct lsa_hdr { u_int32_t ls_seq; u_int16_t ls_chksum; u_int16_t ls_length; -} ; +} __attribute__((packed)); /* link state advertisement */ struct lsa { @@ -173,7 +173,7 @@ struct lsa { } un_opaque[1]; } lsa_un; -} ; +} __attribute__((packed)); /* @@ -183,7 +183,7 @@ struct tos_metric { u_int8_t tos_type; u_int8_t tos_zero; u_int16_t tos_metric; -} ; +} __attribute__((packed)); #define OSPF_AUTH_SIZE 8 @@ -240,7 +240,7 @@ struct ospfhdr { struct lsa_hdr lsa_lshdr[1]; /* may repeat */ } un_lsa ; } ospf_un ; -} ; +} __attribute__((packed)); #define ospf_hello ospf_un.un_hello #define ospf_db ospf_un.un_db @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/ospf6.h,v 1.4 2002-06-11 17:08:40 itojun Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/ospf6.h,v 1.5 2002-11-09 17:19:23 itojun Exp $ (LBL) */ /* * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. @@ -105,14 +105,14 @@ struct lsa_hdr { u_int32_t ls_seq; u_int16_t ls_chksum; u_int16_t ls_length; -} ; +} __attribute__((packed)); struct lsa_prefix { u_int8_t lsa_p_len; u_int8_t lsa_p_opt; u_int16_t lsa_p_mbz; u_int8_t lsa_p_prefix[4]; -}; +} __attribute__((packed)); /* link state advertisement */ struct lsa { @@ -195,7 +195,7 @@ struct lsa { struct lsa_prefix intra_ap_prefix[1]; } un_intra_ap; } lsa_un; -} ; +} __attribute__((packed)); /* @@ -205,7 +205,7 @@ struct tos_metric { u_int8_t tos_type; u_int8_t tos_zero; u_int16_t tos_metric; -} ; +} __attribute__((packed)); #define OSPF_AUTH_SIZE 8 @@ -268,7 +268,7 @@ struct ospf6hdr { struct lsa_hdr lsa_lshdr[1]; /* may repeat */ } un_lsa ; } ospf6_un ; -} ; +} __attribute__((packed)); #define ospf6_hello ospf6_un.un_hello #define ospf6_db ospf6_un.un_db diff --git a/print-arp.c b/print-arp.c index fdfc66e7..c5a05a94 100644 --- a/print-arp.c +++ b/print-arp.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.58 2002-09-04 18:56:11 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.59 2002-11-09 17:19:23 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -81,7 +81,7 @@ struct arp_pkthdr { #define ar_spa(ap) (((const u_char *)((ap)+1))+ (ap)->ar_hln) #define ar_tha(ap) (((const u_char *)((ap)+1))+ (ap)->ar_hln+(ap)->ar_pln) #define ar_tpa(ap) (((const u_char *)((ap)+1))+2*(ap)->ar_hln+(ap)->ar_pln) -}; +} __attribute__((packed)); #define ARP_HDRLEN 8 @@ -146,7 +146,7 @@ struct atmarp_pkthdr { #define aar_tha(ap) (aar_spa(ap) + ATMSPLN(ap)) #define aar_tsa(ap) (aar_tha(ap) + ATMTHLN(ap)) #define aar_tpa(ap) (aar_tsa(ap) + ATMTSLN(ap)) -}; +} __attribute__((packed)); #define ATMSHA(ap) (aar_sha(ap)) #define ATMSSA(ap) (aar_ssa(ap)) diff --git a/print-atalk.c b/print-atalk.c index a67b6c60..df94bf6b 100644 --- a/print-atalk.c +++ b/print-atalk.c @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.75 2002-10-18 04:40:02 itojun Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.76 2002-11-09 17:19:24 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -61,7 +61,7 @@ struct aarp { u_int8_t psaddr[4]; u_int8_t hdaddr[6]; u_int8_t pdaddr[4]; -}; +} __attribute__((packed)); static char tstr[] = "[|atalk]"; 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 diff --git a/print-chdlc.c b/print-chdlc.c index b416991c..424e6baa 100644 --- a/print-chdlc.c +++ b/print-chdlc.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.21 2002-10-18 20:08:34 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.22 2002-11-09 17:19:24 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -153,7 +153,7 @@ struct cisco_slarp { u_int16_t t2; } keep; } un; -}; +} __attribute__((packed)); #define SLARP_LEN 18 diff --git a/print-cnfp.c b/print-cnfp.c index 5981557c..94a05807 100644 --- a/print-cnfp.c +++ b/print-cnfp.c @@ -34,7 +34,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-cnfp.c,v 1.11 2002-09-05 21:25:39 guy Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-cnfp.c,v 1.12 2002-11-09 17:19:25 itojun Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -59,7 +59,7 @@ struct nfhdr { u_int32_t utc_nsec; u_int32_t sequence; /* v5 flow sequence number */ u_int32_t reserved; /* v5 only */ -}; +} __attribute__((packed)); struct nfrec { struct in_addr src_ina; @@ -75,7 +75,7 @@ struct nfrec { u_int32_t asses; /* v1: flags; v5: src,dst AS */ u_int32_t masks; /* src,dst addr prefix; v6: encaps */ struct in_addr peer_nexthop; /* v6: IP address of the nexthop within the peer (FIB)*/ -}; +} __attribute__((packed)); void cnfp_print(const u_char *cp, const u_char *bp) diff --git a/print-egp.c b/print-egp.c index 5ad20f02..2576c8ed 100644 --- a/print-egp.c +++ b/print-egp.c @@ -20,7 +20,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.32 2002-09-05 21:25:40 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.33 2002-11-09 17:19:25 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -37,15 +37,15 @@ static const char rcsid[] = #include "ip.h" struct egp_packet { - u_char egp_version; + u_int8_t egp_version; #define EGP_VERSION 2 - u_char egp_type; + u_int8_t egp_type; #define EGPT_ACQUIRE 3 #define EGPT_REACH 5 #define EGPT_POLL 2 #define EGPT_UPDATE 1 #define EGPT_ERROR 8 - u_char egp_code; + u_int8_t egp_code; #define EGPC_REQUEST 0 #define EGPC_CONFIRM 1 #define EGPC_REFUSE 2 @@ -53,7 +53,7 @@ struct egp_packet { #define EGPC_CEASEACK 4 #define EGPC_HELLO 0 #define EGPC_HEARDU 1 - u_char egp_status; + u_int8_t egp_status; #define EGPS_UNSPEC 0 #define EGPS_ACTIVE 1 #define EGPS_PASSIVE 2 @@ -66,13 +66,13 @@ struct egp_packet { #define EGPS_UP 1 #define EGPS_DOWN 2 #define EGPS_UNSOL 0x80 - u_short egp_checksum; - u_short egp_as; - u_short egp_sequence; + u_int16_t egp_checksum; + u_int16_t egp_as; + u_int16_t egp_sequence; union { - u_short egpu_hello; - u_char egpu_gws[2]; - u_short egpu_reason; + u_int16_t egpu_hello; + u_int8_t egpu_gws[2]; + u_int16_t egpu_reason; #define EGPR_UNSPEC 0 #define EGPR_BADHEAD 1 #define EGPR_BADDATA 2 @@ -86,12 +86,12 @@ struct egp_packet { #define egp_extgw egp_handg.egpu_gws[1] #define egp_reason egp_handg.egpu_reason union { - u_short egpu_poll; + u_int16_t egpu_poll; u_int32_t egpu_sourcenet; } egp_pands; #define egp_poll egp_pands.egpu_poll #define egp_sourcenet egp_pands.egpu_sourcenet -}; +} __attribute__((packed)); const char *egp_acquire_codes[] = { "request", @@ -136,7 +136,7 @@ const char *egp_reasons[] = { static void egpnrprint(register const struct egp_packet *egp) { - register const u_char *cp; + register const u_int8_t *cp; u_int32_t addr; register u_int32_t net; register u_int netlen; @@ -158,7 +158,7 @@ egpnrprint(register const struct egp_packet *egp) net = 0; netlen = 0; } - cp = (u_char *)(egp + 1); + cp = (u_int8_t *)(egp + 1); t_gateways = egp->egp_intgw + egp->egp_extgw; for (gateways = 0; gateways < t_gateways; ++gateways) { @@ -213,7 +213,7 @@ trunc: } void -egp_print(register const u_char *bp) +egp_print(register const u_int8_t *bp) { register const struct egp_packet *egp; register int status; @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#)$Header: /tcpdump/master/tcpdump/print-fr.c,v 1.6 2002-09-05 21:25:41 guy Exp $ (LBL)"; + "@(#)$Header: /tcpdump/master/tcpdump/print-fr.c,v 1.7 2002-11-09 17:19:25 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -345,9 +345,9 @@ out: /* See L2 protocol ID picture above */ struct q933_header { - u_char call_ref; /* usually is 0 for framerelay PVC */ - u_char msg_type; -}; + u_int8_t call_ref; /* usually is 0 for framerelay PVC */ + u_int8_t msg_type; +} __attribute__((packed)); #define REPORT_TYPE_IE 0x01 #define LINK_VERIFY_IE_91 0x19 @@ -357,9 +357,9 @@ struct q933_header { #define MAX_IE_SIZE struct common_ie_header { - u_char ie_id; - u_char ie_len; -}; + u_int8_t ie_id; + u_int8_t ie_len; +} __attribute__((packed)); #define FULL_STATUS 0 #define LINK_VERIFY 1 diff --git a/print-hsrp.c b/print-hsrp.c index a421eab7..2dffa160 100644 --- a/print-hsrp.c +++ b/print-hsrp.c @@ -31,7 +31,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-hsrp.c,v 1.5 2002-08-01 08:53:08 risso Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-hsrp.c,v 1.6 2002-11-09 17:19:25 itojun Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -85,20 +85,20 @@ static struct tok states[] = { /* HSRP protocol header. */ struct hsrp { - u_char hsrp_version; - u_char hsrp_op_code; - u_char hsrp_state; - u_char hsrp_hellotime; - u_char hsrp_holdtime; - u_char hsrp_priority; - u_char hsrp_group; - u_char hsrp_reserved; - u_char hsrp_authdata[HSRP_AUTH_SIZE]; + 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]; struct in_addr hsrp_virtaddr; -}; +} __attribute__((packed)); void -hsrp_print(register const u_char *bp, register u_int len) +hsrp_print(register const u_int8_t *bp, register u_int len) { struct hsrp *hp = (struct hsrp *) bp; diff --git a/print-icmp.c b/print-icmp.c index 3aa44177..81adf2cc 100644 --- a/print-icmp.c +++ b/print-icmp.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-icmp.c,v 1.69 2002-08-01 08:53:08 risso Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-icmp.c,v 1.70 2002-11-09 17:19:26 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -93,7 +93,7 @@ struct icmp { #define icmp_ip icmp_dun.id_ip.idi_ip #define icmp_mask icmp_dun.id_mask #define icmp_data icmp_dun.id_data -}; +} __attribute__((packed)); /* * Lower bounds on packet lengths for various types. @@ -245,19 +245,19 @@ static struct tok type2str[] = { struct mtu_discovery { u_int16_t unused; u_int16_t nexthopmtu; -}; +} __attribute__((packed)); /* rfc1256 */ struct ih_rdiscovery { u_int8_t ird_addrnum; u_int8_t ird_addrsiz; u_int16_t ird_lifetime; -}; +} __attribute__((packed)); struct id_rdiscovery { u_int32_t ird_addr; u_int32_t ird_pref; -}; +} __attribute__((packed)); void icmp_print(const u_char *bp, u_int plen, const u_char *bp2) diff --git a/print-igmp.c b/print-igmp.c index 9c17f62a..b1f3b493 100644 --- a/print-igmp.c +++ b/print-igmp.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-igmp.c,v 1.9 2002-09-05 21:25:41 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-igmp.c,v 1.10 2002-11-09 17:19:26 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -47,11 +47,11 @@ static const char rcsid[] = * The packet format for a traceroute request. */ struct tr_query { - u_int tr_src; /* traceroute source */ - u_int tr_dst; /* traceroute destination */ - u_int tr_raddr; /* traceroute response address */ - u_int tr_rttlqid; /* response ttl and qid */ -}; + 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 */ +} __attribute__((packed)); #define TR_GETTTL(x) (int)(((x) >> 24) & 0xff) #define TR_GETQID(x) ((x) & 0x00ffffff) @@ -61,18 +61,18 @@ struct tr_query { * beginning, followed by one tr_resp for each hop taken. */ struct tr_resp { - u_int tr_qarr; /* query arrival time */ - u_int tr_inaddr; /* incoming interface address */ - u_int tr_outaddr; /* outgoing interface address */ - u_int tr_rmtaddr; /* parent address in source tree */ - u_int tr_vifin; /* input packet count on interface */ - u_int tr_vifout; /* output packet count on interface */ - u_int tr_pktcnt; /* total incoming packets for src-grp */ - u_char tr_rproto; /* routing proto deployed on router */ - u_char tr_fttl; /* ttl required to forward on outvif */ - u_char tr_smask; /* subnet mask for src addr */ - u_char tr_rflags; /* forwarding error codes */ -}; + 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 */ +} __attribute__((packed)); /* defs within mtrace */ #define TR_QUERY 1 diff --git a/print-ipcomp.c b/print-ipcomp.c index 2ee01183..8cdb779d 100644 --- a/print-ipcomp.c +++ b/print-ipcomp.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-ipcomp.c,v 1.15 2002-09-05 21:25:42 guy Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-ipcomp.c,v 1.16 2002-11-09 17:19:26 itojun Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -37,7 +37,7 @@ 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 */ -}; +} __attribute__((packed)); #if defined(HAVE_LIBZ) && defined(HAVE_ZLIB_H) #include <zlib.h> diff --git a/print-isoclns.c b/print-isoclns.c index aee8237c..36af86a9 100644 --- a/print-isoclns.c +++ b/print-isoclns.c @@ -26,7 +26,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.67 2002-10-09 14:04:07 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.68 2002-11-09 17:19:27 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -339,38 +339,38 @@ static struct tok isis_ptp_adjancey_values[] = { }; struct isis_tlv_ptp_adj { - u_char adjacency_state; - u_char extd_local_circuit_id[4]; - u_char neighbor_sysid[SYSTEM_ID_LEN]; - u_char neighbor_extd_local_circuit_id[4]; -}; + 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]; +} __attribute__((packed)); -static int osi_cksum(const u_char *, u_int); -static void esis_print(const u_char *, u_int); -static int isis_print(const u_char *, u_int); +static int osi_cksum(const u_int8_t *, u_int); +static void esis_print(const u_int8_t *, u_int); +static int isis_print(const u_int8_t *, u_int); struct isis_metric_block { - u_char metric_default; - u_char metric_delay; - u_char metric_expense; - u_char metric_error; -}; + u_int8_t metric_default; + u_int8_t metric_delay; + u_int8_t metric_expense; + u_int8_t metric_error; +} __attribute__((packed)); struct isis_tlv_is_reach { struct isis_metric_block isis_metric_block; - u_char neighbor_nodeid[NODE_ID_LEN]; -}; + u_int8_t neighbor_nodeid[NODE_ID_LEN]; +} __attribute__((packed)); struct isis_tlv_es_reach { struct isis_metric_block isis_metric_block; - u_char neighbor_sysid[SYSTEM_ID_LEN]; -}; + u_int8_t neighbor_sysid[SYSTEM_ID_LEN]; +} __attribute__((packed)); struct isis_tlv_ip_reach { struct isis_metric_block isis_metric_block; - u_char prefix[4]; - u_char mask[4]; -}; + u_int8_t prefix[4]; + u_int8_t mask[4]; +} __attribute__((packed)); static struct tok isis_is_reach_virtual_values[] = { { 0, "IsNotVirtual"}, @@ -379,67 +379,67 @@ static struct tok isis_is_reach_virtual_values[] = { }; struct isis_common_header { - u_char nlpid; - u_char fixed_len; - u_char version; /* Protocol version? */ - u_char id_length; - u_char pdu_type; /* 3 MSbs are reserved */ - u_char pdu_version; /* Packet format version? */ - u_char reserved; - u_char max_area; -}; + 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 MSbs are reserved */ + u_int8_t pdu_version; /* Packet format version? */ + u_int8_t reserved; + u_int8_t max_area; +} __attribute__((packed)); struct isis_iih_lan_header { - u_char circuit_type; - u_char source_id[SYSTEM_ID_LEN]; - u_char holding_time[2]; - u_char pdu_len[2]; - u_char priority; - u_char lan_id[NODE_ID_LEN]; -}; + 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]; +} __attribute__((packed)); struct isis_iih_ptp_header { - u_char circuit_type; - u_char source_id[SYSTEM_ID_LEN]; - u_char holding_time[2]; - u_char pdu_len[2]; - u_char circuit_id; -}; + 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; +} __attribute__((packed)); struct isis_lsp_header { - u_char pdu_len[2]; - u_char remaining_lifetime[2]; - u_char lsp_id[LSP_ID_LEN]; - u_char sequence_number[4]; - u_char checksum[2]; - u_char typeblock; -}; + 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; +} __attribute__((packed)); struct isis_csnp_header { - u_char pdu_len[2]; - u_char source_id[NODE_ID_LEN]; - u_char start_lsp_id[LSP_ID_LEN]; - u_char end_lsp_id[LSP_ID_LEN]; -}; + 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]; +} __attribute__((packed)); struct isis_psnp_header { - u_char pdu_len[2]; - u_char source_id[NODE_ID_LEN]; -}; + u_int8_t pdu_len[2]; + u_int8_t source_id[NODE_ID_LEN]; +} __attribute__((packed)); struct isis_tlv_lsp { - u_char remaining_lifetime[2]; - u_char lsp_id[LSP_ID_LEN]; - u_char sequence_number[4]; - u_char checksum[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]; +} __attribute__((packed)); /* allocate space for the following string * xx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx * 32 bytes plus one termination byte */ static char * -print_nsap(register const u_char *pptr, register int nsap_length) +print_nsap(register const u_int8_t *pptr, register int nsap_length) { int nsap_idx; static char nsap_ascii_output[33]; @@ -471,10 +471,10 @@ print_nsap(register const u_char *pptr, register int nsap_length) #define ISIS_CSNP_HEADER_SIZE (sizeof(struct isis_csnp_header)) #define ISIS_PSNP_HEADER_SIZE (sizeof(struct isis_psnp_header)) -void isoclns_print(const u_char *p, u_int length, u_int caplen, - const u_char *esrc, const u_char *edst) +void isoclns_print(const u_int8_t *p, u_int length, u_int caplen, + const u_int8_t *esrc, const u_int8_t *edst) { - u_char pdu_type; + u_int8_t pdu_type; const struct isis_common_header *header; header = (const struct isis_common_header *)p; @@ -528,17 +528,17 @@ static struct tok esis_values[] = { }; struct esis_hdr { - u_char version; - u_char reserved; - u_char type; - u_char tmo[2]; - u_char cksum[2]; + u_int8_t version; + u_int8_t reserved; + u_int8_t type; + u_int8_t tmo[2]; + u_int8_t cksum[2]; }; static void -esis_print(const u_char *p, u_int length) +esis_print(const u_int8_t *p, u_int length) { - const u_char *ep; + const u_int8_t *ep; u_int li; const struct esis_hdr *eh; @@ -592,7 +592,7 @@ esis_print(const u_char *p, u_int length) switch (eh->type & 0x1f) { case ESIS_REDIRECT: { - const u_char *dst, *snpa, *is; + const u_int8_t *dst, *snpa, *is; dst = p; p += *p + 1; if (p > snapend) @@ -618,7 +618,7 @@ esis_print(const u_char *p, u_int length) break; case ESIS_ISH: { - const u_char *is; + const u_int8_t *is; is = p; p += *p + 1; if (p > ep) { @@ -649,7 +649,7 @@ esis_print(const u_char *p, u_int length) if (vflag) while (p < ep && li) { u_int op, opli; - const u_char *q; + const u_int8_t *q; if (snapend - p < 2) return; @@ -692,7 +692,7 @@ esis_print(const u_char *p, u_int length) * xxxx.xxxx.xxxx * 14 bytes plus one termination byte */ static char * -isis_print_sysid(const u_char *cp, int sysid_len) +isis_print_sysid(const u_int8_t *cp, int sysid_len) { int i; static char sysid[15]; @@ -715,7 +715,7 @@ isis_print_sysid(const u_char *cp, int sysid_len) * xxxx.xxxx.xxxx.yy * 17 bytes plus one termination byte */ static char * -isis_print_nodeid(const u_char *cp) +isis_print_nodeid(const u_int8_t *cp) { int i; static char nodeid[18]; @@ -737,7 +737,7 @@ isis_print_nodeid(const u_char *cp) * xxxx.xxxx.xxxx.yy-zz * 20 bytes plus one termination byte */ static char * -isis_print_lspid(const u_char *cp) +isis_print_lspid(const u_int8_t *cp) { int i; static char lspid[21]; @@ -777,7 +777,7 @@ isis_print_metric_block (const struct isis_metric_block *isis_metric_block) } static int -isis_print_tlv_ip_reach (const u_char *cp, int length) +isis_print_tlv_ip_reach (const u_int8_t *cp, int length) { u_int bitmasks[33] = { 0x00000000, @@ -862,7 +862,7 @@ isis_print_tlv_ip_reach (const u_char *cp, int length) */ static int -isis_print_ip_reach_subtlv (const u_char *tptr,int subt,int subl,const char *ident) { +isis_print_ip_reach_subtlv (const u_int8_t *tptr,int subt,int subl,const char *ident) { switch(subt) { case SUBTLV_IP_REACH_ADMIN_TAG32: @@ -903,7 +903,7 @@ trunctlv: */ static int -isis_print_is_reach_subtlv (const u_char *tptr,int subt,int subl,const char *ident) { +isis_print_is_reach_subtlv (const u_int8_t *tptr,int subt,int subl,const char *ident) { int i,j; float bw; /* copy buffer for several subTLVs */ @@ -1078,7 +1078,7 @@ trunctlv: */ static int -isis_print_ext_is_reach (const u_char *tptr,const char *ident) { +isis_print_ext_is_reach (const u_int8_t *tptr,const char *ident) { char ident_buffer[20]; int subt,subl,tslen; @@ -1125,7 +1125,7 @@ isis_print_ext_is_reach (const u_char *tptr,const char *ident) { */ static int -isis_print_mtid (const u_char *tptr,const char *ident) { +isis_print_mtid (const u_int8_t *tptr,const char *ident) { if (!TTEST2(*tptr, 2)) return(0); @@ -1149,7 +1149,7 @@ isis_print_mtid (const u_char *tptr,const char *ident) { * Decode IS-IS packets. Return 0 on error. */ -static int isis_print (const u_char *p, u_int length) +static int isis_print (const u_int8_t *p, u_int length) { const struct isis_common_header *header; @@ -1164,13 +1164,13 @@ static int isis_print (const u_char *p, u_int length) const struct isis_tlv_is_reach *tlv_is_reach; const struct isis_tlv_es_reach *tlv_es_reach; - u_char pdu_type, max_area, id_length, type, len, tmp, alen, lan_alen, prefix_len, ext_is_len, mt_len, subl, subt, tslen; - const u_char *optr, *pptr, *tptr; + u_int8_t pdu_type, max_area, id_length, type, len, tmp, alen, lan_alen, prefix_len, ext_is_len, mt_len, subl, subt, tslen; + const u_int8_t *optr, *pptr, *tptr; u_short packet_len,pdu_len,time_remain; u_int i,j,bit_length,byte_length,metric,ra,rr; - u_char prefix[4]; /* copy buffer for ipv4 prefixes */ + u_int8_t prefix[4]; /* copy buffer for ipv4 prefixes */ #ifdef INET6 - u_char prefix6[16]; /* copy buffer for ipv6 prefixes */ + u_int8_t prefix6[16]; /* copy buffer for ipv6 prefixes */ #endif packet_len=length; optr = p; /* initialize the _o_riginal pointer to the packet start - @@ -2185,7 +2185,7 @@ static int isis_print (const u_char *p, u_int length) */ static int -osi_cksum(const u_char *tptr, u_int len) +osi_cksum(const u_int8_t *tptr, u_int len) { int32_t c0 = 0, c1 = 0; diff --git a/print-krb.c b/print-krb.c index 382a4b60..e419e907 100644 --- a/print-krb.c +++ b/print-krb.c @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-krb.c,v 1.18 2002-09-05 21:25:43 guy Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-krb.c,v 1.19 2002-11-09 17:19:27 itojun Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -64,9 +64,9 @@ static void krb4_print(const u_char *); #define KERB_ERR_NULL_KEY 10 struct krb { - u_char pvno; /* Protocol Version */ - u_char type; /* Type+B */ -}; + u_int8_t pvno; /* Protocol Version */ + u_int8_t type; /* Type+B */ +} __attribute__((packed)); static char tstr[] = " [|kerberos]"; diff --git a/print-lwres.c b/print-lwres.c index 828905c8..35c23049 100644 --- a/print-lwres.c +++ b/print-lwres.c @@ -29,7 +29,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-lwres.c,v 1.7 2002-09-05 00:00:15 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-lwres.c,v 1.8 2002-11-09 17:19:28 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -62,7 +62,7 @@ struct lwres_lwpacket { lwres_uint32_t recvlength; lwres_uint16_t authtype; lwres_uint16_t authlength; -}; +} __attribute__((packed)); #define LWRES_LWPACKETFLAG_RESPONSE 0x0001U /* if set, pkt is a response */ @@ -80,13 +80,13 @@ typedef struct { /* public */ lwres_uint16_t datalength; /* data follows */ -} lwres_nooprequest_t; +} lwres_nooprequest_t __attribute__((packed)); typedef struct { /* public */ lwres_uint16_t datalength; /* data follows */ -} lwres_noopresponse_t; +} lwres_noopresponse_t __attribute__((packed)); /* * get addresses by name @@ -99,7 +99,7 @@ struct lwres_addr { lwres_uint32_t family; lwres_uint16_t length; /* address folows */ -}; +} __attribute__((packed)); typedef struct { /* public */ @@ -107,7 +107,7 @@ typedef struct { lwres_uint32_t addrtypes; lwres_uint16_t namelen; /* name follows */ -} lwres_gabnrequest_t; +} lwres_gabnrequest_t __attribute__((packed)); typedef struct { /* public */ @@ -118,7 +118,7 @@ typedef struct { /* aliases follows */ /* addrs follows */ /* realname follows */ -} lwres_gabnresponse_t; +} lwres_gabnresponse_t __attribute__((packed)); /* * get name by address @@ -138,7 +138,7 @@ typedef struct { lwres_uint16_t realnamelen; /* aliases follows */ /* realname follows */ -} lwres_gnbaresponse_t; +} lwres_gnbaresponse_t __attribute__((packed)); /* * get rdata by name @@ -152,7 +152,7 @@ typedef struct { lwres_uint16_t rdtype; lwres_uint16_t namelen; /* name follows */ -} lwres_grbnrequest_t; +} lwres_grbnrequest_t __attribute__((packed)); typedef struct { /* public */ @@ -165,7 +165,7 @@ typedef struct { /* realname here (len + name) */ /* rdata here (len + name) */ /* signatures here (len + name) */ -} lwres_grbnresponse_t; +} lwres_grbnresponse_t __attribute__((packed)); #define LWRDATA_VALIDATED 0x00000001 diff --git a/print-mobile.c b/print-mobile.c index 29895133..30a4d68a 100644 --- a/print-mobile.c +++ b/print-mobile.c @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.10 2002-08-01 08:53:19 risso Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.11 2002-11-09 17:19:28 itojun Exp $"; #endif #include <tcpdump-stdinc.h> @@ -60,7 +60,7 @@ struct mobile_ip { u_int16_t hcheck; u_int32_t odst; u_int32_t osrc; -}; +} __attribute__((packed)); #define OSRC_PRES 0x0080 /* old source is present */ diff --git a/print-mobility.c b/print-mobility.c index 712342c6..6b1d7195 100644 --- a/print-mobility.c +++ b/print-mobility.c @@ -33,7 +33,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-mobility.c,v 1.5 2002-09-05 00:52:30 guy Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-mobility.c,v 1.6 2002-11-09 17:19:28 itojun Exp $"; #endif #ifdef INET6 @@ -57,7 +57,7 @@ struct ip6_mobility { u_int16_t ip6m_un_data16[1]; /* type-specific field */ u_int8_t ip6m_un_data8[2]; /* type-specific fiedl */ } ip6m_dataun; -}; +} __attribute__((packed)); #define ip6m_data16 ip6m_dataun.ip6m_un_data16 #define ip6m_data8 ip6m_dataun.ip6m_un_data8 diff --git a/print-pim.c b/print-pim.c index 5fc57fc1..ac6891d5 100644 --- a/print-pim.c +++ b/print-pim.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.34 2002-10-19 02:43:05 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.35 2002-11-09 17:19:28 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -47,7 +47,7 @@ struct pim { #define PIM_TYPE(x) ((x) & 0x0f) u_char pim_rsv; /* Reserved */ u_short pim_cksum; /* IP style check sum */ -}; +} __attribute__((packed)); #include <stdio.h> diff --git a/print-pptp.c b/print-pptp.c index 2213607d..00f5fe5a 100644 --- a/print-pptp.c +++ b/print-pptp.c @@ -24,7 +24,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-pptp.c,v 1.7 2002-09-05 21:25:45 guy Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-pptp.c,v 1.8 2002-11-09 17:19:29 itojun Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -103,7 +103,7 @@ struct pptp_hdr { u_int32_t magic_cookie; u_int16_t ctrl_msg_type; u_int16_t reserved0; -}; +} __attribute__((packed)); struct pptp_msg_sccrq { u_int16_t proto_ver; @@ -114,7 +114,7 @@ struct pptp_msg_sccrq { u_int16_t firm_rev; u_char hostname[64]; u_char vendor[64]; -}; +} __attribute__((packed)); struct pptp_msg_sccrp { u_int16_t proto_ver; @@ -126,30 +126,30 @@ struct pptp_msg_sccrp { u_int16_t firm_rev; u_char hostname[64]; u_char vendor[64]; -}; +} __attribute__((packed)); struct pptp_msg_stopccrq { u_int8_t reason; u_int8_t reserved1; u_int16_t reserved2; -}; +} __attribute__((packed)); struct pptp_msg_stopccrp { u_int8_t result_code; u_int8_t err_code; u_int16_t reserved1; -}; +} __attribute__((packed)); struct pptp_msg_echorq { u_int32_t id; -}; +} __attribute__((packed)); struct pptp_msg_echorp { u_int32_t id; u_int8_t result_code; u_int8_t err_code; u_int16_t reserved1; -}; +} __attribute__((packed)); struct pptp_msg_ocrq { u_int16_t call_id; @@ -164,7 +164,7 @@ struct pptp_msg_ocrq { u_int16_t reserved1; u_char phone_no[64]; u_char subaddr[64]; -}; +} __attribute__((packed)); struct pptp_msg_ocrp { u_int16_t call_id; @@ -176,7 +176,7 @@ struct pptp_msg_ocrp { u_int16_t recv_winsiz; u_int16_t pkt_proc_delay; u_int32_t phy_chan_id; -}; +} __attribute__((packed)); struct pptp_msg_icrq { u_int16_t call_id; @@ -188,7 +188,7 @@ struct pptp_msg_icrq { u_char dialed_no[64]; /* DNIS */ u_char dialing_no[64]; /* CLID */ u_char subaddr[64]; -}; +} __attribute__((packed)); struct pptp_msg_icrp { u_int16_t call_id; @@ -198,7 +198,7 @@ struct pptp_msg_icrp { u_int16_t recv_winsiz; u_int16_t pkt_proc_delay; u_int16_t reserved1; -}; +} __attribute__((packed)); struct pptp_msg_iccn { u_int16_t peer_call_id; @@ -207,12 +207,12 @@ struct pptp_msg_iccn { u_int16_t recv_winsiz; u_int16_t pkt_proc_delay; u_int32_t framing_type; -}; +} __attribute__((packed)); struct pptp_msg_ccrq { u_int16_t call_id; u_int16_t reserved1; -}; +} __attribute__((packed)); struct pptp_msg_cdn { u_int16_t call_id; @@ -221,7 +221,7 @@ struct pptp_msg_cdn { u_int16_t cause_code; u_int16_t reserved1; u_char call_stats[128]; -}; +} __attribute__((packed)); struct pptp_msg_wen { u_int16_t peer_call_id; @@ -232,14 +232,14 @@ struct pptp_msg_wen { u_int32_t buffer_overrun; u_int32_t timeout_err; u_int32_t align_err; -}; +} __attribute__((packed)); struct pptp_msg_sli { u_int16_t peer_call_id; u_int16_t reserved1; u_int32_t send_accm; u_int32_t recv_accm; -}; +} __attribute__((packed)); /* attributes that appear more than once in above messages: diff --git a/print-radius.c b/print-radius.c index 21314e09..88c80afe 100644 --- a/print-radius.c +++ b/print-radius.c @@ -44,7 +44,7 @@ #ifndef lint static const char rcsid[] = - "$Id: print-radius.c,v 1.16 2002-09-05 00:00:18 guy Exp $"; + "$Id: print-radius.c,v 1.17 2002-11-09 17:19:29 itojun Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -134,13 +134,13 @@ 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 */ - }; + } __attribute__((packed)); #define MIN_RADIUS_LEN 20 struct radius_attr { u_int8_t type; /* Attribute type */ u_int8_t len; /* Attribute length */ - }; + } __attribute__((packed)); /* Service-Type Attribute standard values */ diff --git a/print-rip.c b/print-rip.c index 78403a4b..f8f523c5 100644 --- a/print-rip.c +++ b/print-rip.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.52 2002-09-05 21:25:46 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.53 2002-11-09 17:19:30 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -38,10 +38,10 @@ static const char rcsid[] = #include "extract.h" /* must come after interface.h */ struct rip { - u_char rip_cmd; /* request/response */ - u_char rip_vers; /* protocol version # */ - u_short rip_zero2; /* unused */ -}; + u_int8_t rip_cmd; /* request/response */ + u_int8_t rip_vers; /* protocol version # */ + u_int16_t rip_zero2; /* unused */ +} __attribute__((packed)); #define RIPCMD_REQUEST 1 /* want info */ #define RIPCMD_RESPONSE 2 /* responding to request */ #define RIPCMD_TRACEON 3 /* turn tracing on */ @@ -52,13 +52,13 @@ struct rip { #define RIP_AUTHLEN 16 struct rip_netinfo { - u_short rip_family; - u_short rip_tag; + 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 */ -}; +} __attribute__((packed)); static void rip_printblk(const u_char *cp, const u_char *ep) diff --git a/print-rsvp.c b/print-rsvp.c index dcd5d52c..fc33ca7b 100644 --- a/print-rsvp.c +++ b/print-rsvp.c @@ -15,7 +15,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-rsvp.c,v 1.4 2002-10-18 13:53:42 hannes Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-rsvp.c,v 1.5 2002-11-09 17:19:30 itojun Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -45,13 +45,13 @@ static const char rcsid[] = */ struct rsvp_common_header { - u_char version_flags; - u_char msg_type; - u_char checksum[2]; - u_char ttl; - u_char reserved; - u_char length[2]; -}; + 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]; +} __attribute__((packed)); /* * RFC2205 object header @@ -68,10 +68,10 @@ struct rsvp_common_header { */ struct rsvp_object_header { - u_char length[2]; - u_char class_num; - u_char ctype; -}; + u_int8_t length[2]; + u_int8_t class_num; + u_int8_t ctype; +} __attribute__((packed)); #define RSVP_VERSION 1 #define RSVP_EXTRACT_VERSION(x) (((x)&0xf0)>>4) diff --git a/print-udp.c b/print-udp.c index 3b32990e..057cb141 100644 --- a/print-udp.c +++ b/print-udp.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.110 2002-09-10 01:45:33 itojun Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.111 2002-11-09 17:19:30 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -59,12 +59,12 @@ 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 */ -}; +} __attribute__((packed)); typedef struct { u_int32_t upper; /* more significant 32 bits */ u_int32_t lower; /* less significant 32 bits */ -} ntp64; +} ntp64 __attribute__((packed)); /* * Sender report. @@ -74,7 +74,7 @@ struct rtcp_sr { u_int32_t sr_ts; /* reference media timestamp */ u_int32_t sr_np; /* no. packets sent */ u_int32_t sr_nb; /* no. bytes sent */ -}; +} __attribute__((packed)); /* * Receiver report. @@ -87,7 +87,7 @@ struct rtcp_rr { 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 */ -}; +} __attribute__((packed)); /*XXX*/ #define RTCP_PT_SR 200 @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-wb.c,v 1.28 2002-09-05 00:00:24 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-wb.c,v 1.29 2002-11-09 17:19:31 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -60,10 +60,10 @@ static const char rcsid[] = struct pkt_hdr { u_int32_t ph_src; /* site id of source */ u_int32_t ph_ts; /* time stamp (for skew computation) */ - u_short ph_version; /* version number */ + u_int16_t ph_version; /* version number */ u_char ph_type; /* message type */ u_char ph_flags; /* message flags */ -}; +} __attribute__((packed)); /* Packet types */ #define PT_DRAWOP 0 /* drawing operation */ @@ -85,15 +85,15 @@ struct pkt_hdr { struct PageID { u_int32_t p_sid; /* session id of initiator */ u_int32_t p_uid; /* page number */ -}; +} __attribute__((packed)); struct dophdr { u_int32_t dh_ts; /* sender's timestamp */ - u_short dh_len; /* body length */ + u_int16_t dh_len; /* body length */ u_char dh_flags; u_char dh_type; /* body type */ /* body follows */ -}; +} __attribute__((packed)); /* * Drawing op sub-types. */ @@ -121,7 +121,7 @@ struct pkt_dop { u_int32_t pd_sseq; /* start sequence number */ u_int32_t pd_eseq; /* end sequence number */ /* drawing ops follow */ -}; +} __attribute__((packed)); /* * A repair request. @@ -131,7 +131,7 @@ struct pkt_rreq { struct PageID pr_page; /* page of drawops */ u_int32_t pr_sseq; /* start seqno */ u_int32_t pr_eseq; /* end seqno */ -}; +} __attribute__((packed)); /* * A repair reply. @@ -140,20 +140,20 @@ struct pkt_rrep { u_int32_t pr_id; /* original site id of ops */ struct pkt_dop pr_dop; /* drawing ops follow */ -}; +} __attribute__((packed)); struct id_off { u_int32_t id; u_int32_t off; -}; +} __attribute__((packed)); struct pgstate { u_int32_t slot; struct PageID page; - u_short nid; - u_short rsvd; + u_int16_t nid; + u_int16_t rsvd; /* seqptr's */ -}; +} __attribute__((packed)); /* * An announcement packet. @@ -164,18 +164,18 @@ struct pkt_id { struct pgstate pi_ps; /* seqptr's */ /* null-terminated site name */ -}; +} __attribute__((packed)); struct pkt_preq { struct PageID pp_page; u_int32_t pp_low; u_int32_t pp_high; -}; +} __attribute__((packed)); struct pkt_prep { u_int32_t pp_n; /* size of pageid array */ /* pgstate's follow */ -}; +} __attribute__((packed)); static int wb_id(const struct pkt_id *id, u_int len) @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ /* - * $Header: /tcpdump/master/tcpdump/route6d.h,v 1.3 2001-10-22 04:27:47 itojun Exp $ + * $Header: /tcpdump/master/tcpdump/route6d.h,v 1.4 2002-11-09 17:19:31 itojun Exp $ */ #define RIP6_VERSION 1 @@ -40,7 +40,7 @@ struct netinfo6 { u_int16_t rip6_tag; u_int8_t rip6_plen; u_int8_t rip6_metric; -}; +} __attribute__((packed)); struct rip6 { u_int8_t rip6_cmd; @@ -52,7 +52,7 @@ struct rip6 { } rip6un; #define rip6_nets rip6un.ru6_nets #define rip6_tracefile rip6un.ru6_tracefile -}; +} __attribute__((packed)); #define HOPCNT_INFINITY6 16 #define MAXRTE 24 @@ -23,7 +23,7 @@ /* * Rx protocol format * - * $Id: rx.h,v 1.6 2002-06-11 17:08:59 itojun Exp $ + * $Id: rx.h,v 1.7 2002-11-09 17:19:31 itojun Exp $ */ #define FS_RX_PORT 7000 @@ -85,7 +85,7 @@ struct rx_header { u_int8_t securityIndex; u_int16_t spare; /* How clever: even though the AFS */ u_int16_t serviceId; /* header files indicate that the */ -}; /* serviceId is first, it's really */ +} __attribute__((packed)); /* serviceId is first, it's really */ /* encoded _after_ the spare field */ /* I wasted a day figuring that out! */ @@ -103,7 +103,7 @@ struct rx_ackPacket { 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 */ -}; +} __attribute__((packed)); /* * Values for the acks array diff --git a/sctpHeader.h b/sctpHeader.h index 69a0ac82..a8b9bdd8 100644 --- a/sctpHeader.h +++ b/sctpHeader.h @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/sctpHeader.h,v 1.4 2002-06-11 17:08:59 itojun Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/sctpHeader.h,v 1.5 2002-11-09 17:19:32 itojun Exp $ (LBL) */ /* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola * @@ -60,37 +60,37 @@ extern "C" { #endif struct sctpHeader{ - u_short source; - u_short destination; - u_int verificationTag; - u_int adler32; -}; + u_int16_t source; + u_int16_t destination; + u_int32_t verificationTag; + u_int32_t adler32; +} __attribute__((packed)); /* various descriptor parsers */ struct sctpChunkDesc{ - u_char chunkID; - u_char chunkFlg; - u_short chunkLength; -}; + u_int8_t chunkID; + u_int8_t chunkFlg; + u_int16_t chunkLength; +} __attribute__((packed)); struct sctpParamDesc{ - u_short paramType; - u_short paramLength; -}; + u_int16_t paramType; + u_int16_t paramLength; +} __attribute__((packed)); struct sctpRelChunkDesc{ struct sctpChunkDesc chk; - u_int serialNumber; -}; + u_int32_t serialNumber; +} __attribute__((packed)); struct sctpVendorSpecificParam { struct sctpParamDesc p; /* type must be 0xfffe */ - u_int vendorId; /* vendor ID from RFC 1700 */ - u_short vendorSpecificType; - u_short vendorSpecificLen; -}; + u_int32_t vendorId; /* vendor ID from RFC 1700 */ + u_int16_t vendorSpecificType; + u_int16_t vendorSpecificLen; +} __attribute__((packed)); /* Structures for the control parts */ @@ -101,58 +101,58 @@ struct sctpVendorSpecificParam { /* this is used for init ack, too */ struct sctpInitiation{ - u_int initTag; /* tag of mine */ - u_int rcvWindowCredit; /* rwnd */ - u_short NumPreopenStreams; /* OS */ - u_short MaxInboundStreams; /* MIS */ - u_int initialTSN; + 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; /* optional param's follow in sctpParamDesc form */ -}; +} __attribute__((packed)); struct sctpV4IpAddress{ struct sctpParamDesc p; /* type is set to SCTP_IPV4_PARAM_TYPE, len=10 */ - u_int ipAddress; -}; + u_int32_t ipAddress; +} __attribute__((packed)); struct sctpV6IpAddress{ struct sctpParamDesc p; /* type is set to SCTP_IPV6_PARAM_TYPE, len=22 */ - u_char ipAddress[16]; -}; + u_int8_t ipAddress[16]; +} __attribute__((packed)); struct sctpDNSName{ struct sctpParamDesc param; - u_char name[1]; -}; + u_int8_t name[1]; +} __attribute__((packed)); struct sctpCookiePreserve{ struct sctpParamDesc p; /* type is set to SCTP_COOKIE_PRESERVE, len=8 */ - u_int extraTime; -}; + u_int32_t extraTime; +} __attribute__((packed)); struct sctpTimeStamp{ - u_int ts_sec; - u_int ts_usec; -}; + u_int32_t ts_sec; + u_int32_t ts_usec; +} __attribute__((packed)); /* wire structure of my cookie */ struct cookieMessage{ - u_int TieTag_curTag; /* copied from assoc if present */ - u_int TieTag_hisTag; /* copied from assoc if present */ - int cookieLife; /* life I will award this cookie */ + u_int32_t TieTag_curTag; /* copied from assoc if present */ + u_int32_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_int addressWhereISent[4]; /* I make this 4 ints so I get 128bits for future */ - int addrtype; /* address type */ - u_short locScope; /* V6 local scope flag */ - u_short siteScope; /* V6 site scope flag */ + u_int32_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 */ /* at the end is tacked on the INIT chunk sent in * its entirety and of course our * signature. */ -}; +} __attribute__((packed)); /* this guy is for use when @@ -163,12 +163,12 @@ struct cookieMessage{ struct sctpUnifiedInit{ struct sctpChunkDesc uh; struct sctpInitiation initm; -}; +} __attribute__((packed)); struct sctpSendableInit{ struct sctpHeader mh; struct sctpUnifiedInit msg; -}; +} __attribute__((packed)); /* Selective Acknowledgement @@ -179,37 +179,37 @@ struct sctpSendableInit{ */ struct sctpSelectiveAck{ - u_int highestConseqTSN; - u_int updatedRwnd; - u_short numberOfdesc; - u_short numDupTsns; -}; + u_int32_t highestConseqTSN; + u_int32_t updatedRwnd; + u_int16_t numberOfdesc; + u_int16_t numDupTsns; +} __attribute__((packed)); struct sctpSelectiveFrag{ - u_short fragmentStart; - u_short fragmentEnd; -}; + u_int16_t fragmentStart; + u_int16_t fragmentEnd; +} __attribute__((packed)); struct sctpUnifiedSack{ struct sctpChunkDesc uh; struct sctpSelectiveAck sack; -}; +} __attribute__((packed)); /* for both RTT request/response the * following is sent */ struct sctpHBrequest { - u_int time_value_1; - u_int time_value_2; -}; + u_int32_t time_value_1; + u_int32_t time_value_2; +} __attribute__((packed)); /* here is what I read and respond with to. */ struct sctpHBunified{ struct sctpChunkDesc hdr; struct sctpParamDesc hb; -}; +} __attribute__((packed)); /* here is what I send */ @@ -217,9 +217,9 @@ struct sctpHBsender{ struct sctpChunkDesc hdr; struct sctpParamDesc hb; struct sctpHBrequest rtt; - char addrFmt[SCTP_ADDRMAX]; - unsigned short userreq; -}; + int8_t addrFmt[SCTP_ADDRMAX]; + u_int16_t userreq; +} __attribute__((packed)); @@ -229,60 +229,60 @@ struct sctpHBsender{ */ struct sctpUnifiedAbort{ struct sctpChunkDesc uh; -}; +} __attribute__((packed)); struct sctpUnifiedAbortLight{ struct sctpHeader mh; struct sctpChunkDesc uh; -}; +} __attribute__((packed)); struct sctpUnifiedAbortHeavy{ struct sctpHeader mh; struct sctpChunkDesc uh; - unsigned short causeCode; - unsigned short causeLen; -}; + u_int16_t causeCode; + u_int16_t causeLen; +} __attribute__((packed)); /* For the graceful shutdown we must carry * the tag (in common header) and the highest consequitive acking value */ struct sctpShutdown { - u_int TSN_Seen; -}; + u_int32_t TSN_Seen; +} __attribute__((packed)); struct sctpUnifiedShutdown{ struct sctpChunkDesc uh; struct sctpShutdown shut; -}; +} __attribute__((packed)); /* in the unified message we add the trailing * stream id since it is the only message * that is defined as a operation error. */ struct sctpOpErrorCause{ - u_short cause; - u_short causeLen; -}; + u_int16_t cause; + u_int16_t causeLen; +} __attribute__((packed)); struct sctpUnifiedOpError{ struct sctpChunkDesc uh; struct sctpOpErrorCause c; -}; +} __attribute__((packed)); struct sctpUnifiedStreamError{ struct sctpHeader mh; struct sctpChunkDesc uh; struct sctpOpErrorCause c; - u_short strmNum; - u_short reserved; -}; + u_int16_t strmNum; + u_int16_t reserved; +} __attribute__((packed)); struct staleCookieMsg{ struct sctpHeader mh; struct sctpChunkDesc uh; struct sctpOpErrorCause c; - u_int moretime; -}; + u_int32_t moretime; +} __attribute__((packed)); /* the following is used in all sends * where nothing is needed except the @@ -291,30 +291,30 @@ struct staleCookieMsg{ struct sctpUnifiedSingleMsg{ struct sctpHeader mh; struct sctpChunkDesc uh; -}; +} __attribute__((packed)); struct sctpDataPart{ - u_int TSN; - u_short streamId; - u_short sequence; - u_int payloadtype; -}; + u_int32_t TSN; + u_int16_t streamId; + u_int16_t sequence; + u_int32_t payloadtype; +} __attribute__((packed)); struct sctpUnifiedDatagram{ struct sctpChunkDesc uh; struct sctpDataPart dp; -}; +} __attribute__((packed)); struct sctpECN_echo{ struct sctpChunkDesc uh; - u_int Lowest_TSN; -}; + u_int32_t Lowest_TSN; +} __attribute__((packed)); struct sctpCWR{ struct sctpChunkDesc uh; - u_int TSN_reduced_at; -}; + u_int32_t TSN_reduced_at; +} __attribute__((packed)); #ifdef __cplusplus } @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#) $Header: /tcpdump/master/tcpdump/sll.h,v 1.5 2002-06-11 17:09:00 itojun Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/sll.h,v 1.6 2002-11-09 17:19:32 itojun Exp $ (LBL) */ /* @@ -88,7 +88,7 @@ struct sll_header { 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 */ -}; +} __attribute__((packed)); /* * The LINUX_SLL_ values for "sll_pkttype"; these correspond to the @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/tcp.h,v 1.8 2001-05-09 01:16:57 fenner Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/tcp.h,v 1.9 2002-11-09 17:19:32 itojun Exp $ (LBL) */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -58,7 +58,7 @@ struct tcphdr { u_int16_t th_win; /* window */ u_int16_t th_sum; /* checksum */ u_int16_t th_urp; /* urgent pointer */ -}; +} __attribute__((packed)); #define TCPOPT_EOL 0 #define TCPOPT_NOP 1 @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/timed.h,v 1.3 2000-12-17 23:07:51 guy Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/timed.h,v 1.4 2002-11-09 17:19:33 itojun Exp $ (LBL) */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -45,15 +45,15 @@ #define ANYADDR NULL struct tsp { - u_char tsp_type; - u_char tsp_vers; - u_short tsp_seq; + u_int8_t tsp_type; + u_int8_t tsp_vers; + u_int16_t tsp_seq; union { struct timeval tspu_time; - char tspu_hopcnt; + int8_t tspu_hopcnt; } tsp_u; - char tsp_name[256]; -}; + int8_t tsp_name[256]; +} __attribute__((packed)); #define tsp_time tsp_u.tspu_time #define tsp_hopcnt tsp_u.tspu_hopcnt @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/token.h,v 1.4 2002-09-05 00:00:25 guy Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/token.h,v 1.5 2002-11-09 17:19:33 itojun Exp $ (LBL) */ /* * Copyright (c) 1998, Larry Lile * All rights reserved. @@ -49,4 +49,4 @@ struct token_header { u_int8_t token_shost[TOKEN_RING_MAC_LEN]; u_int16_t token_rcf; u_int16_t token_rseg[ROUTING_SEGMENT_MAX]; -}; +} __attribute__((packed)); @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/udp.h,v 1.2 2000-10-03 02:55:03 itojun Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/udp.h,v 1.3 2002-11-09 17:19:33 itojun Exp $ (LBL) */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -43,4 +43,4 @@ struct udphdr { u_int16_t uh_dport; /* destination port */ u_int16_t uh_ulen; /* udp length */ u_int16_t uh_sum; /* udp checksum */ -}; +} __attribute__((packed)); |