3 * - Address Resolution Protocol
13 int IPStack_Install(char **Arguments);
14 char *IPStack_ReadDir(tVFS_Node *Node, int Pos);
15 tVFS_Node *IPStack_FindDir(tVFS_Node *Node, char *Name);
18 MODULE_DEFINE(0, 0x000A, IPStack, IPStack_Install, NULL);
19 tDevFS_Driver gIP_DriverInfo = {
23 .ACLs = &gVFS_ACL_EveryoneRX,
24 .Flags = VFS_FFLAG_DIRECTORY,
25 .ReadDir = IPStack_ReadDir,
26 .FindDir = IPStack_FindDir
29 int giIP_NumInterfaces;
30 tInterface *gIP_Interfaces = NULL;
34 * \fn int IPStack_Install(char **Arguments)
35 * \brief Intialise the relevant parts of the stack and register with DevFS
37 int IPStack_Install(char **Arguments)
44 // Parse module arguments
45 for( i = 0; Arguments[i]; i++ )
47 //if(strcmp(Arguments[i], "Device") == '=') {
56 * \brief Read from the IP Stack's Device Directory
58 char *IPStack_ReadDir(tVFS_Node *Node, int Pos)
61 char name[5] = "ip0\0\0";
67 name[2] = '0' + Pos/10;
68 name[3] = '0' + Pos%10;
72 for( iface = gIP_Interfaces; iface && Pos--; iface = iface->Next ) ;
74 // Did we run off the end?
75 if(!iface) return NULL;
77 // Return the pre-generated name
82 * \brief Get the node of an interface
84 tVFS_Node *IPStack_FindDir(tVFS_Node *Node, char *Name)