2002-07-17 Jay Monkman <jtm@smoothsmoothie.com>

* netinet/in.h, netinet/ip.h, netinet/ip_var.h, netinet/tcp.h:
	Modified to added packed attribute.o
This commit is contained in:
Joel Sherrill
2002-07-17 17:08:48 +00:00
parent 2b947a45d7
commit 74c402a2a3
10 changed files with 56 additions and 44 deletions

View File

@@ -1,3 +1,7 @@
2002-07-17 Jay Monkman <jtm@smoothsmoothie.com>
* netinet/in.h, netinet/ip.h, netinet/ip_var.h, netinet/tcp.h:
Modified to added packed attribute.o
2002-07-05 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac: RTEMS_TOP(../..).

View File

@@ -204,12 +204,12 @@
* have a fit if we use.
*/
#define IPPORT_RESERVEDSTART 600
#define BYTE_PACK __attribute__((packed))
/*
* Internet address (a structure for historical reasons)
*/
struct in_addr {
u_long s_addr;
u_long s_addr BYTE_PACK;
};
/*

View File

@@ -64,17 +64,18 @@ struct ip {
#endif
#endif /* not _IP_VHL */
u_char ip_tos; /* type of service */
u_short ip_len; /* total length */
u_short ip_id; /* identification */
u_short ip_off; /* fragment offset field */
u_short ip_len BYTE_PACK; /* total length */
u_short ip_id BYTE_PACK; /* identification */
u_short ip_off BYTE_PACK; /* fragment offset field */
#define IP_RF 0x8000 /* reserved fragment flag */
#define IP_DF 0x4000 /* dont fragment flag */
#define IP_MF 0x2000 /* more fragments flag */
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
u_char ip_ttl; /* time to live */
u_char ip_p; /* protocol */
u_short ip_sum; /* checksum */
struct in_addr ip_src,ip_dst; /* source and dest address */
u_short ip_sum BYTE_PACK; /* checksum */
struct in_addr ip_src BYTE_PACK; /* source address */
struct in_addr ip_dst BYTE_PACK; /* dest address */
};
#ifdef _IP_VHL

View File

@@ -41,10 +41,11 @@
* Overlay for ip header used by other protocols (tcp, udp).
*/
struct ipovly {
caddr_t ih_next, ih_prev; /* for protocol sequence q's */
caddr_t ih_next BYTE_PACK;
caddr_t ih_prev BYTE_PACK; /* for protocol sequence q's */
u_char ih_x1; /* (unused) */
u_char ih_pr; /* protocol */
u_short ih_len; /* protocol length */
u_short ih_len BYTE_PACK; /* protocol length */
struct in_addr ih_src; /* source internet address */
struct in_addr ih_dst; /* destination internet address */
};
@@ -59,12 +60,12 @@ struct ipq {
struct ipq *next,*prev; /* to other reass headers */
u_char ipq_ttl; /* time for reass q to live */
u_char ipq_p; /* protocol of this fragment */
u_short ipq_id; /* sequence id for reassembly */
u_short ipq_id BYTE_PACK; /* sequence id for reassembly */
struct ipasfrag *ipq_next,*ipq_prev;
/* to ip headers of fragments */
struct in_addr ipq_src,ipq_dst;
#ifdef IPDIVERT
u_short ipq_divert; /* divert protocol port */
u_short ipq_divert BYTE_PACK; /* divert protocol port */
#endif
};
@@ -85,12 +86,12 @@ struct ipasfrag {
u_char ipf_mff; /* XXX overlays ip_tos: use low bit
* to avoid destroying tos;
* copied from (ip_off&IP_MF) */
u_short ip_len;
u_short ip_id;
u_short ip_off;
u_short ip_len BYTE_PACK;
u_short ip_id BYTE_PACK;
u_short ip_off BYTE_PACK;
u_char ip_ttl;
u_char ip_p;
u_short ip_sum;
u_short ip_sum BYTE_PACK;
struct ipasfrag *ipf_next; /* next fragment */
struct ipasfrag *ipf_prev; /* previous fragment */
};

View File

