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