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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user