2010-08-06 08:08:02 +00: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 16:31:40 +00:00
|
|
|
#include <Locker.h>
|
2010-10-25 20:20:09 +00:00
|
|
|
#include <NetworkNotifications.h>
|
2010-08-06 08:08:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
class BMessenger;
|
|
|
|
class BNetworkInterface;
|
|
|
|
|
|
|
|
|
|
|
|
class BNetworkRoster {
|
|
|
|
public:
|
2010-08-06 13:22:25 +00:00
|
|
|
static BNetworkRoster& Default();
|
|
|
|
|
2010-08-09 16:31:40 +00:00
|
|
|
size_t CountInterfaces() const;
|
|
|
|
status_t GetNextInterface(uint32* cookie,
|
|
|
|
BNetworkInterface& interface) const;
|
2010-08-06 08:08:02 +00:00
|
|
|
|
2010-11-23 21:01:19 +00:00
|
|
|
status_t AddInterface(const char* name);
|
2010-08-06 08:08:02 +00:00
|
|
|
status_t AddInterface(
|
|
|
|
const BNetworkInterface& interface);
|
2010-11-23 21:01:19 +00:00
|
|
|
status_t RemoveInterface(const char* name);
|
2010-08-06 08:08:02 +00:00
|
|
|
status_t RemoveInterface(
|
|
|
|
const BNetworkInterface& interface);
|
|
|
|
|
|
|
|
status_t StartWatching(const BMessenger& target,
|
|
|
|
uint32 eventMask);
|
|
|
|
void StopWatching(const BMessenger& target);
|
|
|
|
|
|
|
|
private:
|
|
|
|
BNetworkRoster();
|
|
|
|
~BNetworkRoster();
|
2010-08-09 16:31:40 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static BNetworkRoster sDefault;
|
2010-08-06 08:08:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _NETWORK_ROSTER_H
|