📄 route.h
字号:
/*** * * 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_RTNET_RTIPV4_NETROUTINGint rt_ip_route_add_net(u32 addr, u32 mask, u32 gw_addr);int rt_ip_route_del_net(u32 addr, u32 mask);#endif /* CONFIG_RTNET_RTIPV4_NETROUTING */#ifdef CONFIG_RTNET_RTIPV4_ROUTERint rt_ip_route_forward(struct rtskb *rtskb, u32 daddr);#endif /* CONFIG_RTNET_RTIPV4_ROUTER */#ifdef CONFIG_RTNET_RTIPV4_ROUTE_SRCint __rt_ip_route_del_host(u32 addr, struct rtnet_device *rtdev);int __rt_ip_route_output(struct dest_route *rt_buf, u32 daddr, u32 saddr);static inline int rt_ip_route_del_host(u32 addr, struct rtnet_device *rtdev){ return __rt_ip_route_del_host(addr, rtdev);}static inline int rt_ip_route_output(struct dest_route *rt_buf, u32 daddr, u32 saddr){ return __rt_ip_route_output(rt_buf, daddr, saddr);}#else /* !CONFIG_RTNET_RTIPV4_ROUTE_SRC */int __rt_ip_route_del_host(u32 addr);int __rt_ip_route_output(struct dest_route *rt_buf, u32 daddr);static inline int rt_ip_route_del_host(u32 addr, struct rtnet_device *rtdev){ return __rt_ip_route_del_host(addr);}static inline int rt_ip_route_output(struct dest_route *rt_buf, u32 daddr, u32 saddr){ return __rt_ip_route_output(rt_buf, daddr);}#endif /* CONFIG_RTNET_RTIPV4_ROUTE_SRC */int __init rt_ip_routing_init(void);void __exit rt_ip_routing_release(void);#endif /* __RTNET_ROUTE_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -