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 13 class BMessenger; 14 class BNetworkInterface; 15 16 17 class BNetworkRoster { 18 public: 19 static BNetworkRoster& Default(); 20 21 size_t CountInterfaces() const; 22 status_t GetNextInterface(uint32* cookie, 23 BNetworkInterface& interface) const; 24 25 status_t AddInterface(const char* name); 26 status_t AddInterface( 27 const BNetworkInterface& interface); 28 status_t RemoveInterface(const char* name); 29 status_t RemoveInterface( 30 const BNetworkInterface& interface); 31 32 status_t StartWatching(const BMessenger& target, 33 uint32 eventMask); 34 void StopWatching(const BMessenger& target); 35 36 private: 37 BNetworkRoster(); 38 ~BNetworkRoster(); 39 40 private: 41 static BNetworkRoster sDefault; 42 }; 43 44 45 #endif // _NETWORK_ROSTER_H 46