X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=lib%2Fipv4.h;h=0ee46fb24e1bbcd3c9d87ad81892c3e7257e84cf;hp=ec3c511561431fbb9e11b2d76d20b86aab9892bb;hb=1d7706a8506d8073def0965da809960c6ad8bf9a;hpb=b0a4f7b5551cae6fb5af2eb4bcb0dfb3443f7d89 diff --git a/lib/ipv4.h b/lib/ipv4.h index ec3c5115..0ee46fb2 100644 --- a/lib/ipv4.h +++ b/lib/ipv4.h @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: ipv4.h,v 1.1.2.1 2003/07/18 12:16:23 guus Exp $ + $Id: ipv4.h,v 1.1.2.4 2003/10/08 11:34:55 guus Exp $ */ #ifndef __TINC_IPV4_H__ @@ -47,8 +47,7 @@ #define IP_MSS 576 #endif -#ifndef HAVE_NETINET_IP_H - +#ifndef HAVE_STRUCT_IP struct ip { #if __BYTE_ORDER == __LITTLE_ENDIAN unsigned int ip_hl:4; @@ -58,29 +57,27 @@ struct ip { unsigned int ip_hl:4; #endif uint8_t ip_tos; - u_short ip_len; - u_short ip_id; - u_short ip_off; + uint16_t ip_len; + uint16_t ip_id; + uint16_t ip_off; #define IP_RF 0x8000 #define IP_DF 0x4000 #define IP_MF 0x2000 #define IP_OFFMASK 0x1fff uint8_t ip_ttl; uint8_t ip_p; - u_short ip_sum; + uint16_t ip_sum; struct in_addr ip_src, ip_dst; -}; - +} __attribute__ ((__packed__)); #endif -#ifndef HAVE_NETINET_IP_ICMP_H - +#ifndef HAVE_STRUCT_ICMP struct icmp { uint8_t icmp_type; uint8_t icmp_code; uint16_t icmp_cksum; union { - u_char ih_pptr; + uint8_t ih_pptr; struct in_addr ih_gwaddr; struct ih_idseq { uint16_t icd_id; @@ -129,8 +126,7 @@ struct icmp { #define icmp_radv icmp_dun.id_radv #define icmp_mask icmp_dun.id_mask #define icmp_data icmp_dun.id_data -}; - +} __attribute__ ((__packed__)); #endif #endif /* __TINC_IPV4_H__ */