BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / kernel / network / stack / routes.h
blob90d2dea083fbc885647b0b7b9d55b8c64c69982e
1 /*
2 * Copyright 2006-2010, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Axel Dörfler, axeld@pinc-software.de
7 */
8 #ifndef ROUTES_H
9 #define ROUTES_H
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> {
23 int32 ref_count;
25 net_route_private();
26 ~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,
36 size_t size);
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,
45 size_t length);
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);
63 #endif // ROUTES_H