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>
|
2010-08-06 12:08:02 +04:00
|
|
|
|
|
|
|
|
|
|
|
class BMessenger;
|
|
|
|
class BNetworkInterface;
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
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
|