xref: /haiku/src/add-ons/kernel/network/stack/domains.h (revision 3904a8dba0df1065db019e58a491c712cdf9cd83)
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 DOMAINS_H
9 #define DOMAINS_H
10 
11 
12 #include <lock.h>
13 #include <util/list.h>
14 #include <util/DoublyLinkedList.h>
15 
16 #include "routes.h"
17 
18 
19 struct net_device_interface;
20 
21 
22 struct net_domain_private : net_domain,
23 		DoublyLinkedListLinkImpl<net_domain_private> {
24 	recursive_lock		lock;
25 
26 	RouteList			routes;
27 	RouteInfoList		route_infos;
28 };
29 
30 
31 status_t init_domains();
32 status_t uninit_domains();
33 
34 uint32 count_domain_interfaces();
35 status_t list_domain_interfaces(void* buffer, size_t* _bufferSize);
36 status_t add_interface_to_domain(net_domain* domain, struct ifreq& request);
37 status_t remove_interface_from_domain(net_interface* interface);
38 void domain_interface_went_down(net_interface* interface);
39 void domain_removed_device_interface(net_device_interface* interface);
40 status_t domain_interface_control(net_domain_private* domain, int32 option,
41 	struct ifreq* request);
42 
43 net_domain* get_domain(int family);
44 status_t register_domain(int family, const char* name,
45 	struct net_protocol_module_info* module,
46 	struct net_address_module_info* addressModule, net_domain* *_domain);
47 status_t unregister_domain(net_domain* domain);
48 
49 
50 #endif	// DOMAINS_H
51