// === PROTOTYPES ===
// - Routes directory
int IPStack_RouteDir_ReadDir(tVFS_Node *Node, int Pos, char Dest[FILENAME_MAX]);
-tVFS_Node *IPStack_RouteDir_FindDir(tVFS_Node *Node, const char *Name);
+tVFS_Node *IPStack_RouteDir_FindDir(tVFS_Node *Node, const char *Name, Uint Flags);
tVFS_Node *IPStack_RouteDir_MkNod(tVFS_Node *Node, const char *Name, Uint Flags);
int IPStack_RouteDir_Unlink(tVFS_Node *Node, const char *OldName);
tRoute *_Route_FindExactRoute(int Type, void *Network, int Subnet, int Metric);
// - Route Management
tRoute *IPStack_Route_Create(int AddrType, void *Network, int SubnetBits, int Metric);
tRoute *IPStack_AddRoute(const char *Interface, void *Network, int SubnetBits, void *NextHop, int Metric);
-tRoute *_Route_FindInterfaceRoute(int AddressType, void *Address);
-tRoute *IPStack_FindRoute(int AddressType, tInterface *Interface, void *Address);
+tRoute *_Route_FindInterfaceRoute(int AddressType, const void *Address);
+tRoute *IPStack_FindRoute(int AddressType, tInterface *Interface, const void *Address);
// - Individual Routes
int IPStack_Route_IOCtl(tVFS_Node *Node, int ID, void *Data);
/**
* \brief FindDir for the /Devices/ip/routes/ directory
*/
-tVFS_Node *IPStack_RouteDir_FindDir(tVFS_Node *Node, const char *Name)
+tVFS_Node *IPStack_RouteDir_FindDir(tVFS_Node *Node, const char *Name, Uint Flags)
{
// Interpret the name as <type>:<addr>, returning the interface for
// needed to access that address.
{
LOG("Why does this route not have a node? trying to find an iface for the next hop");
- rt = _Route_FindInterfaceRoute(type, rt->NextHop);
- if(!rt) {
+ void *nextrt = _Route_FindInterfaceRoute(type, rt->NextHop);
+ if(!nextrt) {
Log_Notice("Cannot find route to next hop '%s'",
IPStack_PrintAddress(type, rt->NextHop));
return NULL;
}
+ rt = nextrt;
}
if( !rt->Interface ) {
Log_Notice("Routes", "No interface for route %p, what the?", rt);
/**
* \brief Locates what interface should be used to get directly to an address
*/
-tRoute *_Route_FindInterfaceRoute(int AddressType, void *Address)
+tRoute *_Route_FindInterfaceRoute(int AddressType, const void *Address)
{
tRoute *best = NULL, *rt;
int addrSize = IPStack_GetAddressSize(AddressType);
/**
*/
-tRoute *IPStack_FindRoute(int AddressType, tInterface *Interface, void *Address)
+tRoute *IPStack_FindRoute(int AddressType, tInterface *Interface, const void *Address)
{
tRoute *rt;
tRoute *best = NULL;