Kernel - Instruction tracing support
[tpg/acess2.git] / Modules / IPStack / interface.c
index fc79e9e..6538078 100644 (file)
@@ -34,18 +34,18 @@ tVFS_Node   *IPStack_Iface_FindDir(tVFS_Node *Node, const char *Name);
 // === GLOBALS ===
 //! Loopback (127.0.0.0/8, ::1) Pseudo-Interface
 tInterface     gIP_LoopInterface = {
-       Node: {
-               ImplPtr: &gIP_LoopInterface,
-               Flags: VFS_FFLAG_DIRECTORY,
-               Size: -1,
-               NumACLs: 1,
-               ACLs: &gVFS_ACL_EveryoneRX,
-               ReadDir: IPStack_Iface_ReadDir,
-               FindDir: IPStack_Iface_FindDir,
-               IOCtl: IPStack_Iface_IOCtl
+       .Node = {
+               .ImplPtr = &gIP_LoopInterface,
+               .Flags = VFS_FFLAG_DIRECTORY,
+               .Size = -1,
+               .NumACLs = 1,
+               .ACLs = &gVFS_ACL_EveryoneRX,
+               .ReadDir = IPStack_Iface_ReadDir,
+               .FindDir = IPStack_Iface_FindDir,
+               .IOCtl = IPStack_Iface_IOCtl
        },
-       Adapter: NULL,
-       Type: 0
+       .Adapter = NULL,
+       .Type = 0
 };
 tShortSpinlock glIP_Interfaces;
 tInterface     *gIP_Interfaces = NULL;
@@ -54,8 +54,8 @@ tInterface    *gIP_Interfaces_Last = NULL;
 tSocketFile    *gIP_FileTemplates;
 
 tAdapter       gIP_LoopAdapter = {
-       DeviceLen: 8,
-       Device: "LOOPBACK"
+       .DeviceLen = 8,
+       .Device = "LOOPBACK"
        };
 tMutex glIP_Adapters;
 tAdapter       *gIP_Adapters = NULL;
@@ -192,28 +192,12 @@ int IPStack_Root_IOCtl(tVFS_Node *Node, int ID, void *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;
+       BASE_IOCTLS(DRV_TYPE_MISC, "IPStack", VERSION, casIOCtls_Root)
                
-               /*
-                * add_interface
-                * - Adds a new IP interface and binds it to a device
-                */
+       /*
+        * 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);
@@ -384,23 +368,7 @@ int IPStack_Iface_IOCtl(tVFS_Node *Node, int ID, void *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, STR(IDENT));
-               LEAVE('i', 1);
-               return 1;
-       
-       case DRV_IOCTL_VERSION:
-               LEAVE('x', VERSION);
-               return VERSION;
-       
-       case DRV_IOCTL_LOOKUP:
-               tmp = ModUtil_LookupString( (char**)casIOCtls_Iface, (char*)Data );
-               LEAVE('i', tmp);
-               return tmp;
+       BASE_IOCTLS(DRV_TYPE_MISC, "IPStack", VERSION, casIOCtls_Iface)
        
        /*
         * getset_type

UCC git Repository :: git.ucc.asn.au