X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FIPStack%2Fmain.c;h=d5d1ebc2297796ffe31b4a9e61ffbb5ee0095d4c;hb=7536e8afcc3018c4ca2a4aa8f8422cf86a6c188c;hp=c89e79affd097e20886d8d41aa39bbdcead23df7;hpb=fbdee4576c1abe0e817ed974c882bfec63eaa842;p=tpg%2Facess2.git diff --git a/Modules/IPStack/main.c b/Modules/IPStack/main.c index c89e79af..d5d1ebc2 100644 --- a/Modules/IPStack/main.c +++ b/Modules/IPStack/main.c @@ -30,6 +30,11 @@ extern tRoute *IPStack_AddRoute(const char *Interface, void *Network, int Subnet // === GLOBALS === MODULE_DEFINE(0, VERSION, IPStack, IPStack_Install, NULL, NULL); +tVFS_NodeType gIP_RootNodeType = { + .ReadDir = IPStack_Root_ReadDir, + .FindDir = IPStack_Root_FindDir, + .IOCtl = IPStack_Root_IOCtl +}; tDevFS_Driver gIP_DriverInfo = { NULL, "ip", { @@ -37,9 +42,7 @@ tDevFS_Driver gIP_DriverInfo = { .NumACLs = 1, .ACLs = &gVFS_ACL_EveryoneRX, .Flags = VFS_FFLAG_DIRECTORY, - .ReadDir = IPStack_Root_ReadDir, - .FindDir = IPStack_Root_FindDir, - .IOCtl = IPStack_Root_IOCtl + .Type = &gIP_RootNodeType } }; @@ -229,7 +232,7 @@ int IPStack_CompareAddress(int AddressType, const void *Address1, const void *Ad const Uint8 *addr1 = Address1, *addr2 = Address2; // Sanity check size - if( CheckBits < 0 ) CheckBits = 0; + if( CheckBits < 0 ) CheckBits = size*8; if( CheckBits > size*8 ) CheckBits = size*8; if( CheckBits == 0 ) return 1; // /0 matches anything @@ -263,8 +266,8 @@ const char *IPStack_PrintAddress(int AddressType, const void *Address) static char ret[8*4+7+1]; const Uint16 *addr = Address; sprintf(ret, "%x:%x:%x:%x:%x:%x:%x:%x", - addr[0], addr[1], addr[2], addr[3], - addr[4], addr[5], addr[6], addr[7] + ntohs(addr[0]), ntohs(addr[1]), ntohs(addr[2]), ntohs(addr[3]), + ntohs(addr[4]), ntohs(addr[5]), ntohs(addr[6]), ntohs(addr[7]) ); return ret; }