X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FIPStack%2Fipstack.h;h=3833ce7b0d6c2ed345765f511a6678f2d6529383;hb=e14ac96d48bb4ef5cfc845e345df4770e1145ceb;hp=e51fded928ca6f9b93d1bc54f214673480268a7f;hpb=48743e39650eb1ef988380e9d95f27fd40d3a9ce;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/IPStack/ipstack.h b/KernelLand/Modules/IPStack/ipstack.h index e51fded9..3833ce7b 100644 --- a/KernelLand/Modules/IPStack/ipstack.h +++ b/KernelLand/Modules/IPStack/ipstack.h @@ -15,7 +15,16 @@ typedef struct sAdapter tAdapter; typedef struct sInterface tInterface; typedef struct sSocketFile tSocketFile; -typedef void (*tIPCallback)(tInterface *Interface, void *Address, int Length, void *Buffer); +typedef enum eIPErrorMode +{ + IPERR_MISC, + IPERR_HOST_UNREACHABLE, + IPERR_PORT_UNREACHABLE, +} tIPErrorMode; + +// NOTE: Non-const to allow reuse of Rx buffer for prepping Tx +typedef void tIPRxCallback(tInterface *Interface, void *Address, int Length, void *Buffer); +typedef void tIPErrorCallback(tInterface *Interface, tIPErrorMode mode, const void *Address, int Length, const void *Buffer); enum eInterfaceTypes { AF_NULL, @@ -71,6 +80,7 @@ struct sInterface { char Name[]; }; +#if 0 /** * \brief Represents a network adapter */ @@ -84,6 +94,7 @@ struct sAdapter { int DeviceLen; //!< Device name length char Device[]; //!< Device name }; +#endif /** * \brief Describes a socket file definition @@ -118,8 +129,9 @@ static const tMacAddr cMAC_ZERO = {{0x00,0x00,0x00,0x00,0x00,0x00}}; extern int IPStack_AddFile(tSocketFile *File); extern int IPStack_GetAddressSize(int AddressType); extern int IPStack_CompareAddress(int AddressType, const void *Address1, const void *Address2, int CheckBits); +extern bool IPStack_AddressIsBroadcast(int AddrType, const void *Addr, int SubnetBits); extern const char *IPStack_PrintAddress(int AddressType, const void *Address); -extern tRoute *IPStack_FindRoute(int AddressType, tInterface *Interface, void *Address); +extern tRoute *IPStack_FindRoute(int AddressType, tInterface *Interface, const void *Address); #endif