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,
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