Xenomai  3.0.8
route.h
1 /***
2  *
3  * include/ipv4/route.h - real-time routing
4  *
5  * Copyright (C) 2004, 2005 Jan Kiszka <jan.kiszka@web.de>
6  *
7  * Rewritten version of the original route by David Schleef and Ulrich Marx
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22  *
23  */
24 
25 #ifndef __RTNET_ROUTE_H_
26 #define __RTNET_ROUTE_H_
27 
28 #include <linux/init.h>
29 #include <linux/types.h>
30 
31 #include <rtdev.h>
32 
33 
34 struct dest_route {
35  u32 ip;
36  unsigned char dev_addr[MAX_ADDR_LEN];
37  struct rtnet_device *rtdev;
38 };
39 
40 
41 int rt_ip_route_add_host(u32 addr, unsigned char *dev_addr,
42  struct rtnet_device *rtdev);
43 void rt_ip_route_del_all(struct rtnet_device *rtdev);
44 
45 #ifdef CONFIG_XENO_DRIVERS_NET_RTIPV4_NETROUTING
46 int rt_ip_route_add_net(u32 addr, u32 mask, u32 gw_addr);
47 int rt_ip_route_del_net(u32 addr, u32 mask);
48 #endif /* CONFIG_XENO_DRIVERS_NET_RTIPV4_NETROUTING */
49 
50 #ifdef CONFIG_XENO_DRIVERS_NET_RTIPV4_ROUTER
51 int rt_ip_route_forward(struct rtskb *rtskb, u32 daddr);
52 #endif /* CONFIG_XENO_DRIVERS_NET_RTIPV4_ROUTER */
53 
54 int rt_ip_route_del_host(u32 addr, struct rtnet_device *rtdev);
55 int rt_ip_route_get_host(u32 addr, char* if_name, unsigned char *dev_addr,
56  struct rtnet_device *rtdev);
57 int rt_ip_route_output(struct dest_route *rt_buf, u32 daddr, u32 saddr);
58 
59 int __init rt_ip_routing_init(void);
60 void rt_ip_routing_release(void);
61 
62 #endif /* __RTNET_ROUTE_H_ */