X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FIPStack%2Fipstack.h;h=94fabbb5d346a7e5029c6172b4309fb4c08b9083;hb=685d1f5c4d865e814a4640f5f3270a82ea10e4b0;hp=526ff79c92969e501855a02b69854f2390b0612d;hpb=04b368645c34cc3853fc13f93e33ac7878be8479;p=tpg%2Facess2.git diff --git a/Modules/IPStack/ipstack.h b/Modules/IPStack/ipstack.h index 526ff79c..94fabbb5 100644 --- a/Modules/IPStack/ipstack.h +++ b/Modules/IPStack/ipstack.h @@ -5,7 +5,7 @@ #ifndef _IPSTACK_H_ #define _IPSTACK_H_ -#include +#include #include typedef union uIPv4 tIPv4; @@ -19,26 +19,26 @@ typedef void (*tIPCallback)(tInterface *Interface, void *Address, int Length, vo union uIPv4 { Uint32 L; Uint8 B[4]; -}; +} __attribute__((packed)); union uIPv6 { Uint32 L[4]; Uint8 B[16]; -}; +} __attribute__((packed)); struct sMacAddr { Uint8 B[6]; -}; +} __attribute__((packed)); struct sInterface { struct sInterface *Next; tVFS_Node Node; tAdapter *Adapter; - int Type; // 4 for IPv4 and 6 for IPv6 + int Type; // 0 for disabled, 4 for IPv4 and 6 for IPv6 union { struct { tIPv6 Address; - int SubnetBits; + int SubnetBits; //Should this be outside the union? } IP6; struct { @@ -78,6 +78,6 @@ static const tMacAddr cMAC_BROADCAST = {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}}; #define htonl(in) BigEndian32(in) #define ntonb(v) (v) #define ntohs(in) BigEndian16(in) -#define ntohl(in) BigEndian16(in) +#define ntohl(in) BigEndian32(in) #endif