xref: /haiku/src/add-ons/kernel/network/stack/routes.h (revision 25160e50935c4647beb1f0f07839698c389fdf79)
1 /*
2  * Copyright 2006, 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 ROUTES_H
9 #define ROUTES_H
10 
11 
12 #include <net_datalink.h>
13 #include <net_stack.h>
14 
15 #include <util/DoublyLinkedList.h>
16 
17 
18 struct net_route_private : net_route, public DoublyLinkedListLinkImpl<net_route_private> {
19 	int32	ref_count;
20 
21 	net_route_private();
22 	~net_route_private();
23 };
24 
25 typedef DoublyLinkedList<net_route_private> RouteList;
26 typedef DoublyLinkedList<net_route_info, DoublyLinkedListCLink<net_route_info> > RouteInfoList;
27 
28 
29 uint32 route_table_size(struct net_domain_private *domain);
30 status_t list_routes(struct net_domain_private *domain, void *buffer, size_t size);
31 status_t control_routes(struct net_interface *interface,
32 				int32 option, void *argument, size_t length);
33 
34 status_t add_route(struct net_domain *domain,
35 				const struct net_route *route);
36 status_t remove_route(struct net_domain *domain,
37 				const struct net_route *route);
38 struct net_route *get_route(struct net_domain *domain, const struct sockaddr *address);
39 void put_route(struct net_domain *domain, struct net_route *route);
40 
41 status_t register_route_info(struct net_domain *domain,
42 				struct net_route_info *info);
43 status_t unregister_route_info(struct net_domain *domain,
44 				struct net_route_info *info);
45 status_t update_route_info(struct net_domain *domain,
46 				struct net_route_info *info);
47 
48 #endif	// ROUTES_H
49