xref: /haiku/src/add-ons/kernel/network/stack/stack_private.h (revision 98166ebe04ef2ca6c6b79e80b0fce1aed2cd5c6a)
1c22d69bfSAxel Dörfler /*
2d869a061SAxel Dörfler  * Copyright 2006-2010, Haiku, Inc. All Rights Reserved.
3c22d69bfSAxel Dörfler  * Distributed under the terms of the MIT License.
4c22d69bfSAxel Dörfler  *
5c22d69bfSAxel Dörfler  * Authors:
6c22d69bfSAxel Dörfler  *		Axel Dörfler, axeld@pinc-software.de
7c22d69bfSAxel Dörfler  */
8c22d69bfSAxel Dörfler #ifndef STACK_PRIVATE_H
9c22d69bfSAxel Dörfler #define STACK_PRIVATE_H
10c22d69bfSAxel Dörfler 
11c22d69bfSAxel Dörfler 
12c22d69bfSAxel Dörfler #include <net_buffer.h>
13c22d69bfSAxel Dörfler #include <net_datalink.h>
14c22d69bfSAxel Dörfler #include <net_datalink_protocol.h>
15c22d69bfSAxel Dörfler #include <net_protocol.h>
16c22d69bfSAxel Dörfler #include <net_socket.h>
17bfb45f71SHugo Santos #include <net_stack.h>
18df50f7a9SIngo Weinhold #include <net_stack_interface.h>
19c22d69bfSAxel Dörfler 
20c22d69bfSAxel Dörfler 
21*61729d93SAxel Dörfler // Stack-wide configuration
22*61729d93SAxel Dörfler #define ENABLE_DEBUGGER_COMMANDS	1
23*61729d93SAxel Dörfler #define STACK_DEBUG_PREFIX			"\33[31mnet:\33[0m "
24*61729d93SAxel Dörfler 
25*61729d93SAxel Dörfler 
26*61729d93SAxel Dörfler class Interface;
27*61729d93SAxel Dörfler 
28*61729d93SAxel Dörfler 
29bfb45f71SHugo Santos extern net_stack_module_info gNetStackModule;
30c22d69bfSAxel Dörfler extern net_buffer_module_info gNetBufferModule;
31c22d69bfSAxel Dörfler extern net_socket_module_info gNetSocketModule;
32c22d69bfSAxel Dörfler extern net_datalink_module_info gNetDatalinkModule;
33c22d69bfSAxel Dörfler extern net_datalink_protocol_module_info gDatalinkInterfaceProtocolModule;
34df50f7a9SIngo Weinhold extern net_stack_interface_module_info gNetStackInterfaceModule;
35c22d69bfSAxel Dörfler 
36c22d69bfSAxel Dörfler // stack.cpp
37c22d69bfSAxel Dörfler status_t register_domain_datalink_protocols(int family, int type, ...);
38c22d69bfSAxel Dörfler status_t register_domain_protocols(int family, int type, int protocol, ...);
39c22d69bfSAxel Dörfler status_t get_domain_protocols(net_socket* socket);
40c22d69bfSAxel Dörfler status_t put_domain_protocols(net_socket* socket);
41*61729d93SAxel Dörfler status_t get_domain_datalink_protocols(Interface* interface,
42*61729d93SAxel Dörfler 	net_domain* domain);
43*61729d93SAxel Dörfler status_t put_domain_datalink_protocols(Interface* interface,
44*61729d93SAxel Dörfler 	net_domain* domain);
45c22d69bfSAxel Dörfler 
46e6dd439fSAxel Dörfler // notifications.cpp
47d68ffdedSAxel Dörfler status_t notify_interface_added(net_interface* interface);
48d68ffdedSAxel Dörfler status_t notify_interface_removed(net_interface* interface);
49d869a061SAxel Dörfler status_t notify_interface_changed(net_interface* interface, uint32 oldFlags = 0,
50d869a061SAxel Dörfler 	uint32 newFlags = 0);
51d68ffdedSAxel Dörfler status_t notify_link_changed(net_device* device);
52e6dd439fSAxel Dörfler status_t init_notifications();
53e6dd439fSAxel Dörfler void uninit_notifications();
54e6dd439fSAxel Dörfler 
55df50f7a9SIngo Weinhold status_t init_stack();
56df50f7a9SIngo Weinhold status_t uninit_stack();
57df50f7a9SIngo Weinhold 
58d869a061SAxel Dörfler 
59c22d69bfSAxel Dörfler #endif	// STACK_PRIVATE_H
60