2 * Copyright 2006-2010, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Axel Dörfler, axeld@pinc-software.de
12 #include <net_datalink.h>
13 #include <net_stack.h>
15 #include <util/DoublyLinkedList.h>
18 class InterfaceAddress
;
21 struct net_route_private
22 : net_route
, DoublyLinkedListLinkImpl
<net_route_private
> {
29 typedef DoublyLinkedList
<net_route_private
> RouteList
;
30 typedef DoublyLinkedList
<net_route_info
,
31 DoublyLinkedListCLink
<net_route_info
> > RouteInfoList
;
34 uint32
route_table_size(struct net_domain_private
* domain
);
35 status_t
list_routes(struct net_domain_private
* domain
, void* buffer
,
37 status_t
control_routes(struct net_interface
* interface
, net_domain
* domain
,
38 int32 option
, void* argument
, size_t length
);
40 status_t
add_route(struct net_domain
* domain
,
41 const struct net_route
* route
);
42 status_t
remove_route(struct net_domain
* domain
,
43 const struct net_route
* route
);
44 status_t
get_route_information(struct net_domain
* domain
, void* buffer
,
46 void invalidate_routes(net_domain
* domain
, net_interface
* interface
);
47 void invalidate_routes(InterfaceAddress
* address
);
48 struct net_route
* get_route(struct net_domain
* domain
,
49 const struct sockaddr
* address
);
50 status_t
get_device_route(struct net_domain
* domain
, uint32 index
,
51 struct net_route
** _route
);
52 status_t
get_buffer_route(struct net_domain
* domain
,
53 struct net_buffer
* buffer
, struct net_route
** _route
);
54 void put_route(struct net_domain
* domain
, struct net_route
* route
);
56 status_t
register_route_info(struct net_domain
* domain
,
57 struct net_route_info
* info
);
58 status_t
unregister_route_info(struct net_domain
* domain
,
59 struct net_route_info
* info
);
60 status_t
update_route_info(struct net_domain
* domain
,
61 struct net_route_info
* info
);