summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-10-26 17:01:12 +0000
committerAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-10-26 17:01:12 +0000
commit74886818c4bfeb16b36445d839a9fce54f448800 (patch)
tree19f8feebfeab7cb76514fa6652bb8d6c583982d4
parent02bca2551949d6819ca76cf15007601d29c9eed4 (diff)
Use __packed attribute to cleanup the '#define XXX' stuff in here.
Also stops the struct having a double ;; in variable declarations, which breaks a few non-gcc parsers. millert@ ok
-rw-r--r--sys/netipx/ipx.h32
-rw-r--r--sys/netipx/spx.h30
2 files changed, 29 insertions, 33 deletions
diff --git a/sys/netipx/ipx.h b/sys/netipx/ipx.h
index 453c24d77a4..27908dffb59 100644
--- a/sys/netipx/ipx.h
+++ b/sys/netipx/ipx.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipx.h,v 1.17 2003/06/02 23:28:16 millert Exp $ */
+/* $OpenBSD: ipx.h,v 1.18 2003/10/26 17:01:11 avsm Exp $ */
/*-
*
@@ -107,28 +107,27 @@
*/
#define IPX_HOSTADDRLEN 6
#define IPX_NETADDRLEN 4
-#define XXX __attribute__((__packed__))
typedef
union ipx_host {
- u_int8_t c_host[IPX_HOSTADDRLEN] XXX;
- u_int16_t s_host[IPX_HOSTADDRLEN/2] XXX;
+ u_int8_t c_host[IPX_HOSTADDRLEN] __packed;
+ u_int16_t s_host[IPX_HOSTADDRLEN/2] __packed;
} ipx_host_t;
typedef
union ipx_net {
- u_int8_t c_net[IPX_NETADDRLEN] XXX;
- u_int16_t s_net[IPX_NETADDRLEN/2] XXX;
- u_int32_t l_net XXX;
+ u_int8_t c_net[IPX_NETADDRLEN] __packed;
+ u_int16_t s_net[IPX_NETADDRLEN/2] __packed;
+ u_int32_t l_net __packed;
} ipx_net_t;
typedef u_int16_t ipx_port_t;
typedef
struct ipx_addr {
- ipx_net_t ipx_net XXX;
- ipx_host_t ipx_host XXX;
- ipx_port_t ipx_port XXX;
+ ipx_net_t ipx_net __packed;
+ ipx_host_t ipx_host __packed;
+ ipx_port_t ipx_port __packed;
} ipx_addr_t;
/*
@@ -149,14 +148,13 @@ struct sockaddr_ipx {
* Definitions for IPX Internet Datagram Protocol
*/
struct ipx {
- u_int16_t ipx_sum XXX; /* Checksum */
- u_int16_t ipx_len XXX; /* Length, in bytes, including header */
- u_int8_t ipx_tc XXX; /* Transport Control (i.e. hop count) */
- u_int8_t ipx_pt XXX; /* Packet Type (i.e. lev 2 protocol) */
- ipx_addr_t ipx_dna XXX; /* Destination Network Address */
- ipx_addr_t ipx_sna XXX; /* Source Network Address */
+ u_int16_t ipx_sum __packed; /* Checksum */
+ u_int16_t ipx_len __packed; /* Length, in bytes, including header */
+ u_int8_t ipx_tc __packed; /* Transport Control (i.e. hop count) */
+ u_int8_t ipx_pt __packed; /* Packet Type (i.e. lev 2 protocol) */
+ ipx_addr_t ipx_dna __packed; /* Destination Network Address */
+ ipx_addr_t ipx_sna __packed; /* Source Network Address */
};
-#undef XXX
#define ipx_neteqnn(a,b) \
(((a).s_net[0]==(b).s_net[0]) && ((a).s_net[1]==(b).s_net[1]))
diff --git a/sys/netipx/spx.h b/sys/netipx/spx.h
index 83c089575a3..729920184a4 100644
--- a/sys/netipx/spx.h
+++ b/sys/netipx/spx.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: spx.h,v 1.7 2003/06/02 23:28:16 millert Exp $ */
+/* $OpenBSD: spx.h,v 1.8 2003/10/26 17:01:11 avsm Exp $ */
/*-
*
@@ -41,24 +41,22 @@
#include <sys/queue.h>
-#define XXX __attribute__((__packed__));
-
/*
* Definitions for IPX style Sequenced Packet Protocol
*/
struct spxhdr {
- u_int8_t spx_cc XXX; /* connection control */
- u_int8_t spx_dt XXX; /* datastream type */
-#define SPX_SP 0x80 /* system packet */
-#define SPX_SA 0x40 /* send acknowledgement */
-#define SPX_OB 0x20 /* attention (out of band data) */
-#define SPX_EM 0x10 /* end of message */
- u_int16_t spx_sid XXX; /* source connection identifier */
- u_int16_t spx_did XXX; /* destination connection identifier */
- u_int16_t spx_seq XXX; /* sequence number */
- u_int16_t spx_ack XXX; /* acknowledge number */
- u_int16_t spx_alo XXX; /* allocation number */
+ u_int8_t spx_cc __packed; /* connection control */
+ u_int8_t spx_dt __packed; /* datastream type */
+#define SPX_SP 0x80 /* system packet */
+#define SPX_SA 0x40 /* send acknowledgement */
+#define SPX_OB 0x20 /* attention (out of band data) */
+#define SPX_EM 0x10 /* end of message */
+ u_int16_t spx_sid __packed; /* source connection identifier */
+ u_int16_t spx_did __packed; /* destination connection identifier */
+ u_int16_t spx_seq __packed; /* sequence number */
+ u_int16_t spx_ack __packed; /* acknowledge number */
+ u_int16_t spx_alo __packed; /* allocation number */
};
/*
@@ -66,8 +64,8 @@ struct spxhdr {
* containing a Sequenced Packet Protocol packet.
*/
struct spx {
- struct ipx si_i XXX;
- struct spxhdr si_s XXX;
+ struct ipx si_i __packed;
+ struct spxhdr si_s __packed;
};
#define SI(x) ((struct spx *)x)