2010-08-06 12:08:02 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2010, Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _NETWORK_ROSTER_H
|
|
|
|
#define _NETWORK_ROSTER_H
|
|
|
|
|
|
|
|
|
2010-08-09 20:31:40 +04:00
|
|
|
#include <Locker.h>
|
2010-10-26 00:20:09 +04:00
|
|
|
#include <NetworkNotifications.h>
|
2013-11-16 16:26:49 +04:00
|
|
|
#include <ObjectList.h>
|
2010-08-06 12:08:02 +04:00
|
|
|
|
|
|
|
class BMessenger;
|
|
|
|
class BNetworkInterface;
|
2013-11-16 00:57:57 +04:00
|
|
|
struct route_entry;
|
2011-10-09 23:56:19 +04:00
|
|
|
struct wireless_network;
|
2010-08-06 12:08:02 +04:00
|
|
|
|
|
|
|
|
|
|
|
class BNetworkRoster {
|
|
|
|
public:
|
2010-08-06 17:22:25 +04:00
|
|
|
static BNetworkRoster& Default();
|
|
|
|
|
2010-08-09 20:31:40 +04:00
|
|
|
size_t CountInterfaces() const;
|
|
|
|
status_t GetNextInterface(uint32* cookie,
|
|
|
|
BNetworkInterface& interface) const;
|
2010-08-06 12:08:02 +04:00
|
|
|
|
2010-11-24 00:01:19 +03:00
|
|
|
status_t AddInterface(const char* name);
|
2010-08-06 12:08:02 +04:00
|
|
|
status_t AddInterface(
|
|
|
|
const BNetworkInterface& interface);
|
2010-11-24 00:01:19 +03:00
|
|
|
status_t RemoveInterface(const char* name);
|
2010-08-06 12:08:02 +04:00
|
|
|
status_t RemoveInterface(
|
|
|
|
const BNetworkInterface& interface);
|
|
|
|
|
2013-11-18 13:11:40 +04:00
|
|
|
status_t GetRoutes(int family,
|
|
|
|
BObjectList<route_entry>& routes) const;
|
2013-11-16 00:57:57 +04:00
|
|
|
|
2011-10-09 23:56:19 +04:00
|
|
|
int32 CountPersistentNetworks() const;
|
|
|
|
status_t GetNextPersistentNetwork(uint32* cookie,
|
|
|
|
wireless_network& network) const;
|
|
|
|
status_t AddPersistentNetwork(
|
|
|
|
const wireless_network& network);
|
|
|
|
status_t RemovePersistentNetwork(const char* name);
|
|
|
|
|
2010-08-06 12:08:02 +04:00
|
|
|
status_t StartWatching(const BMessenger& target,
|
|
|
|
uint32 eventMask);
|
|
|
|
void StopWatching(const BMessenger& target);
|
|
|
|
|
|
|
|
private:
|
|
|
|
BNetworkRoster();
|
|
|
|
~BNetworkRoster();
|
2010-08-09 20:31:40 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
static BNetworkRoster sDefault;
|
2010-08-06 12:08:02 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _NETWORK_ROSTER_H
|