+/**
+ * \brief Handles IOCtls for the IPStack root
+ */
+int IPStack_Root_IOCtl(tVFS_Node *Node, int ID, void *Data)
+{
+ int tmp;
+ ENTER("pNode iID pData", Node, ID, Data);
+
+ switch(ID)
+ {
+ // --- Standard IOCtls (0-3) ---
+ case DRV_IOCTL_TYPE:
+ LEAVE('i', DRV_TYPE_MISC);
+ return DRV_TYPE_MISC;
+
+ case DRV_IOCTL_IDENT:
+ tmp = ModUtil_SetIdent(Data, "IPStack");
+ LEAVE('i', 1);
+ return 1;
+
+ case DRV_IOCTL_VERSION:
+ LEAVE('x', VERSION);
+ return VERSION;
+
+ case DRV_IOCTL_LOOKUP:
+ tmp = ModUtil_LookupString( (char**)casIOCtls_Root, (char*)Data );
+ LEAVE('i', tmp);
+ return tmp;
+
+ /*
+ * add_interface
+ * - Adds a new IP interface and binds it to a device
+ */
+ case 4:
+ if( Threads_GetUID() != 0 ) LEAVE_RET('i', -1);
+ if( !CheckString( Data ) ) LEAVE_RET('i', -1);
+ tmp = IPStack_AddInterface(Data);
+ LEAVE_RET('i', tmp);
+ }
+ LEAVE('i', 0);
+ return 0;
+}
+
+/**
+ * \brief Read from an interface's directory
+ */
+char *IPStack_Iface_ReadDir(tVFS_Node *Node, int Pos)
+{
+ tSocketFile *file = gIP_FileTemplates;
+ while(Pos-- && file) {
+ file = file->Next;
+ }
+
+ if(!file) return NULL;
+
+ return strdup(file->Name);
+}
+
+/**
+ * \brief Gets a named node from an interface directory
+ */
+tVFS_Node *IPStack_Iface_FindDir(tVFS_Node *Node, char *Name)
+{
+ tSocketFile *file = gIP_FileTemplates;
+
+ // Get file definition
+ for(;file;file = file->Next)
+ {
+ if( strcmp(file->Name, Name) == 0 ) break;
+ }
+ if(!file) return NULL;
+
+ // Pass the buck!
+ return file->Init(Node->ImplPtr);
+}
+
+/**
+ * \brief Names for interface IOCtl Calls
+ */