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// Flags for the start_watching_network() calls.
13
14#define B_NETWORK_INTERFACE_ADDED				0x0001
15#define B_NETWORK_INTERFACE_REMOVED				0x0002
16#define B_NETWORK_INTERFACE_CHANGED				0x0003
17#define B_NETWORK_DEVICE_LINK_CHANGED			0x0010
18#define B_NETWORK_WLAN_JOINED					0x0100
19#define B_NETWORK_WLAN_LEFT						0x0200
20#define B_NETWORK_WLAN_SCANNED					0x0300
21#define B_NETWORK_WLAN_MESSAGE_INTEGRITY_FAILED	0x0400
22
23// TODO: add routes, stack unloaded/loaded, ... events
24
25enum {
26	B_WATCH_NETWORK_INTERFACE_CHANGES	= 0x000f,
27	B_WATCH_NETWORK_LINK_CHANGES	 	= 0x00f0,
28	B_WATCH_NETWORK_WLAN_CHANGES		= 0x0f00
29};
30
31#define B_NETWORK_MONITOR				'_NTN'
32
33
34#if defined(__cplusplus) && !defined(_KERNEL_MODE)
35
36// these are only needed for the function exports
37#include <Messenger.h>
38
39class BHandler;
40class BLooper;
41
42
43extern status_t	start_watching_network(uint32 flags, const BMessenger& target);
44extern status_t	start_watching_network(uint32 flags, const BHandler* handler,
45				const BLooper* looper = NULL);
46
47extern status_t	stop_watching_network(const BMessenger& target);
48extern status_t	stop_watching_network(const BHandler* handler,
49				const BLooper* looper = NULL);
50
51#endif	// __cplusplus && !_KERNEL_MODE
52
53
54#endif	// _NETWORK_NOTIFICATIONS_H
55