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;
17 typedef void (*tIPCallback)(tInterface *Interface, void *Address, int Length, void *Buffer);
22 } __attribute__((packed));
27 } __attribute__((packed));
31 } __attribute__((packed));
34 struct sInterface *Next;
37 int TimeoutDelay; // Time in miliseconds before a connection times out
38 int Type; // 0 for disabled, 4 for IPv4 and 6 for IPv6
42 int SubnetBits; //Should this be outside the union?
54 * \brief Represents a network adapter
57 struct sAdapter *Next;
66 static const tMacAddr cMAC_BROADCAST = {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}};
68 #define MAC_SET(t,v) memcpy(&(t),&(v),sizeof(tMacAddr))
69 #define IP4_SET(t,v) (t).L = (v).L;
70 #define IP6_SET(t,v) memcpy(&(t),&(v),sizeof(tIPv6))
72 #define MAC_EQU(a,b) memcmp(&(a),&(b),sizeof(tMacAddr))
73 #define IP4_EQU(a,b) ((a).L==(b).L)
74 #define IP6_EQU(a,b) memcmp(&(a),&(b),sizeof(tIPv6))
78 #define htons(in) BigEndian16(in)
79 #define htonl(in) BigEndian32(in)
81 #define ntohs(in) BigEndian16(in)
82 #define ntohl(in) BigEndian32(in)