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);
34 struct sInterface *Next;
37 int Type; // 4 for IPv4 and 6 for IPv6
53 * \brief Represents a network adapter
56 struct sAdapter *Next;
65 static const tMacAddr cMAC_BROADCAST = {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}};
67 #define MAC_SET(t,v) memcpy(&(t),&(v),sizeof(tMacAddr))
68 #define IP4_SET(t,v) (t).L = (v).L;
69 #define IP6_SET(t,v) memcpy(&(t),&(v),sizeof(tIPv6))
71 #define MAC_EQU(a,b) memcmp(&(a),&(b),sizeof(tMacAddr))
72 #define IP4_EQU(a,b) ((a).L==(b).L)
73 #define IP6_EQU(a,b) memcmp(&(a),&(b),sizeof(tIPv6))
77 #define htons(in) BigEndian16(in)
78 #define htonl(in) BigEndian32(in)
80 #define ntohs(in) BigEndian16(in)
81 #define ntohl(in) BigEndian16(in)