11 typedef union uIPv4 tIPv4;
12 typedef union uIPv6 tIPv6;
13 typedef struct sMacAddr tMacAddr;
14 typedef struct sAdapter tAdapter;
15 typedef struct sInterface tInterface;
16 typedef struct sSocketFile tSocketFile;
18 typedef void (*tIPCallback)(tInterface *Interface, void *Address, int Length, void *Buffer);
23 } __attribute__((packed));
28 } __attribute__((packed));
32 } __attribute__((packed));
35 struct sInterface *Next;
38 int TimeoutDelay; // Time in miliseconds before a connection times out
39 int Type; // 0 for disabled, 4 for IPv4 and 6 for IPv6
43 int SubnetBits; //Should this be outside the union?
55 * \brief Represents a network adapter
58 struct sAdapter *Next;
68 * \brief Describes a socket file definition
72 struct sSocketFile *Next;
75 tVFS_Node *(*Init)(tInterface *Interface);
78 static const tMacAddr cMAC_BROADCAST = {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}};
80 #define MAC_SET(t,v) memcpy(&(t),&(v),sizeof(tMacAddr))
81 #define IP4_SET(t,v) (t).L = (v).L;
82 #define IP6_SET(t,v) memcpy(&(t),&(v),sizeof(tIPv6))
84 #define MAC_EQU(a,b) memcmp(&(a),&(b),sizeof(tMacAddr))
85 #define IP4_EQU(a,b) ((a).L==(b).L)
86 #define IP6_EQU(a,b) memcmp(&(a),&(b),sizeof(tIPv6))
90 #define htons(in) BigEndian16(in)
91 #define htonl(in) BigEndian32(in)
93 #define ntohs(in) BigEndian16(in)
94 #define ntohl(in) BigEndian32(in)
96 extern int IPStack_AddFile(tSocketFile *File);