X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FIPStack%2Fipv4.h;h=33507b28f568f5f4d0fb26f4ec7ff1fe7c4a73c9;hb=7941d6b368acb0abc17e6a77ffaf7b4c306b67ab;hp=b092becb0541200aefba315ba6c140a7e66e4d8e;hpb=0f48b41ce8edd3b6d549d641b35901e4b51a5132;p=tpg%2Facess2.git diff --git a/Modules/IPStack/ipv4.h b/Modules/IPStack/ipv4.h index b092becb..33507b28 100644 --- a/Modules/IPStack/ipv4.h +++ b/Modules/IPStack/ipv4.h @@ -28,7 +28,7 @@ struct sIPv4Header } __attribute__((packed)); Uint8 FragOffHi; // Number of 8-byte blocks from the original start - Uint8 TTL; // Max number of hops effectively + Uint8 TTL; // Max number of hops, effectively Uint8 Protocol; Uint16 HeaderChecksum; // One's Complement Sum of the entire header must equal zero @@ -39,12 +39,14 @@ struct sIPv4Header } __attribute__((packed)); #define IP4PROT_ICMP 1 -#define IP4PROT_TCP 6 -#define IP4PROT_UDP 17 +#define IP4PROT_TCP 6 +#define IP4PROT_UDP 17 #define IPV4_ETHERNET_ID 0x0800 // === FUNCTIONS === extern int IPv4_RegisterCallback(int ID, tIPCallback Callback); +extern Uint16 IPv4_Checksum(const void *Buf, int Size); +extern int IPv4_SendPacket(tInterface *Iface, tIPv4 Address, int Protocol, int ID, int Length, const void *Data); #endif