1/* 2 * Copyright 2010, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef _NETWORK_ROSTER_H 6#define _NETWORK_ROSTER_H 7 8 9#include <Locker.h> 10#include <NetworkNotifications.h> 11 12 13class BMessenger; 14class BNetworkInterface; 15struct wireless_network; 16 17 18class BNetworkRoster { 19public: 20 static BNetworkRoster& Default(); 21 22 size_t CountInterfaces() const; 23 status_t GetNextInterface(uint32* cookie, 24 BNetworkInterface& interface) const; 25 26 status_t AddInterface(const char* name); 27 status_t AddInterface( 28 const BNetworkInterface& interface); 29 status_t RemoveInterface(const char* name); 30 status_t RemoveInterface( 31 const BNetworkInterface& interface); 32 33 int32 CountPersistentNetworks() const; 34 status_t GetNextPersistentNetwork(uint32* cookie, 35 wireless_network& network) const; 36 status_t AddPersistentNetwork( 37 const wireless_network& network); 38 status_t RemovePersistentNetwork(const char* name); 39 40 status_t StartWatching(const BMessenger& target, 41 uint32 eventMask); 42 void StopWatching(const BMessenger& target); 43 44private: 45 BNetworkRoster(); 46 ~BNetworkRoster(); 47 48private: 49 static BNetworkRoster sDefault; 50}; 51 52 53#endif // _NETWORK_ROSTER_H 54