linux路由内核实现分析(四)---路由缓存机制(2)
dst_entry结构
struct dst_entry
{
struct rcu_head rcu_head;
struct dst_entry *child;
struct net_device *dev;
short error;
short obsolete;
int flags;
#define DST_HOST 1
#define DST_NOXFRM 2
#define DST_NOPOLICY 4
#define DST_NOHASH 8
unsigned long expires;
unsigned short header_len;
unsigned short nfheader_len;
unsigned short trailer_len;
u32 metrics[RTAX_MAX];
struct dst_entry *path;
unsigned long rate_last;
unsigned long rate_tokens;
struct neighbour *neighbour;
struct hh_cache *hh;
struct xfrm_state *xfrm;
int (*input)(struct sk_buff*);
int (*output)(struct sk_buff*);
#ifdef CONFIG_NET_CLS_ROUTE
__u32 tclassid;
#endif
struct dst_ops *ops;
unsigned long lastuse;
atomic_t __refcnt;
int __use;
union {
struct dst_entry *next;
struct rtable *rt_next;
struct rt6_info *rt6_next;
struct dn_route *dn_next;
};
char info[0];
};
struct net_device *dev; //用于网络接口的指针
int __use; //该表项已经被使用的次数(即缓存查找返回该表项的次数)
short error; //当fib_lookup失败时,错误值被保存在error(用一个正值)
中,在ip_error成员中使用该值来决定如何处理本次路由查找失败(即决定生成哪一类ICMP消息)。
struct neighbour *neighbour; //这个路由路径上下一个neighbour结构的指针。
int (*input)(struct sk_buff*);
int (*output)(struct sk_buff*);
//input 和 output 分别对应着在IP层的输入和输出函数,output对应着下一层发送数据的函数(dev_queue_xmit),input对应着向上一层发送数据的函数(例如tcp_recv)
这几个结构的关系如下:
用rt_hash_bucket来管理一张哈希表,存储了rtable结构,rtable结构中内含的dst_entry结构可以找出邻居节点,用以确认next hop
linux路由内核实现分析(四)---路由缓存机制(2)相关推荐
- linux路由内核实现分析(四)---路由缓存机制(1)
------------------------------------------------------------------------------------------ 以下是我根据 li ...
- linux路由内核实现分析(四)---路由缓存机制(4)
ip_route_input函数 int ip_route_input(struct sk_buff *skb, __be32 daddr, __be32 saddr, u8 tos, struc ...
- linux路由内核实现分析(四)---路由缓存机制(3)
在函数ip_rt_init( )中进行了rt_hash_bucket的初始化,代码如下: rt_hash_table = (struct rt_hash_bucket *) alloc_large_s ...
- linux路由内核实现分析 四,linux路由内核实现分析(二)---FIB相关数据结构(4)
fib_info结构 struct fib_info { struct hlist_node fib_hash; struct hlist_node fib_lhash; int fib_treere ...
- linux路由内核实现分析(三)---路由查找过程
------------------------------------------------------------------------------------------ 以下是我根据 li ...
- linux路由内核实现分析(一)----邻居子节点(1)
------------------------------------------------------------------------------------------ 以下是我根据 li ...
- mysql 源码 缓存_MySQL源码:MYSQL存储过程/函数的分析原理及缓存机制
前言:我个人认为,有关MYSQL存储过程/函数在MYSQL中的实现比较粗糙,可扩展性不够好,其实现的耦合性太高,所以主要讲一些它的原理方面的内容,但有可能在某些方面理解不够好或者有些不正确的地方,欢迎 ...
- linux路由内核实现分析(二)---FIB相关数据结构(1)
------------------------------------------------------------------------------------------ 以下是我根据 li ...
- linux路由内核实现分析(二)---FIB相关数据结构(4)
fib_info结构 struct fib_info {struct hlist_node fib_hash;struct hlist_node fib_lhash;int fib_treeref;a ...
最新文章
- 深入理解计算机系统答案2.11,深入理解计算机系统 第十一章
- docker镜像构建工具kaniko构建过程缓慢原因探究
- 最常用的13条mysql语句
- (连通图 模板题 无向图求桥)Critical Links -- UVA -- 796
- push api v3_充分利用Push API的指南
- Linux系统服务及其创建详解(service/chkconfig)
- tensorflow获取可用GPU设备
- 不同CPU指令的指令集密度
- MySQL时间函数timestampdiff()使用
- 字体的基础知识:英文字体的特征及结构(终于找到了)
- UTF-8 ,UTF8, GBK,GB2312 之间的关系和区别
- 按英语体育计算机创建透视表,2016年职称计算机考试模拟练习题
- 日志技术之JUL入门
- 35岁,转行AI年薪100万,牛逼的人生无需解释!
- 删除Oracle表空间,释放硬盘空间
- 欺骗的艺术——第二部分(8)
- UR机器人通信接口总结
- QT QList<T>介绍与应用、详解、使用说明、官方手册翻译
- 2010年高考作文题目大全
- 单点登录,统一登录平台的食堂打饭模型
热门文章
- 解决pytorch DataLoader 加载数据报错UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xe5 in position 1023
- 解决xgboost报错XGBoostError: XGBoost Library (libxgboost.dylib) could not be loaded
- block引用c语言数组,Block在ARC和MRC下的使用分析
- idea主题颜色Linux,IntelliJ IDEA更换主题样式分享
- LeetCode开心刷题二十七天——51. N-Queens
- 使用C# 未解决的问题(VS2012)
- 大约HR升级版的设计为组汇总
- 效率源希捷硬盘远程维修案例-K9盘卡死引起的F级处理
- 关于MySql5“data too long for column”问题的探解
- 通过程序实现文件下载更名,动态文件下载