Added family parameter to the GetRoutes() API.

Moved common code to a private file.
This commit is contained in:
Stefano Ceccherini
2013-11-18 10:13:26 +01:00
parent ba3f67bfb4
commit 41d4206692
8 changed files with 103 additions and 123 deletions
+2 -2
View File
@@ -106,8 +106,8 @@ public:
status_t RemoveRoute(int family,
const route_entry& route);
status_t RemoveDefaultRoute(int family);
status_t GetRoutes(BObjectList<route_entry>& routes) const;
status_t GetDefaultRoute(BNetworkAddress& gateway) const;
status_t GetRoutes(int family, BObjectList<route_entry>& routes) const;
status_t GetDefaultRoute(int family, BNetworkAddress& gateway) const;
status_t AutoConfigure(int family);
+2 -1
View File
@@ -31,7 +31,8 @@ public:
status_t RemoveInterface(
const BNetworkInterface& interface);
status_t GetRoutes(BObjectList<route_entry>& routes) const;
status_t GetRoutes(int family,
BObjectList<route_entry>& routes) const;
int32 CountPersistentNetworks() const;
status_t GetNextPersistentNetwork(uint32* cookie,
+14
View File
@@ -0,0 +1,14 @@
/*
* Copyright 2013, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef ROUTESUPPORT_H_
#define ROUTESUPPORT_H_
#include <ObjectList.h>
status_t get_routes(const char* interfaceName,
int family, BObjectList<route_entry>& routes);
#endif /* __ROUTESUPPORT_H_ */