xref: /haiku/headers/os/net/NetworkNotifications.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_NOTIFICATIONS_H
6 #define _NETWORK_NOTIFICATIONS_H
7 
8 
9 #include <SupportDefs.h>
10 
11 
12 class BHandler;
13 class BLooper;
14 class BMessenger;
15 
16 
17 #define B_NETWORK_INTERFACE_ADDED				0x0001
18 #define B_NETWORK_INTERFACE_REMOVED				0x0002
19 #define B_NETWORK_INTERFACE_CHANGED				0x0003
20 #define B_NETWORK_DEVICE_LINK_CHANGED			0x0010
21 #define B_NETWORK_WLAN_JOINED					0x0100
22 #define B_NETWORK_WLAN_LEFT						0x0200
23 #define B_NETWORK_WLAN_SCANNED					0x0300
24 #define B_NETWORK_WLAN_MESSAGE_INTEGRITY_FAILED	0x0400
25 
26 // TODO: add routes, stack unloaded/loaded, ... events
27 
28 enum {
29 	B_WATCH_NETWORK_INTERFACE_CHANGES	= 0x000f,
30 	B_WATCH_NETWORK_LINK_CHANGES	 	= 0x00f0,
31 	B_WATCH_NETWORK_WLAN_CHANGES		= 0x0f00
32 };
33 
34 #define B_NETWORK_MONITOR				'_NTN'
35 
36 
37 #ifdef __cplusplus
38 
39 status_t	start_watching_network(uint32 flags, const BMessenger& target);
40 status_t	start_watching_network(uint32 flags, const BHandler* handler,
41 				const BLooper* looper = NULL);
42 
43 status_t	stop_watching_network(const BMessenger& target);
44 status_t	stop_watching_network(const BHandler* handler,
45 				const BLooper* looper = NULL);
46 
47 #endif	// __cplusplus
48 
49 
50 #endif	// _NETWORK_NOTIFICATIONS_H
51