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));
29 } __attribute__((packed));
33 } __attribute__((packed));
36 struct sInterface *Next;
39 int TimeoutDelay; // Time in miliseconds before a packet times out
40 int Type; // 0 for disabled, 4 for IPv4 and 6 for IPv6
44 int SubnetBits; //Should this be outside the union?
56 * \brief Represents a network adapter
59 struct sAdapter *Next;
70 * \brief Describes a socket file definition
74 struct sSocketFile *Next;
77 tVFS_Node *(*Init)(tInterface *Interface);
80 static const tMacAddr cMAC_BROADCAST = {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}};
82 #define MAC_SET(t,v) memcpy(&(t),&(v),sizeof(tMacAddr))
83 #define IP4_SET(t,v) (t).L = (v).L;
84 #define IP6_SET(t,v) memcpy(&(t),&(v),sizeof(tIPv6))
86 #define MAC_EQU(a,b) (memcmp(&(a),&(b),sizeof(tMacAddr))==0)
87 #define IP4_EQU(a,b) ((a).L==(b).L)
88 #define IP6_EQU(a,b) (memcmp(&(a),&(b),sizeof(tIPv6))==0)
92 #define htons(v) BigEndian16(v)
93 #define htonl(v) BigEndian32(v)
95 #define ntohs(v) BigEndian16(v)
96 #define ntohl(v) BigEndian32(v)
98 extern int IPStack_AddFile(tSocketFile *File);