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