Modules/USB - Cleanup mostly
[tpg/acess2.git] / Modules / IPStack / ipstack.h
index e6ded4b..e51fded 100644 (file)
@@ -38,21 +38,6 @@ struct sMacAddr {
        Uint8   B[6];
 } __attribute__((packed));
 
-struct sInterface {
-       struct sInterface       *Next;  //!< Next interface in list
-       
-       tVFS_Node       Node;   //!< Node to use the interface
-       
-       tAdapter        *Adapter;       //!< Adapter the interface is associated with
-        int    TimeoutDelay;   //!< Time in miliseconds before a packet times out
-        int    Type;   //!< Interface type, see ::eInterfaceTypes
-       
-       void    *Address;       //!< IP address (stored after the Name)
-        int    SubnetBits;     //!< Number of bits that denote the address network
-       
-       char    Name[];
-};
-
 /**
  * \brief Route definition structure
  */
@@ -69,6 +54,23 @@ typedef struct sRoute {
         int    Metric; //!< Route priority
 }      tRoute;
 
+struct sInterface {
+       struct sInterface       *Next;  //!< Next interface in list
+       
+       tVFS_Node       Node;   //!< Node to use the interface
+       
+       tAdapter        *Adapter;       //!< Adapter the interface is associated with
+        int    TimeoutDelay;   //!< Time in miliseconds before a packet times out
+        int    Type;   //!< Interface type, see ::eInterfaceTypes
+       
+       void    *Address;       //!< IP address (stored after the Name)
+        int    SubnetBits;     //!< Number of bits that denote the address network
+       
+       tRoute  Route;  //!< Interface route
+       
+       char    Name[];
+};
+
 /**
  * \brief Represents a network adapter
  */
@@ -95,6 +97,7 @@ struct sSocketFile
 };
 
 static const tMacAddr cMAC_BROADCAST = {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}};
+static const tMacAddr cMAC_ZERO = {{0x00,0x00,0x00,0x00,0x00,0x00}};
 
 #define MAC_SET(t,v)   memcpy(&(t),&(v),sizeof(tMacAddr))
 #define IP4_SET(t,v)   (t).L = (v).L;
@@ -114,8 +117,8 @@ static const tMacAddr cMAC_BROADCAST = {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}};
 
 extern int     IPStack_AddFile(tSocketFile *File);
 extern int     IPStack_GetAddressSize(int AddressType);
-extern int     IPStack_CompareAddress(int AddressType, void *Address1, void *Address2, int CheckBits);
-extern const char      *IPStack_PrintAddress(int AddressType, void *Address);
+extern int     IPStack_CompareAddress(int AddressType, const void *Address1, const void *Address2, int CheckBits);
+extern const char      *IPStack_PrintAddress(int AddressType, const void *Address);
 
 extern tRoute  *IPStack_FindRoute(int AddressType, tInterface *Interface, void *Address);
 

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