xref: /haiku/headers/os/net/NetworkRoster.h (revision 308f0e195dc9a71620970f8ebfe6e02fe6e27ddc)
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(
26 									const BNetworkInterface& interface);
27 			status_t			RemoveInterface(
28 									const BNetworkInterface& interface);
29 
30 			status_t			StartWatching(const BMessenger& target,
31 									uint32 eventMask);
32 			void				StopWatching(const BMessenger& target);
33 
34 private:
35 								BNetworkRoster();
36 								~BNetworkRoster();
37 
38 private:
39 	static	BNetworkRoster		sDefault;
40 };
41 
42 
43 #endif	// _NETWORK_ROSTER_H
44