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