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;
69 * \brief Describes a socket file definition
73 struct sSocketFile *Next;
76 tVFS_Node *(*Init)(tInterface *Interface);
79 static const tMacAddr cMAC_BROADCAST = {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}};
81 #define MAC_SET(t,v) memcpy(&(t),&(v),sizeof(tMacAddr))
82 #define IP4_SET(t,v) (t).L = (v).L;
83 #define IP6_SET(t,v) memcpy(&(t),&(v),sizeof(tIPv6))
85 #define MAC_EQU(a,b) (memcmp(&(a),&(b),sizeof(tMacAddr))==0)
86 #define IP4_EQU(a,b) ((a).L==(b).L)
87 #define IP6_EQU(a,b) (memcmp(&(a),&(b),sizeof(tIPv6))==0)
91 #define htons(in) BigEndian16(in)
92 #define htonl(in) BigEndian32(in)
94 #define ntohs(in) BigEndian16(in)
95 #define ntohl(in) BigEndian32(in)
97 extern int IPStack_AddFile(tSocketFile *File);