<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -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>
      <filename>ah.h</filename>
    </modified>
    <modified>
      <diff>@@ -20,14 +20,14 @@
  *
  * AppleTalk protocol formats (courtesy Bill Croft of Stanford/SUMEX).
  *
- * @(#) $Header: /tcpdump/master/tcpdump/appletalk.h,v 1.14 2002-11-09 17:19:17 itojun Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/appletalk.h,v 1.15 2002-12-11 07:13:49 guy 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</diff>
      <filename>appletalk.h</filename>
    </modified>
    <modified>
      <diff>@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * @(#) $Id: arcnet.h,v 1.1 2001-04-17 08:39:18 guy Exp $ (LBL)
+ * @(#) $Id: arcnet.h,v 1.2 2002-12-11 07:13:50 guy Exp $ (LBL)
  *
  * from: NetBSD: if_arc.h,v 1.13 1999/11/19 20:41:19 thorpej Exp
  */
@@ -56,7 +56,7 @@ struct	arc_header {
 	u_int8_t  arc_type2;	/* same as arc_type */
 	u_int8_t  arc_flag2;	/* real flag value */
 	u_int16_t arc_seqid2;	/* real seqid value */
-} __attribute__((__packed__));
+};
 
 #define	ARC_HDRLEN		3
 #define	ARC_HDRNEWLEN		6</diff>
      <filename>arcnet.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/bootp.h,v 1.12 2002-11-09 17:19:17 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/bootp.h,v 1.13 2002-12-11 07:13:50 guy 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 */</diff>
      <filename>bootp.h</filename>
    </modified>
    <modified>
      <diff>@@ -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.10 2002-11-09 17:19:17 itojun Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/decnet.h,v 1.11 2002-12-11 07:13:50 guy 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)&amp;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));
+  };</diff>
      <filename>decnet.h</filename>
    </modified>
    <modified>
      <diff>@@ -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_*/</diff>
      <filename>esp.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ether.h,v 1.7 2002-11-09 17:19:18 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ether.h,v 1.8 2002-12-11 07:13:51 guy 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</diff>
      <filename>ether.h</filename>
    </modified>
    <modified>
      <diff>@@ -18,12 +18,48 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * @(#) $Header: /tcpdump/master/tcpdump/extract.h,v 1.18 2002-09-05 00:00:09 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/extract.h,v 1.19 2002-12-11 07:13:51 guy Exp $ (LBL)
  */
 
 /* Network to host order macros */
 
 #ifdef LBL_ALIGN
+/*
+ * The processor doesn't natively handle unaligned loads.
+ */
+#ifdef HAVE___ATTRIBUTE__
+/*
+ * We have __attribute__; we assume that means we have __attribute__((packed)).
+ * Declare packed structures containing a u_int16_t and a u_int32_t,
+ * cast the pointer to point to one of those, and fetch through it;
+ * the GCC manual doesn't appear to explicitly say that
+ * __attribute__((packed)) causes the compiler to generate unaligned-safe
+ * code, but it apppears to do so.
+ *
+ * We do this in case the compiler can generate, for this instruction set,
+ * better code to do an unaligned load and pass stuff to &quot;ntohs()&quot; or
+ * &quot;ntohl()&quot; than the code to fetch the bytes one at a time and
+ * assemble them.  (That might not be the case on a little-endian platform,
+ * where &quot;ntohs()&quot; and &quot;ntohl()&quot; might not be done inline.)
+ */
+typedef struct {
+	u_int16_t	val;
+} __attribute__((packed)) unaligned_u_int16_t;
+
+typedef struct {
+	u_int32_t	val;
+} __attribute__((packed)) unaligned_u_int32_t;
+
+#define EXTRACT_16BITS(p) \
+	((u_int16_t)ntohs(((const unaligned_u_int16_t *)(p))-&gt;val))
+#define EXTRACT_32BITS(p) \
+	((u_int32_t)ntohl(((const unaligned_u_int32_t *)(p))-&gt;val))
+#else /* HAVE___ATTRIBUTE__ */
+/*
+ * We don't have __attribute__, so do unaligned loads of big-endian
+ * quantities the hard way - fetch the bytes one at a time and
+ * assemble them.
+ */
 #define EXTRACT_16BITS(p) \
 	((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 0) &lt;&lt; 8 | \
 		     (u_int16_t)*((const u_int8_t *)(p) + 1)))
@@ -32,12 +68,17 @@
 		     (u_int32_t)*((const u_int8_t *)(p) + 1) &lt;&lt; 16 | \
 		     (u_int32_t)*((const u_int8_t *)(p) + 2) &lt;&lt; 8 | \
 		     (u_int32_t)*((const u_int8_t *)(p) + 3)))
-#else
+#endif /* HAVE___ATTRIBUTE__ */
+#else /* LBL_ALIGN */
+/*
+ * The processor natively handles unaligned loads, so we can just
+ * cast the pointer and fetch through it.
+ */
 #define EXTRACT_16BITS(p) \
 	((u_int16_t)ntohs(*(const u_int16_t *)(p)))
 #define EXTRACT_32BITS(p) \
 	((u_int32_t)ntohl(*(const u_int32_t *)(p)))
-#endif
+#endif /* LBL_ALIGN */
 
 #define EXTRACT_24BITS(p) \
 	((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 0) &lt;&lt; 16 | \</diff>
      <filename>extract.h</filename>
    </modified>
    <modified>
      <diff>@@ -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.10 2002-11-09 17:19:18 itojun Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/fddi.h,v 1.11 2002-12-11 07:13:51 guy 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</diff>
      <filename>fddi.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/icmp6.h,v 1.13 2002-11-09 17:19:18 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/icmp6.h,v 1.14 2002-12-11 07:13:52 guy 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>
      <filename>icmp6.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.5 2002-11-09 17:19:18 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.6 2002-12-11 07:13:52 guy 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)
 </diff>
      <filename>ieee802_11.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/igrp.h,v 1.5 2002-11-09 17:19:19 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/igrp.h,v 1.6 2002-12-11 07:13:52 guy 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 &amp; 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 ! */</diff>
      <filename>igrp.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ip.h,v 1.9 2002-11-09 17:19:19 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ip.h,v 1.10 2002-12-11 07:13:53 guy 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 */</diff>
      <filename>ip.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ip6.h,v 1.4 2002-11-09 17:19:19 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ip6.h,v 1.5 2002-12-11 07:13:53 guy 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 */</diff>
      <filename>ip6.h</filename>
    </modified>
    <modified>
      <diff>@@ -18,12 +18,12 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * @(#) $Header: /tcpdump/master/tcpdump/ipfc.h,v 1.3 2002-12-11 07:05:21 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/ipfc.h,v 1.4 2002-12-11 07:13:53 guy Exp $ (LBL)
  */
 
 struct ipfc_header {
 	u_char  ipfc_dhost[8];
 	u_char  ipfc_shost[8];
-} __attribute__((packed));
+};
 
 #define IPFC_HDRLEN 16</diff>
      <filename>ipfc.h</filename>
    </modified>
    <modified>
      <diff>@@ -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.6 2002-11-09 17:19:20 itojun Exp $ */
+/* YIPS @(#)$Id: ipsec_doi.h,v 1.7 2002-12-11 07:13:53 guy 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</diff>
      <filename>ipsec_doi.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 /*
  * IPX protocol formats
  *
- * @(#) $Header: /tcpdump/master/tcpdump/ipx.h,v 1.7 2002-11-09 17:19:20 itojun Exp $
+ * @(#) $Header: /tcpdump/master/tcpdump/ipx.h,v 1.8 2002-12-11 07:13:54 guy 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
 </diff>
      <filename>ipx.h</filename>
    </modified>
    <modified>
      <diff>@@ -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.9 2002-11-09 17:19:21 itojun Exp $ */
+/* YIPS @(#)$Id: isakmp.h,v 1.10 2002-12-11 07:13:54 guy 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</diff>
      <filename>isakmp.h</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
  *
  */
 
-/* $Id: lane.h,v 1.6 2002-11-09 17:19:21 itojun Exp $ */
+/* $Id: lane.h,v 1.7 2002-12-11 07:13:54 guy 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));
+};</diff>
      <filename>lane.h</filename>
    </modified>
    <modified>
      <diff>@@ -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.15 2002-11-09 17:19:21 itojun Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/llc.h,v 1.16 2002-12-11 07:13:54 guy 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</diff>
      <filename>llc.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/nameser.h,v 1.12 2002-11-09 17:19:21 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/nameser.h,v 1.13 2002-12-11 07:13:55 guy 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 __attribute__((packed));
+} HEADER;
 
 /*
  * Macros for subfields of flag fields.</diff>
      <filename>nameser.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,14 @@
 /*
  * NETBIOS protocol formats
  *
- * @(#) $Header: /tcpdump/master/tcpdump/netbios.h,v 1.2 2002-11-09 17:19:22 itojun Exp $
+ * @(#) $Header: /tcpdump/master/tcpdump/netbios.h,v 1.3 2002-12-11 07:13:55 guy Exp $
  */
 
 struct p8022Hdr {
     u_char	dsap;
     u_char	ssap;
     u_char	flags;
-} __attribute__((packed));
+};
 
 #define	p8022Size	3		/* min 802.2 header size */
 </diff>
      <filename>netbios.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/nfs.h,v 1.6 2002-12-11 05:04:12 guy Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/nfs.h,v 1.7 2002-12-11 07:13:55 guy Exp $ (LBL) */
 /*	$NetBSD: nfs.h,v 1.1 1996/05/23 22:49:53 fvdl Exp $	*/
 
 /*
@@ -262,19 +262,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;
 
 /*
@@ -283,7 +283,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
@@ -296,7 +296,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
@@ -307,7 +307,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;
 
 /*
@@ -348,7 +348,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
@@ -376,7 +376,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.
@@ -394,7 +394,7 @@ struct nfsv3_sattr {
 	nfstime3  sa_atime;
 	u_int32_t   sa_mtimetype;
 	nfstime3  sa_mtime;
-} __attribute__((packed));
+};
 
 struct nfs_statfs {
 	union {
@@ -415,7 +415,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
@@ -441,7 +441,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;
@@ -450,4 +450,4 @@ struct nfsv3_pathconf {
 	u_int32_t pc_chownrestricted;
 	u_int32_t pc_caseinsensitive;
 	u_int32_t pc_casepreserving;
-} __attribute__((packed));
+};</diff>
      <filename>nfs.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* $Header: /tcpdump/master/tcpdump/ntp.h,v 1.5 2002-11-09 17:19:22 itojun Exp $ */
+/* $Header: /tcpdump/master/tcpdump/ntp.h,v 1.6 2002-12-11 07:13:56 guy 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)
  */</diff>
      <filename>ntp.h</filename>
    </modified>
    <modified>
      <diff>@@ -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.3 2002-11-09 17:19:22 itojun Exp $ */
+/* YIPS @(#)$Id: oakley.h,v 1.4 2002-12-11 07:13:56 guy 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_) */</diff>
      <filename>oakley.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ospf.h,v 1.6 2002-12-11 07:07:25 guy Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ospf.h,v 1.7 2002-12-11 07:13:56 guy 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</diff>
      <filename>ospf.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ospf6.h,v 1.5 2002-11-09 17:19:23 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ospf6.h,v 1.6 2002-12-11 07:13:56 guy 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>
      <filename>ospf6.h</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.18 2002-09-05 21:25:36 guy Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.19 2002-12-11 07:13:57 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -38,6 +38,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 int
 ah_print(register const u_char *bp)
@@ -53,12 +54,12 @@ ah_print(register const u_char *bp)
 	TCHECK(*ah);
 
 	sumlen = ah-&gt;ah_len &lt;&lt; 2;
-	spi = (u_int32_t)ntohl(ah-&gt;ah_spi);
+	spi = EXTRACT_32BITS(&amp;ah-&gt;ah_spi);
 
 	printf(&quot;AH(spi=0x%08x&quot;, spi);
 	if (vflag)
 		printf(&quot;,sumlen=%d&quot;, sumlen);
-	printf(&quot;,seq=0x%x&quot;, (u_int32_t)ntohl(*(const u_int32_t *)(ah + 1)));
+	printf(&quot;,seq=0x%x&quot;, EXTRACT_32BITS(ah + 1));
 	if (bp + sizeof(struct ah) + sumlen &gt; ep)
 		fputs(&quot;[truncated]&quot;, stdout);
 	fputs(&quot;): &quot;, stdout);</diff>
      <filename>print-ah.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.59 2002-11-09 17:19:23 itojun Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.60 2002-12-11 07:13:57 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -81,15 +81,15 @@ struct	arp_pkthdr {
 #define ar_spa(ap)	(((const u_char *)((ap)+1))+  (ap)-&gt;ar_hln)
 #define ar_tha(ap)	(((const u_char *)((ap)+1))+  (ap)-&gt;ar_hln+(ap)-&gt;ar_pln)
 #define ar_tpa(ap)	(((const u_char *)((ap)+1))+2*(ap)-&gt;ar_hln+(ap)-&gt;ar_pln)
-} __attribute__((packed));
+};
 
 #define ARP_HDRLEN	8
 
-#define HRD(ap) ((ap)-&gt;ar_hrd)
+#define HRD(ap) EXTRACT_16BITS(&amp;(ap)-&gt;ar_hrd)
 #define HLN(ap) ((ap)-&gt;ar_hln)
 #define PLN(ap) ((ap)-&gt;ar_pln)
-#define OP(ap)  ((ap)-&gt;ar_op)
-#define PRO(ap) ((ap)-&gt;ar_pro)
+#define OP(ap)  EXTRACT_16BITS(&amp;(ap)-&gt;ar_op)
+#define PRO(ap) EXTRACT_16BITS(&amp;(ap)-&gt;ar_pro)
 #define SHA(ap) (ar_sha(ap))
 #define SPA(ap) (ar_spa(ap))
 #define THA(ap) (ar_tha(ap))
@@ -131,12 +131,12 @@ struct	atmarp_pkthdr {
 	u_char	aar_tpa[];	/* target protocol address */
 #endif
 
-#define ATMHRD(ap)  ((ap)-&gt;aar_hrd)
+#define ATMHRD(ap)  EXTRACT_16BITS(&amp;(ap)-&gt;aar_hrd)
 #define ATMSHLN(ap) ((ap)-&gt;aar_shtl &amp; ATMARP_LEN_MASK)
 #define ATMSSLN(ap) ((ap)-&gt;aar_sstl &amp; ATMARP_LEN_MASK)
 #define ATMSPLN(ap) ((ap)-&gt;aar_spln)
-#define ATMOP(ap)   ((ap)-&gt;aar_op)
-#define ATMPRO(ap)  ((ap)-&gt;aar_pro)
+#define ATMOP(ap)   EXTRACT_16BITS(&amp;(ap)-&gt;aar_op)
+#define ATMPRO(ap)  EXTRACT_16BITS(&amp;(ap)-&gt;aar_pro)
 #define ATMTHLN(ap) ((ap)-&gt;aar_thtl &amp; ATMARP_LEN_MASK)
 #define ATMTSLN(ap) ((ap)-&gt;aar_tstl &amp; ATMARP_LEN_MASK)
 #define ATMTPLN(ap) ((ap)-&gt;aar_tpln)
@@ -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))
@@ -179,9 +179,9 @@ atmarp_print(const u_char *bp, u_int length, u_int caplen)
 	ap = (const struct atmarp_pkthdr *)bp;
 	TCHECK(*ap);
 
-	hrd = EXTRACT_16BITS(&amp;ATMHRD(ap));
-	pro = EXTRACT_16BITS(&amp;ATMPRO(ap));
-	op = EXTRACT_16BITS(&amp;ATMOP(ap));
+	hrd = ATMHRD(ap);
+	pro = ATMPRO(ap);
+	op = ATMOP(ap);
 
 	if (!TTEST2(*aar_tpa(ap), ATMTPLN(ap))) {
 		(void)printf(&quot;truncated-atmarp&quot;);
@@ -256,13 +256,13 @@ arp_print(const u_char *bp, u_int length, u_int caplen)
 
 	ap = (const struct arp_pkthdr *)bp;
 	TCHECK(*ap);
-	hrd = EXTRACT_16BITS(&amp;HRD(ap));
+	hrd = HRD(ap);
 	if (hrd == ARPHRD_ATM2225) {
 		atmarp_print(bp, length, caplen);
 		return;
 	}
-	pro = EXTRACT_16BITS(&amp;PRO(ap));
-	op = EXTRACT_16BITS(&amp;OP(ap));
+	pro = PRO(ap);
+	op = OP(ap);
 
 	if (!TTEST2(*ar_tpa(ap), PLN(ap))) {
 		(void)printf(&quot;truncated-arp&quot;);</diff>
      <filename>print-arp.c</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.76 2002-11-09 17:19:24 itojun Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.77 2002-12-11 07:13:57 guy Exp $ (LBL)&quot;;
 #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[] = &quot;[|atalk]&quot;;
 
@@ -202,9 +202,10 @@ aarp_print(register const u_char *bp, u_int length)
 
 	printf(&quot;aarp &quot;);
 	ap = (const struct aarp *)bp;
-	if (ntohs(ap-&gt;htype) == 1 &amp;&amp; ntohs(ap-&gt;ptype) == ETHERTYPE_ATALK &amp;&amp;
+	if (EXTRACT_16BITS(&amp;ap-&gt;htype) == 1 &amp;&amp;
+	    EXTRACT_16BITS(&amp;ap-&gt;ptype) == ETHERTYPE_ATALK &amp;&amp;
 	    ap-&gt;halen == 6 &amp;&amp; ap-&gt;palen == 4 )
-		switch (ntohs(ap-&gt;op)) {
+		switch (EXTRACT_16BITS(&amp;ap-&gt;op)) {
 
 		case 1:				/* request */
 			(void)printf(&quot;who-has %s tell %s&quot;,
@@ -222,8 +223,8 @@ aarp_print(register const u_char *bp, u_int length)
 			return;
 		}
 	(void)printf(&quot;len %u op %u htype %u ptype %#x halen %u palen %u&quot;,
-	    length, ntohs(ap-&gt;op), ntohs(ap-&gt;htype), ntohs(ap-&gt;ptype),
-	    ap-&gt;halen, ap-&gt;palen);
+	    length, EXTRACT_16BITS(&amp;ap-&gt;op), EXTRACT_16BITS(&amp;ap-&gt;htype),
+	    EXTRACT_16BITS(&amp;ap-&gt;ptype), ap-&gt;halen, ap-&gt;palen);
 }
 
 /*</diff>
      <filename>print-atalk.c</filename>
    </modified>
    <modified>
      <diff>@@ -36,7 +36,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     &quot;@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.55 2002-11-09 17:19:24 itojun Exp $&quot;;
+     &quot;@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.56 2002-12-11 07:13:58 guy Exp $&quot;;
 #endif
 
 #include &lt;tcpdump-stdinc.h&gt;
@@ -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 */
-} __attribute__((packed)); /* EXTRACT_16BITS(&amp;bgp_route_refresh-&gt;afi) (sigh) */ 
+};                    /* EXTRACT_16BITS(&amp;bgp_route_refresh-&gt;afi) (sigh)      */ 
 #define BGP_ROUTE_REFRESH_SIZE          23
 
 struct bgp_attr {
@@ -119,10 +119,10 @@ struct bgp_attr {
 	} bgpa_len;
 #define bgp_attr_len(p) \
 	(((p)-&gt;bgpa_flags &amp; 0x10) ? \
-		ntohs((p)-&gt;bgpa_len.elen) : (p)-&gt;bgpa_len.len)
+		EXTRACT_16BITS(&amp;(p)-&gt;bgpa_len.elen) : (p)-&gt;bgpa_len.len)
 #define bgp_attr_off(p) \
 	(((p)-&gt;bgpa_flags &amp; 0x10) ? 4 : 3)
-} __attribute__((packed));
+};
 
 #define BGPTYPE_ORIGIN			1
 #define BGPTYPE_AS_PATH			2</diff>
      <filename>print-bgp.c</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.67 2002-12-04 19:09:29 hannes Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.68 2002-12-11 07:13:58 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -95,11 +95,11 @@ bootp_print(register const u_char *cp, u_short sport, u_short dport, u_int lengt
 	if (bp-&gt;bp_hops)
 		printf(&quot;, hops:%d&quot;, bp-&gt;bp_hops);
 	if (bp-&gt;bp_xid)
-		printf(&quot;, xid:0x%x&quot;, (u_int32_t)ntohl(bp-&gt;bp_xid));
+		printf(&quot;, xid:0x%x&quot;, EXTRACT_32BITS(&amp;bp-&gt;bp_xid));
 	if (bp-&gt;bp_secs)
-		printf(&quot;, secs:%d&quot;, ntohs(bp-&gt;bp_secs));
+		printf(&quot;, secs:%d&quot;, EXTRACT_16BITS(&amp;bp-&gt;bp_secs));
 	if (bp-&gt;bp_flags)
-		printf(&quot;, flags:0x%x&quot;, ntohs(bp-&gt;bp_flags));
+		printf(&quot;, flags:0x%x&quot;, EXTRACT_16BITS(&amp;bp-&gt;bp_flags));
 
 	/* Client's ip address */
 	TCHECK(bp-&gt;bp_ciaddr);</diff>
      <filename>print-bootp.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.23 2002-12-04 19:06:50 hannes Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.24 2002-12-11 07:13:58 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -155,7 +155,7 @@ struct cisco_slarp {
 			u_int16_t t2;
 		} keep;
 	} un;
-} __attribute__((packed));
+};
 
 #define SLARP_LEN	18
 
@@ -171,7 +171,7 @@ chdlc_slarp_print(const u_char *cp, u_int length)
 
 	slarp = (const struct cisco_slarp *)cp;
         printf(&quot;SLARP (length: %u), &quot;,length);
-	switch (ntohl(slarp-&gt;code)) {
+	switch (EXTRACT_32BITS(&amp;slarp-&gt;code)) {
 	case SLARP_REQUEST:
 		printf(&quot;request&quot;);
                 /* ok we do not know it - but lets at least dump it */
@@ -184,14 +184,15 @@ chdlc_slarp_print(const u_char *cp, u_int length)
 		break;
 	case SLARP_KEEPALIVE:
 		printf(&quot;keepalive: mineseen=0x%08x, yourseen=0x%08x&quot;,
-			(u_int32_t)ntohl(slarp-&gt;un.keep.myseq),
-			(u_int32_t)ntohl(slarp-&gt;un.keep.yourseq));
+			EXTRACT_32BITS(&amp;slarp-&gt;un.keep.myseq),
+			EXTRACT_32BITS(&amp;slarp-&gt;un.keep.yourseq));
 		printf(&quot;, reliability=0x%04x, t1=%d.%d&quot;,
-			ntohs(slarp-&gt;un.keep.rel), ntohs(slarp-&gt;un.keep.t1),
-			ntohs(slarp-&gt;un.keep.t2));
+			EXTRACT_16BITS(&amp;slarp-&gt;un.keep.rel),
+			EXTRACT_16BITS(&amp;slarp-&gt;un.keep.t1),
+			EXTRACT_16BITS(&amp;slarp-&gt;un.keep.t2));
 		break;
 	default:
-		printf(&quot;0x%02x unknown&quot;, (u_int32_t)ntohl(slarp-&gt;code));
+		printf(&quot;0x%02x unknown&quot;, EXTRACT_32BITS(&amp;slarp-&gt;code));
                 if (vflag &lt;= 1)
                     print_unknown_data(cp+4,&quot;\n\t&quot;,length-4);
 		break;</diff>
      <filename>print-chdlc.c</filename>
    </modified>
    <modified>
      <diff>@@ -34,7 +34,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-cnfp.c,v 1.12 2002-11-09 17:19:25 itojun Exp $&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-cnfp.c,v 1.13 2002-12-11 07:13:58 guy Exp $&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -47,8 +47,8 @@ static const char rcsid[] =
 #include &lt;string.h&gt;
 
 #include &quot;interface.h&quot;
-
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 #include &quot;tcp.h&quot;
 
@@ -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)
@@ -93,18 +93,18 @@ cnfp_print(const u_char *cp, const u_char *bp)
 	if ((const u_char *)(nh + 1) &gt; snapend)
 		return;
 
-	nrecs = ntohl(nh-&gt;ver_cnt) &amp; 0xffff;
-	ver = (ntohl(nh-&gt;ver_cnt) &amp; 0xffff0000) &gt;&gt; 16;
-	t = ntohl(nh-&gt;utc_sec);
+	nrecs = EXTRACT_32BITS(&amp;nh-&gt;ver_cnt) &amp; 0xffff;
+	ver = (EXTRACT_32BITS(&amp;nh-&gt;ver_cnt) &amp; 0xffff0000) &gt;&gt; 16;
+	t = EXTRACT_32BITS(&amp;nh-&gt;utc_sec);
 /*	(p = ctime(&amp;t))[24] = '\0'; */
 
 	printf(&quot;NetFlow v%x, %u.%03u uptime, %u.%09u, &quot;, ver,
-	       (unsigned)ntohl(nh-&gt;msys_uptime)/1000,
-	       (unsigned)ntohl(nh-&gt;msys_uptime)%1000,
-	       (unsigned)ntohl(nh-&gt;utc_sec), (unsigned)ntohl(nh-&gt;utc_nsec));
+	       EXTRACT_32BITS(&amp;nh-&gt;msys_uptime)/1000,
+	       EXTRACT_32BITS(&amp;nh-&gt;msys_uptime)%1000,
+	       EXTRACT_32BITS(&amp;nh-&gt;utc_sec), EXTRACT_32BITS(&amp;nh-&gt;utc_nsec));
 
 	if (ver == 5 || ver == 6) {
-		printf(&quot;#%u, &quot;, (unsigned)htonl(nh-&gt;sequence));
+		printf(&quot;#%u, &quot;, EXTRACT_32BITS(&amp;nh-&gt;sequence));
 		nr = (const struct nfrec *)&amp;nh[1];
 		snaplen -= 24;
 	} else {
@@ -119,36 +119,36 @@ cnfp_print(const u_char *cp, const u_char *bp)
 		char asbuf[20];
 
 		printf(&quot;\n  started %u.%03u, last %u.%03u&quot;,
-		       (unsigned)ntohl(nr-&gt;start_time)/1000,
-		       (unsigned)ntohl(nr-&gt;start_time)%1000,
-		       (unsigned)ntohl(nr-&gt;last_time)/1000,
-		       (unsigned)ntohl(nr-&gt;last_time)%1000);
+		       EXTRACT_32BITS(&amp;nr-&gt;start_time)/1000,
+		       EXTRACT_32BITS(&amp;nr-&gt;start_time)%1000,
+		       EXTRACT_32BITS(&amp;nr-&gt;last_time)/1000,
+		       EXTRACT_32BITS(&amp;nr-&gt;last_time)%1000);
 
 		asbuf[0] = buf[0] = '\0';
 		if (ver == 5 || ver == 6) {
 			snprintf(buf, sizeof(buf), &quot;/%u&quot;,
-				 (unsigned)(ntohl(nr-&gt;masks) &gt;&gt; 24) &amp; 0xff);
+				 (EXTRACT_32BITS(&amp;nr-&gt;masks) &gt;&gt; 24) &amp; 0xff);
 			snprintf(asbuf, sizeof(asbuf), &quot;:%u&quot;,
-				 (unsigned)(ntohl(nr-&gt;asses) &gt;&gt; 16) &amp; 0xffff);
+				 (EXTRACT_32BITS(&amp;nr-&gt;asses) &gt;&gt; 16) &amp; 0xffff);
 		}
 		printf(&quot;\n    %s%s%s:%u &quot;, intoa(nr-&gt;src_ina.s_addr), buf, asbuf,
-			(unsigned)ntohl(nr-&gt;ports) &gt;&gt; 16);
+			EXTRACT_32BITS(&amp;nr-&gt;ports) &gt;&gt; 16);
 
 		if (ver == 5 || ver ==6) {
 			snprintf(buf, sizeof(buf), &quot;/%d&quot;,
-				 (unsigned)(ntohl(nr-&gt;masks) &gt;&gt; 16) &amp; 0xff);
+				 (EXTRACT_32BITS(&amp;nr-&gt;masks) &gt;&gt; 16) &amp; 0xff);
 			snprintf(asbuf, sizeof(asbuf), &quot;:%u&quot;,
-				 (unsigned)ntohl(nr-&gt;asses) &amp; 0xffff);
+				 EXTRACT_32BITS(&amp;nr-&gt;asses) &amp; 0xffff);
 		}
 		printf(&quot;&gt; %s%s%s:%u &quot;, intoa(nr-&gt;dst_ina.s_addr), buf, asbuf,
-			(unsigned)ntohl(nr-&gt;ports) &amp; 0xffff);
+			EXTRACT_32BITS(&amp;nr-&gt;ports) &amp; 0xffff);
 
 		printf(&quot;&gt;&gt; %s\n    &quot;, intoa(nr-&gt;nhop_ina.s_addr));
 
-		pent = getprotobynumber((ntohl(nr-&gt;proto_tos) &gt;&gt; 8) &amp; 0xff);
+		pent = getprotobynumber((EXTRACT_32BITS(&amp;nr-&gt;proto_tos) &gt;&gt; 8) &amp; 0xff);
 		if (!pent || nflag)
 			printf(&quot;%u &quot;,
-			       (unsigned)(ntohl(nr-&gt;proto_tos) &gt;&gt; 8) &amp; 0xff);
+			       (EXTRACT_32BITS(&amp;nr-&gt;proto_tos) &gt;&gt; 8) &amp; 0xff);
 		else
 			printf(&quot;%s &quot;, pent-&gt;p_name);
 
