xref: /haiku/headers/os/net/NetworkNotifications.h (revision ed13a41e18a8848868e341c262143f25950be786)
11d56eab0SAxel Dörfler /*
21d56eab0SAxel Dörfler  * Copyright 2010, Haiku, Inc. All Rights Reserved.
31d56eab0SAxel Dörfler  * Distributed under the terms of the MIT License.
41d56eab0SAxel Dörfler  */
51d56eab0SAxel Dörfler #ifndef _NETWORK_NOTIFICATIONS_H
61d56eab0SAxel Dörfler #define _NETWORK_NOTIFICATIONS_H
71d56eab0SAxel Dörfler 
81d56eab0SAxel Dörfler 
91d56eab0SAxel Dörfler #include <SupportDefs.h>
101d56eab0SAxel Dörfler 
111d56eab0SAxel Dörfler 
12*ed13a41eSPhilippe Houdoin // Flags for the start_watching_network() calls.
131d56eab0SAxel Dörfler 
141d56eab0SAxel Dörfler #define B_NETWORK_INTERFACE_ADDED				0x0001
151d56eab0SAxel Dörfler #define B_NETWORK_INTERFACE_REMOVED				0x0002
161d56eab0SAxel Dörfler #define B_NETWORK_INTERFACE_CHANGED				0x0003
171d56eab0SAxel Dörfler #define B_NETWORK_DEVICE_LINK_CHANGED			0x0010
181d56eab0SAxel Dörfler #define B_NETWORK_WLAN_JOINED					0x0100
191d56eab0SAxel Dörfler #define B_NETWORK_WLAN_LEFT						0x0200
201d56eab0SAxel Dörfler #define B_NETWORK_WLAN_SCANNED					0x0300
211d56eab0SAxel Dörfler #define B_NETWORK_WLAN_MESSAGE_INTEGRITY_FAILED	0x0400
221d56eab0SAxel Dörfler 
231d56eab0SAxel Dörfler // TODO: add routes, stack unloaded/loaded, ... events
241d56eab0SAxel Dörfler 
251d56eab0SAxel Dörfler enum {
261d56eab0SAxel Dörfler 	B_WATCH_NETWORK_INTERFACE_CHANGES	= 0x000f,
271d56eab0SAxel Dörfler 	B_WATCH_NETWORK_LINK_CHANGES	 	= 0x00f0,
281d56eab0SAxel Dörfler 	B_WATCH_NETWORK_WLAN_CHANGES		= 0x0f00
291d56eab0SAxel Dörfler };
301d56eab0SAxel Dörfler 
311d56eab0SAxel Dörfler #define B_NETWORK_MONITOR				'_NTN'
321d56eab0SAxel Dörfler 
331d56eab0SAxel Dörfler 
34*ed13a41eSPhilippe Houdoin #if defined(__cplusplus) && !defined(_KERNEL_MODE)
351d56eab0SAxel Dörfler 
36*ed13a41eSPhilippe Houdoin // these are only needed for the function exports
37*ed13a41eSPhilippe Houdoin #include <Messenger.h>
38*ed13a41eSPhilippe Houdoin 
39*ed13a41eSPhilippe Houdoin class BHandler;
40*ed13a41eSPhilippe Houdoin class BLooper;
41*ed13a41eSPhilippe Houdoin 
42*ed13a41eSPhilippe Houdoin 
43*ed13a41eSPhilippe Houdoin extern status_t	start_watching_network(uint32 flags, const BMessenger& target);
44*ed13a41eSPhilippe Houdoin extern status_t	start_watching_network(uint32 flags, const BHandler* handler,
451d56eab0SAxel Dörfler 				const BLooper* looper = NULL);
461d56eab0SAxel Dörfler 
47*ed13a41eSPhilippe Houdoin extern status_t	stop_watching_network(const BMessenger& target);
48*ed13a41eSPhilippe Houdoin extern status_t	stop_watching_network(const BHandler* handler,
491d56eab0SAxel Dörfler 				const BLooper* looper = NULL);
501d56eab0SAxel Dörfler 
51*ed13a41eSPhilippe Houdoin #endif	// __cplusplus && !_KERNEL_MODE
521d56eab0SAxel Dörfler 
531d56eab0SAxel Dörfler 
541d56eab0SAxel Dörfler #endif	// _NETWORK_NOTIFICATIONS_H
55