2010-10-26 00:20:09 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2010, Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _NETWORK_NOTIFICATIONS_H
|
|
|
|
#define _NETWORK_NOTIFICATIONS_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
|
|
|
2010-10-26 14:24:17 +04:00
|
|
|
// Flags for the start_watching_network() calls.
|
2010-10-26 00:20:09 +04:00
|
|
|
|
|
|
|
#define B_NETWORK_INTERFACE_ADDED 0x0001
|
|
|
|
#define B_NETWORK_INTERFACE_REMOVED 0x0002
|
|
|
|
#define B_NETWORK_INTERFACE_CHANGED 0x0003
|
|
|
|
#define B_NETWORK_DEVICE_LINK_CHANGED 0x0010
|
|
|
|
#define B_NETWORK_WLAN_JOINED 0x0100
|
|
|
|
#define B_NETWORK_WLAN_LEFT 0x0200
|
|
|
|
#define B_NETWORK_WLAN_SCANNED 0x0300
|
|
|
|
#define B_NETWORK_WLAN_MESSAGE_INTEGRITY_FAILED 0x0400
|
|
|
|
|
|
|
|
// TODO: add routes, stack unloaded/loaded, ... events
|
|
|
|
|
|
|
|
enum {
|
|
|
|
B_WATCH_NETWORK_INTERFACE_CHANGES = 0x000f,
|
|
|
|
B_WATCH_NETWORK_LINK_CHANGES = 0x00f0,
|
|
|
|
B_WATCH_NETWORK_WLAN_CHANGES = 0x0f00
|
|
|
|
};
|
|
|
|
|
|
|
|
#define B_NETWORK_MONITOR '_NTN'
|
|
|
|
|
|
|
|
|
2010-10-26 14:24:17 +04:00
|
|
|
#if defined(__cplusplus) && !defined(_KERNEL_MODE)
|
|
|
|
|
|
|
|
// these are only needed for the function exports
|
|
|
|
#include <Messenger.h>
|
|
|
|
|
|
|
|
class BHandler;
|
|
|
|
class BLooper;
|
|
|
|
|
2010-10-26 00:20:09 +04:00
|
|
|
|
2010-10-26 14:24:17 +04:00
|
|
|
extern status_t start_watching_network(uint32 flags, const BMessenger& target);
|
|
|
|
extern status_t start_watching_network(uint32 flags, const BHandler* handler,
|
2010-10-26 00:20:09 +04:00
|
|
|
const BLooper* looper = NULL);
|
|
|
|
|
2010-10-26 14:24:17 +04:00
|
|
|
extern status_t stop_watching_network(const BMessenger& target);
|
|
|
|
extern status_t stop_watching_network(const BHandler* handler,
|
2010-10-26 00:20:09 +04:00
|
|
|
const BLooper* looper = NULL);
|
|
|
|
|
2010-10-26 14:24:17 +04:00
|
|
|
#endif // __cplusplus && !_KERNEL_MODE
|
2010-10-26 00:20:09 +04:00
|
|
|
|
|
|
|
|
|
|
|
#endif // _NETWORK_NOTIFICATIONS_H
|