@@ -156,9 +156,9 @@ cnfp_print(const u_char *cp, const u_char *bp)
 		if (pent &amp;&amp; pent-&gt;p_proto == IPPROTO_TCP) {
 			int flags;
 			if (ver == 1)
-				flags = (ntohl(nr-&gt;asses) &gt;&gt; 24) &amp; 0xff;
+				flags = (EXTRACT_32BITS(&amp;nr-&gt;asses) &gt;&gt; 24) &amp; 0xff;
 			else
-				flags = (ntohl(nr-&gt;proto_tos) &gt;&gt; 16) &amp; 0xff;
+				flags = (EXTRACT_32BITS(&amp;nr-&gt;proto_tos) &gt;&gt; 16) &amp; 0xff;
 			if (flags &amp; TH_FIN)	putchar('F');
 			if (flags &amp; TH_SYN)	putchar('S');
 			if (flags &amp; TH_RST)	putchar('R');
@@ -172,12 +172,12 @@ cnfp_print(const u_char *cp, const u_char *bp)
 		buf[0]='\0';
 		if (ver == 6) {
 			snprintf(buf, sizeof(buf), &quot;(%u&lt;&gt;%u encaps)&quot;,
-				 (unsigned)(ntohl(nr-&gt;masks) &gt;&gt; 8) &amp; 0xff,
-				 (unsigned)(ntohl(nr-&gt;masks)) &amp; 0xff);
+				 (EXTRACT_32BITS(&amp;nr-&gt;masks) &gt;&gt; 8) &amp; 0xff,
+				 (EXTRACT_32BITS(&amp;nr-&gt;masks)) &amp; 0xff);
 		}
 		printf(&quot;tos %u, %u (%u octets) %s&quot;,
-		       (unsigned)ntohl(nr-&gt;proto_tos) &amp; 0xff,
-		       (unsigned)ntohl(nr-&gt;packets),
-		       (unsigned)ntohl(nr-&gt;octets), buf);
+		       EXTRACT_32BITS(&amp;nr-&gt;proto_tos) &amp; 0xff,
+		       EXTRACT_32BITS(&amp;nr-&gt;packets),
+		       EXTRACT_32BITS(&amp;nr-&gt;octets), buf);
 	}
 }</diff>
      <filename>print-cnfp.c</filename>
    </modified>
    <modified>
      <diff>@@ -32,7 +32,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-dhcp6.c,v 1.22 2002-08-02 04:05:51 guy Exp $&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-dhcp6.c,v 1.23 2002-12-11 07:13:59 guy Exp $&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -46,6 +46,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 /* lease duration */
 #define DHCP6_DURATITION_INFINITE 0xffffffff
@@ -74,7 +75,7 @@ struct dhcp6 {
 		u_int32_t x;
 	} dh6_msgtypexid;
 	/* options follow */
-} __attribute__ ((__packed__));
+};
 #define dh6_msgtype	dh6_msgtypexid.m
 #define dh6_xid		dh6_msgtypexid.x
 #define DH6_XIDMASK	0x00ffffff
@@ -127,7 +128,7 @@ struct dhcp6opt {
 	u_int16_t dh6opt_type;
 	u_int16_t dh6opt_len;
 	/* type-dependent data follows */
-} __attribute__ ((__packed__));
+};
 
 static char *
 dhcp6opt_name(int type)
@@ -212,10 +213,10 @@ dhcp6opt_print(u_char *cp, u_char *ep)
 		if (ep - cp &lt; sizeof(*dh6o))
 			goto trunc;
 		dh6o = (struct dhcp6opt *)cp;
-		optlen = ntohs(dh6o-&gt;dh6opt_len);
+		optlen = EXTRACT_16BITS(&amp;dh6o-&gt;dh6opt_len);
 		if (ep - cp &lt; sizeof(*dh6o) + optlen)
 			goto trunc;
-		opttype = ntohs(dh6o-&gt;dh6opt_type);
+		opttype = EXTRACT_16BITS(&amp;dh6o-&gt;dh6opt_type);
 		printf(&quot; (%s&quot;, dhcp6opt_name(opttype));
 		switch (opttype) {
 		case DH6OPT_CLIENTID:
@@ -226,12 +227,12 @@ dhcp6opt_print(u_char *cp, u_char *ep)
 				break;
 			}
 			tp = (u_char *)(dh6o + 1);
-			switch (ntohs(*(u_int16_t *)tp)) {
+			switch (EXTRACT_16BITS(tp)) {
 			case 1:
 				if (optlen &gt;= 2 + 6) {
 					printf(&quot; hwaddr/time type %u time %u &quot;,
-					    ntohs(*(u_int16_t *)&amp;tp[2]),
-					    ntohl(*(u_int32_t *)&amp;tp[4]));
+					    EXTRACT_16BITS(&amp;tp[2]),
+					    EXTRACT_32BITS(&amp;tp[4]));
 					for (i = 8; i &lt; optlen; i++)
 						printf(&quot;%02x&quot;, tp[i]);
 					/*(*/
@@ -256,7 +257,7 @@ dhcp6opt_print(u_char *cp, u_char *ep)
 			case 3:
 				if (optlen &gt;= 2 + 2) {
 					printf(&quot; hwaddr type %u &quot;,
-					    ntohs(*(u_int16_t *)&amp;tp[2]));
+					    EXTRACT_16BITS(&amp;tp[2]));
 					for (i = 4; i &lt; optlen; i++)
 						printf(&quot;%02x&quot;, tp[i]);
 					/*(*/
@@ -267,7 +268,7 @@ dhcp6opt_print(u_char *cp, u_char *ep)
 				}
 				break;
 			default:
-				printf(&quot; type %d)&quot;, ntohs(*(u_int16_t *)tp));
+				printf(&quot; type %d)&quot;, EXTRACT_16BITS(tp));
 				break;
 			}
 			break;
@@ -406,7 +407,7 @@ dhcp6_print(register const u_char *cp, u_int length,
 		printf(&quot; %s (&quot;, name);	/*)*/
 	else
 		printf(&quot; msgtype-%u (&quot;, dh6-&gt;dh6_msgtype);	/*)*/
-	printf(&quot;xid=%x&quot;, ntohl(dh6-&gt;dh6_xid) &amp; DH6_XIDMASK);
+	printf(&quot;xid=%x&quot;, EXTRACT_32BITS(&amp;dh6-&gt;dh6_xid) &amp; DH6_XIDMASK);
 	extp = (u_char *)(dh6 + 1);
 	dhcp6opt_print(extp, ep);
 	/*(*/</diff>
      <filename>print-dhcp6.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.81 2002-09-05 21:25:39 guy Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.82 2002-12-11 07:13:59 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -506,19 +506,20 @@ ns_print(register const u_char *bp, u_int length)
 	register const HEADER *np;
 	register int qdcount, ancount, nscount, arcount;
 	register const u_char *cp;
+	u_int16_t b2;
 
 	np = (const HEADER *)bp;
 	TCHECK(*np);
 	/* get the byte-order right */
-	qdcount = ntohs(np-&gt;qdcount);
-	ancount = ntohs(np-&gt;ancount);
-	nscount = ntohs(np-&gt;nscount);
-	arcount = ntohs(np-&gt;arcount);
+	qdcount = EXTRACT_16BITS(&amp;np-&gt;qdcount);
+	ancount = EXTRACT_16BITS(&amp;np-&gt;ancount);
+	nscount = EXTRACT_16BITS(&amp;np-&gt;nscount);
+	arcount = EXTRACT_16BITS(&amp;np-&gt;arcount);
 
 	if (DNS_QR(np)) {
 		/* this is a response */
 		printf(&quot; %d%s%s%s%s%s%s&quot;,
-			ntohs(np-&gt;id),
+			EXTRACT_16BITS(&amp;np-&gt;id),
 			ns_ops[DNS_OPCODE(np)],
 			ns_resp[DNS_RCODE(np)],
 			DNS_AA(np)? &quot;*&quot; : &quot;&quot;,
@@ -531,7 +532,7 @@ ns_print(register const u_char *bp, u_int length)
 		/* Print QUESTION section on -vv */
 		cp = (const u_char *)(np + 1);
 		while (qdcount--) {
-			if (qdcount &lt; ntohs(np-&gt;qdcount) - 1)
+			if (qdcount &lt; EXTRACT_16BITS(&amp;np-&gt;qdcount) - 1)
 				putchar(',');
 			if (vflag &gt; 1) {
 				fputs(&quot; q:&quot;, stdout);
@@ -585,13 +586,14 @@ ns_print(register const u_char *bp, u_int length)
 	}
 	else {
 		/* this is a request */
-		printf(&quot; %d%s%s%s&quot;, ntohs(np-&gt;id), ns_ops[DNS_OPCODE(np)],
+		printf(&quot; %d%s%s%s&quot;, EXTRACT_16BITS(&amp;np-&gt;id), ns_ops[DNS_OPCODE(np)],
 		    DNS_RD(np) ? &quot;+&quot; : &quot;&quot;,
 		    DNS_AD(np) ? &quot;$&quot; : &quot;&quot;);
 
 		/* any weirdness? */
-		if (*(((u_short *)np)+1) &amp; htons(0x6cf))
-			printf(&quot; [b2&amp;3=0x%x]&quot;, ntohs(*(((u_short *)np)+1)));
+		b2 = EXTRACT_16BITS(((u_short *)np)+1);
+		if (b2 &amp; 0x6cf)
+			printf(&quot; [b2&amp;3=0x%x]&quot;, b2);
 
 		if (DNS_OPCODE(np) == IQUERY) {
 			if (qdcount)</diff>
      <filename>print-domain.c</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.33 2002-11-09 17:19:25 itojun Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.34 2002-12-11 07:13:59 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -33,6 +33,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 #include &quot;ip.h&quot;
 
@@ -91,7 +92,7 @@ struct egp_packet {
 	} egp_pands;
 #define  egp_poll  egp_pands.egpu_poll
 #define  egp_sourcenet  egp_pands.egpu_sourcenet
-} __attribute__((packed));
+};
 
 const char *egp_acquire_codes[] = {
 	&quot;request&quot;,
@@ -231,7 +232,7 @@ egp_print(register const u_int8_t *bp)
 		printf(&quot;[version %d]&quot;, egp-&gt;egp_version);
 		return;
 	}
-	printf(&quot;as:%d seq:%d&quot;, ntohs(egp-&gt;egp_as), ntohs(egp-&gt;egp_sequence));
+	printf(&quot;as:%d seq:%d&quot;, EXTRACT_16BITS(&amp;egp-&gt;egp_as), EXTRACT_16BITS(&amp;egp-&gt;egp_sequence));
 
 	type = egp-&gt;egp_type;
 	code = egp-&gt;egp_code;
@@ -256,8 +257,8 @@ egp_print(register const u_int8_t *bp)
 				break;
 			}
 			printf(&quot; hello:%d poll:%d&quot;,
-			       ntohs(egp-&gt;egp_hello),
-			       ntohs(egp-&gt;egp_poll));
+			       EXTRACT_16BITS(&amp;egp-&gt;egp_hello),
+			       EXTRACT_16BITS(&amp;egp-&gt;egp_poll));
 			break;
 
 		case EGPC_REFUSE:
@@ -338,10 +339,10 @@ egp_print(register const u_int8_t *bp)
 		else
 			printf(&quot; [status %d]&quot;, status);
 
-		if (ntohs(egp-&gt;egp_reason) &lt;= EGPR_UVERSION)
-			printf(&quot; %s&quot;, egp_reasons[ntohs(egp-&gt;egp_reason)]);
+		if (EXTRACT_16BITS(&amp;egp-&gt;egp_reason) &lt;= EGPR_UVERSION)
+			printf(&quot; %s&quot;, egp_reasons[EXTRACT_16BITS(&amp;egp-&gt;egp_reason)]);
 		else
-			printf(&quot; [reason %d]&quot;, ntohs(egp-&gt;egp_reason));
+			printf(&quot; [reason %d]&quot;, EXTRACT_16BITS(&amp;egp-&gt;egp_reason));
 		break;
 
 	default:</diff>
      <filename>print-egp.c</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.30 2002-11-13 09:35:13 guy Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.31 2002-12-11 07:13:59 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -58,6 +58,7 @@ static const char rcsid[] =
 #define AVOID_CHURN 1
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 static struct esp_algorithm *espsecret_xform=NULL;  /* cache of decoded alg. */
 static char                 *espsecret_key=NULL;
@@ -215,8 +216,8 @@ esp_print(register const u_char *bp, register const u_char *bp2,
 		fputs(&quot;[|ESP]&quot;, stdout);
 		goto fail;
 	}
-	printf(&quot;ESP(spi=0x%08x&quot;, (u_int32_t)ntohl(esp-&gt;esp_spi));
-	printf(&quot;,seq=0x%x&quot;, (u_int32_t)ntohl(esp-&gt;esp_seq));
+	printf(&quot;ESP(spi=0x%08x&quot;, EXTRACT_32BITS(&amp;esp-&gt;esp_spi));
+	printf(&quot;,seq=0x%x&quot;, EXTRACT_32BITS(&amp;esp-&gt;esp_seq));
 	printf(&quot;)&quot;);
 
 	/* if we don't have decryption key, we can't decrypt this packet. */
@@ -237,20 +238,20 @@ esp_print(register const u_char *bp, register const u_char *bp2,
 		ip6 = (struct ip6_hdr *)bp2;
 		ip = NULL;
 		/* we do not attempt to decrypt jumbograms */
-		if (!ntohs(ip6-&gt;ip6_plen))
+		if (!EXTRACT_16BITS(&amp;ip6-&gt;ip6_plen))
 			goto fail;
 		/* if we can't get nexthdr, we do not need to decrypt it */
-		len = sizeof(struct ip6_hdr) + ntohs(ip6-&gt;ip6_plen);
+		len = sizeof(struct ip6_hdr) + EXTRACT_16BITS(&amp;ip6-&gt;ip6_plen);
 		break;
 #endif /*INET6*/
 	case 4:
 		/* nexthdr &amp; padding are in the last fragment */
-		if (ntohs(ip-&gt;ip_off) &amp; IP_MF)
+		if (EXTRACT_16BITS(&amp;ip-&gt;ip_off) &amp; IP_MF)
 			goto fail;
 #ifdef INET6
 		ip6 = NULL;
 #endif
-		len = ntohs(ip-&gt;ip_len);
+		len = EXTRACT_16BITS(&amp;ip-&gt;ip_len);
 		break;
 	default:
 		goto fail;</diff>
      <filename>print-esp.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-	&quot;@(#)$Header: /tcpdump/master/tcpdump/print-fr.c,v 1.7 2002-11-09 17:19:25 itojun Exp $ (LBL)&quot;;
+	&quot;@(#)$Header: /tcpdump/master/tcpdump/print-fr.c,v 1.8 2002-12-11 07:14:00 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -347,7 +347,7 @@ out:
 struct q933_header {
     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
@@ -359,7 +359,7 @@ struct q933_header {
 struct common_ie_header {
     u_int8_t ie_id;
     u_int8_t ie_len;
-} __attribute__((packed));
+};
 
 #define FULL_STATUS 0
 #define LINK_VERIFY 1</diff>
      <filename>print-fr.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-frag6.c,v 1.14 2002-08-01 08:53:07 risso Exp $&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-frag6.c,v 1.15 2002-12-11 07:14:00 guy Exp $&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -38,6 +38,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 int
 frag6_print(register const u_char *bp, register const u_char *bp2)
@@ -56,20 +57,20 @@ frag6_print(register const u_char *bp, register const u_char *bp2)
 
 	if (vflag) {
 		printf(&quot;frag (0x%08x:%d|%ld)&quot;,
-		       (u_int32_t)ntohl(dp-&gt;ip6f_ident),
-		       ntohs(dp-&gt;ip6f_offlg &amp; IP6F_OFF_MASK),
-		       sizeof(struct ip6_hdr) + ntohs(ip6-&gt;ip6_plen) -
+		       EXTRACT_32BITS(&amp;dp-&gt;ip6f_ident),
+		       EXTRACT_16BITS(&amp;dp-&gt;ip6f_offlg &amp; IP6F_OFF_MASK),
+		       sizeof(struct ip6_hdr) + EXTRACT_16BITS(&amp;ip6-&gt;ip6_plen) -
 			       (long)(bp - bp2) - sizeof(struct ip6_frag));
 	} else {
 		printf(&quot;frag (%d|%ld)&quot;,
-		       ntohs(dp-&gt;ip6f_offlg &amp; IP6F_OFF_MASK),
-		       sizeof(struct ip6_hdr) + ntohs(ip6-&gt;ip6_plen) -
+		       EXTRACT_16BITS(&amp;dp-&gt;ip6f_offlg &amp; IP6F_OFF_MASK),
+		       sizeof(struct ip6_hdr) + EXTRACT_16BITS(&amp;ip6-&gt;ip6_plen) -
 			       (long)(bp - bp2) - sizeof(struct ip6_frag));
 	}
 
 #if 1
 	/* it is meaningless to decode non-first fragment */
-	if (ntohs(dp-&gt;ip6f_offlg &amp; IP6F_OFF_MASK) != 0)
+	if (EXTRACT_16BITS(&amp;dp-&gt;ip6f_offlg &amp; IP6F_OFF_MASK) != 0)
 		return 65535;
 	else
 #endif</diff>
      <filename>print-frag6.c</filename>
    </modified>
    <modified>
      <diff>@@ -31,7 +31,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-hsrp.c,v 1.6 2002-11-09 17:19:25 itojun Exp $&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-hsrp.c,v 1.7 2002-12-11 07:14:00 guy Exp $&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -95,7 +95,7 @@ struct hsrp {
 	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_int8_t *bp, register u_int len)</diff>
      <filename>print-hsrp.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-icmp.c,v 1.70 2002-11-09 17:19:26 itojun Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-icmp.c,v 1.71 2002-12-11 07:14:01 guy Exp $ (LBL)&quot;;
 #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)
@@ -284,7 +284,7 @@ icmp_print(const u_char *bp, u_int plen, const u_char *bp2)
 		(void)snprintf(buf, sizeof(buf), &quot;echo %s seq %u&quot;,
 			dp-&gt;icmp_type == ICMP_ECHO ?
 			&quot;request&quot; : &quot;reply&quot;,
-			(unsigned)ntohs(dp-&gt;icmp_seq));
+			EXTRACT_16BITS(&amp;dp-&gt;icmp_seq));
 		break;
 
 	case ICMP_UNREACH:
@@ -304,7 +304,7 @@ icmp_print(const u_char *bp, u_int plen, const u_char *bp2)
 			oip = &amp;dp-&gt;icmp_ip;
 			hlen = IP_HL(oip) * 4;
 			ouh = (struct udphdr *)(((u_char *)oip) + hlen);
-			dport = ntohs(ouh-&gt;uh_dport);
+			dport = EXTRACT_16BITS(&amp;ouh-&gt;uh_dport);
 			switch (oip-&gt;ip_p) {
 
 			case IPPROTO_TCP:
@@ -449,26 +449,26 @@ icmp_print(const u_char *bp, u_int plen, const u_char *bp2)
 	case ICMP_MASKREPLY:
 		TCHECK(dp-&gt;icmp_mask);
 		(void)snprintf(buf, sizeof(buf), &quot;address mask is 0x%08x&quot;,
-		    (unsigned)ntohl(dp-&gt;icmp_mask));
+		    EXTRACT_32BITS(&amp;dp-&gt;icmp_mask));
 		break;
 
 	case ICMP_TSTAMP:
 		TCHECK(dp-&gt;icmp_seq);
 		(void)snprintf(buf, sizeof(buf),
 		    &quot;time stamp query id %u seq %u&quot;,
-		    (unsigned)ntohs(dp-&gt;icmp_id),
-		    (unsigned)ntohs(dp-&gt;icmp_seq));
+		    EXTRACT_16BITS(&amp;dp-&gt;icmp_id),
+		    EXTRACT_16BITS(&amp;dp-&gt;icmp_seq));
 		break;
 
 	case ICMP_TSTAMPREPLY:
 		TCHECK(dp-&gt;icmp_ttime);
 		(void)snprintf(buf, sizeof(buf),
-		    &quot;time stamp reply id %u seq %u : org 0x%lx recv 0x%lx xmit 0x%lx&quot;,
-		    (unsigned)ntohs(dp-&gt;icmp_id),
-		    (unsigned)ntohs(dp-&gt;icmp_seq),
-		    (unsigned long)ntohl(dp-&gt;icmp_otime),
-		    (unsigned long)ntohl(dp-&gt;icmp_rtime),
-		    (unsigned long)ntohl(dp-&gt;icmp_ttime));
+		    &quot;time stamp reply id %u seq %u : org 0x%x recv 0x%x xmit 0x%x&quot;,
+		    EXTRACT_16BITS(&amp;dp-&gt;icmp_id),
+		    EXTRACT_16BITS(&amp;dp-&gt;icmp_seq),
+		    EXTRACT_32BITS(&amp;dp-&gt;icmp_otime),
+		    EXTRACT_32BITS(&amp;dp-&gt;icmp_rtime),
+		    EXTRACT_32BITS(&amp;dp-&gt;icmp_ttime));
 		break;
 
 	default:
@@ -481,7 +481,7 @@ icmp_print(const u_char *bp, u_int plen, const u_char *bp2)
 		if (TTEST2(*bp, plen)) {
 			sum = in_cksum((u_short*)dp, plen, 0);
 			if (sum != 0) {
-				icmp_sum = ntohs(dp-&gt;icmp_cksum);
+				icmp_sum = EXTRACT_16BITS(&amp;dp-&gt;icmp_cksum);
 				(void)printf(&quot; (wrong icmp cksum %x (-&gt;%x)!)&quot;,
 					     icmp_sum,
 					     in_cksum_shouldbe(icmp_sum, sum));
@@ -493,7 +493,7 @@ icmp_print(const u_char *bp, u_int plen, const u_char *bp2)
 		(void)printf(&quot; for &quot;);
 		ip = (struct ip *)bp;
 		snaplen = snapend - bp;
-		ip_print(bp, ntohs(ip-&gt;ip_len));
+		ip_print(bp, EXTRACT_16BITS(&amp;ip-&gt;ip_len));
 	}
 	return;
 trunc:</diff>
      <filename>print-icmp.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.65 2002-09-05 00:52:30 guy Exp $&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.66 2002-12-11 07:14:01 guy Exp $&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -40,6 +40,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 #include &quot;udp.h&quot;
 #include &quot;ah.h&quot;
@@ -119,7 +120,7 @@ icmp6_print(const u_char *bp, const u_char *bp2)
 	/* 'ep' points to the end of available data. */
 	ep = snapend;
 	if (ip-&gt;ip6_plen)
-		icmp6len = (ntohs(ip-&gt;ip6_plen) + sizeof(struct ip6_hdr) -
+		icmp6len = (EXTRACT_16BITS(&amp;ip-&gt;ip6_plen) + sizeof(struct ip6_hdr) -
 			    (bp - bp2));
 	else			/* XXX: jumbo payload case... */
 		icmp6len = snapend - bp;
@@ -151,7 +152,7 @@ icmp6_print(const u_char *bp, const u_char *bp2)
 			    == NULL)
 				goto trunc;
 
-			dport = ntohs(ouh-&gt;uh_dport);
+			dport = EXTRACT_16BITS(&amp;ouh-&gt;uh_dport);
 			switch (prot) {
 			case IPPROTO_TCP:
 				printf(&quot;icmp6: %s tcp port %s unreachable&quot;,
@@ -179,7 +180,7 @@ icmp6_print(const u_char *bp, const u_char *bp2)
 		break;
 	case ICMP6_PACKET_TOO_BIG:
 		TCHECK(dp-&gt;icmp6_mtu);
-		printf(&quot;icmp6: too big %u&quot;, (u_int32_t)ntohl(dp-&gt;icmp6_mtu));
+		printf(&quot;icmp6: too big %u&quot;, EXTRACT_32BITS(&amp;dp-&gt;icmp6_mtu));
 		break;
 	case ICMP6_TIME_EXCEEDED:
 		TCHECK(oip-&gt;ip6_dst);
@@ -202,15 +203,15 @@ icmp6_print(const u_char *bp, const u_char *bp2)
 		switch (dp-&gt;icmp6_code) {
 		case ICMP6_PARAMPROB_HEADER:
 			printf(&quot;icmp6: parameter problem errorneous - octet %u&quot;,
-				(u_int32_t)ntohl(dp-&gt;icmp6_pptr));
+				EXTRACT_32BITS(&amp;dp-&gt;icmp6_pptr));
 			break;
 		case ICMP6_PARAMPROB_NEXTHEADER:
 			printf(&quot;icmp6: parameter problem next header - octet %u&quot;,
-				(u_int32_t)ntohl(dp-&gt;icmp6_pptr));
+				EXTRACT_32BITS(&amp;dp-&gt;icmp6_pptr));
 			break;
 		case ICMP6_PARAMPROB_OPTION:
 			printf(&quot;icmp6: parameter problem option - octet %u&quot;,
-				(u_int32_t)ntohl(dp-&gt;icmp6_pptr));
+				EXTRACT_32BITS(&amp;dp-&gt;icmp6_pptr));
 			break;
 		default:
 			printf(&quot;icmp6: parameter problem code-#%d&quot;,
@@ -266,11 +267,11 @@ icmp6_print(const u_char *bp, const u_char *bp2)
 			printf(&quot;pref=%s, &quot;,
 			    get_rtpref(p-&gt;nd_ra_flags_reserved));
 
-			printf(&quot;router_ltime=%d, &quot;, ntohs(p-&gt;nd_ra_router_lifetime));
+			printf(&quot;router_ltime=%d, &quot;, EXTRACT_16BITS(&amp;p-&gt;nd_ra_router_lifetime));
 			printf(&quot;reachable_time=%u, &quot;,
-				(u_int32_t)ntohl(p-&gt;nd_ra_reachable));
+				EXTRACT_32BITS(&amp;p-&gt;nd_ra_reachable));
 			printf(&quot;retrans_time=%u)&quot;,
-				(u_int32_t)ntohl(p-&gt;nd_ra_retransmit));
+				EXTRACT_32BITS(&amp;p-&gt;nd_ra_retransmit));
 #define RTADVLEN 16
 			icmp6_opt_print((const u_char *)dp + RTADVLEN,
 					icmp6len - RTADVLEN);
@@ -349,7 +350,7 @@ icmp6_print(const u_char *bp, const u_char *bp2)
 		printf(&quot;icmp6: ha discovery request&quot;);
 		if (vflag) {
 			TCHECK(dp-&gt;icmp6_data16[0]);
-			printf(&quot;(id=%d)&quot;, ntohs(dp-&gt;icmp6_data16[0]));
+			printf(&quot;(id=%d)&quot;, EXTRACT_16BITS(&amp;dp-&gt;icmp6_data16[0]));
 		}
 		break;
 	case ICMP6_HADISCOV_REPLY:
@@ -360,7 +361,7 @@ icmp6_print(const u_char *bp, const u_char *bp2)
 			u_char *cp;
 
 			TCHECK(dp-&gt;icmp6_data16[0]);
-			printf(&quot;(id=%d&quot;, ntohs(dp-&gt;icmp6_data16[0]));
+			printf(&quot;(id=%d&quot;, EXTRACT_16BITS(&amp;dp-&gt;icmp6_data16[0]));
 			cp = (u_char *)dp + icmp6len;
 			res = (u_int32_t *)(dp + 1);
 			in6 = (struct in6_addr *)(res + 2);
@@ -375,14 +376,14 @@ icmp6_print(const u_char *bp, const u_char *bp2)
 		printf(&quot;icmp6: mobile router solicitation&quot;);
 		if (vflag) {
 			TCHECK(dp-&gt;icmp6_data16[0]);
-			printf(&quot;(id=%d)&quot;, ntohs(dp-&gt;icmp6_data16[0]));
+			printf(&quot;(id=%d)&quot;, EXTRACT_16BITS(&amp;dp-&gt;icmp6_data16[0]));
 		}
 		break;
 	case ICMP6_MOBILEPREFIX_ADVERT:
 		printf(&quot;icmp6: mobile router advertisement&quot;);
 		if (vflag) {
 			TCHECK(dp-&gt;icmp6_data16[0]);
-			printf(&quot;(id=%d)&quot;, ntohs(dp-&gt;icmp6_data16[0]));
+			printf(&quot;(id=%d)&quot;, EXTRACT_16BITS(&amp;dp-&gt;icmp6_data16[0]));
 #define MPADVLEN 6
 			icmp6_opt_print((const u_char *)dp + MPADVLEN,
 					icmp6len - MPADVLEN);
@@ -538,9 +539,9 @@ icmp6_opt_print(const u_char *bp, int resid)
 			if (opp-&gt;nd_opt_pi_flags_reserved)
 				printf(&quot; &quot;);
 			printf(&quot;valid_ltime=%s,&quot;,
-			    get_lifetime((u_int32_t)ntohl(opp-&gt;nd_opt_pi_valid_time)));
+			    get_lifetime(EXTRACT_32BITS(&amp;opp-&gt;nd_opt_pi_valid_time)));
 			printf(&quot;preferred_ltime=%s,&quot;,
-			    get_lifetime((u_int32_t)ntohl(opp-&gt;nd_opt_pi_preferred_time)));
+			    get_lifetime(EXTRACT_32BITS(&amp;opp-&gt;nd_opt_pi_preferred_time)));
 			printf(&quot;prefix=%s/%d&quot;,
 			    ip6addr_string(&amp;opp-&gt;nd_opt_pi_prefix),
 			    opp-&gt;nd_opt_pi_prefix_len);
@@ -564,7 +565,7 @@ icmp6_opt_print(const u_char *bp, int resid)
 				printf(&quot;)&quot;);
 				break;
 			}
-			printf(&quot; mtu=%u&quot;, (u_int32_t)ntohl(opm-&gt;nd_opt_mtu_mtu));
+			printf(&quot; mtu=%u&quot;, EXTRACT_32BITS(&amp;opm-&gt;nd_opt_mtu_mtu));
 			if (opm-&gt;nd_opt_mtu_len != 1)
 				printf(&quot;!&quot;);
 			printf(&quot;)&quot;);
@@ -574,7 +575,7 @@ icmp6_opt_print(const u_char *bp, int resid)
 			TCHECK(opa-&gt;nd_opt_adv_interval);
 			printf(&quot;(advint:&quot;);	/*)*/
 			printf(&quot; advint=%u&quot;,
-			    (u_int32_t)ntohl(opa-&gt;nd_opt_adv_interval));
+			    EXTRACT_32BITS(&amp;opa-&gt;nd_opt_adv_interval));
 			/*(*/
 			printf(&quot;)&quot;);
 			break;
@@ -582,8 +583,8 @@ icmp6_opt_print(const u_char *bp, int resid)
 			oph = (struct nd_opt_homeagent_info *)op;
 			TCHECK(oph-&gt;nd_opt_hai_lifetime);
 			printf(&quot;(ha info:&quot;);	/*)*/
-			printf(&quot; pref=%d&quot;, ntohs(oph-&gt;nd_opt_hai_preference));
-			printf(&quot;, lifetime=%u&quot;, ntohs(oph-&gt;nd_opt_hai_lifetime));
+			printf(&quot; pref=%d&quot;, EXTRACT_16BITS(&amp;oph-&gt;nd_opt_hai_preference));
+			printf(&quot;, lifetime=%u&quot;, EXTRACT_16BITS(&amp;oph-&gt;nd_opt_hai_lifetime));
 			printf(&quot;)&quot;);
 			break;
 		case ND_OPT_ROUTE_INFO:
@@ -610,7 +611,7 @@ icmp6_opt_print(const u_char *bp, int resid)
 			    opri-&gt;nd_opt_rti_prefixlen);
 			printf(&quot;, pref=%s&quot;, get_rtpref(opri-&gt;nd_opt_rti_flags));
 			printf(&quot;, lifetime=%s&quot;,
-			    get_lifetime((u_int32_t)ntohl(opri-&gt;nd_opt_rti_lifetime)));
+			    get_lifetime(EXTRACT_32BITS(&amp;opri-&gt;nd_opt_rti_lifetime)));
 			/*(*/
 			printf(&quot;)&quot;);
 			break;
