Network route API: Second try (WIP).

Implement BNetworkRoster::GetRoutes() and BNetworkInterface::GetRoutes().
Also implement BNetworkInterface::GetDefaultGateway().
There is code duplication at the moment, and the api only supports IPV4.
This commit is contained in:
Stefano Ceccherini
2013-11-16 13:29:32 +01:00
parent c88a1b9d2a
commit 905f910e53
5 changed files with 110 additions and 80 deletions
+3 -1
View File
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <net/if_types.h>
#include <List.h>
#include <ObjectList.h>
#include <NetworkAddress.h>
@@ -106,6 +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 AutoConfigure(int family);
+2 -4
View File
@@ -8,7 +8,7 @@
#include <Locker.h>
#include <NetworkNotifications.h>
#include <ObjectList.h>
class BMessenger;
class BNetworkInterface;
@@ -31,9 +31,7 @@ public:
status_t RemoveInterface(
const BNetworkInterface& interface);
status_t GetNextRoute(uint32* cookie,
route_entry& entry,
const char* interface = NULL) const;
status_t GetRoutes(BObjectList<route_entry>& routes) const;
int32 CountPersistentNetworks() const;
status_t GetNextPersistentNetwork(uint32* cookie,