X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FIPStack%2Fipstack.h;h=43953942276a31ee2b8d99ddc54736d43d0e6157;hb=1529dadb6c2170bf9899fbde46d06a3d9a392b52;hp=95f93c478181bd444441c30d01db1fd3ad2c09d3;hpb=872dbea3900b09c78092d3cdf035513f400bcfe8;p=tpg%2Facess2.git diff --git a/Modules/IPStack/ipstack.h b/Modules/IPStack/ipstack.h index 95f93c47..43953942 100644 --- a/Modules/IPStack/ipstack.h +++ b/Modules/IPStack/ipstack.h @@ -23,6 +23,7 @@ union uIPv4 { } __attribute__((packed)); union uIPv6 { + Uint16 W[8]; Uint32 L[4]; Uint8 B[16]; } __attribute__((packed)); @@ -35,7 +36,7 @@ struct sInterface { struct sInterface *Next; tVFS_Node Node; tAdapter *Adapter; - int TimeoutDelay; // Time in miliseconds before a connection times out + int TimeoutDelay; // Time in miliseconds before a packet times out int Type; // 0 for disabled, 4 for IPv4 and 6 for IPv6 union { struct { @@ -82,17 +83,17 @@ static const tMacAddr cMAC_BROADCAST = {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}}; #define IP4_SET(t,v) (t).L = (v).L; #define IP6_SET(t,v) memcpy(&(t),&(v),sizeof(tIPv6)) -#define MAC_EQU(a,b) memcmp(&(a),&(b),sizeof(tMacAddr)) +#define MAC_EQU(a,b) (memcmp(&(a),&(b),sizeof(tMacAddr))==0) #define IP4_EQU(a,b) ((a).L==(b).L) -#define IP6_EQU(a,b) memcmp(&(a),&(b),sizeof(tIPv6)) +#define IP6_EQU(a,b) (memcmp(&(a),&(b),sizeof(tIPv6))==0) // === FUNCTIONS === #define htonb(v) (v) -#define htons(in) BigEndian16(in) -#define htonl(in) BigEndian32(in) +#define htons(v) BigEndian16(v) +#define htonl(v) BigEndian32(v) #define ntonb(v) (v) -#define ntohs(in) BigEndian16(in) -#define ntohl(in) BigEndian32(in) +#define ntohs(v) BigEndian16(v) +#define ntohl(v) BigEndian32(v) extern int IPStack_AddFile(tSocketFile *File);