@@ -643,7 +644,7 @@ mld6_print(const u_char *bp)
 	if ((u_char *)mp + sizeof(*mp) &gt; ep)
 		return;
 
-	printf(&quot;max resp delay: %d &quot;, ntohs(mp-&gt;mld6_maxdelay));
+	printf(&quot;max resp delay: %d &quot;, EXTRACT_16BITS(&amp;mp-&gt;mld6_maxdelay));
 	printf(&quot;addr: %s&quot;, ip6addr_string(&amp;mp-&gt;mld6_addr));
 }
 
@@ -708,13 +709,13 @@ icmp6_nodeinfo_print(int icmp6len, const u_char *bp, const u_char *ep)
 		TCHECK2(*dp, sizeof(*ni6));
 		ni6 = (struct icmp6_nodeinfo *)dp;
 		printf(&quot; (&quot;);	/*)*/
-		switch (ntohs(ni6-&gt;ni_qtype)) {
+		switch (EXTRACT_16BITS(&amp;ni6-&gt;ni_qtype)) {
 		case NI_QTYPE_NOOP:
 			printf(&quot;noop&quot;);
 			break;
 		case NI_QTYPE_SUPTYPES:
 			printf(&quot;supported qtypes&quot;);
-			i = ntohs(ni6-&gt;ni_flags);
+			i = EXTRACT_16BITS(&amp;ni6-&gt;ni_flags);
 			if (i)
 				printf(&quot; [%s]&quot;, (i &amp; 0x01) ? &quot;C&quot; : &quot;&quot;);
 			break;
@@ -850,7 +851,7 @@ icmp6_nodeinfo_print(int icmp6len, const u_char *bp, const u_char *ep)
 			break;
 		}
 
-		switch (ntohs(ni6-&gt;ni_qtype)) {
+		switch (EXTRACT_16BITS(&amp;ni6-&gt;ni_qtype)) {
 		case NI_QTYPE_NOOP:
 			if (needcomma)
 				printf(&quot;, &quot;);
@@ -863,7 +864,7 @@ icmp6_nodeinfo_print(int icmp6len, const u_char *bp, const u_char *ep)
 			if (needcomma)
 				printf(&quot;, &quot;);
 			printf(&quot;supported qtypes&quot;);
-			i = ntohs(ni6-&gt;ni_flags);
+			i = EXTRACT_16BITS(&amp;ni6-&gt;ni_flags);
 			if (i)
 				printf(&quot; [%s]&quot;, (i &amp; 0x01) ? &quot;C&quot; : &quot;&quot;);
 			break;
@@ -885,7 +886,7 @@ icmp6_nodeinfo_print(int icmp6len, const u_char *bp, const u_char *ep)
 				printf(&quot;\&quot;&quot;);
 			} else
 				dnsname_print(cp, ep);
-			if ((ntohs(ni6-&gt;ni_flags) &amp; 0x01) != 0)
+			if ((EXTRACT_16BITS(&amp;ni6-&gt;ni_flags) &amp; 0x01) != 0)
 				printf(&quot; [TTL=%u]&quot;, *(u_int32_t *)(ni6 + 1));
 			break;
 		case NI_QTYPE_NODEADDR:
@@ -898,7 +899,7 @@ icmp6_nodeinfo_print(int icmp6len, const u_char *bp, const u_char *ep)
 					break;
 				printf(&quot; %s&quot;, getname6(bp + i));
 				i += sizeof(struct in6_addr);
-				printf(&quot;(%d)&quot;, (int32_t)ntohl(*(int32_t *)(bp + i)));
+				printf(&quot;(%d)&quot;, (int32_t)EXTRACT_32BITS(bp + i));
 				i += sizeof(int32_t);
 			}
 			i = ni6-&gt;ni_flags;
@@ -963,7 +964,7 @@ icmp6_rrenum_print(int icmp6len, const u_char *bp, const u_char *ep)
 		break;
 	}
 
-	printf(&quot;, seq=%u&quot;, (u_int32_t)ntohl(rr6-&gt;rr_seqnum));
+	printf(&quot;, seq=%u&quot;, EXTRACT_32BITS(&amp;rr6-&gt;rr_seqnum));
 
 	if (vflag) {
 #define F(x, y)	((rr6-&gt;rr_flags) &amp; (x) ? (y) : &quot;&quot;)
@@ -978,7 +979,7 @@ icmp6_rrenum_print(int icmp6len, const u_char *bp, const u_char *ep)
 		printf(&quot;seg=%u,&quot;, rr6-&gt;rr_segnum);
 		printf(&quot;maxdelay=%u&quot;, rr6-&gt;rr_maxdelay);
 		if (rr6-&gt;rr_reserved)
-			printf(&quot;rsvd=0x%x&quot;, (u_int16_t)ntohs(rr6-&gt;rr_reserved));
+			printf(&quot;rsvd=0x%x&quot;, EXTRACT_16BITS(&amp;rr6-&gt;rr_reserved));
 		/*[*/
 		printf(&quot;]&quot;);
 #undef F
@@ -1043,12 +1044,12 @@ icmp6_rrenum_print(int icmp6len, const u_char *bp, const u_char *ep)
 					printf(&quot;vltime=infty,&quot;);
 				else
 					printf(&quot;vltime=%u,&quot;,
-					    (u_int32_t)ntohl(use-&gt;rpu_vltime));
+					    EXTRACT_32BITS(&amp;use-&gt;rpu_vltime));
 				if (~use-&gt;rpu_pltime == 0)
 					printf(&quot;pltime=infty,&quot;);
 				else
 					printf(&quot;pltime=%u,&quot;,
-					    (u_int32_t)ntohl(use-&gt;rpu_pltime));
+					    EXTRACT_32BITS(&amp;use-&gt;rpu_pltime));
 			}
 			if (inet_ntop(AF_INET6, &amp;use-&gt;rpu_prefix, hbuf,
 			    sizeof(hbuf)))</diff>
      <filename>print-icmp6.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-igmp.c,v 1.10 2002-11-09 17:19:26 itojun Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-igmp.c,v 1.11 2002-12-11 07:14:02 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -51,7 +51,7 @@ struct tr_query {
     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) &gt;&gt; 24) &amp; 0xff)
 #define TR_GETQID(x)        ((x) &amp; 0x00ffffff)
@@ -72,7 +72,7 @@ struct tr_resp {
     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
@@ -116,12 +116,12 @@ print_mtrace(register const u_char *bp, register u_int len)
 	(void)printf(&quot; [invalid len %d]&quot;, len);
 	return;
     }
-    printf(&quot;mtrace %lu: %s to %s reply-to %s&quot;,
-        (u_long)TR_GETQID(ntohl(tr-&gt;tr_rttlqid)),
+    printf(&quot;mtrace %u: %s to %s reply-to %s&quot;,
+        TR_GETQID(EXTRACT_32BITS(&amp;tr-&gt;tr_rttlqid)),
         ipaddr_string(&amp;tr-&gt;tr_src), ipaddr_string(&amp;tr-&gt;tr_dst),
         ipaddr_string(&amp;tr-&gt;tr_raddr));
-    if (IN_CLASSD(ntohl(tr-&gt;tr_raddr)))
-        printf(&quot; with-ttl %d&quot;, TR_GETTTL(ntohl(tr-&gt;tr_rttlqid)));
+    if (IN_CLASSD(EXTRACT_32BITS(&amp;tr-&gt;tr_raddr)))
+        printf(&quot; with-ttl %d&quot;, TR_GETTTL(EXTRACT_32BITS(&amp;tr-&gt;tr_rttlqid)));
     return;
 trunc:
     (void)printf(&quot;[|igmp]&quot;);
@@ -139,11 +139,11 @@ print_mresp(register const u_char *bp, register u_int len)
 	return;
     }
     printf(&quot;mresp %lu: %s to %s reply-to %s&quot;,
-        (u_long)TR_GETQID(ntohl(tr-&gt;tr_rttlqid)),
+        (u_long)TR_GETQID(EXTRACT_32BITS(&amp;tr-&gt;tr_rttlqid)),
         ipaddr_string(&amp;tr-&gt;tr_src), ipaddr_string(&amp;tr-&gt;tr_dst),
         ipaddr_string(&amp;tr-&gt;tr_raddr));
-    if (IN_CLASSD(ntohl(tr-&gt;tr_raddr)))
-        printf(&quot; with-ttl %d&quot;, TR_GETTTL(ntohl(tr-&gt;tr_rttlqid)));
+    if (IN_CLASSD(EXTRACT_32BITS(&amp;tr-&gt;tr_raddr)))
+        printf(&quot; with-ttl %d&quot;, TR_GETTTL(EXTRACT_32BITS(&amp;tr-&gt;tr_rttlqid)));
     return;
 trunc:
     (void)printf(&quot;[|igmp]&quot;);</diff>
      <filename>print-igmp.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.116 2002-10-18 04:40:03 itojun Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.117 2002-12-11 07:14:02 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -367,7 +367,7 @@ ip_print(register const u_char *bp, register u_int length)
 		return;
 	}
 
-	len = ntohs(ip-&gt;ip_len);
+	len = EXTRACT_16BITS(&amp;ip-&gt;ip_len);
 	if (length &lt; len)
 		(void)printf(&quot;truncated-ip - %d bytes missing! &quot;,
 			len - length);
@@ -376,7 +376,7 @@ ip_print(register const u_char *bp, register u_int length)
 
         printf(&quot;IP &quot;);
 
-	off = ntohs(ip-&gt;ip_off);
+	off = EXTRACT_16BITS(&amp;ip-&gt;ip_off);
 
         if (vflag) {
             (void)printf(&quot;(tos 0x%x&quot;, (int)ip-&gt;ip_tos);
@@ -395,11 +395,11 @@ ip_print(register const u_char *bp, register u_int length)
             }
 
             if (ip-&gt;ip_ttl &gt;= 1)
-                (void)printf(&quot;, ttl %d&quot;, (int)ip-&gt;ip_ttl);    
+                (void)printf(&quot;, ttl %u&quot;, ip-&gt;ip_ttl);    
 
             if ((off &amp; 0x3fff) == 0)
-                (void)printf(&quot;, id %d&quot;, (int)ntohs(ip-&gt;ip_id));
-            (void)printf(&quot;, len %d) &quot;, (int)ntohs(ip-&gt;ip_len));
+                (void)printf(&quot;, id %u&quot;, EXTRACT_16BITS(&amp;ip-&gt;ip_id));
+            (void)printf(&quot;, len %u) &quot;, EXTRACT_16BITS(&amp;ip-&gt;ip_len));
 	}
 
 	/*
@@ -602,7 +602,7 @@ again:
 #ifndef IP_DF
 #define IP_DF 0x4000
 #endif /* IP_DF */