@@ -45,10 +45,10 @@ typedef u_long tcp_cc; /* connection count per rfc1644 */
* Per RFC 793, September, 1981.
*/
struct tcphdr {
u_short th_sport; /* source port */
u_short th_dport; /* destination port */
tcp_seq th_seq; /* sequence number */
tcp_seq th_ack; /* acknowledgement number */
u_short th_sport BYTE_PACK; /* source port */
u_short th_dport BYTE_PACK; /* destination port */
tcp_seq th_seq BYTE_PACK; /* sequence number */
tcp_seq th_ack BYTE_PACK; /* acknowledgement number */
#if BYTE_ORDER == LITTLE_ENDIAN
u_char th_x2:4, /* (unused) */
th_off:4; /* data offset */
@@ -66,9 +66,9 @@ struct tcphdr {
#define TH_URG 0x20
#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG)
u_short th_win; /* window */
u_short th_sum; /* checksum */
u_short th_urp; /* urgent pointer */
u_short th_win BYTE_PACK; /* window */
u_short th_sum BYTE_PACK; /* checksum */
u_short th_urp BYTE_PACK; /* urgent pointer */
};
#define TCPOPT_EOL 0

View File

@@ -1,3 +1,7 @@
2002-07-17 Jay Monkman <jtm@smoothsmoothie.com>
* netinet/in.h, netinet/ip.h, netinet/ip_var.h, netinet/tcp.h:
Modified to added packed attribute.o
2002-07-05 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac: RTEMS_TOP(../..).

View File

@@ -204,12 +204,12 @@
* have a fit if we use.
*/
#define IPPORT_RESERVEDSTART 600
#define BYTE_PACK __attribute__((packed))
/*
* Internet address (a structure for historical reasons)
*/
struct in_addr {
u_long s_addr;
u_long s_addr BYTE_PACK;
};
/*

View File

@@ -64,17 +64,18 @@ struct ip {
#endif
#endif /* not _IP_VHL */
u_char ip_tos; /* type of service */
u_short ip_len; /* total length */
u_short ip_id; /* identification */
u_short ip_off; /* fragment offset field */
u_short ip_len BYTE_PACK; /* total length */
u_short ip_id BYTE_PACK; /* identification */
u_short ip_off BYTE_PACK; /* fragment offset field */
#define IP_RF 0x8000 /* reserved fragment flag */
#define IP_DF 0x4000 /* dont fragment flag */
#define IP_MF 0x2000 /* more fragments flag */
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
u_char ip_ttl; /* time to live */
u_char ip_p; /* protocol */
u_short ip_sum; /* checksum */
struct in_addr ip_src,ip_dst; /* source and dest address */
u_short ip_sum BYTE_PACK; /* checksum */
struct in_addr ip_src BYTE_PACK; /* source address */
struct in_addr ip_dst BYTE_PACK; /* dest address */
};
#ifdef _IP_VHL

View File

@@ -41,10 +41,11 @@
* Overlay for ip header used by other protocols (tcp, udp).
*/
struct ipovly {
caddr_t ih_next, ih_prev; /* for protocol sequence q's */
caddr_t ih_next BYTE_PACK;
caddr_t ih_prev BYTE_PACK; /* for protocol sequence q's */
u_char ih_x1; /* (unused) */
u_char ih_pr; /* protocol */
u_short ih_len; /* protocol length */
u_short ih_len BYTE_PACK; /* protocol length */
struct in_addr ih_src; /* source internet address */
struct in_addr ih_dst; /* destination internet address */
};
@@ -59,12 +60,12 @@ struct ipq {
struct ipq *next,*prev; /* to other reass headers */
u_char ipq_ttl; /* time for reass q to live */
u_char ipq_p; /* protocol of this fragment */
u_short ipq_id; /* sequence id for reassembly */
u_short ipq_id BYTE_PACK; /* sequence id for reassembly */
struct ipasfrag *ipq_next,*ipq_prev;
/* to ip headers of fragments */
struct in_addr ipq_src,ipq_dst;
#ifdef IPDIVERT
u_short ipq_divert; /* divert protocol port */
u_short ipq_divert BYTE_PACK; /* divert protocol port */
#endif
};
@@ -85,12 +86,12 @@ struct ipasfrag {
u_char ipf_mff; /* XXX overlays ip_tos: use low bit
* to avoid destroying tos;
* copied from (ip_off&IP_MF) */
u_short ip_len;
u_short ip_id;
u_short ip_off;
u_short ip_len BYTE_PACK;
u_short ip_id BYTE_PACK;
u_short ip_off BYTE_PACK;
u_char ip_ttl;
u_char ip_p;
u_short ip_sum;
u_short ip_sum BYTE_PACK;
struct ipasfrag *ipf_next; /* next fragment */
struct ipasfrag *ipf_prev; /* previous fragment */
};

View File

@@ -45,10 +45,10 @@ typedef u_long tcp_cc; /* connection count per rfc1644 */
* Per RFC 793, September, 1981.
*/
struct tcphdr {
u_short th_sport; /* source port */
u_short th_dport; /* destination port */
tcp_seq th_seq; /* sequence number */
tcp_seq th_ack; /* acknowledgement number */
u_short th_sport BYTE_PACK; /* source port */
u_short th_dport BYTE_PACK; /* destination port */
tcp_seq th_seq BYTE_PACK; /* sequence number */
tcp_seq th_ack BYTE_PACK; /* acknowledgement number */
#if BYTE_ORDER == LITTLE_ENDIAN
u_char th_x2:4, /* (unused) */
th_off:4; /* data offset */
@@ -66,9 +66,9 @@ struct tcphdr {
#define TH_URG 0x20
#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG)
u_short th_win; /* window */
u_short th_sum; /* checksum */
u_short th_urp; /* urgent pointer */
u_short th_win BYTE_PACK; /* window */
u_short th_sum BYTE_PACK; /* checksum */
u_short th_urp BYTE_PACK; /* urgent pointer */
};
#define TCPOPT_EOL 0