route.c
来自「一个基于linux的TCP/IP协议栈的实现」· C语言 代码 · 共 35 行
C
35 行
/* route.c * linqianghe@163.com * 2006-10-13 */#include "route.h"#include "af_inet.h"static void myipv4_link_failure(struct sk_buff *skb){ struct rtable *rt; //icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0); rt = (struct rtable *) skb->dst; if( rt ) dst_set_expires( &rt->u.dst, 0 );}struct dst_ops myipv4_dst_ops = { .family = MY_AF_INET, .protocol = __constant_htons(ETH_P_IP), //.gc = rt_garbage_collect, //.check = ipv4_dst_check, //.destroy = ipv4_dst_destroy, //.ifdown = ipv4_dst_ifdown, //.negative_advice = ipv4_negative_advice, .link_failure = myipv4_link_failure, //.update_pmtu = ip_rt_update_pmtu, .entry_size = sizeof(struct rtable),};EXPORT_SYMBOL_GPL( myipv4_dst_ops );
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?