-		(void)printf(&quot; (frag %d:%u@%d%s)&quot;, ntohs(ip-&gt;ip_id), len,
+		(void)printf(&quot; (frag %u:%u@%u%s)&quot;, EXTRACT_16BITS(&amp;ip-&gt;ip_id), len,
 			(off &amp; 0x1fff) * 8,
 			(off &amp; IP_MF)? &quot;+&quot; : &quot;&quot;);
 
@@ -616,7 +616,7 @@ again:
 		if ((u_char *)ip + hlen &lt;= snapend) {
 			sum = in_cksum((const u_short *)ip, hlen, 0);
 			if (sum != 0) {
-				ip_sum = ntohs(ip-&gt;ip_sum);
+				ip_sum = EXTRACT_16BITS(&amp;ip-&gt;ip_sum);
 				(void)printf(&quot;%sbad cksum %x (-&gt;%x)!&quot;, sep,
 					     ip_sum,
 					     in_cksum_shouldbe(ip_sum, sum));</diff>
      <filename>print-ip.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.27 2002-10-18 04:40:03 itojun Exp $&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.28 2002-12-11 07:14:02 guy Exp $&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -38,6 +38,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 #include &quot;ip6.h&quot;
 
@@ -64,7 +65,7 @@ ip6_print(register const u_char *bp, register u_int length)
 	}
 	advance = sizeof(struct ip6_hdr);
 
-	len = ntohs(ip6-&gt;ip6_plen);
+	len = EXTRACT_16BITS(&amp;ip6-&gt;ip6_plen);
 	if (length &lt; len + advance)
 		(void)printf(&quot;truncated-ip6 - %d bytes missing!&quot;,
 			len + advance - length);
@@ -182,7 +183,7 @@ ip6_print(register const u_char *bp, register u_int length)
 
  end:
 
-	flow = ntohl(ip6-&gt;ip6_flow);
+	flow = EXTRACT_32BITS(&amp;ip6-&gt;ip6_flow);
 #if 0
 	/* rfc1883 */
 	if (flow &amp; 0x0f000000)</diff>
      <filename>print-ip6.c</filename>
    </modified>
    <modified>
      <diff>@@ -33,7 +33,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ip6opts.c,v 1.12 2002-08-01 08:53:11 risso Exp $&quot;;
+     &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ip6opts.c,v 1.13 2002-12-11 07:14:03 guy Exp $&quot;;
 #endif
 
 #ifdef INET6
@@ -45,6 +45,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 /* items outside of rfc2292bis */
 #ifndef IP6OPT_MINLEN
@@ -103,7 +104,7 @@ ip6_sopt_print(const u_char *bp, int len)
 		printf(&quot;, ui: trunc&quot;);
 		goto trunc;
 	    }
-            printf(&quot;, ui: 0x%04x &quot;, ntohs(*(u_int16_t *)&amp;bp[i + 2]));
+            printf(&quot;, ui: 0x%04x &quot;, EXTRACT_16BITS(&amp;bp[i + 2]));
 	    break;
         case IP6SOPT_ALTCOA:
              if (len - i &lt; IP6SOPT_ALTCOA_MINLEN) {
@@ -117,8 +118,7 @@ ip6_sopt_print(const u_char *bp, int len)
 		printf(&quot;, auth: trunc&quot;);
 		goto trunc;
 	    }
-            printf(&quot;, auth spi: 0x%08x&quot;,
-		   (u_int32_t)ntohl(*(u_int32_t *)&amp;bp[i + 2]));
+            printf(&quot;, auth spi: 0x%08x&quot;, EXTRACT_32BITS(&amp;bp[i + 2]));
 	    break;
 	default:
 	    if (len - i &lt; IP6OPT_MINLEN) {
@@ -173,7 +173,7 @@ ip6_opt_print(const u_char *bp, int len)
 		printf(&quot;(rtalert: invalid len %d)&quot;, bp[i + 1]);
 		goto trunc;
 	    }
-	    printf(&quot;(rtalert: 0x%04x) &quot;, ntohs(*(u_int16_t *)&amp;bp[i + 2]));
+	    printf(&quot;(rtalert: 0x%04x) &quot;, EXTRACT_16BITS(&amp;bp[i + 2]));
 	    break;
 	case IP6OPT_JUMBO:
 	    if (len - i &lt; IP6OPT_JUMBO_LEN) {
@@ -184,7 +184,7 @@ ip6_opt_print(const u_char *bp, int len)
 		printf(&quot;(jumbo: invalid len %d)&quot;, bp[i + 1]);
 		goto trunc;
 	    }
-	    printf(&quot;(jumbo: %u) &quot;, (u_int32_t)ntohl(*(u_int32_t *)&amp;bp[i + 2]));
+	    printf(&quot;(jumbo: %u) &quot;, EXTRACT_32BITS(&amp;bp[i + 2]));
 	    break;
         case IP6OPT_HOME_ADDRESS:
 	    if (len - i &lt; IP6OPT_HOMEADDR_MINLEN) {
@@ -223,8 +223,7 @@ ip6_opt_print(const u_char *bp, int len)
 	    if ((bp[i + 2] &amp; 0x0f) || bp[i + 3] || bp[i + 4])
 		    printf(&quot;res&quot;);
 	    printf(&quot;, sequence: %u&quot;, bp[i + 5]);
-	    printf(&quot;, lifetime: %u&quot;,
-		(u_int32_t)ntohl(*(u_int32_t *)&amp;bp[i + 6]));
+	    printf(&quot;, lifetime: %u&quot;, EXTRACT_32BITS(&amp;bp[i + 6]));
 
 	    if (bp[i + 1] &gt; IP6OPT_BU_MINLEN - 2) {
 		ip6_sopt_print(&amp;bp[i + IP6OPT_BU_MINLEN],
@@ -246,10 +245,8 @@ ip6_opt_print(const u_char *bp, int len)
 	    if (bp[i + 3])
 		    printf(&quot;res&quot;);
 	    printf(&quot;, sequence: %u&quot;, bp[i + 4]);
-	    printf(&quot;, lifetime: %u&quot;,
-		(u_int32_t)ntohl(*(u_int32_t *)&amp;bp[i + 5]));
-	    printf(&quot;, refresh: %u&quot;,
-		(u_int32_t)ntohl(*(u_int32_t *)&amp;bp[i + 9]));
+	    printf(&quot;, lifetime: %u&quot;, EXTRACT_32BITS(&amp;bp[i + 5]));
+	    printf(&quot;, refresh: %u&quot;, EXTRACT_32BITS(&amp;bp[i + 9]));
 
 	    if (bp[i + 1] &gt; IP6OPT_BA_MINLEN - 2) {
 		ip6_sopt_print(&amp;bp[i + IP6OPT_BA_MINLEN],</diff>
      <filename>print-ip6opts.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ipcomp.c,v 1.16 2002-11-09 17:19:26 itojun Exp $&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ipcomp.c,v 1.17 2002-12-11 07:14:03 guy Exp $&quot;;
 #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) &amp;&amp; defined(HAVE_ZLIB_H)
 #include &lt;zlib.h&gt;
@@ -45,6 +45,7 @@ struct ipcomp {
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 int
 ipcomp_print(register const u_char *bp, int *nhdr)
@@ -57,7 +58,7 @@ ipcomp_print(register const u_char *bp, int *nhdr)
 #endif
 
 	ipcomp = (struct ipcomp *)bp;
-	cpi = (u_int16_t)ntohs(ipcomp-&gt;comp_cpi);
+	cpi = EXTRACT_16BITS(&amp;ipcomp-&gt;comp_cpi);
 
 	/* 'ep' points to the end of available data. */
 	ep = snapend;</diff>
      <filename>print-ipcomp.c</filename>
    </modified>
    <modified>
      <diff>@@ -30,7 +30,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.35 2002-09-05 21:25:42 guy Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.36 2002-12-11 07:14:03 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -350,28 +350,28 @@ isakmp_attrmap_print(const u_char *p, const u_char *ep,
 	if (p[0] &amp; 0x80)
 		totlen = 4;
 	else
-		totlen = 4 + ntohs(q[1]);
+		totlen = 4 + EXTRACT_16BITS(&amp;q[1]);
 	if (ep &lt; p + totlen) {
 		printf(&quot;[|attr]&quot;);
 		return ep + 1;
 	}
 
 	printf(&quot;(&quot;);
-	t = ntohs(q[0]) &amp; 0x7fff;
+	t = EXTRACT_16BITS(&amp;q[0]) &amp; 0x7fff;
 	if (map &amp;&amp; t &lt; nmap &amp;&amp; map[t].type)
 		printf(&quot;type=%s &quot;, map[t].type);
 	else
 		printf(&quot;type=#%d &quot;, t);
 	if (p[0] &amp; 0x80) {
 		printf(&quot;value=&quot;);
-		v = ntohs(q[1]);
+		v = EXTRACT_16BITS(&amp;q[1]);
 		if (map &amp;&amp; t &lt; nmap &amp;&amp; v &lt; map[t].nvalue &amp;&amp; map[t].value[v])
 			printf(&quot;%s&quot;, map[t].value[v]);
 		else
 			rawprint((caddr_t)&amp;q[1], 2);
 	} else {
-		printf(&quot;len=%d value=&quot;, ntohs(q[1]));
-		rawprint((caddr_t)&amp;p[4], ntohs(q[1]));
+		printf(&quot;len=%d value=&quot;, EXTRACT_16BITS(&amp;q[1]));
+		rawprint((caddr_t)&amp;p[4], EXTRACT_16BITS(&amp;q[1]));
 	}
 	printf(&quot;)&quot;);
 	return p + totlen;
@@ -388,22 +388,22 @@ isakmp_attr_print(const u_char *p, const u_char *ep)
 	if (p[0] &amp; 0x80)
 		totlen = 4;
 	else
-		totlen = 4 + ntohs(q[1]);
+		totlen = 4 + EXTRACT_16BITS(&amp;q[1]);
 	if (ep &lt; p + totlen) {
 		printf(&quot;[|attr]&quot;);
 		return ep + 1;
 	}
 
 	printf(&quot;(&quot;);
-	t = ntohs(q[0]) &amp; 0x7fff;
+	t = EXTRACT_16BITS(&amp;q[0]) &amp; 0x7fff;
 	printf(&quot;type=#%d &quot;, t);
 	if (p[0] &amp; 0x80) {
 		printf(&quot;value=&quot;);
 		t = q[1];
 		rawprint((caddr_t)&amp;q[1], 2);
 	} else {
-		printf(&quot;len=%d value=&quot;, ntohs(q[1]));
-		rawprint((caddr_t)&amp;p[2], ntohs(q[1]));
+		printf(&quot;len=%d value=&quot;, EXTRACT_16BITS(&amp;q[1]));
+		rawprint((caddr_t)&amp;p[2], EXTRACT_16BITS(&amp;q[1]));
 	}
 	printf(&quot;)&quot;);
 	return p + totlen;</diff>
      <filename>print-isakmp.c</filename>
    </modified>
    <modified>
      <diff>@@ -26,7 +26,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.72 2002-12-11 06:00:41 guy Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.73 2002-12-11 07:14:04 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -346,7 +346,7 @@ struct isis_tlv_ptp_adj {
     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_int8_t *, u_int);
 static void esis_print(const u_int8_t *, u_int);
@@ -357,23 +357,23 @@ struct isis_metric_block {
     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_int8_t neighbor_nodeid[NODE_ID_LEN];
-} __attribute__((packed));
+};
 
 struct isis_tlv_es_reach {
     struct isis_metric_block isis_metric_block;
     u_int8_t neighbor_sysid[SYSTEM_ID_LEN];
-} __attribute__((packed));
+};
 
 struct isis_tlv_ip_reach {
     struct isis_metric_block isis_metric_block;
     u_int8_t prefix[4];
     u_int8_t mask[4];
-} __attribute__((packed));
+};
 
 static struct tok isis_is_reach_virtual_values[] = {
     { 0,    &quot;IsNotVirtual&quot;},
@@ -390,7 +390,7 @@ struct isis_common_header {
     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_int8_t circuit_type;
@@ -399,7 +399,7 @@ struct isis_iih_lan_header {
     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_int8_t circuit_type;
@@ -407,7 +407,7 @@ struct isis_iih_ptp_header {
     u_int8_t holding_time[2];
     u_int8_t pdu_len[2];
     u_int8_t circuit_id;
-} __attribute__((packed));
+};
 
 struct isis_lsp_header {
     u_int8_t pdu_len[2];
@@ -416,26 +416,26 @@ struct isis_lsp_header {
     u_int8_t sequence_number[4];
     u_int8_t checksum[2];
     u_int8_t typeblock;
-} __attribute__((packed));
+};
 
 struct isis_csnp_header {
     u_int8_t pdu_len[2];
     u_int8_t source_id[NODE_ID_LEN];
     u_int8_t start_lsp_id[LSP_ID_LEN];
     u_int8_t end_lsp_id[LSP_ID_LEN];
-} __attribute__((packed));
+};
 
 struct isis_psnp_header {
     u_int8_t pdu_len[2];
     u_int8_t source_id[NODE_ID_LEN];
-} __attribute__((packed));
+};
 
 struct isis_tlv_lsp {
     u_int8_t remaining_lifetime[2];
     u_int8_t lsp_id[LSP_ID_LEN];
     u_int8_t sequence_number[4];
     u_int8_t checksum[2];
-} __attribute__((packed));
+};
 
 
 /* allocate space for the following string</diff>
      <filename>print-isoclns.c</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-krb.c,v 1.20 2002-12-11 05:40:09 guy Exp $&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-krb.c,v 1.21 2002-12-11 07:14:04 guy Exp $&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -67,7 +67,7 @@ static void krb4_print(const u_char *);
 struct krb {
 	u_int8_t pvno;		/* Protocol Version */
 	u_int8_t type;		/* Type+B */
-} __attribute__((packed));
+};
 
 static char tstr[] = &quot; [|kerberos]&quot;;
 </diff>
      <filename>print-krb.c</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.16 2002-09-05 21:25:43 guy Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.17 2002-12-11 07:14:04 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -36,6 +36,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 #include &quot;ether.h&quot;
 #include &quot;lane.h&quot;
 
@@ -67,13 +68,13 @@ lane_hdr_print(register const u_char *bp, int length)
 	ep = (const struct lecdatahdr_8023 *)bp;
 	if (qflag)
 		(void)printf(&quot;lecid:%x %s %s %d: &quot;,
-			     ntohs(ep-&gt;le_header),
+			     EXTRACT_16BITS(&amp;ep-&gt;le_header),
 			     etheraddr_string(ep-&gt;h_source),
 			     etheraddr_string(ep-&gt;h_dest),
 			     length);
 	else
 		(void)printf(&quot;lecid:%x %s %s %s %d: &quot;,
-			     ntohs(ep-&gt;le_header),
+			     EXTRACT_16BITS(&amp;ep-&gt;le_header),
 			     etheraddr_string(ep-&gt;h_source),
 			     etheraddr_string(ep-&gt;h_dest),
 			     etherproto_string(ep-&gt;h_type),
@@ -102,13 +103,13 @@ lane_print(const u_char *p, u_int length, u_int caplen)
 	}
 
 	lec = (struct lane_controlhdr *)p;
-	if (ntohs(lec-&gt;lec_header) == 0xff00) {
+	if (EXTRACT_16BITS(&amp;lec-&gt;lec_header) == 0xff00) {
 		/*
 		 * LE Control.
 		 */
 		printf(&quot;lec: proto %x vers %x %s&quot;,
 		    lec-&gt;lec_proto, lec-&gt;lec_vers,
-		    tok2str(lecop2str, &quot;opcode-#%u&quot;, ntohs(lec-&gt;lec_opcode)));
+		    tok2str(lecop2str, &quot;opcode-#%u&quot;, EXTRACT_16BITS(&amp;lec-&gt;lec_opcode)));
 		return;
 	}
 
@@ -133,7 +134,7 @@ lane_print(const u_char *p, u_int length, u_int caplen)
 	ep = (struct lecdatahdr_8023 *)p;
 	p += sizeof(struct lecdatahdr_8023);
 
-	ether_type = ntohs(ep-&gt;h_type);
+	ether_type = EXTRACT_16BITS(&amp;ep-&gt;h_type);
 
 	/*
 	 * Is it (gag) an 802.3 encapsulation?</diff>
      <filename>print-lane.c</filename>
    </modified>
    <modified>
      <diff>@@ -29,7 +29,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-lwres.c,v 1.8 2002-11-09 17:19:28 itojun Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-lwres.c,v 1.9 2002-12-11 07:14:04 guy Exp $ (LBL)&quot;;
 #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 __attribute__((packed));
+} lwres_nooprequest_t;
 
 typedef struct {
 	/* public */
 	lwres_uint16_t			datalength;
 	/* data follows */
-} lwres_noopresponse_t __attribute__((packed));
+} lwres_noopresponse_t;
 
 /*
  * 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 __attribute__((packed));
+} lwres_gabnrequest_t;
 
 typedef struct {
 	/* public */
@@ -118,7 +118,7 @@ typedef struct {
 	/* aliases follows */
 	/* addrs follows */
 	/* realname follows */
-} lwres_gabnresponse_t __attribute__((packed));
+} lwres_gabnresponse_t;
 
 /*
  * get name by address
@@ -138,7 +138,7 @@ typedef struct {
 	lwres_uint16_t			realnamelen;
 	/* aliases follows */
 	/* realname follows */
-} lwres_gnbaresponse_t __attribute__((packed));
+} lwres_gnbaresponse_t;
 
 /*
  * get rdata by name
@@ -152,7 +152,7 @@ typedef struct {
 	lwres_uint16_t			rdtype;
 	lwres_uint16_t			namelen;
 	/* name follows */
-} lwres_grbnrequest_t __attribute__((packed));
+} lwres_grbnrequest_t;
 
 typedef struct {
 	/* public */
@@ -165,7 +165,7 @@ typedef struct {
 	/* realname here (len + name) */
 	/* rdata here (len + name) */
 	/* signatures here (len + name) */
-} lwres_grbnresponse_t __attribute__((packed));
+} lwres_grbnresponse_t;
 
 #define LWRDATA_VALIDATED	0x00000001
 
@@ -262,13 +262,13 @@ lwres_printaddr(lwres_addr_t *ap)
 	int i;
 
 	TCHECK(ap-&gt;length);
-	l = ntohs(ap-&gt;length);
+	l = EXTRACT_16BITS(&amp;ap-&gt;length);
 	/* XXX ap points to packed struct */
 	p = (const char *)&amp;ap-&gt;length + sizeof(ap-&gt;length);
 	if (p + l &gt; (const char *)snapend)
 		goto trunc;
 
-	switch (ntohl(ap-&gt;family)) {
+	switch (EXTRACT_32BITS(&amp;ap-&gt;family)) {
 	case 1:	/* IPv4 */
 		printf(&quot; %s&quot;, ipaddr_string(p));
 		p += sizeof(struct in_addr);
@@ -280,7 +280,7 @@ lwres_printaddr(lwres_addr_t *ap)
 		break;
 #endif
 	default:
-		printf(&quot; %lu/&quot;, (unsigned long)ntohl(ap-&gt;family));
+		printf(&quot; %u/&quot;, EXTRACT_32BITS(&amp;ap-&gt;family));
 		for (i = 0; i &lt; l; i++)
 			printf(&quot;%02x&quot;, *p++);
 	}
@@ -305,35 +305,35 @@ lwres_print(register const u_char *bp, u_int length)
 	TCHECK(np-&gt;authlength);
 
 	printf(&quot; lwres&quot;);
-	v = ntohs(np-&gt;version);
+	v = EXTRACT_16BITS(&amp;np-&gt;version);
 	if (vflag || v != LWRES_LWPACKETVERSION_0)
 		printf(&quot; v%u&quot;, v);
 	if (v != LWRES_LWPACKETVERSION_0) {
-		s = (const char *)np + ntohl(np-&gt;length);
+		s = (const char *)np + EXTRACT_32BITS(&amp;np-&gt;length);
 		goto tail;
 	}
 
-	response = ntohs(np-&gt;pktflags) &amp; LWRES_LWPACKETFLAG_RESPONSE;
+	response = EXTRACT_16BITS(&amp;np-&gt;pktflags) &amp; LWRES_LWPACKETFLAG_RESPONSE;
 
 	/* opcode and pktflags */
-	v = (u_int32_t)ntohl(np-&gt;opcode);
+	v = EXTRACT_32BITS(&amp;np-&gt;opcode);
 	s = tok2str(opcode, &quot;#0x%x&quot;, v);
 	printf(&quot; %s%s&quot;, s, response ? &quot;&quot; : &quot;?&quot;);
 
 	/* pktflags */
-	v = ntohs(np-&gt;pktflags);
+	v = EXTRACT_16BITS(&amp;np-&gt;pktflags);
 	if (v &amp; ~LWRES_LWPACKETFLAG_RESPONSE)
 		printf(&quot;[0x%x]&quot;, v);
 
 	if (vflag &gt; 1) {
 		printf(&quot; (&quot;);	/*)*/
-		printf(&quot;serial:0x%lx&quot;, (unsigned long)ntohl(np-&gt;serial));
-		printf(&quot; result:0x%lx&quot;, (unsigned long)ntohl(np-&gt;result));
-		printf(&quot; recvlen:%lu&quot;, (unsigned long)ntohl(np-&gt;recvlength));
+		printf(&quot;serial:0x%x&quot;, EXTRACT_32BITS(&amp;np-&gt;serial));
+		printf(&quot; result:0x%x&quot;, EXTRACT_32BITS(&amp;np-&gt;result));
+		printf(&quot; recvlen:%u&quot;, EXTRACT_32BITS(&amp;np-&gt;recvlength));
 		/* BIND910: not used */
 		if (vflag &gt; 2) {
-			printf(&quot; authtype:0x%x&quot;, ntohs(np-&gt;authtype));
-			printf(&quot; authlen:%u&quot;, ntohs(np-&gt;authlength));
+			printf(&quot; authtype:0x%x&quot;, EXTRACT_16BITS(&amp;np-&gt;authtype));
+			printf(&quot; authlen:%u&quot;, EXTRACT_16BITS(&amp;np-&gt;authlength));
 		}
 		/*(*/
 		printf(&quot;)&quot;);
@@ -353,7 +353,7 @@ lwres_print(register const u_char *bp, u_int length)
 		gnba = NULL;
 		grbn = NULL;
 
-		switch (ntohl(np-&gt;opcode)) {
+		switch (EXTRACT_32BITS(&amp;np-&gt;opcode)) {
 		case LWRES_OPCODE_NOOP:
 			break;
 		case LWRES_OPCODE_GETADDRSBYNAME:
@@ -362,15 +362,15 @@ lwres_print(register const u_char *bp, u_int length)
 			/* XXX gabn points to packed struct */
 			s = (const char *)&amp;gabn-&gt;namelen +
 			    sizeof(gabn-&gt;namelen);
-			l = ntohs(gabn-&gt;namelen);
+			l = EXTRACT_16BITS(&amp;gabn-&gt;namelen);
 
 			/* BIND910: not used */
 			if (vflag &gt; 2) {
-				printf(&quot; flags:0x%lx&quot;,
-				    (unsigned long)ntohl(gabn-&gt;flags));
+				printf(&quot; flags:0x%x&quot;,
+				    EXTRACT_32BITS(&amp;gabn-&gt;flags));
 			}
 
-			v = (u_int32_t)ntohl(gabn-&gt;addrtypes);
+			v = EXTRACT_32BITS(&amp;gabn-&gt;addrtypes);
 			switch (v &amp; (LWRES_ADDRTYPE_V4 | LWRES_ADDRTYPE_V6)) {
 			case LWRES_ADDRTYPE_V4:
 				printf(&quot; IPv4&quot;);
@@ -396,8 +396,8 @@ lwres_print(register const u_char *bp, u_int length)
 
 			/* BIND910: not used */
 			if (vflag &gt; 2) {
-				printf(&quot; flags:0x%lx&quot;,
-				    (unsigned long)ntohl(gnba-&gt;flags));
+				printf(&quot; flags:0x%x&quot;,
+				    EXTRACT_32BITS(&amp;gnba-&gt;flags));
 			}
 
 			s = (const char *)&amp;gnba-&gt;addr;
@@ -414,21 +414,21 @@ lwres_print(register const u_char *bp, u_int length)
 
 			/* BIND910: not used */
 			if (vflag &gt; 2) {
-				printf(&quot; flags:0x%lx&quot;,
-				    (unsigned long)ntohl(grbn-&gt;flags));
+				printf(&quot; flags:0x%x&quot;,
+				    EXTRACT_32BITS(&amp;grbn-&gt;flags));
 			}
 
 			printf(&quot; %s&quot;, tok2str(ns_type2str, &quot;Type%d&quot;,
-			    ntohs(grbn-&gt;rdtype)));
-			if (ntohs(grbn-&gt;rdclass) != C_IN) {
+			    EXTRACT_16BITS(&amp;grbn-&gt;rdtype)));
+			if (EXTRACT_16BITS(&amp;grbn-&gt;rdclass) != C_IN) {
 				printf(&quot; %s&quot;, tok2str(ns_class2str, &quot;Class%d&quot;,
-				    ntohs(grbn-&gt;rdclass)));
+				    EXTRACT_16BITS(&amp;grbn-&gt;rdclass)));
 			}
 
 			/* XXX grbn points to packed struct */
 			s = (const char *)&amp;grbn-&gt;namelen +
 			    sizeof(grbn-&gt;namelen);
-			l = ntohs(gabn-&gt;namelen);
+			l = EXTRACT_16BITS(&amp;gabn-&gt;namelen);
 
 			advance = lwres_printname(l, s);
 			if (advance &lt; 0)
@@ -453,7 +453,7 @@ lwres_print(register const u_char *bp, u_int length)
 		gnba = NULL;
 		grbn = NULL;
 
-		switch (ntohl(np-&gt;opcode)) {
+		switch (EXTRACT_32BITS(&amp;np-&gt;opcode)) {
 		case LWRES_OPCODE_NOOP:
 			break;
 		case LWRES_OPCODE_GETADDRSBYNAME:
@@ -462,16 +462,16 @@ lwres_print(register const u_char *bp, u_int length)
 			/* XXX gabn points to packed struct */
 			s = (const char *)&amp;gabn-&gt;realnamelen +
 			    sizeof(gabn-&gt;realnamelen);
-			l = ntohs(gabn-&gt;realnamelen);
+			l = EXTRACT_16BITS(&amp;gabn-&gt;realnamelen);
 
 			/* BIND910: not used */
 			if (vflag &gt; 2) {
-				printf(&quot; flags:0x%lx&quot;,
-				    (unsigned long)ntohl(gabn-&gt;flags));
+				printf(&quot; flags:0x%x&quot;,
+				    EXTRACT_32BITS(&amp;gabn-&gt;flags));
 			}
 
-			printf(&quot; %u/%u&quot;, ntohs(gabn-&gt;naliases),
-			    ntohs(gabn-&gt;naddrs));
+			printf(&quot; %u/%u&quot;, EXTRACT_16BITS(&amp;gabn-&gt;naliases),
+			    EXTRACT_16BITS(&amp;gabn-&gt;naddrs));
 
 			advance = lwres_printname(l, s);
 			if (advance &lt; 0)
@@ -479,7 +479,7 @@ lwres_print(register const u_char *bp, u_int length)
 			s += advance;
 
 			/* aliases */
-			na = ntohs(gabn-&gt;naliases);
+			na = EXTRACT_16BITS(&amp;gabn-&gt;naliases);
 			for (i = 0; i &lt; na; i++) {
 				advance = lwres_printnamelen(s);
 				if (advance &lt; 0)
@@ -488,7 +488,7 @@ lwres_print(register const u_char *bp, u_int length)
 			}
 
 			/* addrs */
-			na = ntohs(gabn-&gt;naddrs);
+			na = EXTRACT_16BITS(&amp;gabn-&gt;naddrs);
 			for (i = 0; i &lt; na; i++) {
 				advance = lwres_printaddr((lwres_addr_t *)s);
 				if (advance &lt; 0)
@@ -502,15 +502,15 @@ lwres_print(register const u_char *bp, u_int length)
 			/* XXX gnba points to packed struct */
 			s = (const char *)&amp;gnba-&gt;realnamelen +
 			    sizeof(gnba-&gt;realnamelen);
-			l = ntohs(gnba-&gt;realnamelen);
+			l = EXTRACT_16BITS(&amp;gnba-&gt;realnamelen);
 
 			/* BIND910: not used */
 			if (vflag &gt; 2) {
-				printf(&quot; flags:0x%lx&quot;,
-				    (unsigned long)ntohl(gnba-&gt;flags));
+				printf(&quot; flags:0x%x&quot;,
+				    EXTRACT_32BITS(&amp;gnba-&gt;flags));
 			}
 
-			printf(&quot; %u&quot;, ntohs(gnba-&gt;naliases));
+			printf(&quot; %u&quot;, EXTRACT_16BITS(&amp;gnba-&gt;naliases));
 
 			advance = lwres_printname(l, s);
 			if (advance &lt; 0)
@@ -518,7 +518,7 @@ lwres_print(register const u_char *bp, u_int length)
 			s += advance;
 
 			/* aliases */
-			na = ntohs(gnba-&gt;naliases);
+			na = EXTRACT_16BITS(&amp;gnba-&gt;naliases);
 			for (i = 0; i &lt; na; i++) {
 				advance = lwres_printnamelen(s);
 				if (advance &lt; 0)
@@ -533,20 +533,20 @@ lwres_print(register const u_char *bp, u_int length)
 
 			/* BIND910: not used */
 			if (vflag &gt; 2) {
-				printf(&quot; flags:0x%lx&quot;,
-				    (unsigned long)ntohl(grbn-&gt;flags));
+				printf(&quot; flags:0x%x&quot;,
+				    EXTRACT_32BITS(&amp;grbn-&gt;flags));
 			}
 
 			printf(&quot; %s&quot;, tok2str(ns_type2str, &quot;Type%d&quot;,
-			    ntohs(grbn-&gt;rdtype)));
-			if (ntohs(grbn-&gt;rdclass) != C_IN) {
+			    EXTRACT_16BITS(&amp;grbn-&gt;rdtype)));
+			if (EXTRACT_16BITS(&amp;grbn-&gt;rdclass) != C_IN) {
 				printf(&quot; %s&quot;, tok2str(ns_class2str, &quot;Class%d&quot;,
-				    ntohs(grbn-&gt;rdclass)));
+				    EXTRACT_16BITS(&amp;grbn-&gt;rdclass)));
 			}
 			printf(&quot; TTL &quot;);
-			relts_print(ntohl(grbn-&gt;ttl));
-			printf(&quot; %u/%u&quot;, ntohs(grbn-&gt;nrdatas),
-			    ntohs(grbn-&gt;nsigs));
+			relts_print(EXTRACT_32BITS(&amp;grbn-&gt;ttl));
+			printf(&quot; %u/%u&quot;, EXTRACT_16BITS(&amp;grbn-&gt;nrdatas),
+			    EXTRACT_16BITS(&amp;grbn-&gt;nsigs));
 
 			/* XXX grbn points to packed struct */
 			s = (const char *)&amp;grbn-&gt;nsigs+ sizeof(grbn-&gt;nsigs);
@@ -557,7 +557,7 @@ lwres_print(register const u_char *bp, u_int length)
 			s += advance;
 
 			/* rdatas */
-			na = ntohs(grbn-&gt;nrdatas);
+			na = EXTRACT_16BITS(&amp;grbn-&gt;nrdatas);
 			for (i = 0; i &lt; na; i++) {
 				/* XXX should decode resource data */
 				advance = lwres_printbinlen(s);
@@ -567,7 +567,7 @@ lwres_print(register const u_char *bp, u_int length)
 			}
 
 			/* sigs */
-			na = ntohs(grbn-&gt;nsigs);
+			na = EXTRACT_16BITS(&amp;grbn-&gt;nsigs);
 			for (i = 0; i &lt; na; i++) {
 				/* XXX how should we print it? */
 				advance = lwres_printbinlen(s);
@@ -584,11 +584,11 @@ lwres_print(register const u_char *bp, u_int length)
 
   tail:
 	/* length mismatch */
-	if (ntohl(np-&gt;length) != length) {
-		printf(&quot; [len: %lu != %u]&quot;, (unsigned long)ntohl(np-&gt;length),
+	if (EXTRACT_32BITS(&amp;np-&gt;length) != length) {
+		printf(&quot; [len: %u != %u]&quot;, EXTRACT_32BITS(&amp;np-&gt;length),
 		    length);
 	}
-	if (!unsupported &amp;&amp; s &lt; (const char *)np + ntohl(np-&gt;length))
+	if (!unsupported &amp;&amp; s &lt; (const char *)np + EXTRACT_32BITS(&amp;np-&gt;length))
 		printf(&quot;[extra]&quot;);
 	return;
 </diff>
      <filename>print-lwres.c</filename>
    </modified>
    <modified>
      <diff>@@ -42,7 +42,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     &quot;@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.11 2002-11-09 17:19:28 itojun Exp $&quot;;
+     &quot;@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.12 2002-12-11 07:14:05 guy Exp $&quot;;
 #endif
 
 #include &lt;tcpdump-stdinc.h&gt;
@@ -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>
      <filename>print-mobile.c</filename>
    </modified>
    <modified>
      <diff>@@ -33,7 +33,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     &quot;@(#) $Header: /tcpdump/master/tcpdump/print-mobility.c,v 1.7 2002-11-13 09:35:51 guy Exp $&quot;;
+     &quot;@(#) $Header: /tcpdump/master/tcpdump/print-mobility.c,v 1.8 2002-12-11 07:14:05 guy Exp $&quot;;
 #endif
 
 #ifdef INET6
@@ -58,7 +58,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>
      <filename>print-mobility.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.97 2002-09-05 00:00:16 guy Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.98 2002-12-11 07:14:05 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -38,6 +38,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 #include &quot;nfs.h&quot;
 #include &quot;nfsfh.h&quot;
@@ -174,7 +175,7 @@ static int print_int64(const u_int32_t *dp, int how)
 #ifdef INT64_FORMAT
 	u_int64_t res;
 
-	res = ((u_int64_t)ntohl(dp[0]) &lt;&lt; 32) | (u_int64_t)ntohl(dp[1]);
+	res = ((u_int64_t)EXTRACT_32BITS(&amp;dp[0]) &lt;&lt; 32) | (u_int64_t)EXTRACT_32BITS(&amp;dp[1]);
 	switch (how) {
 	case SIGNED:
 		printf(INT64_FORMAT, res);
@@ -191,16 +192,16 @@ static int print_int64(const u_int32_t *dp, int how)
 #else
 	u_int32_t high;
 
-	high = (u_int32_t)ntohl(dp[0]);
+	high = EXTRACT_32BITS(&amp;dp[0]);
 
 	switch (how) {
 	case SIGNED:
 	case UNSIGNED:
 	case HEX:
 		if (high != 0)
-			printf(&quot;0x%x%08x&quot;, high, (u_int32_t)ntohl(dp[1]));
+			printf(&quot;0x%x%08x&quot;, high, EXTRACT_32BITS(&amp;dp[1]));
 		else
-			printf(&quot;0x%x&quot;, (u_int32_t)ntohl(dp[1]));
+			printf(&quot;0x%x&quot;, EXTRACT_32BITS(&amp;dp[1]));
 		break;
 	default:
 		return (0);
@@ -252,41 +253,61 @@ static const u_int32_t *
 parse_sattr3(const u_int32_t *dp, struct nfsv3_sattr *sa3)
 {
 	TCHECK(dp[0]);
-	if ((sa3-&gt;sa_modeset = ntohl(*dp++))) {
+	sa3-&gt;sa_modeset = EXTRACT_32BITS(dp);
+	dp++;
+	if (sa3-&gt;sa_modeset) {
 		TCHECK(dp[0]);
-		sa3-&gt;sa_mode = ntohl(*dp++);
+		sa3-&gt;sa_mode = EXTRACT_32BITS(dp);
+		dp++;
 	}
 
 	TCHECK(dp[0]);
-	if ((sa3-&gt;sa_uidset = ntohl(*dp++))) {
+	sa3-&gt;sa_uidset = EXTRACT_32BITS(dp);
+	dp++;
+	if (sa3-&gt;sa_uidset) {
 		TCHECK(dp[0]);
-		sa3-&gt;sa_uid = ntohl(*dp++);
+		sa3-&gt;sa_uid = EXTRACT_32BITS(dp);
+		dp++;
 	}
 
 	TCHECK(dp[0]);
-	if ((sa3-&gt;sa_gidset = ntohl(*dp++))) {
+	sa3-&gt;sa_gidset = EXTRACT_32BITS(dp);
+	dp++;
+	if (sa3-&gt;sa_gidset) {
 		TCHECK(dp[0]);
-		sa3-&gt;sa_gid = ntohl(*dp++);
+		sa3-&gt;sa_gid = EXTRACT_32BITS(dp);
+		dp++;
 	}
 
 	TCHECK(dp[0]);
-	if ((sa3-&gt;sa_sizeset = ntohl(*dp++))) {
+	sa3-&gt;sa_sizeset = EXTRACT_32BITS(dp);
+	dp++;
+	if (sa3-&gt;sa_sizeset) {
 		TCHECK(dp[0]);
-		sa3-&gt;sa_size = ntohl(*dp++);
+		sa3-&gt;sa_size = EXTRACT_32BITS(dp);
+		dp++;
 	}
 
 	TCHECK(dp[0]);
-	if ((sa3-&gt;sa_atimetype = ntohl(*dp++)) == NFSV3SATTRTIME_TOCLIENT) {
+	sa3-&gt;sa_atimetype = EXTRACT_32BITS(dp);
+	dp++;
+	if (sa3-&gt;sa_atimetype == NFSV3SATTRTIME_TOCLIENT) {
 		TCHECK(dp[1]);
-		sa3-&gt;sa_atime.nfsv3_sec = ntohl(*dp++);
-		sa3-&gt;sa_atime.nfsv3_nsec = ntohl(*dp++);
+		sa3-&gt;sa_atime.nfsv3_sec = EXTRACT_32BITS(dp);
+		dp++;
+		sa3-&gt;sa_atime.nfsv3_nsec = EXTRACT_32BITS(dp);
+		dp++;
 	}
 
 	TCHECK(dp[0]);
-	if ((sa3-&gt;sa_mtimetype = ntohl(*dp++)) == NFSV3SATTRTIME_TOCLIENT) {
+	sa3-&gt;sa_mtimetype = EXTRACT_32BITS(dp);
+	dp++;
+	if (sa3-&gt;sa_mtimetype == NFSV3SATTRTIME_TOCLIENT) {
 		TCHECK(dp[1]);
-		sa3-&gt;sa_mtime.nfsv3_sec = ntohl(*dp++);
-		sa3-&gt;sa_mtime.nfsv3_nsec = ntohl(*dp++);
+		sa3-&gt;sa_mtime.nfsv3_sec = EXTRACT_32BITS(dp);
+		dp++;
+		sa3-&gt;sa_mtime.nfsv3_nsec = EXTRACT_32BITS(dp);
+		dp++;
 	}
 
 	return dp;
@@ -329,15 +350,15 @@ nfsreply_print(register const u_char *bp, u_int length,
 	if (!nflag) {
 		strlcpy(srcid, &quot;nfs&quot;, sizeof(srcid));
 		snprintf(dstid, sizeof(dstid), &quot;%u&quot;,
-		    (u_int32_t)ntohl(rp-&gt;rm_xid));
+		    EXTRACT_32BITS(&amp;rp-&gt;rm_xid));
 	} else {
 		snprintf(srcid, sizeof(srcid), &quot;%u&quot;, NFS_PORT);
 		snprintf(dstid, sizeof(dstid), &quot;%u&quot;,
-		    (u_int32_t)ntohl(rp-&gt;rm_xid));
+		    EXTRACT_32BITS(&amp;rp-&gt;rm_xid));
 	}
 	print_nfsaddr(bp2, srcid, dstid);
 	(void)printf(&quot;reply %s %d&quot;,
-		     ntohl(rp-&gt;rm_reply.rp_stat) == MSG_ACCEPTED?
+		     EXTRACT_32BITS(&amp;rp-&gt;rm_reply.rp_stat) == MSG_ACCEPTED?
 			     &quot;ok&quot;:&quot;ERR&quot;,
 			     length);
 
@@ -360,11 +381,11 @@ parsereq(register const struct rpc_msg *rp, register u_int length)
 	 */
 	dp = (u_int32_t *)&amp;rp-&gt;rm_call.cb_cred;
 	TCHECK(dp[1]);
-	len = ntohl(dp[1]);
+	len = EXTRACT_32BITS(&amp;dp[1]);
 	if (len &lt; length) {
 		dp += (len + (2 * sizeof(*dp) + 3)) / sizeof(*dp);
 		TCHECK(dp[1]);
-		len = ntohl(dp[1]);
+		len = EXTRACT_32BITS(&amp;dp[1]);
 		if (len &lt; length) {
 			dp += (len + (2 * sizeof(*dp) + 3)) / sizeof(*dp);
 			TCHECK2(dp[0], 0);
@@ -382,11 +403,11 @@ trunc:
 static const u_int32_t *
 parsefh(register const u_int32_t *dp, int v3)
 {
-	int len;
+	u_int len;
 
 	if (v3) {
 		TCHECK(dp[0]);
-		len = (int)ntohl(*dp) / 4;
+		len = EXTRACT_32BITS(dp) / 4;
 		dp++;
 	} else
 		len = NFSX_V2FH / 4;
@@ -462,11 +483,11 @@ nfsreq_print(register const u_char *bp, u_int length,
 	rp = (const struct rpc_msg *)bp;
 	if (!nflag) {
 		snprintf(srcid, sizeof(srcid), &quot;%u&quot;,
-		    (u_int32_t)ntohl(rp-&gt;rm_xid));
+		    EXTRACT_32BITS(&amp;rp-&gt;rm_xid));
 		strlcpy(dstid, &quot;nfs&quot;, sizeof(dstid));
 	} else {
 		snprintf(srcid, sizeof(srcid), &quot;%u&quot;,
-		    (u_int32_t)ntohl(rp-&gt;rm_xid));
+		    EXTRACT_32BITS(&amp;rp-&gt;rm_xid));
 		snprintf(dstid, sizeof(dstid), &quot;%u&quot;, NFS_PORT);
 	}
 	print_nfsaddr(bp2, srcid, dstid);
@@ -474,8 +495,8 @@ nfsreq_print(register const u_char *bp, u_int length,
 
 	xid_map_enter(rp, bp2);	/* record proc number for later on */
 
-	v3 = (ntohl(rp-&gt;rm_call.cb_vers) == NFS_VER3);
-	proc = ntohl(rp-&gt;rm_call.cb_proc);
+	v3 = (EXTRACT_32BITS(&amp;rp-&gt;rm_call.cb_vers) == NFS_VER3);
+	proc = EXTRACT_32BITS(&amp;rp-&gt;rm_call.cb_proc);
 
 	if (!v3 &amp;&amp; proc &lt; NFS_NPROCS)
 		proc =  nfsv3_procid[proc];
@@ -514,7 +535,7 @@ nfsreq_print(register const u_char *bp, u_int length,
 		if ((dp = parsereq(rp, length)) != NULL &amp;&amp;
 		    (dp = parsefh(dp, v3)) != NULL) {
 			TCHECK(dp[0]);
-			printf(&quot; %04x&quot;, (u_int32_t)ntohl(dp[0]));
+			printf(&quot; %04x&quot;, EXTRACT_32BITS(&amp;dp[0]));
 			return;
 		}
 		break;
@@ -533,13 +554,13 @@ nfsreq_print(register const u_char *bp, u_int length,
 			if (v3) {
 				TCHECK(dp[2]);
 				printf(&quot; %u bytes @ &quot;,
-				       (u_int32_t) ntohl(dp[2]));
+				       EXTRACT_32BITS(&amp;dp[2]));
 				print_int64(dp, UNSIGNED);
 			} else {
 				TCHECK(dp[1]);
 				printf(&quot; %u bytes @ %u&quot;,
-				    (u_int32_t)ntohl(dp[1]),
-				    (u_int32_t)ntohl(dp[0]));
+				    EXTRACT_32BITS(&amp;dp[1]),
+				    EXTRACT_32BITS(&amp;dp[0]));
 			}
 			return;
 		}
@@ -552,22 +573,22 @@ nfsreq_print(register const u_char *bp, u_int length,
 			if (v3) {
 				TCHECK(dp[4]);
 				printf(&quot; %u bytes @ &quot;,
-						(u_int32_t) ntohl(dp[4]));
+						EXTRACT_32BITS(&amp;dp[4]));
 				print_int64(dp, UNSIGNED);
 				if (vflag) {
 					dp += 3;
 					TCHECK(dp[0]);
 					printf(&quot; &lt;%s&gt;&quot;,
 						tok2str(nfsv3_writemodes,
-							NULL, ntohl(*dp)));
+							NULL, EXTRACT_32BITS(dp)));
 				}
 			} else {
 				TCHECK(dp[3]);
 				printf(&quot; %u (%u) bytes @ %u (%u)&quot;,
-						(u_int32_t)ntohl(dp[3]),
-						(u_int32_t)ntohl(dp[2]),
-						(u_int32_t)ntohl(dp[1]),
-						(u_int32_t)ntohl(dp[0]));
+						EXTRACT_32BITS(&amp;dp[3]),
+						EXTRACT_32BITS(&amp;dp[2]),
+						EXTRACT_32BITS(&amp;dp[1]),
+						EXTRACT_32BITS(&amp;dp[0]));
 			}
 			return;
 		}
@@ -606,15 +627,16 @@ nfsreq_print(register const u_char *bp, u_int length,
 		if ((dp = parsereq(rp, length)) != 0 &amp;&amp;
 		    (dp = parsefhn(dp, v3)) != 0) {
 			TCHECK(*dp);
-			type = (nfs_type)ntohl(*dp++);
+			type = (nfs_type)EXTRACT_32BITS(dp);
+			dp++;
 			if ((dp = parse_sattr3(dp, &amp;sa3)) == 0)
 				break;
 			printf(&quot; %s&quot;, tok2str(type2str, &quot;unk-ft %d&quot;, type));
 			if (vflag &amp;&amp; (type == NFCHR || type == NFBLK)) {
 				TCHECK(dp[1]);
 				printf(&quot; %u/%u&quot;,
-				       (u_int32_t)ntohl(dp[0]),
-				       (u_int32_t)ntohl(dp[1]));
+				       EXTRACT_32BITS(&amp;dp[0]),
+				       EXTRACT_32BITS(&amp;dp[1]));
 				dp += 2;
 			}
 			if (vflag)
@@ -668,7 +690,7 @@ nfsreq_print(register const u_char *bp, u_int length,
 				 * offset cookie here.
 				 */
 				printf(&quot; %u bytes @ &quot;,
-				    (u_int32_t) ntohl(dp[4]));
+				    EXTRACT_32BITS(&amp;dp[4]));
 				print_int64(dp, SIGNED);
 				if (vflag)
 					printf(&quot; verf %08x%08x&quot;, dp[2],
@@ -680,8 +702,8 @@ nfsreq_print(register const u_char *bp, u_int length,
 				 * common, but offsets &gt; 2^31 aren't.
 				 */
 				printf(&quot; %u bytes @ %d&quot;,
-				    (u_int32_t)ntohl(dp[1]),
-				    (u_int32_t)ntohl(dp[0]));
+				    EXTRACT_32BITS(&amp;dp[1]),
+				    EXTRACT_32BITS(&amp;dp[0]));
 			}
 			return;
 		}
@@ -696,11 +718,11 @@ nfsreq_print(register const u_char *bp, u_int length,
 			 * We don't try to interpret the offset
 			 * cookie here.
 			 */
-			printf(&quot; %u bytes @ &quot;, (u_int32_t) ntohl(dp[4]));
+			printf(&quot; %u bytes @ &quot;, EXTRACT_32BITS(&amp;dp[4]));
 			print_int64(dp, SIGNED);
 			if (vflag)
 				printf(&quot; max %u verf %08x%08x&quot;,
-				       (u_int32_t) ntohl(dp[5]), dp[2], dp[3]);
+				       EXTRACT_32BITS(&amp;dp[5]), dp[2], dp[3]);
 			return;
 		}
 		break;
@@ -730,14 +752,14 @@ nfsreq_print(register const u_char *bp, u_int length,
 		printf(&quot; commit&quot;);
 		if ((dp = parsereq(rp, length)) != NULL &amp;&amp;
 		    (dp = parsefh(dp, v3)) != NULL) {
-			printf(&quot; %u bytes @ &quot;, (u_int32_t) ntohl(dp[2]));
+			printf(&quot; %u bytes @ &quot;, EXTRACT_32BITS(&amp;dp[2]));
 			print_int64(dp, UNSIGNED);
 			return;
 		}
 		break;
 
 	default:
-		printf(&quot; proc-%u&quot;, (u_int32_t)ntohl(rp-&gt;rm_call.cb_proc));
+		printf(&quot; proc-%u&quot;, EXTRACT_32BITS(&amp;rp-&gt;rm_call.cb_proc));
 		return;
 	}
 
@@ -876,8 +898,8 @@ xid_map_enter(const struct rpc_msg *rp, const u_char *bp)
 		memcpy(&amp;xmep-&gt;server, &amp;ip6-&gt;ip6_dst, sizeof(ip6-&gt;ip6_dst));
 	}
 #endif
-	xmep-&gt;proc = ntohl(rp-&gt;rm_call.cb_proc);
-	xmep-&gt;vers = ntohl(rp-&gt;rm_call.cb_vers);
+	xmep-&gt;proc = EXTRACT_32BITS(&amp;rp-&gt;rm_call.cb_proc);
+	xmep-&gt;vers = EXTRACT_32BITS(&amp;rp-&gt;rm_call.cb_vers);
 }
 
 /*
@@ -975,7 +997,7 @@ parserep(register const struct rpc_msg *rp, register u_int length)
 	 */
 	dp = ((const u_int32_t *)&amp;rp-&gt;rm_reply) + 1;
 	TCHECK(dp[1]);
-	len = ntohl(dp[1]);
+	len = EXTRACT_32BITS(&amp;dp[1]);
 	if (len &gt;= length)
 		return (NULL);
 	/*
@@ -987,7 +1009,7 @@ parserep(register const struct rpc_msg *rp, register u_int length)
 	/*
 	 * now we can check the ar_stat field
 	 */
-	astat = ntohl(*(enum accept_stat *)dp);
+	astat = EXTRACT_32BITS(dp);
 	switch (astat) {
 
 	case SUCCESS:
@@ -1037,7 +1059,7 @@ parsestatus(const u_int32_t *dp, int *er)
 
 	TCHECK(dp[0]);
 
-	errnum = ntohl(dp[0]);
+	errnum = EXTRACT_32BITS(&amp;dp[0]);
 	if (er)
 		*er = errnum;
 	if (errnum != 0) {
@@ -1061,10 +1083,10 @@ parsefattr(const u_int32_t *dp, int verbose, int v3)
 	if (verbose) {
 		printf(&quot; %s %o ids %d/%d&quot;,
 		    tok2str(type2str, &quot;unk-ft %d &quot;,
-		    (u_int32_t)ntohl(fap-&gt;fa_type)),
-		    (u_int32_t)ntohl(fap-&gt;fa_mode),
-		    (u_int32_t)ntohl(fap-&gt;fa_uid),
-		    (u_int32_t) ntohl(fap-&gt;fa_gid));
+		    EXTRACT_32BITS(&amp;fap-&gt;fa_type)),
+		    EXTRACT_32BITS(&amp;fap-&gt;fa_mode),
+		    EXTRACT_32BITS(&amp;fap-&gt;fa_uid),
+		    EXTRACT_32BITS(&amp;fap-&gt;fa_gid));
 		if (v3) {
 			TCHECK(fap-&gt;fa3_size);
 			printf(&quot; sz &quot;);
@@ -1072,7 +1094,7 @@ parsefattr(const u_int32_t *dp, int verbose, int v3)
 			putchar(' ');
 		} else {
 			TCHECK(fap-&gt;fa2_size);
-			printf(&quot; sz %d &quot;, (u_int32_t) ntohl(fap-&gt;fa2_size));
+			printf(&quot; sz %d &quot;, EXTRACT_32BITS(&amp;fap-&gt;fa2_size));
 		}
 	}
 	/* print lots more stuff */
@@ -1080,38 +1102,38 @@ parsefattr(const u_int32_t *dp, int verbose, int v3)
 		if (v3) {
 			TCHECK(fap-&gt;fa3_ctime);
 			printf(&quot;nlink %d rdev %d/%d &quot;,
-			       (u_int32_t)ntohl(fap-&gt;fa_nlink),
-			       (u_int32_t) ntohl(fap-&gt;fa3_rdev.specdata1),
-			       (u_int32_t) ntohl(fap-&gt;fa3_rdev.specdata2));
+			       EXTRACT_32BITS(&amp;fap-&gt;fa_nlink),
+			       EXTRACT_32BITS(&amp;fap-&gt;fa3_rdev.specdata1),
+			       EXTRACT_32BITS(&amp;fap-&gt;fa3_rdev.specdata2));
 			printf(&quot;fsid &quot;);
 			print_int64((u_int32_t *)&amp;fap-&gt;fa3_fsid, HEX);
 			printf(&quot; nodeid &quot;);
 			print_int64((u_int32_t *)&amp;fap-&gt;fa3_fileid, HEX);
 			printf(&quot; a/m/ctime %u.%06u &quot;,
-			       (u_int32_t) ntohl(fap-&gt;fa3_atime.nfsv3_sec),
-			       (u_int32_t) ntohl(fap-&gt;fa3_atime.nfsv3_nsec));
+			       EXTRACT_32BITS(&amp;fap-&gt;fa3_atime.nfsv3_sec),
+			       EXTRACT_32BITS(&amp;fap-&gt;fa3_atime.nfsv3_nsec));
 			printf(&quot;%u.%06u &quot;,
-			       (u_int32_t) ntohl(fap-&gt;fa3_mtime.nfsv3_sec),
-			       (u_int32_t) ntohl(fap-&gt;fa3_mtime.nfsv3_nsec));
+			       EXTRACT_32BITS(&amp;fap-&gt;fa3_mtime.nfsv3_sec),
+			       EXTRACT_32BITS(&amp;fap-&gt;fa3_mtime.nfsv3_nsec));
 			printf(&quot;%u.%06u &quot;,
-			       (u_int32_t) ntohl(fap-&gt;fa3_ctime.nfsv3_sec),
-			       (u_int32_t) ntohl(fap-&gt;fa3_ctime.nfsv3_nsec));
+			       EXTRACT_32BITS(&amp;fap-&gt;fa3_ctime.nfsv3_sec),
+			       EXTRACT_32BITS(&amp;fap-&gt;fa3_ctime.nfsv3_nsec));
 		} else {
 			TCHECK(fap-&gt;fa2_ctime);
 			printf(&quot;nlink %d rdev %x fsid %x nodeid %x a/m/ctime &quot;,
-			       (u_int32_t) ntohl(fap-&gt;fa_nlink),
-			       (u_int32_t) ntohl(fap-&gt;fa2_rdev),
-			       (u_int32_t) ntohl(fap-&gt;fa2_fsid),
-			       (u_int32_t) ntohl(fap-&gt;fa2_fileid));
+			       EXTRACT_32BITS(&amp;fap-&gt;fa_nlink),
+			       EXTRACT_32BITS(&amp;fap-&gt;fa2_rdev),
+			       EXTRACT_32BITS(&amp;fap-&gt;fa2_fsid),
+			       EXTRACT_32BITS(&amp;fap-&gt;fa2_fileid));
 			printf(&quot;%u.%06u &quot;,
-			       (u_int32_t) ntohl(fap-&gt;fa2_atime.nfsv2_sec),
-			       (u_int32_t) ntohl(fap-&gt;fa2_atime.nfsv2_usec));
+			       EXTRACT_32BITS(&amp;fap-&gt;fa2_atime.nfsv2_sec),
+			       EXTRACT_32BITS(&amp;fap-&gt;fa2_atime.nfsv2_usec));
 			printf(&quot;%u.%06u &quot;,
-			       (u_int32_t) ntohl(fap-&gt;fa2_mtime.nfsv2_sec),
-			       (u_int32_t) ntohl(fap-&gt;fa2_mtime.nfsv2_usec));
+			       EXTRACT_32BITS(&amp;fap-&gt;fa2_mtime.nfsv2_sec),
+			       EXTRACT_32BITS(&amp;fap-&gt;fa2_mtime.nfsv2_usec));
 			printf(&quot;%u.%06u &quot;,
-			       (u_int32_t) ntohl(fap-&gt;fa2_ctime.nfsv2_sec),
-			       (u_int32_t) ntohl(fap-&gt;fa2_ctime.nfsv2_usec));
+			       EXTRACT_32BITS(&amp;fap-&gt;fa2_ctime.nfsv2_sec),
+			       EXTRACT_32BITS(&amp;fap-&gt;fa2_ctime.nfsv2_usec));
 		}
 	}
 	return ((const u_int32_t *)((unsigned char *)dp +
@@ -1208,15 +1230,15 @@ parsestatfs(const u_int32_t *dp, int v3)
 			printf(&quot; afiles &quot;);
 			print_int64((u_int32_t *)&amp;sfsp-&gt;sf_afiles, UNSIGNED);
 			printf(&quot; invar %u&quot;,
-			       (u_int32_t) ntohl(sfsp-&gt;sf_invarsec));
+			       EXTRACT_32BITS(&amp;sfsp-&gt;sf_invarsec));
 		}
 	} else {
 		printf(&quot; tsize %d bsize %d blocks %d bfree %d bavail %d&quot;,
-			(u_int32_t)ntohl(sfsp-&gt;sf_tsize),
-			(u_int32_t)ntohl(sfsp-&gt;sf_bsize),
-			(u_int32_t)ntohl(sfsp-&gt;sf_blocks),
-			(u_int32_t)ntohl(sfsp-&gt;sf_bfree),
-			(u_int32_t)ntohl(sfsp-&gt;sf_bavail));
+			EXTRACT_32BITS(&amp;sfsp-&gt;sf_tsize),
+			EXTRACT_32BITS(&amp;sfsp-&gt;sf_bsize),
+			EXTRACT_32BITS(&amp;sfsp-&gt;sf_blocks),
+			EXTRACT_32BITS(&amp;sfsp-&gt;sf_bfree),
+			EXTRACT_32BITS(&amp;sfsp-&gt;sf_bavail));
 	}
 
 	return (1);
@@ -1239,7 +1261,7 @@ parserddires(const u_int32_t *dp)
 
 	TCHECK(dp[2]);
 	printf(&quot; offset %x size %d &quot;,
-	       (u_int32_t)ntohl(dp[0]), (u_int32_t)ntohl(dp[1]));
+	       EXTRACT_32BITS(&amp;dp[0]), EXTRACT_32BITS(&amp;dp[1]));
 	if (dp[2] != 0)
 		printf(&quot; eof&quot;);
 
@@ -1254,8 +1276,8 @@ parse_wcc_attr(const u_int32_t *dp)
 	printf(&quot; sz &quot;);
 	print_int64(dp, UNSIGNED);
 	printf(&quot; mtime %u.%06u ctime %u.%06u&quot;,
-	       (u_int32_t)ntohl(dp[2]), (u_int32_t)ntohl(dp[3]),
-	       (u_int32_t)ntohl(dp[4]), (u_int32_t)ntohl(dp[5]));
+	       EXTRACT_32BITS(&amp;dp[2]), EXTRACT_32BITS(&amp;dp[3]),
+	       EXTRACT_32BITS(&amp;dp[4]), EXTRACT_32BITS(&amp;dp[5]));
 	return (dp + 6);
 }
 
@@ -1266,7 +1288,7 @@ static const u_int32_t *
 parse_pre_op_attr(const u_int32_t *dp, int verbose)
 {
 	TCHECK(dp[0]);
-	if (!ntohl(dp[0]))
+	if (!EXTRACT_32BITS(&amp;dp[0]))
 		return (dp + 1);
 	dp++;
 	TCHECK2(*dp, 24);
@@ -1287,7 +1309,7 @@ static const u_int32_t *
 parse_post_op_attr(const u_int32_t *dp, int verbose)
 {
 	TCHECK(dp[0]);
-	if (!ntohl(dp[0]))
+	if (!EXTRACT_32BITS(&amp;dp[0]))
 		return (dp + 1);
 	dp++;
 	if (verbose) {
@@ -1322,7 +1344,7 @@ parsecreateopres(const u_int32_t *dp, int verbose)
 		dp = parse_wcc_data(dp, verbose);
 	else {
 		TCHECK(dp[0]);
-		if (!ntohl(dp[0]))
+		if (!EXTRACT_32BITS(&amp;dp[0]))
 			return (dp + 1);
 		dp++;
 		if (!(dp = parsefh(dp, 1)))
@@ -1392,19 +1414,19 @@ parsefsinfo(const u_int32_t *dp)
 	sfp = (struct nfsv3_fsinfo *)dp;
 	TCHECK(*sfp);
 	printf(&quot; rtmax %u rtpref %u wtmax %u wtpref %u dtpref %u&quot;,
-	       (u_int32_t) ntohl(sfp-&gt;fs_rtmax),
-	       (u_int32_t) ntohl(sfp-&gt;fs_rtpref),
-	       (u_int32_t) ntohl(sfp-&gt;fs_wtmax),
-	       (u_int32_t) ntohl(sfp-&gt;fs_wtpref),
-	       (u_int32_t) ntohl(sfp-&gt;fs_dtpref));
+	       EXTRACT_32BITS(&amp;sfp-&gt;fs_rtmax),
+	       EXTRACT_32BITS(&amp;sfp-&gt;fs_rtpref),
+	       EXTRACT_32BITS(&amp;sfp-&gt;fs_wtmax),
+	       EXTRACT_32BITS(&amp;sfp-&gt;fs_wtpref),
+	       EXTRACT_32BITS(&amp;sfp-&gt;fs_dtpref));
 	if (vflag) {
 		printf(&quot; rtmult %u wtmult %u maxfsz &quot;,
-		       (u_int32_t) ntohl(sfp-&gt;fs_rtmult),
-		       (u_int32_t) ntohl(sfp-&gt;fs_wtmult));
+		       EXTRACT_32BITS(&amp;sfp-&gt;fs_rtmult),
+		       EXTRACT_32BITS(&amp;sfp-&gt;fs_wtmult));
 		print_int64((u_int32_t *)&amp;sfp-&gt;fs_maxfilesize, UNSIGNED);
 		printf(&quot; delta %u.%06u &quot;,
-		       (u_int32_t) ntohl(sfp-&gt;fs_timedelta.nfsv3_sec),
-		       (u_int32_t) ntohl(sfp-&gt;fs_timedelta.nfsv3_nsec));
+		       EXTRACT_32BITS(&amp;sfp-&gt;fs_timedelta.nfsv3_sec),
+		       EXTRACT_32BITS(&amp;sfp-&gt;fs_timedelta.nfsv3_nsec));
 	}
 	return (1);
 trunc:
@@ -1430,12 +1452,12 @@ parsepathconf(const u_int32_t *dp)
 	TCHECK(*spp);
 
 	printf(&quot; linkmax %u namemax %u %s %s %s %s&quot;,
-	       (u_int32_t) ntohl(spp-&gt;pc_linkmax),
-	       (u_int32_t) ntohl(spp-&gt;pc_namemax),
-	       ntohl(spp-&gt;pc_notrunc) ? &quot;notrunc&quot; : &quot;&quot;,
-	       ntohl(spp-&gt;pc_chownrestricted) ? &quot;chownres&quot; : &quot;&quot;,
-	       ntohl(spp-&gt;pc_caseinsensitive) ? &quot;igncase&quot; : &quot;&quot;,
-	       ntohl(spp-&gt;pc_casepreserving) ? &quot;keepcase&quot; : &quot;&quot;);
+	       EXTRACT_32BITS(&amp;spp-&gt;pc_linkmax),
+	       EXTRACT_32BITS(&amp;spp-&gt;pc_namemax),
+	       EXTRACT_32BITS(&amp;spp-&gt;pc_notrunc) ? &quot;notrunc&quot; : &quot;&quot;,
+	       EXTRACT_32BITS(&amp;spp-&gt;pc_chownrestricted) ? &quot;chownres&quot; : &quot;&quot;,
+	       EXTRACT_32BITS(&amp;spp-&gt;pc_caseinsensitive) ? &quot;igncase&quot; : &quot;&quot;,
+	       EXTRACT_32BITS(&amp;spp-&gt;pc_casepreserving) ? &quot;keepcase&quot; : &quot;&quot;);
 	return (1);
 trunc:
 	return (0);
@@ -1523,7 +1545,7 @@ interp_reply(const struct rpc_msg *rp, u_int32_t proc, u_int32_t vers, int lengt
 		if (!(dp = parse_post_op_attr(dp, vflag)))
 			break;
 		if (!er)
-			printf(&quot; c %04x&quot;, (u_int32_t)ntohl(dp[0]));
+			printf(&quot; c %04x&quot;, EXTRACT_32BITS(&amp;dp[0]));
 		return;
 
 	case NFSPROC_READLINK:
@@ -1546,8 +1568,8 @@ interp_reply(const struct rpc_msg *rp, u_int32_t proc, u_int32_t vers, int lengt
 				return;
 			if (vflag) {
 				TCHECK(dp[1]);
-				printf(&quot;%u bytes&quot;, (u_int32_t) ntohl(dp[0]));
-				if (ntohl(dp[1]))
+				printf(&quot;%u bytes&quot;, EXTRACT_32BITS(&amp;dp[0]));
+				if (EXTRACT_32BITS(&amp;dp[1]))
 					printf(&quot; EOF&quot;);
 			}
 			return;
@@ -1570,12 +1592,12 @@ interp_reply(const struct rpc_msg *rp, u_int32_t proc, u_int32_t vers, int lengt
 				return;
 			if (vflag) {
 				TCHECK(dp[0]);
-				printf(&quot;%u bytes&quot;, (u_int32_t) ntohl(dp[0]));
+				printf(&quot;%u bytes&quot;, EXTRACT_32BITS(&amp;dp[0]));
 				if (vflag &gt; 1) {
 					TCHECK(dp[1]);
 					printf(&quot; &lt;%s&gt;&quot;,
 						tok2str(nfsv3_writemodes,
-							NULL, ntohl(dp[1])));
+							NULL, EXTRACT_32BITS(&amp;dp[1])));
 				}
 				return;
 			}</diff>
      <filename>print-nfs.c</filename>
    </modified>
    <modified>
      <diff>@@ -25,7 +25,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ntp.c,v 1.34 2002-08-01 08:53:21 risso Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ntp.c,v 1.35 2002-12-11 07:14:06 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -39,6 +39,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 #ifdef MODEMASK
 #undef MODEMASK					/* Solaris sucks */
 #endif
@@ -197,8 +198,8 @@ p_sfix(register const struct s_fixedpt *sfp)
 	register int f;
 	register float ff;
 
-	i = ntohs(sfp-&gt;int_part);
-	f = ntohs(sfp-&gt;fraction);
+	i = EXTRACT_16BITS(&amp;sfp-&gt;int_part);
+	f = EXTRACT_16BITS(&amp;sfp-&gt;fraction);
 	ff = f / 65536.0;	/* shift radix point by 16 bits */
 	f = ff * 1000000.0;	/* Treat fraction as parts per million */
 	printf(&quot;%d.%06d&quot;, i, f);
@@ -214,8 +215,8 @@ p_ntp_time(register const struct l_fixedpt *lfp)
 	register u_int32_t f;
 	register float ff;
 
-	i = ntohl(lfp-&gt;int_part);
-	uf = ntohl(lfp-&gt;fraction);
+	i = EXTRACT_32BITS(&amp;lfp-&gt;int_part);
+	uf = EXTRACT_32BITS(&amp;lfp-&gt;fraction);
 	ff = uf;
 	if (ff &lt; 0.0)		/* some compilers are buggy */
 		ff += FMAXINT;
@@ -236,10 +237,10 @@ p_ntp_delta(register const struct l_fixedpt *olfp,
 	register float ff;
 	int signbit;
 
-	i = ntohl(lfp-&gt;int_part) - ntohl(olfp-&gt;int_part);
+	i = EXTRACT_32BITS(&amp;lfp-&gt;int_part) - EXTRACT_32BITS(&amp;olfp-&gt;int_part);
 
-	uf = ntohl(lfp-&gt;fraction);
-	ouf = ntohl(olfp-&gt;fraction);
+	uf = EXTRACT_32BITS(&amp;lfp-&gt;fraction);
+	ouf = EXTRACT_32BITS(&amp;olfp-&gt;fraction);
 
 	if (i &gt; 0) {		/* new is definitely greater than old */
 		signbit = 0;</diff>
      <filename>print-ntp.c</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.34 2002-11-10 20:41:33 guy Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.35 2002-12-11 07:14:06 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -36,6 +36,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 #include &quot;ospf.h&quot;
 
@@ -112,8 +113,8 @@ ospf_print_lshdr(register const struct lsa_hdr *lshp) {
                lshp-&gt;ls_type,
                ipaddr_string(&amp;lshp-&gt;ls_stateid),
                ipaddr_string(&amp;lshp-&gt;ls_router),
-               (u_int32_t)ntohl(lshp-&gt;ls_seq),
-               ntohs(lshp-&gt;ls_age));
+               EXTRACT_32BITS(&amp;lshp-&gt;ls_seq),
+               EXTRACT_16BITS(&amp;lshp-&gt;ls_age));
         printf(&quot;\n\t    Options: %s&quot;, bittok2str(ospf_option_values,&quot;none&quot;,lshp-&gt;ls_options));
 
 	return (0);
@@ -141,12 +142,12 @@ ospf_print_lsa(register const struct lsa *lsap)
                lsap-&gt;ls_hdr.ls_type,
                ipaddr_string(&amp;lsap-&gt;ls_hdr.ls_stateid),
                ipaddr_string(&amp;lsap-&gt;ls_hdr.ls_router),
-               (u_int32_t)ntohl(lsap-&gt;ls_hdr.ls_seq),
-               ntohs(lsap-&gt;ls_hdr.ls_age));
+               EXTRACT_32BITS(&amp;lsap-&gt;ls_hdr.ls_seq),
+               EXTRACT_16BITS(&amp;lsap-&gt;ls_hdr.ls_age));
         printf(&quot;\n\t    Options: %s&quot;, bittok2str(ospf_option_values,&quot;none&quot;,lsap-&gt;ls_hdr.ls_options));
 
 	TCHECK(lsap-&gt;ls_hdr.ls_length);
-	ls_end = (u_char *)lsap + ntohs(lsap-&gt;ls_hdr.ls_length);
+	ls_end = (u_char *)lsap + EXTRACT_16BITS(&amp;lsap-&gt;ls_hdr.ls_length);
 	switch (lsap-&gt;ls_hdr.ls_type) {
 
 	case LS_TYPE_ROUTER:
@@ -154,7 +155,7 @@ ospf_print_lsa(register const struct lsa *lsap)
                 printf(&quot;\n\t    Router LSA Options: %s&quot;, bittok2str(ospf_rla_flag_values,&quot;unknown (%u)&quot;,lsap-&gt;lsa_un.un_rla.rla_flags));
 
 		TCHECK(lsap-&gt;lsa_un.un_rla.rla_count);
-		j = ntohs(lsap-&gt;lsa_un.un_rla.rla_count);
+		j = EXTRACT_16BITS(&amp;lsap-&gt;lsa_un.un_rla.rla_count);
 		TCHECK(lsap-&gt;lsa_un.un_rla.rla_link);
 		rlp = lsap-&gt;lsa_un.un_rla.rla_link;
 		while (j--) {
@@ -190,14 +191,14 @@ ospf_print_lsa(register const struct lsa *lsap)
 				    rlp-&gt;link_type);
 				return (0);
 			}
-			printf(&quot;, tos 0, metric: %d&quot;, ntohs(rlp-&gt;link_tos0metric));
+			printf(&quot;, tos 0, metric: %d&quot;, EXTRACT_16BITS(&amp;rlp-&gt;link_tos0metric));
 			tosp = (struct tos_metric *)
 			    ((sizeof rlp-&gt;link_tos0metric) + (u_char *) rlp);
 			for (k = 0; k &lt; (int) rlp-&gt;link_toscount; ++k, ++tosp) {
 				TCHECK(*tosp);
 				printf(&quot;, tos %d, metric: %d&quot;,
 				    tosp-&gt;tos_type,
-				    ntohs(tosp-&gt;tos_metric));
+				    EXTRACT_16BITS(&amp;tosp-&gt;tos_metric));
 			}
 			rlp = (struct rlalink *)((u_char *)(rlp + 1) +
 			    ((rlp-&gt;link_toscount) * sizeof(*tosp)));
@@ -224,14 +225,14 @@ ospf_print_lsa(register const struct lsa *lsap)
 		lp = lsap-&gt;lsa_un.un_sla.sla_tosmetric;
                 /* suppress tos if its not supported */
                 if(!((lsap-&gt;ls_hdr.ls_options)&amp;OSPF_OPTION_T)) {
-                    printf(&quot;, metric: %u&quot;, (u_int32_t)ntohl(*lp)&amp;SLA_MASK_METRIC);
+                    printf(&quot;, metric: %u&quot;, EXTRACT_32BITS(lp)&amp;SLA_MASK_METRIC);
                     break;
                 }
 		while ((u_char *)lp &lt; ls_end) {
 			register u_int32_t ul;
 
 			TCHECK(*lp);
-			ul = ntohl(*lp);
+			ul = EXTRACT_32BITS(lp);
 			printf(&quot;, tos %d metric %d&quot;,
 			    (ul &amp; SLA_MASK_TOS) &gt;&gt; SLA_SHIFT_TOS,
 			    ul &amp; SLA_MASK_METRIC);
@@ -244,14 +245,14 @@ ospf_print_lsa(register const struct lsa *lsap)
 		lp = lsap-&gt;lsa_un.un_sla.sla_tosmetric;
                 /* suppress tos if its not supported */
                 if(!((lsap-&gt;ls_hdr.ls_options)&amp;OSPF_OPTION_T)) {
-                    printf(&quot;, metric: %u&quot;, (u_int32_t)ntohl(*lp)&amp;SLA_MASK_METRIC);
+                    printf(&quot;, metric: %u&quot;, EXTRACT_32BITS(lp)&amp;SLA_MASK_METRIC);
                     break;
                 }
 		while ((u_char *)lp &lt; ls_end) {
 			register u_int32_t ul;
 
 			TCHECK(*lp);
-			ul = ntohl(*lp);
+			ul = EXTRACT_32BITS(lp);
 			printf(&quot;, tos %d metric %d&quot;,
 			    (ul &amp; SLA_MASK_TOS) &gt;&gt; SLA_SHIFT_TOS,
 			    ul &amp; SLA_MASK_METRIC);
@@ -270,7 +271,7 @@ ospf_print_lsa(register const struct lsa *lsap)
 			register u_int32_t ul;
 
 			TCHECK(almp-&gt;asla_tosmetric);
-			ul = ntohl(almp-&gt;asla_tosmetric);
+			ul = EXTRACT_32BITS(&amp;almp-&gt;asla_tosmetric);
 			printf(&quot;, type %d, tos %d metric:&quot;,
 			    (ul &amp; ASLA_FLAG_EXTERNAL) ? 2 : 1,
 			    (ul &amp; ASLA_MASK_TOS) &gt;&gt; ASLA_SHIFT_TOS);
@@ -298,7 +299,7 @@ ospf_print_lsa(register const struct lsa *lsap)
 		mcp = lsap-&gt;lsa_un.un_mcla;
 		while ((u_char *)mcp &lt; ls_end) {
 			TCHECK(mcp-&gt;mcla_vid);
-			switch (ntohl(mcp-&gt;mcla_vtype)) {
+			switch (EXTRACT_32BITS(&amp;mcp-&gt;mcla_vtype)) {
 
 			case MCLA_VERTEX_ROUTER:
 				printf(&quot;\n\t    Router Router-ID %s&quot;,
@@ -312,7 +313,7 @@ ospf_print_lsa(register const struct lsa *lsap)
 
 			default:
 				printf(&quot;\n\t    unknown VertexType (%u)&quot;,
-				    (u_int32_t)ntohl(mcp-&gt;mcla_vtype));
+				    EXTRACT_32BITS(&amp;mcp-&gt;mcla_vtype));
 				break;
 			}
 		++mcp;
@@ -346,8 +347,8 @@ ospf_decode_v2(register const struct ospfhdr *op,
 	case OSPF_TYPE_HELLO:
                 TCHECK(op-&gt;ospf_hello.hello_deadint);
                 printf(&quot;\n\t  Hello Timer: %us, Dead Timer %us, mask: %s, Priority: %u&quot;,
-                       ntohs(op-&gt;ospf_hello.hello_helloint),
-                       (u_int32_t)ntohl(op-&gt;ospf_hello.hello_deadint),
+                       EXTRACT_16BITS(&amp;op-&gt;ospf_hello.hello_helloint),
+                       EXTRACT_32BITS(&amp;op-&gt;ospf_hello.hello_deadint),
                        ipaddr_string(&amp;op-&gt;ospf_hello.hello_mask),
                        op-&gt;ospf_hello.hello_priority);
 
@@ -408,13 +409,13 @@ ospf_decode_v2(register const struct ospfhdr *op,
 	case OSPF_TYPE_LS_UPDATE:
                 lsap = op-&gt;ospf_lsu.lsu_lsa;
                 TCHECK(op-&gt;ospf_lsu.lsu_count);
-                lsa_count = ntohl(op-&gt;ospf_lsu.lsu_count);
+                lsa_count = EXTRACT_32BITS(&amp;op-&gt;ospf_lsu.lsu_count);
                 printf(&quot;, %d LSA%s&quot;,lsa_count, lsa_count &gt; 1 ? &quot;s&quot; : &quot;&quot;);
                 while (lsa_count--) {
                         if (ospf_print_lsa(lsap))
                                 goto trunc;
                         lsap = (struct lsa *)((u_char *)lsap +
-                                              ntohs(lsap-&gt;ls_hdr.ls_length));
+                                              EXTRACT_16BITS(&amp;lsap-&gt;ls_hdr.ls_length));
                 }
 		break;
 
@@ -448,7 +449,7 @@ ospf_print(register const u_char *bp, register u_int length,
 
         /* XXX Before we do anything else, strip off the MD5 trailer */
         TCHECK(op-&gt;ospf_authtype);
-        if (ntohs(op-&gt;ospf_authtype) == OSPF_AUTH_MD5) {
+        if (EXTRACT_16BITS(&amp;op-&gt;ospf_authtype) == OSPF_AUTH_MD5) {
                 length -= OSPF_AUTH_MD5_LEN;
                 snapend -= OSPF_AUTH_MD5_LEN;
         }
@@ -465,8 +466,8 @@ ospf_print(register const u_char *bp, register u_int length,
                 return;
 
 	TCHECK(op-&gt;ospf_len);
-	if (length != ntohs(op-&gt;ospf_len)) {
-		printf(&quot; [len %d]&quot;, ntohs(op-&gt;ospf_len));
+	if (length != EXTRACT_16BITS(&amp;op-&gt;ospf_len)) {
+		printf(&quot; [len %d]&quot;, EXTRACT_16BITS(&amp;op-&gt;ospf_len));
 		return;
 	}
 	dataend = bp + length;
@@ -485,7 +486,7 @@ ospf_print(register const u_char *bp, register u_int length,
 	if (vflag) {
 		/* Print authentication data (should we really do this?) */
 		TCHECK2(op-&gt;ospf_authdata[0], sizeof(op-&gt;ospf_authdata));
-		switch (ntohs(op-&gt;ospf_authtype)) {
+		switch (EXTRACT_16BITS(&amp;op-&gt;ospf_authtype)) {
 
 		case OSPF_AUTH_NONE:
 			break;
@@ -502,7 +503,7 @@ ospf_print(register const u_char *bp, register u_int length,
 			break;
 
 		default:
-			printf(&quot;, unknown Authentication Type %d&quot;, ntohs(op-&gt;ospf_authtype));
+			printf(&quot;, unknown Authentication Type %d&quot;, EXTRACT_16BITS(&amp;op-&gt;ospf_authtype));
 			return;
 		}
 	}</diff>
      <filename>print-ospf.c</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ospf6.c,v 1.9 2002-08-01 08:53:23 risso Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ospf6.c,v 1.10 2002-12-11 07:14:06 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -217,8 +217,8 @@ ospf6_print_lshdr(register const struct lsa_hdr *lshp)
 	printf(&quot; {&quot;);						/* } (ctags) */
 
 	TCHECK(lshp-&gt;ls_seq);
-	ospf6_print_seqage(ntohl(lshp-&gt;ls_seq), ntohs(lshp-&gt;ls_age));
-	ospf6_print_ls_type(ntohs(lshp-&gt;ls_type), &amp;lshp-&gt;ls_stateid,
+	ospf6_print_seqage(EXTRACT_32BITS(&amp;lshp-&gt;ls_seq), EXTRACT_16BITS(&amp;lshp-&gt;ls_age));
+	ospf6_print_ls_type(EXTRACT_16BITS(&amp;lshp-&gt;ls_type), &amp;lshp-&gt;ls_stateid,
 		&amp;lshp-&gt;ls_router, &quot;ls_type %d&quot;);
 
 	return (0);
@@ -245,7 +245,7 @@ ospf6_print_lsaprefix(register const struct lsa_prefix *lsapp)
 	if (lsapp-&gt;lsa_p_opt)
 		printf(&quot;(opt=%x)&quot;, lsapp-&gt;lsa_p_opt);
 	if (lsapp-&gt;lsa_p_mbz)
-		printf(&quot;(mbz=%x)&quot;, ntohs(lsapp-&gt;lsa_p_mbz)); /* XXX */
+		printf(&quot;(mbz=%x)&quot;, EXTRACT_16BITS(&amp;lsapp-&gt;lsa_p_mbz)); /* XXX */
 	return sizeof(*lsapp) - 4 + k * 4;
 
 trunc:
@@ -280,15 +280,15 @@ ospf6_print_lsa(register const struct lsa *lsap)
 	if (ospf6_print_lshdr(&amp;lsap-&gt;ls_hdr))
 		return (1);
 	TCHECK(lsap-&gt;ls_hdr.ls_length);
-	ls_end = (u_char *)lsap + ntohs(lsap-&gt;ls_hdr.ls_length);
-	switch (ntohs(lsap-&gt;ls_hdr.ls_type)) {
+	ls_end = (u_char *)lsap + EXTRACT_16BITS(&amp;lsap-&gt;ls_hdr.ls_length);
+	switch (EXTRACT_16BITS(&amp;lsap-&gt;ls_hdr.ls_type)) {
 	case LS_TYPE_ROUTER | LS_SCOPE_AREA:
 		TCHECK(lsap-&gt;lsa_un.un_rla.rla_flags);
 		ospf6_print_bits(ospf6_rla_flag_bits,
 			lsap-&gt;lsa_un.un_rla.rla_flags);
 		TCHECK(lsap-&gt;lsa_un.un_rla.rla_options);
 		ospf6_print_bits(ospf6_option_bits,
-			ntohl(lsap-&gt;lsa_un.un_rla.rla_options));
+			EXTRACT_32BITS(&amp;lsap-&gt;lsa_un.un_rla.rla_options));
 
 		TCHECK(lsap-&gt;lsa_un.un_rla.rla_link);
 		rlp = lsap-&gt;lsa_un.un_rla.rla_link;
@@ -321,7 +321,7 @@ ospf6_print_lsa(register const struct lsa *lsap)
 				    rlp-&gt;link_type);
 				return (0);
 			}
-			printf(&quot; metric %d&quot;, ntohs(rlp-&gt;link_metric));
+			printf(&quot; metric %d&quot;, EXTRACT_16BITS(&amp;rlp-&gt;link_metric));
 								/* { (ctags) */
 			printf(&quot; }&quot;);
 			rlp++;
@@ -331,7 +331,7 @@ ospf6_print_lsa(register const struct lsa *lsap)
 	case LS_TYPE_NETWORK | LS_SCOPE_AREA:
 		TCHECK(lsap-&gt;lsa_un.un_nla.nla_options);
 		ospf6_print_bits(ospf6_option_bits,
-			ntohl(lsap-&gt;lsa_un.un_nla.nla_options));
+			EXTRACT_32BITS(&amp;lsap-&gt;lsa_un.un_nla.nla_options));
 		printf(&quot; rtrs&quot;);
 		ap = lsap-&gt;lsa_un.un_nla.nla_router;
 		while ((u_char *)ap &lt; ls_end) {
@@ -344,7 +344,7 @@ ospf6_print_lsa(register const struct lsa *lsap)
 	case LS_TYPE_INTER_AP | LS_SCOPE_AREA:
 		TCHECK(lsap-&gt;lsa_un.un_inter_ap.inter_ap_metric);
 		printf(&quot; metric %u&quot;,
-			(u_int32_t)ntohl(lsap-&gt;lsa_un.un_inter_ap.inter_ap_metric) &amp; SLA_MASK_METRIC);
+			EXTRACT_32BITS(&amp;lsap-&gt;lsa_un.un_inter_ap.inter_ap_metric) &amp; SLA_MASK_METRIC);
 		lsapp = lsap-&gt;lsa_un.un_inter_ap.inter_ap_prefix;
 		while (lsapp + sizeof(lsapp) &lt;= (struct lsa_prefix *)ls_end) {
 			k = ospf6_print_lsaprefix(lsapp);
@@ -355,10 +355,10 @@ ospf6_print_lsa(register const struct lsa *lsap)
 		break;
 	case LS_SCOPE_AS | LS_TYPE_ASE:
 		TCHECK(lsap-&gt;lsa_un.un_asla.asla_metric);
-		flags32 = ntohl(lsap-&gt;lsa_un.un_asla.asla_metric);
+		flags32 = EXTRACT_32BITS(&amp;lsap-&gt;lsa_un.un_asla.asla_metric);
 		ospf6_print_bits(ospf6_asla_flag_bits, flags32);
 		printf(&quot; metric %u&quot;,
-		       (u_int32_t)ntohl(lsap-&gt;lsa_un.un_asla.asla_metric) &amp;
+		       EXTRACT_32BITS(&amp;lsap-&gt;lsa_un.un_asla.asla_metric) &amp;
 		       ASLA_MASK_METRIC);
 		lsapp = lsap-&gt;lsa_un.un_asla.asla_prefix;
 		k = ospf6_print_lsaprefix(lsapp);
@@ -401,7 +401,7 @@ ospf6_print_lsa(register const struct lsa *lsap)
 			register u_int32_t ul;
 
 			TCHECK(*lp);
-			ul = ntohl(*lp);
+			ul = EXTRACT_32BITS(lp);
 			printf(&quot; tos %d metric %d&quot;,
 			    (ul &amp; SLA_MASK_TOS) &gt;&gt; SLA_SHIFT_TOS,
 			    ul &amp; SLA_MASK_METRIC);
@@ -414,7 +414,7 @@ ospf6_print_lsa(register const struct lsa *lsap)
 		mcp = lsap-&gt;lsa_un.un_mcla;
 		while ((u_char *)mcp &lt; ls_end) {
 			TCHECK(mcp-&gt;mcla_vid);
-			switch (ntohl(mcp-&gt;mcla_vtype)) {
+			switch (EXTRACT_32BITS(&amp;mcp-&gt;mcla_vtype)) {
 
 			case MCLA_VERTEX_ROUTER:
 				printf(&quot; rtr rtrid %s&quot;,
@@ -428,7 +428,7 @@ ospf6_print_lsa(register const struct lsa *lsap)
 
 			default:
 				printf(&quot; ??VertexType %u??&quot;,
-				    (u_int32_t)ntohl(mcp-&gt;mcla_vtype));
+				    EXTRACT_32BITS(&amp;mcp-&gt;mcla_vtype));
 				break;
 			}
 		++mcp;
@@ -439,13 +439,13 @@ ospf6_print_lsa(register const struct lsa *lsap)
 		/* Link LSA */
 		llsap = &amp;lsap-&gt;lsa_un.un_llsa;
 		TCHECK(llsap-&gt;llsa_options);
-		ospf6_print_bits(ospf6_option_bits, ntohl(llsap-&gt;llsa_options));
+		ospf6_print_bits(ospf6_option_bits, EXTRACT_32BITS(&amp;llsap-&gt;llsa_options));
 		TCHECK(llsap-&gt;llsa_nprefix);
 		printf(&quot; pri %d lladdr %s npref %d&quot;, llsap-&gt;llsa_priority,
 			ip6addr_string(&amp;llsap-&gt;llsa_lladdr),
-			(u_int32_t)ntohl(llsap-&gt;llsa_nprefix));
+			EXTRACT_32BITS(&amp;llsap-&gt;llsa_nprefix));
 		lsapp = llsap-&gt;llsa_prefix;
-		for (j = 0; j &lt; ntohl(llsap-&gt;llsa_nprefix); j++) {
+		for (j = 0; j &lt; EXTRACT_32BITS(&amp;llsap-&gt;llsa_nprefix); j++) {
 			k = ospf6_print_lsaprefix(lsapp);
 			if (k)
 				goto trunc;
@@ -457,17 +457,17 @@ ospf6_print_lsa(register const struct lsa *lsap)
 		/* Intra-Area-Prefix LSA */
 		TCHECK(lsap-&gt;lsa_un.un_intra_ap.intra_ap_rtid);
 		ospf6_print_ls_type(
-			ntohs(lsap-&gt;lsa_un.un_intra_ap.intra_ap_lstype),
+			EXTRACT_16BITS(&amp;lsap-&gt;lsa_un.un_intra_ap.intra_ap_lstype),
 			&amp;lsap-&gt;lsa_un.un_intra_ap.intra_ap_lsid,
 			&amp;lsap-&gt;lsa_un.un_intra_ap.intra_ap_rtid,
 			&quot;LinkStateType %d&quot;);
 		TCHECK(lsap-&gt;lsa_un.un_intra_ap.intra_ap_nprefix);
 		printf(&quot; npref %d&quot;,
-			ntohs(lsap-&gt;lsa_un.un_intra_ap.intra_ap_nprefix));
+			EXTRACT_16BITS(&amp;lsap-&gt;lsa_un.un_intra_ap.intra_ap_nprefix));
 
 		lsapp = lsap-&gt;lsa_un.un_intra_ap.intra_ap_prefix;
 		for (j = 0;
-		     j &lt; ntohs(lsap-&gt;lsa_un.un_intra_ap.intra_ap_nprefix);
+		     j &lt; EXTRACT_16BITS(&amp;lsap-&gt;lsa_un.un_intra_ap.intra_ap_nprefix);
 		     j++) {
 			k = ospf6_print_lsaprefix(lsapp);
 			if (k)
@@ -478,7 +478,7 @@ ospf6_print_lsa(register const struct lsa *lsap)
 
 	default:
 		printf(&quot; ??LinkStateType 0x%04x??&quot;,
-			ntohs(lsap-&gt;ls_hdr.ls_type));
+			EXTRACT_16BITS(&amp;lsap-&gt;ls_hdr.ls_type));
 	}
 
 								/* { (ctags) */
@@ -513,12 +513,12 @@ ospf6_decode_v3(register const struct ospf6hdr *op,
 		if (vflag) {
 			TCHECK(op-&gt;ospf6_hello.hello_deadint);
 			ospf6_print_bits(ospf6_option_bits,
-			    ntohl(op-&gt;ospf6_hello.hello_options));
+			    EXTRACT_32BITS(&amp;op-&gt;ospf6_hello.hello_options));
 			printf(&quot; ifid %s pri %d int %d dead %u&quot;,
 			    ipaddr_string(&amp;op-&gt;ospf6_hello.hello_ifid),
 			    op-&gt;ospf6_hello.hello_priority,
-			    ntohs(op-&gt;ospf6_hello.hello_helloint),
-			    ntohs(op-&gt;ospf6_hello.hello_deadint));
+			    EXTRACT_16BITS(&amp;op-&gt;ospf6_hello.hello_helloint),
+			    EXTRACT_16BITS(&amp;op-&gt;ospf6_hello.hello_deadint));
 		}
 		TCHECK(op-&gt;ospf6_hello.hello_dr);
 		if (op-&gt;ospf6_hello.hello_dr != 0)
@@ -542,7 +542,7 @@ ospf6_decode_v3(register const struct ospf6hdr *op,
 	case OSPF_TYPE_DB:
 		TCHECK(op-&gt;ospf6_db.db_options);
 		ospf6_print_bits(ospf6_option_bits,
-			ntohl(op-&gt;ospf6_db.db_options));
+			EXTRACT_32BITS(&amp;op-&gt;ospf6_db.db_options));
 		sep = ' ';
 		TCHECK(op-&gt;ospf6_db.db_flags);
 		if (op-&gt;ospf6_db.db_flags &amp; OSPF6_DB_INIT) {
@@ -558,8 +558,8 @@ ospf6_decode_v3(register const struct ospf6hdr *op,
 			sep = '/';
 		}
 		TCHECK(op-&gt;ospf6_db.db_seq);
-		printf(&quot; mtu %u S %X&quot;, ntohs(op-&gt;ospf6_db.db_mtu),
-			(u_int32_t)ntohl(op-&gt;ospf6_db.db_seq));
+		printf(&quot; mtu %u S %X&quot;, EXTRACT_16BITS(&amp;op-&gt;ospf6_db.db_mtu),
+			EXTRACT_32BITS(&amp;op-&gt;ospf6_db.db_seq));
 
 		if (vflag) {
 			/* Print all the LS adv's */
@@ -579,7 +579,7 @@ ospf6_decode_v3(register const struct ospf6hdr *op,
 			while ((u_char *)lsrp &lt; dataend) {
 				TCHECK(*lsrp);
 				printf(&quot; {&quot;);		/* } (ctags) */
-				ospf6_print_ls_type(ntohs(lsrp-&gt;ls_type),
+				ospf6_print_ls_type(EXTRACT_16BITS(&amp;lsrp-&gt;ls_type),
 				    &amp;lsrp-&gt;ls_stateid,
 				    &amp;lsrp-&gt;ls_router,
 				    &quot;LinkStateType %d&quot;);
@@ -594,12 +594,12 @@ ospf6_decode_v3(register const struct ospf6hdr *op,
 		if (vflag) {
 			lsap = op-&gt;ospf6_lsu.lsu_lsa;
 			TCHECK(op-&gt;ospf6_lsu.lsu_count);
-			i = ntohl(op-&gt;ospf6_lsu.lsu_count);
+			i = EXTRACT_32BITS(&amp;op-&gt;ospf6_lsu.lsu_count);
 			while (i--) {
 				if (ospf6_print_lsa(lsap))
 					goto trunc;
 				lsap = (struct lsa *)((u_char *)lsap +
-				    ntohs(lsap-&gt;ls_hdr.ls_length));
+				    EXTRACT_16BITS(&amp;lsap-&gt;ls_hdr.ls_length));
 			}
 		}
 		break;
@@ -644,8 +644,8 @@ ospf6_print(register const u_char *bp, register u_int length)
 		return;
 
 	TCHECK(op-&gt;ospf6_len);
-	if (length != ntohs(op-&gt;ospf6_len)) {
-		printf(&quot; [len %d]&quot;, ntohs(op-&gt;ospf6_len));
+	if (length != EXTRACT_16BITS(&amp;op-&gt;ospf6_len)) {
+		printf(&quot; [len %d]&quot;, EXTRACT_16BITS(&amp;op-&gt;ospf6_len));
 		return;
 	}
 	dataend = bp + length;</diff>
      <filename>print-ospf6.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.35 2002-11-09 17:19:28 itojun Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.36 2002-12-11 07:14:06 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -47,7 +47,7 @@ struct pim {
 #define PIM_TYPE(x)	((x) &amp; 0x0f)
 	u_char  pim_rsv;	/* Reserved */
 	u_short	pim_cksum;	/* IP style check sum */
-} __attribute__((packed));
+};
 
 
 #include &lt;stdio.h&gt;</diff>
      <filename>print-pim.c</filename>
    </modified>
    <modified>
      <diff>@@ -24,7 +24,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     &quot;@(#) $Header: /tcpdump/master/tcpdump/print-pptp.c,v 1.8 2002-11-09 17:19:29 itojun Exp $&quot;;
+     &quot;@(#) $Header: /tcpdump/master/tcpdump/print-pptp.c,v 1.9 2002-12-11 07:14:07 guy Exp $&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -36,6 +36,7 @@ static const char rcsid[] =
 #include &lt;stdio.h&gt;
 
 #include &quot;interface.h&quot;
+#include &quot;extract.h&quot;
 
 static char tstr[] = &quot; [|pptp]&quot;;
 
@@ -103,7 +104,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 +115,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 +127,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 +165,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 +177,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 +189,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 +199,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 +208,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 +222,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 +233,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:
 
@@ -286,10 +287,10 @@ static void
 pptp_bearer_cap_print(const u_int32_t *bearer_cap)
 {
 	printf(&quot; BEARER_CAP(&quot;);
-	if (ntohl(*bearer_cap) &amp; PPTP_BEARER_CAP_DIGITAL_MASK) {
+	if (EXTRACT_32BITS(bearer_cap) &amp; PPTP_BEARER_CAP_DIGITAL_MASK) {
                 printf(&quot;D&quot;);
         }
-        if (ntohl(*bearer_cap) &amp; PPTP_BEARER_CAP_ANALOG_MASK) {
+        if (EXTRACT_32BITS(bearer_cap) &amp; PPTP_BEARER_CAP_ANALOG_MASK) {
                 printf(&quot;A&quot;);
         }
 	printf(&quot;)&quot;);
@@ -299,7 +300,7 @@ static void
 pptp_bearer_type_print(const u_int32_t *bearer_type)
 {
 	printf(&quot; BEARER_TYPE(&quot;);
-	switch (ntohl(*bearer_type)) {
+	switch (EXTRACT_32BITS(bearer_type)) {
 	case 1:
 		printf(&quot;A&quot;);	/* Analog */
 		break;
@@ -319,25 +320,25 @@ pptp_bearer_type_print(const u_int32_t *bearer_type)
 static void
 pptp_call_id_print(const u_int16_t *call_id)
 {
-	printf(&quot; CALL_ID(%u)&quot;, ntohs(*call_id));
+	printf(&quot; CALL_ID(%u)&quot;, EXTRACT_16BITS(call_id));
 }
 
 static void
 pptp_call_ser_print(const u_int16_t *call_ser)
 {
-	printf(&quot; CALL_SER_NUM(%u)&quot;, ntohs(*call_ser));
+	printf(&quot; CALL_SER_NUM(%u)&quot;, EXTRACT_16BITS(call_ser));
 }
 
 static void
 pptp_cause_code_print(const u_int16_t *cause_code)
 {
-	printf(&quot; CAUSE_CODE(%u)&quot;, ntohs(*cause_code));
+	printf(&quot; CAUSE_CODE(%u)&quot;, EXTRACT_16BITS(cause_code));
 }
 
 static void
 pptp_conn_speed_print(const u_int32_t *conn_speed)
 {
-	printf(&quot; CONN_SPEED(%lu)&quot;, (unsigned long)ntohl(*conn_speed));
+	printf(&quot; CONN_SPEED(%u)&quot;, EXTRACT_32BITS(conn_speed));
 }
 
 static void
@@ -378,17 +379,17 @@ pptp_err_code_print(const u_int8_t *err_code)
 static void
 pptp_firm_rev_print(const u_int16_t *firm_rev)
 {
-	printf(&quot; FIRM_REV(%u)&quot;, ntohs(*firm_rev));
+	printf(&quot; FIRM_REV(%u)&quot;, EXTRACT_16BITS(firm_rev));
 }
 
 static void
 pptp_framing_cap_print(const u_int32_t *framing_cap)
 {
 	printf(&quot; FRAME_CAP(&quot;);
-	if (ntohl(*framing_cap) &amp; PPTP_FRAMING_CAP_ASYNC_MASK) {
+	if (EXTRACT_32BITS(framing_cap) &amp; PPTP_FRAMING_CAP_ASYNC_MASK) {
                 printf(&quot;A&quot;);		/* Async */
         }
-        if (ntohl(*framing_cap) &amp; PPTP_FRAMING_CAP_SYNC_MASK) {
+        if (EXTRACT_32BITS(framing_cap) &amp; PPTP_FRAMING_CAP_SYNC_MASK) {
                 printf(&quot;S&quot;);		/* Sync */
         }
 	printf(&quot;)&quot;);
@@ -398,7 +399,7 @@ static void
 pptp_framing_type_print(const u_int32_t *framing_type)
 {
 	printf(&quot; FRAME_TYPE(&quot;);
-	switch (ntohl(*framing_type)) {
+	switch (EXTRACT_32BITS(framing_type)) {
 	case 1:
 		printf(&quot;A&quot;);		/* Async */
 		break;
@@ -424,44 +425,45 @@ pptp_hostname_print(const u_char *hostname)
 static void
 pptp_id_print(const u_int32_t *id)
 {
-	printf(&quot; ID(%lu)&quot;, (unsigned long)ntohl(*id));
+	printf(&quot; ID(%u)&quot;, EXTRACT_32BITS(id));
 }
 
 static void
 pptp_max_channel_print(const u_int16_t *max_channel)
 {
-	printf(&quot; MAX_CHAN(%u)&quot;, ntohs(*max_channel));
+	printf(&quot; MAX_CHAN(%u)&quot;, EXTRACT_16BITS(max_channel));
 }
 
 static void
 pptp_peer_call_id_print(const u_int16_t *peer_call_id)
 {
-	printf(&quot; PEER_CALL_ID(%u)&quot;, ntohs(*peer_call_id));
+	printf(&quot; PEER_CALL_ID(%u)&quot;, EXTRACT_16BITS(peer_call_id));
 }
 
 static void
 pptp_phy_chan_id_print(const u_int32_t *phy_chan_id)
 {
-	printf(&quot; PHY_CHAN_ID(%lu)&quot;, (unsigned long)ntohl(*phy_chan_id));
+	printf(&quot; PHY_CHAN_ID(%u)&quot;, EXTRACT_32BITS(phy_chan_id));
 }
 
 static void
 pptp_pkt_proc_delay_print(const u_int16_t *pkt_proc_delay)
 {
-	printf(&quot; PROC_DELAY(%u)&quot;, ntohs(*pkt_proc_delay));
+	printf(&quot; PROC_DELAY(%u)&quot;, EXTRACT_16BITS(pkt_proc_delay));
 }
 
 static void
 pptp_proto_ver_print(const u_int16_t *proto_ver)
 {
 	printf(&quot; PROTO_VER(%u.%u)&quot;,	/* Version.Revision */
-	       ntohs(*proto_ver) &gt;&gt; 8, ntohs(*proto_ver) &amp; 0xff);
+	       EXTRACT_16BITS(proto_ver) &gt;&gt; 8,
+	       EXTRACT_16BITS(proto_ver) &amp; 0xff);
 }
 
 static void
 pptp_recv_winsiz_print(const u_int16_t *recv_winsiz)
 {
-	printf(&quot; RECV_WIN(%u)&quot;, ntohs(*recv_winsiz));
+	printf(&quot; RECV_WIN(%u)&quot;, EXTRACT_16BITS(recv_winsiz));
 }
 
 static void
@@ -741,9 +743,9 @@ pptp_ocrq_print(const u_char *dat)
 	TCHECK(ptr-&gt;call_ser);
 	pptp_call_ser_print(&amp;ptr-&gt;call_ser);
 	TCHECK(ptr-&gt;min_bps);
-	printf(&quot; MIN_BPS(%lu)&quot;, (unsigned long)ntohl(ptr-&gt;min_bps));
+	printf(&quot; MIN_BPS(%u)&quot;, EXTRACT_32BITS(&amp;ptr-&gt;min_bps));
 	TCHECK(ptr-&gt;max_bps);
-	printf(&quot; MAX_BPS(%lu)&quot;, (unsigned long)ntohl(ptr-&gt;max_bps));
+	printf(&quot; MAX_BPS(%u)&quot;, EXTRACT_32BITS(&amp;ptr-&gt;max_bps));
 	TCHECK(ptr-&gt;bearer_type);
 	pptp_bearer_type_print(&amp;ptr-&gt;bearer_type);
 	TCHECK(ptr-&gt;framing_type);
@@ -753,7 +755,7 @@ pptp_ocrq_print(const u_char *dat)
 	TCHECK(ptr-&gt;pkt_proc_delay);
 	pptp_pkt_proc_delay_print(&amp;ptr-&gt;pkt_proc_delay);
 	TCHECK(ptr-&gt;phone_no_len);
-	printf(&quot; PHONE_NO_LEN(%u)&quot;, ntohs(ptr-&gt;phone_no_len));
+	printf(&quot; PHONE_NO_LEN(%u)&quot;, EXTRACT_16BITS(&amp;ptr-&gt;phone_no_len));
 	TCHECK(ptr-&gt;reserved1);
 	TCHECK(ptr-&gt;phone_no);
 	printf(&quot; PHONE_NO(%.64s)&quot;, ptr-&gt;phone_no);
@@ -810,9 +812,9 @@ pptp_icrq_print(const u_char *dat)
 	TCHECK(ptr-&gt;phy_chan_id);
 	pptp_phy_chan_id_print(&amp;ptr-&gt;phy_chan_id);
 	TCHECK(ptr-&gt;dialed_no_len);
-	printf(&quot; DIALED_NO_LEN(%u)&quot;, ntohs(ptr-&gt;dialed_no_len));
+	printf(&quot; DIALED_NO_LEN(%u)&quot;, EXTRACT_16BITS(&amp;ptr-&gt;dialed_no_len));
 	TCHECK(ptr-&gt;dialing_no_len);
-	printf(&quot; DIALING_NO_LEN(%u)&quot;, ntohs(ptr-&gt;dialing_no_len));
+	printf(&quot; DIALING_NO_LEN(%u)&quot;, EXTRACT_16BITS(&amp;ptr-&gt;dialing_no_len));
 	TCHECK(ptr-&gt;dialed_no);
 	printf(&quot; DIALED_NO(%.64s)&quot;, ptr-&gt;dialed_no);
 	TCHECK(ptr-&gt;dialing_no);
@@ -921,19 +923,17 @@ pptp_wen_print(const u_char *dat)
 	pptp_peer_call_id_print(&amp;ptr-&gt;peer_call_id);
 	TCHECK(ptr-&gt;reserved1);
 	TCHECK(ptr-&gt;crc_err);
-	printf(&quot; CRC_ERR(%lu)&quot;, (unsigned long)ntohl(ptr-&gt;crc_err));
+	printf(&quot; CRC_ERR(%u)&quot;, EXTRACT_32BITS(&amp;ptr-&gt;crc_err));
 	TCHECK(ptr-&gt;framing_err);
-	printf(&quot; FRAMING_ERR(%lu)&quot;, (unsigned long)ntohl(ptr-&gt;framing_err));
+	printf(&quot; FRAMING_ERR(%u)&quot;, EXTRACT_32BITS(&amp;ptr-&gt;framing_err));
 	TCHECK(ptr-&gt;hardware_overrun);
-	printf(&quot; HARDWARE_OVERRUN(%lu)&quot;,
-	       (unsigned long)ntohl(ptr-&gt;hardware_overrun));
+	printf(&quot; HARDWARE_OVERRUN(%u)&quot;, EXTRACT_32BITS(&amp;ptr-&gt;hardware_overrun));
 	TCHECK(ptr-&gt;buffer_overrun);
-	printf(&quot; BUFFER_OVERRUN(%lu)&quot;,
-	       (unsigned long)ntohl(ptr-&gt;buffer_overrun));
+	printf(&quot; BUFFER_OVERRUN(%u)&quot;, EXTRACT_32BITS(&amp;ptr-&gt;buffer_overrun));
 	TCHECK(ptr-&gt;timeout_err);
-	printf(&quot; TIMEOUT_ERR(%lu)&quot;, (unsigned long)ntohl(ptr-&gt;timeout_err));
+	printf(&quot; TIMEOUT_ERR(%u)&quot;, EXTRACT_32BITS(&amp;ptr-&gt;timeout_err));
 	TCHECK(ptr-&gt;align_err);
-	printf(&quot; ALIGN_ERR(%lu)&quot;, (unsigned long)ntohl(ptr-&gt;align_err));
+	printf(&quot; ALIGN_ERR(%u)&quot;, EXTRACT_32BITS(&amp;ptr-&gt;align_err));
 
 	return;
 
@@ -950,9 +950,9 @@ pptp_sli_print(const u_char *dat)
 	pptp_peer_call_id_print(&amp;ptr-&gt;peer_call_id);
 	TCHECK(ptr-&gt;reserved1);
 	TCHECK(ptr-&gt;send_accm);
-	printf(&quot; SEND_ACCM(0x%08lx)&quot;, (unsigned long)ntohl(ptr-&gt;send_accm));
+	printf(&quot; SEND_ACCM(0x%08x)&quot;, EXTRACT_32BITS(&amp;ptr-&gt;send_accm));
 	TCHECK(ptr-&gt;recv_accm);
-	printf(&quot; RECV_ACCM(0x%08lx)&quot;, (unsigned long)ntohl(ptr-&gt;recv_accm));
+	printf(&quot; RECV_ACCM(0x%08x)&quot;, EXTRACT_32BITS(&amp;ptr-&gt;recv_accm));
 
 	return;
 
@@ -973,11 +973,11 @@ pptp_print(const u_char *dat)
 
 	TCHECK(hdr-&gt;length);
 	if (vflag) {
-		printf(&quot; Length=%u&quot;, ntohs(hdr-&gt;length));
+		printf(&quot; Length=%u&quot;, EXTRACT_16BITS(&amp;hdr-&gt;length));
 	}
 	TCHECK(hdr-&gt;msg_type);
 	if (vflag) {
-		switch(ntohs(hdr-&gt;msg_type)) {
+		switch(EXTRACT_16BITS(&amp;hdr-&gt;msg_type)) {
 		case PPTP_MSG_TYPE_CTRL:
 			printf(&quot; CTRL-MSG&quot;);
 			break;
@@ -991,7 +991,7 @@ pptp_print(const u_char *dat)
 	}
 
 	TCHECK(hdr-&gt;magic_cookie);
-	mc = ntohl(hdr-&gt;magic_cookie);
+	mc = EXTRACT_32BITS(&amp;hdr-&gt;magic_cookie);
 	if (mc != PPTP_MAGIC_COOKIE) {
 		printf(&quot; UNEXPECTED Magic-Cookie!!(%08x)&quot;, mc);
 	}
@@ -999,7 +999,7 @@ pptp_print(const u_char *dat)
 		printf(&quot; Magic-Cookie=%08x&quot;, mc);
 	}
 	TCHECK(hdr-&gt;ctrl_msg_type);
-	ctrl_msg_type = ntohs(hdr-&gt;ctrl_msg_type);
+	ctrl_msg_type = EXTRACT_16BITS(&amp;hdr-&gt;ctrl_msg_type);
 	if (ctrl_msg_type &lt; PPTP_MAX_MSGTYPE_INDEX) {
 		printf(&quot; CTRL_MSGTYPE=%s&quot;,
 		       pptp_message_type_string[ctrl_msg_type]);</diff>
      <filename>print-pptp.c</filename>
    </modified>
    <modified>
      <diff>@@ -44,7 +44,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;$Id: print-radius.c,v 1.18 2002-11-10 20:37:31 guy Exp $&quot;;
+    &quot;$Id: print-radius.c,v 1.19 2002-12-11 07:14:07 guy Exp $&quot;;
 #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 */
@@ -823,7 +823,7 @@ radius_print(const u_char *dat, u_int length)
    }
 
    rad = (struct radius_hdr *)dat;
-   len = ntohs(rad-&gt;len);
+   len = EXTRACT_16BITS(&amp;rad-&gt;len);
 
    if (len &lt; MIN_RADIUS_LEN)
    {</diff>
      <filename>print-radius.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.53 2002-11-09 17:19:30 itojun Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.54 2002-12-11 07:14:07 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -41,7 +41,7 @@ struct rip {
 	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 */
@@ -58,7 +58,7 @@ struct rip_netinfo {
 	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)
@@ -83,7 +83,9 @@ rip_entry_print_v1(register const struct rip_netinfo *ni)
 		printf(&quot;]&quot;);
 		return;
 	}
-	if (ni-&gt;rip_tag || ni-&gt;rip_dest_mask || ni-&gt;rip_router) {
+	if (EXTRACT_16BITS(&amp;ni-&gt;rip_tag) ||
+	    EXTRACT_32BITS(&amp;ni-&gt;rip_dest_mask) ||
+	    EXTRACT_32BITS(&amp;ni-&gt;rip_router)) {
 		/* MBZ fields not zero */
 		printf(&quot; [&quot;);
 		rip_printblk((u_char *)&amp;ni-&gt;rip_family,
@@ -139,11 +141,11 @@ rip_entry_print_v2(register const struct rip_netinfo *ni)
 		return;
 	} else { /* AF_INET */
 		printf(&quot; {%s&quot;, ipaddr_string(&amp;ni-&gt;rip_dest));
-		if (ni-&gt;rip_dest_mask)
+		if (EXTRACT_32BITS(&amp;ni-&gt;rip_dest_mask))
 			printf(&quot;/%s&quot;, ipaddr_string(&amp;ni-&gt;rip_dest_mask));
-		if (ni-&gt;rip_router)
+		if (EXTRACT_32BITS(&amp;ni-&gt;rip_router))
 			printf(&quot;-&gt;%s&quot;, ipaddr_string(&amp;ni-&gt;rip_router));
-		if (ni-&gt;rip_tag)
+		if (EXTRACT_16BITS(&amp;ni-&gt;rip_tag))
 			printf(&quot; tag %04x&quot;, EXTRACT_16BITS(&amp;ni-&gt;rip_tag));
 		printf(&quot;}(%d)&quot;, EXTRACT_32BITS(&amp;ni-&gt;rip_metric));
 	}</diff>
      <filename>print-rip.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ripng.c,v 1.13 2002-08-06 04:42:06 guy Exp $&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-ripng.c,v 1.14 2002-12-11 07:14:08 guy Exp $&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -52,6 +52,7 @@ IN6_ADDR_EQUAL(const struct in6_addr *a, const struct in6_addr *b)
 #include &quot;route6d.h&quot;
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 static int
 rip6_entry_print(register const struct netinfo6 *ni, int metric)
@@ -59,7 +60,7 @@ rip6_entry_print(register const struct netinfo6 *ni, int metric)
 	int l;
 	l = printf(&quot;%s/%d&quot;, ip6addr_string(&amp;ni-&gt;rip6_dest), ni-&gt;rip6_plen);
 	if (ni-&gt;rip6_tag)
-		l += printf(&quot; [%d]&quot;, ntohs(ni-&gt;rip6_tag));
+		l += printf(&quot; [%d]&quot;, EXTRACT_16BITS(&amp;ni-&gt;rip6_tag));
 	if (metric)
 		l += printf(&quot; (%d)&quot;, ni-&gt;rip6_metric);
 	return l;</diff>
      <filename>print-ripng.c</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-rsvp.c,v 1.7 2002-12-10 08:16:22 guy Exp $&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-rsvp.c,v 1.8 2002-12-11 07:14:08 guy Exp $&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -52,7 +52,7 @@ struct rsvp_common_header {
     u_int8_t ttl;
     u_int8_t reserved;
     u_int8_t length[2];
-} __attribute__((packed));
+};
 
 /* 
  * RFC2205 object header
@@ -72,7 +72,7 @@ struct rsvp_object_header {
     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)&amp;0xf0)&gt;&gt;4) </diff>
      <filename>print-rsvp.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.21 2002-08-01 08:53:26 risso Exp $&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.22 2002-12-11 07:14:08 guy Exp $&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -38,6 +38,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 int
 rt6_print(register const u_char *bp, register const u_char *bp2)
@@ -76,7 +77,7 @@ rt6_print(register const u_char *bp, register const u_char *bp2)
 		TCHECK(dp0-&gt;ip6r0_reserved);
 		if (dp0-&gt;ip6r0_reserved || vflag) {
 			printf(&quot;, rsv=0x%0x&quot;,
-			    (u_int32_t)ntohl(dp0-&gt;ip6r0_reserved));
+			    EXTRACT_32BITS(&amp;dp0-&gt;ip6r0_reserved));
 		}
 
 		if (len % 2 == 1)</diff>
      <filename>print-rt6.c</filename>
    </modified>
    <modified>
      <diff>@@ -35,7 +35,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-&quot;@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.10 2002-08-01 08:53:27 risso Exp $ (NETLAB/PEL)&quot;;
+&quot;@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.11 2002-12-11 07:14:08 guy Exp $ (NETLAB/PEL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -104,8 +104,8 @@ void sctp_print(const u_char *bp,        /* beginning of sctp packet */
   /*    sctpPacketLength -= sizeof(struct sctpHeader);  packet length  */
   /*  			      is now only as long as the payload  */
 
-  sourcePort = ntohs(sctpPktHdr-&gt;source);
-  destPort = ntohs(sctpPktHdr-&gt;destination);
+  sourcePort = EXTRACT_16BITS(&amp;sctpPktHdr-&gt;source);
+  destPort = EXTRACT_16BITS(&amp;sctpPktHdr-&gt;destination);
 
 #ifdef INET6
   if (ip6) {
@@ -152,9 +152,9 @@ void sctp_print(const u_char *bp,        /* beginning of sctp packet */
       u_short align;
       const u_char *chunkEnd;
 
-      chunkEnd = ((const u_char*)chunkDescPtr + ntohs(chunkDescPtr-&gt;chunkLength));
+      chunkEnd = ((const u_char*)chunkDescPtr + EXTRACT_16BITS(&amp;chunkDescPtr-&gt;chunkLength));
 
-      align=ntohs(chunkDescPtr-&gt;chunkLength) % 4;
+      align=EXTRACT_16BITS(&amp;chunkDescPtr-&gt;chunkLength) % 4;
       if (align != 0)
 	align = 4 - align;
 
@@ -193,10 +193,10 @@ void sctp_print(const u_char *bp,        /* beginning of sctp packet */
 
 	    dataHdrPtr=(const struct sctpDataPart*)(chunkDescPtr+1);
 
-	    printf(&quot;[TSN: %u] &quot;, (u_int32_t)ntohl(dataHdrPtr-&gt;TSN));
-	    printf(&quot;[SID: %u] &quot;, ntohs(dataHdrPtr-&gt;streamId));
-	    printf(&quot;[SSEQ %u] &quot;, ntohs(dataHdrPtr-&gt;sequence));
-	    printf(&quot;[PPID 0x%x] &quot;, (u_int32_t)ntohl(dataHdrPtr-&gt;payloadtype));
+	    printf(&quot;[TSN: %u] &quot;, EXTRACT_32BITS(&amp;dataHdrPtr-&gt;TSN));
+	    printf(&quot;[SID: %u] &quot;, EXTRACT_16BITS(&amp;dataHdrPtr-&gt;streamId));
+	    printf(&quot;[SSEQ %u] &quot;, EXTRACT_16BITS(&amp;dataHdrPtr-&gt;sequence));
+	    printf(&quot;[PPID 0x%x] &quot;, EXTRACT_32BITS(&amp;dataHdrPtr-&gt;payloadtype));
 	    fflush(stdout);
 
 	    if (vflag)		/* if verbose output is specified */
@@ -222,11 +222,11 @@ void sctp_print(const u_char *bp,        /* beginning of sctp packet */
 
 	    printf(&quot;[INIT] &quot;);
 	    init=(const struct sctpInitiation*)(chunkDescPtr+1);
-	    printf(&quot;[init tag: %u] &quot;, (u_int32_t)ntohl(init-&gt;initTag));
-	    printf(&quot;[rwnd: %u] &quot;, (u_int32_t)ntohl(init-&gt;rcvWindowCredit));
-	    printf(&quot;[OS: %u] &quot;, ntohs(init-&gt;NumPreopenStreams));
-	    printf(&quot;[MIS: %u] &quot;, ntohs(init-&gt;MaxInboundStreams));
-	    printf(&quot;[init TSN: %u] &quot;, (u_int32_t)ntohl(init-&gt;initialTSN));
+	    printf(&quot;[init tag: %u] &quot;, EXTRACT_32BITS(&amp;init-&gt;initTag));
+	    printf(&quot;[rwnd: %u] &quot;, EXTRACT_32BITS(&amp;init-&gt;rcvWindowCredit));
+	    printf(&quot;[OS: %u] &quot;, EXTRACT_16BITS(&amp;init-&gt;NumPreopenStreams));
+	    printf(&quot;[MIS: %u] &quot;, EXTRACT_16BITS(&amp;init-&gt;MaxInboundStreams));
+	    printf(&quot;[init TSN: %u] &quot;, EXTRACT_32BITS(&amp;init-&gt;initialTSN));
 
 #if(0) /* ALC you can add code for optional params here */
 	    if( (init+1) &lt; chunkEnd )
@@ -241,11 +241,11 @@ void sctp_print(const u_char *bp,        /* beginning of sctp packet */
 
 	    printf(&quot;[INIT ACK] &quot;);
 	    init=(const struct sctpInitiation*)(chunkDescPtr+1);
-	    printf(&quot;[init tag: %u] &quot;, (u_int32_t)ntohl(init-&gt;initTag));
-	    printf(&quot;[rwnd: %u] &quot;, (u_int32_t)ntohl(init-&gt;rcvWindowCredit));
-	    printf(&quot;[OS: %u] &quot;, ntohs(init-&gt;NumPreopenStreams));
-	    printf(&quot;[MIS: %u] &quot;, ntohs(init-&gt;MaxInboundStreams));
-	    printf(&quot;[init TSN: %u] &quot;, (u_int32_t)ntohl(init-&gt;initialTSN));
+	    printf(&quot;[init tag: %u] &quot;, EXTRACT_32BITS(&amp;init-&gt;initTag));
+	    printf(&quot;[rwnd: %u] &quot;, EXTRACT_32BITS(&amp;init-&gt;rcvWindowCredit));
+	    printf(&quot;[OS: %u] &quot;, EXTRACT_16BITS(&amp;init-&gt;NumPreopenStreams));
+	    printf(&quot;[MIS: %u] &quot;, EXTRACT_16BITS(&amp;init-&gt;MaxInboundStreams));
+	    printf(&quot;[init TSN: %u] &quot;, EXTRACT_32BITS(&amp;init-&gt;initialTSN));
 
 #if(0) /* ALC you can add code for optional params here */
 	    if( (init+1) &lt; chunkEnd )
@@ -263,30 +263,30 @@ void sctp_print(const u_char *bp,        /* beginning of sctp packet */
 
 	    printf(&quot;[SACK] &quot;);
 	    sack=(const struct sctpSelectiveAck*)(chunkDescPtr+1);
-	    printf(&quot;[cum ack %u] &quot;, (u_int32_t)ntohl(sack-&gt;highestConseqTSN));
-	    printf(&quot;[a_rwnd %u] &quot;, (u_int32_t)ntohl(sack-&gt;updatedRwnd));
-	    printf(&quot;[#gap acks %u] &quot;, ntohs(sack-&gt;numberOfdesc));
-	    printf(&quot;[#dup tsns %u] &quot;, ntohs(sack-&gt;numDupTsns));
+	    printf(&quot;[cum ack %u] &quot;, EXTRACT_32BITS(&amp;sack-&gt;highestConseqTSN));
+	    printf(&quot;[a_rwnd %u] &quot;, EXTRACT_32BITS(&amp;sack-&gt;updatedRwnd));
+	    printf(&quot;[#gap acks %u] &quot;, EXTRACT_16BITS(&amp;sack-&gt;numberOfdesc));
+	    printf(&quot;[#dup tsns %u] &quot;, EXTRACT_16BITS(&amp;sack-&gt;numDupTsns));
 
 
 	    /* print gaps */
 	    for (frag = ( (const struct sctpSelectiveFrag *)
 			  ((const struct sctpSelectiveAck *) sack+1)),
 		   fragNo=0;
-		 (const void *)frag &lt; nextChunk &amp;&amp; fragNo &lt; ntohs(sack-&gt;numberOfdesc);
+		 (const void *)frag &lt; nextChunk &amp;&amp; fragNo &lt; EXTRACT_16BITS(&amp;sack-&gt;numberOfdesc);
 		 frag++, fragNo++)
 	      printf(&quot;\n\t\t[gap ack block #%d: start = %u, end = %u] &quot;,
 		     fragNo+1,
-		     (u_int32_t)(ntohl(sack-&gt;highestConseqTSN) + ntohs(frag-&gt;fragmentStart)),
-		     (u_int32_t)(ntohl(sack-&gt;highestConseqTSN) + ntohs(frag-&gt;fragmentEnd)));
+		     EXTRACT_32BITS(&amp;sack-&gt;highestConseqTSN) + EXTRACT_16BITS(&amp;frag-&gt;fragmentStart),
+		     EXTRACT_32BITS(&amp;sack-&gt;highestConseqTSN) + EXTRACT_16BITS(&amp;frag-&gt;fragmentEnd));
 
 
 	    /* print duplicate TSNs */
 	    for (dupTSN = (const u_long*)frag, tsnNo=0;
-		 (const void *) dupTSN &lt; nextChunk &amp;&amp; tsnNo&lt;ntohs(sack-&gt;numDupTsns);
+		 (const void *) dupTSN &lt; nextChunk &amp;&amp; tsnNo&lt;EXTRACT_16BITS(&amp;sack-&gt;numDupTsns);
 		 dupTSN++, tsnNo++)
 	      printf(&quot;\n\t\t[dup TSN #%u: %u] &quot;, tsnNo+1,
-	          (u_int32_t)ntohl(*dupTSN));
+	          EXTRACT_32BITS(dupTSN));
 
 	    break;
 	  }</diff>
      <filename>print-sctp.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-sunrpc.c,v 1.42 2002-09-05 00:00:22 guy Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-sunrpc.c,v 1.43 2002-12-11 07:14:09 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -43,6 +43,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 #include &quot;ip.h&quot;
 #ifdef INET6
@@ -78,11 +79,11 @@ sunrpcrequest_print(register const u_char *bp, register u_int length,
 
 	if (!nflag) {
 		snprintf(srcid, sizeof(srcid), &quot;0x%x&quot;,
-		    (u_int32_t)ntohl(rp-&gt;rm_xid));
+		    EXTRACT_32BITS(&amp;rp-&gt;rm_xid));
 		strlcpy(dstid, &quot;sunrpc&quot;, sizeof(dstid));
 	} else {
 		snprintf(srcid, sizeof(srcid), &quot;0x%x&quot;,
-		    (u_int32_t)ntohl(rp-&gt;rm_xid));
+		    EXTRACT_32BITS(&amp;rp-&gt;rm_xid));
 		snprintf(dstid, sizeof(dstid), &quot;0x%x&quot;, PMAPPORT);
 	}
 
@@ -107,23 +108,23 @@ sunrpcrequest_print(register const u_char *bp, register u_int length,
 	}
 
 	printf(&quot; %s&quot;, tok2str(proc2str, &quot; proc #%u&quot;,
-	    (u_int32_t)ntohl(rp-&gt;rm_call.cb_proc)));
-	x = ntohl(rp-&gt;rm_call.cb_rpcvers);
+	    EXTRACT_32BITS(&amp;rp-&gt;rm_call.cb_proc)));
+	x = EXTRACT_32BITS(&amp;rp-&gt;rm_call.cb_rpcvers);
 	if (x != 2)
 		printf(&quot; [rpcver %u]&quot;, x);
 
-	switch (ntohl(rp-&gt;rm_call.cb_proc)) {
+	switch (EXTRACT_32BITS(&amp;rp-&gt;rm_call.cb_proc)) {
 
 	case PMAPPROC_SET:
 	case PMAPPROC_UNSET:
 	case PMAPPROC_GETPORT:
 	case PMAPPROC_CALLIT:
-		x = ntohl(rp-&gt;rm_call.cb_prog);
+		x = EXTRACT_32BITS(&amp;rp-&gt;rm_call.cb_prog);
 		if (!nflag)
 			printf(&quot; %s&quot;, progstr(x));
 		else
 			printf(&quot; %u&quot;, x);
-		printf(&quot;.%u&quot;, (u_int32_t)ntohl(rp-&gt;rm_call.cb_vers));
+		printf(&quot;.%u&quot;, EXTRACT_32BITS(&amp;rp-&gt;rm_call.cb_vers));
 		break;
 	}
 }</diff>
      <filename>print-sunrpc.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.103 2002-09-05 21:25:49 guy Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.104 2002-12-11 07:14:09 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -146,7 +146,7 @@ static int tcp6_cksum(const struct ip6_hdr *ip6, const struct tcphdr *tp,
 		u_int16_t pa[20];
 	} phu;
 
-	tlen = ntohs(ip6-&gt;ip6_plen) + sizeof(struct ip6_hdr) -
+	tlen = EXTRACT_16BITS(&amp;ip6-&gt;ip6_plen) + sizeof(struct ip6_hdr) -
 	    ((const char *)tp - (const char*)ip6);
 
 	/* pseudo-header */
@@ -208,8 +208,8 @@ tcp_print(register const u_char *bp, register u_int length,
 		return;
 	}
 
-	sport = ntohs(tp-&gt;th_sport);
-	dport = ntohs(tp-&gt;th_dport);
+	sport = EXTRACT_16BITS(&amp;tp-&gt;th_sport);
+	dport = EXTRACT_16BITS(&amp;tp-&gt;th_dport);
 
 	hlen = TH_OFF(tp) * 4;
 
@@ -261,10 +261,10 @@ tcp_print(register const u_char *bp, register u_int length,
 
 	TCHECK(*tp);
 
-	seq = (u_int32_t)ntohl(tp-&gt;th_seq);
-	ack = (u_int32_t)ntohl(tp-&gt;th_ack);
-	win = ntohs(tp-&gt;th_win);
-	urp = ntohs(tp-&gt;th_urp);
+	seq = EXTRACT_32BITS(&amp;tp-&gt;th_seq);
+	ack = EXTRACT_32BITS(&amp;tp-&gt;th_ack);
+	win = EXTRACT_16BITS(&amp;tp-&gt;th_win);
+	urp = EXTRACT_16BITS(&amp;tp-&gt;th_urp);
 
 	if (qflag) {
 		(void)printf(&quot;tcp %d&quot;, length - TH_OFF(tp) * 4);
@@ -289,6 +289,7 @@ tcp_print(register const u_char *bp, register u_int length,
 
 	if (!Sflag &amp;&amp; (flags &amp; TH_ACK)) {
 		register struct tcp_seq_hash *th;
+		const void *src, *dst;
 		register int rev;
 		struct tha tha;
 		/*
@@ -301,63 +302,68 @@ tcp_print(register const u_char *bp, register u_int length,
 		memset(&amp;tha, 0, sizeof(tha));
 		rev = 0;
 		if (ip6) {
+			src = &amp;ip6-&gt;ip6_src;
+			dst = &amp;ip6-&gt;ip6_dst;
 			if (sport &gt; dport)
 				rev = 1;
 			else if (sport == dport) {
-				int i;
-
-				for (i = 0; i &lt; 4; i++) {
-					if (((u_int32_t *)(&amp;ip6-&gt;ip6_src))[i] &gt;
-					    ((u_int32_t *)(&amp;ip6-&gt;ip6_dst))[i]) {
-						rev = 1;
-						break;
-					}
-				}
+				if (memcmp(src, dst, sizeof ip6-&gt;ip6_dst) &gt; 0)
+					rev = 1;
 			}
 			if (rev) {
-				tha.src = ip6-&gt;ip6_dst;
-				tha.dst = ip6-&gt;ip6_src;
+				memcpy(&amp;tha.src, dst, sizeof ip6-&gt;ip6_dst);
+				memcpy(&amp;tha.dst, src, sizeof ip6-&gt;ip6_src);
 				tha.port = dport &lt;&lt; 16 | sport;
 			} else {
-				tha.dst = ip6-&gt;ip6_dst;
-				tha.src = ip6-&gt;ip6_src;
+				memcpy(&amp;tha.dst, dst, sizeof ip6-&gt;ip6_dst);
+				memcpy(&amp;tha.src, src, sizeof ip6-&gt;ip6_src);
 				tha.port = sport &lt;&lt; 16 | dport;
 			}
 		} else {
-			if (sport &gt; dport ||
-			    (sport == dport &amp;&amp;
-			     ip-&gt;ip_src.s_addr &gt; ip-&gt;ip_dst.s_addr)) {
+			src = &amp;ip-&gt;ip_src;
+			dst = &amp;ip-&gt;ip_dst;
+			if (sport &gt; dport)
 				rev = 1;
+			else if (sport == dport) {
+				if (memcmp(src, dst, sizeof ip-&gt;ip_dst) &gt; 0)
+					rev = 1;
 			}
 			if (rev) {
-				*(struct in_addr *)&amp;tha.src = ip-&gt;ip_dst;
-				*(struct in_addr *)&amp;tha.dst = ip-&gt;ip_src;
+				memcpy(&amp;tha.src, dst, sizeof ip-&gt;ip_dst);
+				memcpy(&amp;tha.dst, src, sizeof ip-&gt;ip_src);
 				tha.port = dport &lt;&lt; 16 | sport;
 			} else {
-				*(struct in_addr *)&amp;tha.dst = ip-&gt;ip_dst;
-				*(struct in_addr *)&amp;tha.src = ip-&gt;ip_src;
+				memcpy(&amp;tha.dst, dst, sizeof ip-&gt;ip_dst);
+				memcpy(&amp;tha.src, src, sizeof ip-&gt;ip_src);
 				tha.port = sport &lt;&lt; 16 | dport;
 			}
 		}
 #else
-		if (sport &lt; dport ||
-		    (sport == dport &amp;&amp;
-		     ip-&gt;ip_src.s_addr &lt; ip-&gt;ip_dst.s_addr)) {
-			tha.src = ip-&gt;ip_src, tha.dst = ip-&gt;ip_dst;
-			tha.port = sport &lt;&lt; 16 | dport;
-			rev = 0;
-		} else {
-			tha.src = ip-&gt;ip_dst, tha.dst = ip-&gt;ip_src;
-			tha.port = dport &lt;&lt; 16 | sport;
+		rev = 0;
+		src = &amp;ip-&gt;ip_src;
+		dst = &amp;ip-&gt;ip_dst;
+		if (sport &gt; dport)
 			rev = 1;
+		else if (sport == dport) {
+			if (memcmp(src, dst, sizeof ip-&gt;ip_dst) &gt; 0)
+				rev = 1;
+		}
+		if (rev) {
+			memcpy(&amp;tha.src, dst, sizeof ip-&gt;ip_dst);
+			memcpy(&amp;tha.dst, src, sizeof ip-&gt;ip_src);
+			tha.port = dport &lt;&lt; 16 | sport;
+		} else {
+			memcpy(&amp;tha.dst, dst, sizeof ip-&gt;ip_dst);
+			memcpy(&amp;tha.src, src, sizeof ip-&gt;ip_src);
+			tha.port = sport &lt;&lt; 16 | dport;
 		}
 #endif
 
 		threv = rev;
 		for (th = &amp;tcp_seq_hash[tha.port % TSEQ_HASHSIZE];
 		     th-&gt;nxt; th = th-&gt;nxt)
-			if (!memcmp((char *)&amp;tha, (char *)&amp;th-&gt;addr,
-				  sizeof(th-&gt;addr)))
+			if (memcmp((char *)&amp;tha, (char *)&amp;th-&gt;addr,
+				  sizeof(th-&gt;addr)) == 0)
 				break;
 
 		if (!th-&gt;nxt || (flags &amp; TH_SYN)) {
@@ -396,7 +402,7 @@ tcp_print(register const u_char *bp, register u_int length,
 		if (TTEST2(tp-&gt;th_sport, length)) {
 			sum = tcp_cksum(ip, tp, length);
 			if (sum != 0) {
-				tcp_sum = ntohs(tp-&gt;th_sum);
+				tcp_sum = EXTRACT_16BITS(&amp;tp-&gt;th_sum);
 				(void)printf(&quot; [bad tcp cksum %x (-&gt;%x)!]&quot;,
 				    tcp_sum, in_cksum_shouldbe(tcp_sum, sum));
 			} else</diff>
      <filename>print-tcp.c</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-tftp.c,v 1.32 2002-08-01 08:53:32 risso Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-tftp.c,v 1.33 2002-12-11 07:14:09 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -42,6 +42,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 /* op code to string mapping */
 static struct tok op2str[] = {
@@ -85,7 +86,7 @@ tftp_print(register const u_char *bp, u_int length)
 
 	/* Print tftp request type */
 	TCHECK(tp-&gt;th_opcode);
-	opcode = ntohs(tp-&gt;th_opcode);
+	opcode = EXTRACT_16BITS(&amp;tp-&gt;th_opcode);
 	cp = tok2str(op2str, &quot;tftp-#%d&quot;, opcode);
 	printf(&quot; %s&quot;, cp);
 	/* Bail if bogus opcode */
@@ -115,14 +116,14 @@ tftp_print(register const u_char *bp, u_int length)
 	case ACK:
 	case DATA:
 		TCHECK(tp-&gt;th_block);
-		printf(&quot; block %d&quot;, ntohs(tp-&gt;th_block));
+		printf(&quot; block %d&quot;, EXTRACT_16BITS(&amp;tp-&gt;th_block));
 		break;
 
 	case ERROR:
 		/* Print error code string */
 		TCHECK(tp-&gt;th_code);
 		printf(&quot; %s &quot;, tok2str(err2str, &quot;tftp-err-#%d \&quot;&quot;,
-				       ntohs(tp-&gt;th_code)));
+				       EXTRACT_16BITS(&amp;tp-&gt;th_code)));
 		/* Print error message string */
 		i = fn_print((const u_char *)tp-&gt;th_data, snapend);
 		putchar('&quot;');</diff>
      <filename>print-tftp.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-timed.c,v 1.6 2002-09-05 21:25:50 guy Exp $&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-timed.c,v 1.7 2002-12-11 07:14:10 guy Exp $&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -35,6 +35,7 @@ static const char rcsid[] =
 
 #include &quot;timed.h&quot;
 #include &quot;interface.h&quot;
+#include &quot;extract.h&quot;
 
 static const char *tsptype[TSPTYPENUMBER] =
   { &quot;ANY&quot;, &quot;ADJTIME&quot;, &quot;ACK&quot;, &quot;MASTERREQ&quot;, &quot;MASTERACK&quot;, &quot;SETTIME&quot;, &quot;MASTERUP&quot;,
@@ -85,8 +86,8 @@ timed_print(register const u_char *bp)
 			fputs(&quot; [|timed]&quot;, stdout);
 			return;
 		}
-		sec = ntohl((long)tsp-&gt;tsp_time.tv_sec);
-		usec = ntohl((long)tsp-&gt;tsp_time.tv_usec);
+		sec = EXTRACT_32BITS(&amp;tsp-&gt;tsp_time.tv_sec);
+		usec = EXTRACT_32BITS(&amp;tsp-&gt;tsp_time.tv_usec);
 		if (usec &lt; 0)
 			/* corrupt, skip the rest of the packet */
 			return;</diff>
      <filename>print-timed.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.112 2002-12-04 19:09:30 hannes Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.113 2002-12-11 07:14:10 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -42,6 +42,7 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 #include &quot;appletalk.h&quot;
 
 #include &quot;udp.h&quot;
@@ -59,12 +60,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 __attribute__((packed));
+} ntp64;
 
 /*
  * Sender report.
@@ -74,7 +75,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 +88,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
@@ -112,14 +113,14 @@ vat_print(const void *hdr, register const struct udphdr *up)
 	if ((ts &amp; 0xf060) != 0) {
 		/* probably vt */
 		(void)printf(&quot;udp/vt %u %d / %d&quot;,
-			     (u_int32_t)(ntohs(up-&gt;uh_ulen) - sizeof(*up)),
+			     (u_int32_t)(EXTRACT_16BITS(&amp;up-&gt;uh_ulen) - sizeof(*up)),
 			     ts &amp; 0x3ff, ts &gt;&gt; 10);
 	} else {
 		/* probably vat */
-		u_int32_t i0 = (u_int32_t)ntohl(((u_int *)hdr)[0]);
-		u_int32_t i1 = (u_int32_t)ntohl(((u_int *)hdr)[1]);
+		u_int32_t i0 = EXTRACT_32BITS(&amp;((u_int *)hdr)[0]);
+		u_int32_t i1 = EXTRACT_32BITS(&amp;((u_int *)hdr)[1]);
 		printf(&quot;udp/vat %u c%d %u%s&quot;,
-			(u_int32_t)(ntohs(up-&gt;uh_ulen) - sizeof(*up) - 8),
+			(u_int32_t)(EXTRACT_16BITS(&amp;up-&gt;uh_ulen) - sizeof(*up) - 8),
 			i0 &amp; 0xffff,
 			i1, i0 &amp; 0x800000? &quot;*&quot; : &quot;&quot;);
 		/* audio format */
@@ -136,9 +137,9 @@ rtp_print(const void *hdr, u_int len, register const struct udphdr *up)
 	/* rtp v1 or v2 */
 	u_int *ip = (u_int *)hdr;
 	u_int hasopt, hasext, contype, hasmarker;
-	u_int32_t i0 = (u_int32_t)ntohl(((u_int *)hdr)[0]);
-	u_int32_t i1 = (u_int32_t)ntohl(((u_int *)hdr)[1]);
-	u_int dlen = ntohs(up-&gt;uh_ulen) - sizeof(*up) - 8;
+	u_int32_t i0 = EXTRACT_32BITS(&amp;((u_int *)hdr)[0]);
+	u_int32_t i1 = EXTRACT_32BITS(&amp;((u_int *)hdr)[1]);
+	u_int dlen = EXTRACT_16BITS(&amp;up-&gt;uh_ulen) - sizeof(*up) - 8;
 	const char * ptype;
 
 	ip += 2;
@@ -171,7 +172,7 @@ rtp_print(const void *hdr, u_int len, register const struct udphdr *up)
 		i0 &amp; 0xffff,
 		i1);
 	if (vflag) {
-		printf(&quot; %u&quot;, (u_int32_t)ntohl(((u_int *)hdr)[2]));
+		printf(&quot; %u&quot;, EXTRACT_32BITS(&amp;((u_int *)hdr)[2]));
 		if (hasopt) {
 			u_int i2, optlen;
 			do {
@@ -215,8 +216,8 @@ rtcp_print(const u_char *hdr, const u_char *ep)
 		printf(&quot; [|rtcp]&quot;);
 		return (ep);
 	}
-	len = (ntohs(rh-&gt;rh_len) + 1) * 4;
-	flags = ntohs(rh-&gt;rh_flags);
+	len = (EXTRACT_16BITS(&amp;rh-&gt;rh_len) + 1) * 4;
+	flags = EXTRACT_16BITS(&amp;rh-&gt;rh_flags);
 	cnt = (flags &gt;&gt; 8) &amp; 0x1f;
 	switch (flags &amp; 0xff) {
 	case RTCP_PT_SR:
@@ -225,16 +226,16 @@ rtcp_print(const u_char *hdr, const u_char *ep)
 		if (len != cnt * sizeof(*rr) + sizeof(*sr) + sizeof(*rh))
 			printf(&quot; [%d]&quot;, len);
 		if (vflag)
-			printf(&quot; %u&quot;, (u_int32_t)ntohl(rh-&gt;rh_ssrc));
+			printf(&quot; %u&quot;, EXTRACT_32BITS(&amp;rh-&gt;rh_ssrc));
 		if ((u_char *)(sr + 1) &gt; ep) {
 			printf(&quot; [|rtcp]&quot;);
 			return (ep);
 		}
-		ts = (double)((u_int32_t)ntohl(sr-&gt;sr_ntp.upper)) +
-		    ((double)((u_int32_t)ntohl(sr-&gt;sr_ntp.lower)) /
+		ts = (double)(EXTRACT_32BITS(&amp;sr-&gt;sr_ntp.upper)) +
+		    ((double)(EXTRACT_32BITS(&amp;sr-&gt;sr_ntp.lower)) /
 		    4294967296.0);
-		printf(&quot; @%.2f %u %up %ub&quot;, ts, (u_int32_t)ntohl(sr-&gt;sr_ts),
-		    (u_int32_t)ntohl(sr-&gt;sr_np), (u_int32_t)ntohl(sr-&gt;sr_nb));
+		printf(&quot; @%.2f %u %up %ub&quot;, ts, EXTRACT_32BITS(&amp;sr-&gt;sr_ts),
+		    EXTRACT_32BITS(&amp;sr-&gt;sr_np), EXTRACT_32BITS(&amp;sr-&gt;sr_nb));
 		rr = (struct rtcp_rr *)(sr + 1);
 		break;
 	case RTCP_PT_RR:
@@ -243,18 +244,18 @@ rtcp_print(const u_char *hdr, const u_char *ep)
 			printf(&quot; [%d]&quot;, len);
 		rr = (struct rtcp_rr *)(rh + 1);
 		if (vflag)
-			printf(&quot; %u&quot;, (u_int32_t)ntohl(rh-&gt;rh_ssrc));
+			printf(&quot; %u&quot;, EXTRACT_32BITS(&amp;rh-&gt;rh_ssrc));
 		break;
 	case RTCP_PT_SDES:
 		printf(&quot; sdes %d&quot;, len);
 		if (vflag)
-			printf(&quot; %u&quot;, (u_int32_t)ntohl(rh-&gt;rh_ssrc));
+			printf(&quot; %u&quot;, EXTRACT_32BITS(&amp;rh-&gt;rh_ssrc));
 		cnt = 0;
 		break;
 	case RTCP_PT_BYE:
 		printf(&quot; bye %d&quot;, len);
 		if (vflag)
-			printf(&quot; %u&quot;, (u_int32_t)ntohl(rh-&gt;rh_ssrc));
+			printf(&quot; %u&quot;, EXTRACT_32BITS(&amp;rh-&gt;rh_ssrc));
 		cnt = 0;
 		break;
 	default:
@@ -270,13 +271,13 @@ rtcp_print(const u_char *hdr, const u_char *ep)
 			return (ep);
 		}
 		if (vflag)
-			printf(&quot; %u&quot;, (u_int32_t)ntohl(rr-&gt;rr_srcid));
-		ts = (double)((u_int32_t)ntohl(rr-&gt;rr_lsr)) / 65536.;
-		dts = (double)((u_int32_t)ntohl(rr-&gt;rr_dlsr)) / 65536.;
+			printf(&quot; %u&quot;, EXTRACT_32BITS(&amp;rr-&gt;rr_srcid));
+		ts = (double)(EXTRACT_32BITS(&amp;rr-&gt;rr_lsr)) / 65536.;
+		dts = (double)(EXTRACT_32BITS(&amp;rr-&gt;rr_dlsr)) / 65536.;
 		printf(&quot; %ul %us %uj @%.2f+%.2f&quot;,
-		    (u_int32_t)ntohl(rr-&gt;rr_nl) &amp; 0x00ffffff,
-		    (u_int32_t)ntohl(rr-&gt;rr_ls),
-		    (u_int32_t)ntohl(rr-&gt;rr_dv), ts, dts);
+		    EXTRACT_32BITS(&amp;rr-&gt;rr_nl) &amp; 0x00ffffff,
+		    EXTRACT_32BITS(&amp;rr-&gt;rr_ls),
+		    EXTRACT_32BITS(&amp;rr-&gt;rr_dv), ts, dts);
 	}
 	return (hdr + len);
 }
@@ -330,7 +331,7 @@ static int udp6_cksum(const struct ip6_hdr *ip6, const struct udphdr *up,
 		u_int16_t pa[20];
 	} phu;
 
-	tlen = ntohs(ip6-&gt;ip6_plen) + sizeof(struct ip6_hdr) -
+	tlen = EXTRACT_16BITS(&amp;ip6-&gt;ip6_plen) + sizeof(struct ip6_hdr) -
 	    ((const char *)up - (const char*)ip6);
 
 	/* pseudo-header */
@@ -471,9 +472,9 @@ udp_print(register const u_char *bp, u_int length,
 	}
 	length -= sizeof(struct udphdr);
 
-	sport = ntohs(up-&gt;uh_sport);
-	dport = ntohs(up-&gt;uh_dport);
-	ulen = ntohs(up-&gt;uh_ulen);
+	sport = EXTRACT_16BITS(&amp;up-&gt;uh_sport);
+	dport = EXTRACT_16BITS(&amp;up-&gt;uh_dport);
+	ulen = EXTRACT_16BITS(&amp;up-&gt;uh_ulen);
 	if (ulen &lt; 8) {
 		(void)printf(&quot;%s &gt; %s: truncated-udplength %d&quot;,
 			     ipaddr_string(&amp;ip-&gt;ip_src),
@@ -499,7 +500,7 @@ udp_print(register const u_char *bp, u_int length,
 
 		case PT_RPC:
 			rp = (struct rpc_msg *)(up + 1);
-			direction = (enum msg_type)ntohl(rp-&gt;rm_direction);
+			direction = (enum msg_type)EXTRACT_32BITS(&amp;rp-&gt;rm_direction);
 			if (direction == CALL)
 				sunrpcrequest_print((u_char *)rp, length,
 				    (u_char *)ip);
@@ -538,7 +539,7 @@ udp_print(register const u_char *bp, u_int length,
 
 		rp = (struct rpc_msg *)(up + 1);
 		if (TTEST(rp-&gt;rm_direction)) {
-			direction = (enum msg_type)ntohl(rp-&gt;rm_direction);
+			direction = (enum msg_type)EXTRACT_32BITS(&amp;rp-&gt;rm_direction);
 			if (dport == NFS_PORT &amp;&amp; direction == CALL) {
 				nfsreq_print((u_char *)rp, length,
 				    (u_char *)ip);</diff>
      <filename>print-udp.c</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-wb.c,v 1.29 2002-11-09 17:19:31 itojun Exp $ (LBL)&quot;;
+    &quot;@(#) $Header: /tcpdump/master/tcpdump/print-wb.c,v 1.30 2002-12-11 07:14:10 guy Exp $ (LBL)&quot;;
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -34,8 +34,10 @@ static const char rcsid[] =
 
 #include &quot;interface.h&quot;
 #include &quot;addrtoname.h&quot;
+#include &quot;extract.h&quot;
 
 /* XXX need to add byte-swapping macros! */
+/* XXX - you mean like the ones in &quot;extract.h&quot;? */
 
 /*
  * Largest packet size.  Everything should fit within this space.
@@ -51,7 +53,7 @@ static const char rcsid[] =
 #define DOP_ROUNDUP(x)	((((int)(x)) + (DOP_ALIGN - 1)) &amp; ~(DOP_ALIGN - 1))
 #define DOP_NEXT(d)\
 	((struct dophdr *)((u_char *)(d) + \
-			  DOP_ROUNDUP(ntohs((d)-&gt;dh_len) + sizeof(*(d)))))
+			  DOP_ROUNDUP(EXTRACT_16BITS(&amp;(d)-&gt;dh_len) + sizeof(*(d)))))
 
 /*
  * Format of the whiteboard packet header.
@@ -63,7 +65,7 @@ struct pkt_hdr {
 	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,7 +87,7 @@ 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 */
@@ -93,7 +95,7 @@ struct dophdr {
 	u_char	dh_flags;
 	u_char	dh_type;	/* body type */
 	/* body follows */
-} __attribute__((packed));
+};
 /*
  * Drawing op sub-types.
  */
@@ -121,7 +123,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 +133,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,12 +142,12 @@ 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;
@@ -153,7 +155,7 @@ struct pgstate {
 	u_int16_t nid;
 	u_int16_t rsvd;
         /* seqptr's */
-} __attribute__((packed));
+};
 
 /*
  * An announcement packet.
@@ -164,18 +166,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)
@@ -192,14 +194,14 @@ wb_id(const struct pkt_id *id, u_int len)
 	len -= sizeof(*id);
 
 	printf(&quot; %u/%s:%u (max %u/%s:%u) &quot;,
-	       (u_int32_t)ntohl(id-&gt;pi_ps.slot),
+	       EXTRACT_32BITS(&amp;id-&gt;pi_ps.slot),
 	       ipaddr_string(&amp;id-&gt;pi_ps.page.p_sid),
-	       (u_int32_t)ntohl(id-&gt;pi_ps.page.p_uid),
-	       (u_int32_t)ntohl(id-&gt;pi_mslot),
+	       EXTRACT_32BITS(&amp;id-&gt;pi_ps.page.p_uid),
+	       EXTRACT_32BITS(&amp;id-&gt;pi_mslot),
 	       ipaddr_string(&amp;id-&gt;pi_mpage.p_sid),
-	       (u_int32_t)ntohl(id-&gt;pi_mpage.p_uid));
+	       EXTRACT_32BITS(&amp;id-&gt;pi_mpage.p_uid));
 
-	nid = ntohs(id-&gt;pi_ps.nid);
+	nid = EXTRACT_16BITS(&amp;id-&gt;pi_ps.nid);
 	len -= sizeof(*io) * nid;
 	io = (struct id_off *)(id + 1);
 	cp = (char *)(io + nid);
@@ -212,7 +214,7 @@ wb_id(const struct pkt_id *id, u_int len)
 	c = '&lt;';
 	for (i = 0; i &lt; nid &amp;&amp; (u_char *)io &lt; snapend; ++io, ++i) {
 		printf(&quot;%c%s:%u&quot;,
-		    c, ipaddr_string(&amp;io-&gt;id), (u_int32_t)ntohl(io-&gt;off));
+		    c, ipaddr_string(&amp;io-&gt;id), EXTRACT_32BITS(&amp;io-&gt;off));
 		c = ',';
 	}
 	if (i &gt;= nid) {
@@ -232,9 +234,9 @@ wb_rreq(const struct pkt_rreq *rreq, u_int len)
 	printf(&quot; please repair %s %s:%u&lt;%u:%u&gt;&quot;,
 	       ipaddr_string(&amp;rreq-&gt;pr_id),
 	       ipaddr_string(&amp;rreq-&gt;pr_page.p_sid),
-	       (u_int32_t)ntohl(rreq-&gt;pr_page.p_uid),
-	       (u_int32_t)ntohl(rreq-&gt;pr_sseq),
-	       (u_int32_t)ntohl(rreq-&gt;pr_eseq));
+	       EXTRACT_32BITS(&amp;rreq-&gt;pr_page.p_uid),
+	       EXTRACT_32BITS(&amp;rreq-&gt;pr_sseq),
+	       EXTRACT_32BITS(&amp;rreq-&gt;pr_eseq));
 	return (0);
 }
 
@@ -246,9 +248,9 @@ wb_preq(const struct pkt_preq *preq, u_int len)
 		return (-1);
 
 	printf(&quot; need %u/%s:%u&quot;,
-	       (u_int32_t)ntohl(preq-&gt;pp_low),
+	       EXTRACT_32BITS(&amp;preq-&gt;pp_low),
 	       ipaddr_string(&amp;preq-&gt;pp_page.p_sid),
-	       (u_int32_t)ntohl(preq-&gt;pp_page.p_uid));
+	       EXTRACT_32BITS(&amp;preq-&gt;pp_page.p_uid));
 	return (0);
 }
 
@@ -263,20 +265,20 @@ wb_prep(const struct pkt_prep *prep, u_int len)
 	if (len &lt; sizeof(*prep)) {
 		return (-1);
 	}
-	n = ntohl(prep-&gt;pp_n);
+	n = EXTRACT_32BITS(&amp;prep-&gt;pp_n);
 	ps = (const struct pgstate *)(prep + 1);
 	while (--n &gt;= 0 &amp;&amp; (u_char *)ps &lt; ep) {
 		const struct id_off *io, *ie;
 		char c = '&lt;';
 
 		printf(&quot; %u/%s:%u&quot;,
-		    (u_int32_t)ntohl(ps-&gt;slot),
+		    EXTRACT_32BITS(&amp;ps-&gt;slot),
 		    ipaddr_string(&amp;ps-&gt;page.p_sid),
-		    (u_int32_t)ntohl(ps-&gt;page.p_uid));
+		    EXTRACT_32BITS(&amp;ps-&gt;page.p_uid));
 		io = (struct id_off *)(ps + 1);
 		for (ie = io + ps-&gt;nid; io &lt; ie &amp;&amp; (u_char *)io &lt; ep; ++io) {
 			printf(&quot;%c%s:%u&quot;, c, ipaddr_string(&amp;io-&gt;id),
-			    (u_int32_t)ntohl(io-&gt;off));
+			    EXTRACT_32BITS(&amp;io-&gt;off));
 			c = ',';
 		}
 		printf(&quot;&gt;&quot;);
@@ -317,7 +319,7 @@ wb_dops(const struct dophdr *dh, u_int32_t ss, u_int32_t es)
 		else {
 			printf(&quot; %s&quot;, dopstr[t]);
 			if (t == DT_SKIP || t == DT_HOLE) {
-				u_int32_t ts = ntohl(dh-&gt;dh_ts);
+				u_int32_t ts = EXTRACT_32BITS(&amp;dh-&gt;dh_ts);
 				printf(&quot;%d&quot;, ts - ss + 1);
 				if (ss &gt; ts || ts &gt; es) {
 					printf(&quot;[|]&quot;);
@@ -350,13 +352,14 @@ wb_rrep(const struct pkt_rrep *rrep, u_int len)
 	printf(&quot; for %s %s:%u&lt;%u:%u&gt;&quot;,
 	    ipaddr_string(&amp;rrep-&gt;pr_id),
 	    ipaddr_string(&amp;dop-&gt;pd_page.p_sid),
-	    (u_int32_t)ntohl(dop-&gt;pd_page.p_uid),
-	    (u_int32_t)ntohl(dop-&gt;pd_sseq),
-	    (u_int32_t)ntohl(dop-&gt;pd_eseq));
+	    EXTRACT_32BITS(&amp;dop-&gt;pd_page.p_uid),
+	    EXTRACT_32BITS(&amp;dop-&gt;pd_sseq),
+	    EXTRACT_32BITS(&amp;dop-&gt;pd_eseq));
 
 	if (vflag)
 		return (wb_dops((const struct dophdr *)(dop + 1),
-		    ntohl(dop-&gt;pd_sseq), ntohl(dop-&gt;pd_eseq)));
+		    EXTRACT_32BITS(&amp;dop-&gt;pd_sseq),
+		    EXTRACT_32BITS(&amp;dop-&gt;pd_eseq)));
 	return (0);
 }
 
@@ -370,13 +373,14 @@ wb_drawop(const struct pkt_dop *dop, u_int len)
 
 	printf(&quot; %s:%u&lt;%u:%u&gt;&quot;,
 	    ipaddr_string(&amp;dop-&gt;pd_page.p_sid),
-	    (u_int32_t)ntohl(dop-&gt;pd_page.p_uid),
-	    (u_int32_t)ntohl(dop-&gt;pd_sseq),
-	    (u_int32_t)ntohl(dop-&gt;pd_eseq));
+	    EXTRACT_32BITS(&amp;dop-&gt;pd_page.p_uid),
+	    EXTRACT_32BITS(&amp;dop-&gt;pd_sseq),
+	    EXTRACT_32BITS(&amp;dop-&gt;pd_eseq));
 
 	if (vflag)
 		return (wb_dops((const struct dophdr *)(dop + 1),
-				ntohl(dop-&gt;pd_sseq), ntohl(dop-&gt;pd_eseq)));
+				EXTRACT_32BITS(&amp;dop-&gt;pd_sseq),
+				EXTRACT_32BITS(&amp;dop-&gt;pd_eseq)));
 	return (0);
 }
 </diff>
      <filename>print-wb.c</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Header: /tcpdump/master/tcpdump/route6d.h,v 1.4 2002-11-09 17:19:31 itojun Exp $
+ * $Header: /tcpdump/master/tcpdump/route6d.h,v 1.5 2002-12-11 07:14:10 guy 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</diff>
      <filename>route6d.h</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@
 /*
  * Rx protocol format
  *
- * $Id: rx.h,v 1.7 2002-11-09 17:19:31 itojun Exp $
+ * $Id: rx.h,v 1.8 2002-12-11 07:14:11 guy 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 */
-} __attribute__((packed));		/* serviceId is first, it's really */
+};					/* 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>
      <filename>rx.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/sctpHeader.h,v 1.5 2002-11-09 17:19:32 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/sctpHeader.h,v 1.6 2002-12-11 07:14:11 guy Exp $ (LBL) */
 
 /* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola
  *
@@ -64,7 +64,7 @@ struct sctpHeader{
   u_int16_t destination;
   u_int32_t verificationTag;
   u_int32_t adler32;
-} __attribute__((packed));
+};
 
 /* various descriptor parsers */
 
@@ -72,25 +72,25 @@ struct sctpChunkDesc{
   u_int8_t chunkID;
   u_int8_t chunkFlg;
   u_int16_t chunkLength;
-} __attribute__((packed));
+};
 
 struct sctpParamDesc{
   u_int16_t paramType;
   u_int16_t paramLength;
-} __attribute__((packed));
+};
 
 
 struct sctpRelChunkDesc{
   struct sctpChunkDesc chk;
   u_int32_t serialNumber;
-} __attribute__((packed));
+};
 
 struct sctpVendorSpecificParam {
   struct sctpParamDesc p;  /* type must be 0xfffe */
   u_int32_t vendorId;	   /* vendor ID from RFC 1700 */
   u_int16_t vendorSpecificType;
   u_int16_t vendorSpecificLen;
-} __attribute__((packed));
+};
 
 
 /* Structures for the control parts */
@@ -107,35 +107,35 @@ struct sctpInitiation{
   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_int32_t  ipAddress;
-} __attribute__((packed));
+};
 
 
 struct sctpV6IpAddress{
   struct sctpParamDesc p;	/* type is set to SCTP_IPV6_PARAM_TYPE, len=22 */
   u_int8_t  ipAddress[16];
-} __attribute__((packed));
+};
 
 struct sctpDNSName{
   struct sctpParamDesc param;
   u_int8_t name[1];
-} __attribute__((packed));
+};
 
 
 struct sctpCookiePreserve{
   struct sctpParamDesc p;	/* type is set to SCTP_COOKIE_PRESERVE, len=8 */
   u_int32_t extraTime;
-} __attribute__((packed));
+};
 
 
 struct sctpTimeStamp{
   u_int32_t ts_sec;
   u_int32_t ts_usec;
-} __attribute__((packed));
+};
 
 /* wire structure of my cookie */
 struct cookieMessage{
@@ -152,7 +152,7 @@ struct cookieMessage{
    * 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
@@ -183,18 +183,18 @@ struct sctpSelectiveAck{
   u_int32_t updatedRwnd;
   u_int16_t numberOfdesc;
   u_int16_t numDupTsns;
-} __attribute__((packed));
+};
 
 struct sctpSelectiveFrag{
   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
@@ -203,13 +203,13 @@ struct sctpUnifiedSack{
 struct sctpHBrequest {
   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 */
@@ -219,7 +219,7 @@ struct sctpHBsender{
   struct sctpHBrequest rtt;
   int8_t addrFmt[SCTP_ADDRMAX];
   u_int16_t userreq;
-} __attribute__((packed));
+};
 
 
 
@@ -229,31 +229,31 @@ 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;
   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_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
@@ -262,12 +262,12 @@ struct sctpUnifiedShutdown{
 struct sctpOpErrorCause{
   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;
@@ -275,14 +275,14 @@ struct sctpUnifiedStreamError{
   struct sctpOpErrorCause c;
   u_int16_t strmNum;
   u_int16_t reserved;
-} __attribute__((packed));
+};
 
 struct staleCookieMsg{
   struct sctpHeader mh;
   struct sctpChunkDesc uh;
   struct sctpOpErrorCause c;
   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_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_int32_t Lowest_TSN;
-} __attribute__((packed));
+};
 
 
 struct sctpCWR{
   struct sctpChunkDesc uh;
   u_int32_t TSN_reduced_at;
-} __attribute__((packed));
+};
 
 #ifdef	__cplusplus
 }</diff>
      <filename>sctpHeader.h</filename>
    </modified>
    <modified>
      <diff>@@ -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.6 2002-11-09 17:19:32 itojun Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/sll.h,v 1.7 2002-12-11 07:14:11 guy 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 &quot;sll_pkttype&quot;; these correspond to the</diff>
      <filename>sll.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/tcp.h,v 1.9 2002-11-09 17:19:32 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/tcp.h,v 1.10 2002-12-11 07:14:11 guy 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</diff>
      <filename>tcp.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/timed.h,v 1.4 2002-11-09 17:19:33 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/timed.h,v 1.5 2002-12-11 07:14:12 guy Exp $ (LBL) */
 /*
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -53,7 +53,7 @@ struct tsp {
 		int8_t tspu_hopcnt;
 	} tsp_u;
 	int8_t tsp_name[256];
-} __attribute__((packed));
+};
 
 #define	tsp_time	tsp_u.tspu_time
 #define	tsp_hopcnt	tsp_u.tspu_hopcnt</diff>
      <filename>timed.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/token.h,v 1.5 2002-11-09 17:19:33 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/token.h,v 1.6 2002-12-11 07:14:12 guy 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));
+};</diff>
      <filename>token.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/udp.h,v 1.3 2002-11-09 17:19:33 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/udp.h,v 1.4 2002-12-11 07:14:12 guy 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));
+};</diff>
      <filename>udp.h</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3a4254f5c662637cf669ff66b941240d7e456d6d</id>
    </parent>
  </parents>
  <author>
    <name>guy</name>
    <email>guy</email>
  </author>
  <url>http://github.com/mcr/tcpdump/commit/fcc82f451d3e51fdf636abbf927edb287bada0e0</url>
  <id>fcc82f451d3e51fdf636abbf927edb287bada0e0</id>
  <committed-date>2002-12-10T23:13:49-08:00</committed-date>
  <authored-date>2002-12-10T23:13:49-08:00</authored-date>
  <message>The &quot;__attribute__((packed))&quot; tag on structures causes some files not to
compile with Sun C, as &quot;interface.h&quot; isn't being included before the
structures are being declared.

Furthermore, in the files that Sun C *can* compile, it doesn't cause Sun
C to generate code that's safe with unaligned accesses, as
&quot;__attribute__&quot; is defined as a do-nothing macro with compilers that
don't support it.

Therefore, we get rid of that tag on the structures to which it was
added, and instead use &quot;EXTRACT_16BIT()&quot; and &quot;EXTRACT_32BIT()&quot; to fetch
16-bit and 32-bit big-endian quantities from packets.  We also fix some
other references to multi-byte quantities to get rid of code that tries
to do unaligned loads on platforms that don't support them.

We also throw in a hack that makes those macros use
&quot;__attribute__((packed))&quot; on structures containing only one 16-bit or
32-bit integer to get the compiler to generate unaligned-safe code
rather than doing it by hand.  (GCC on SPARC produces the same code that
doing it by hand does; I don't know if GCC on any other big-endian
strict-alignment processor generates better code for that case.  On
little-endian processors, as &quot;ntohs()&quot; and &quot;ntohl()&quot; might be functions,
that might actually produce worse code.)

Fix some places to use &quot;%u&quot; rather than &quot;%d&quot; to print unsigned
quantities.</message>
  <tree>938119171c0d1eb45c66c2f576b95293f04f468b</tree>
  <committer>
    <name>guy</name>
    <email>guy</email>
  </committer>
</commit>
