0
点赞
收藏
分享

微信扫一扫

Linux: proc/net/ipv6_route

whiteMu 2022-01-20 阅读 48

说明

https://github.com/torvalds/linux/commit/138d0be35b141e09f6b267c6ae4094318d4e4491 net: bpf: Add netlink and ipv6_route bpf_iter targets

static int __net_init ip6_route_net_init_late(struct net *net)
{
#ifdef CONFIG_PROC_FS
	proc_create_net("ipv6_route", 0, net->proc_net, &ipv6_route_seq_ops,
			sizeof(struct ipv6_route_iter));
	proc_create_net_single("rt6_stats", 0444, net->proc_net,
			rt6_stats_seq_show, NULL);
#endif
	return 0;
}

const struct seq_operations ipv6_route_seq_ops = {
	.start	= ipv6_route_seq_start,
	.next	= ipv6_route_seq_next,
	.stop	= ipv6_route_seq_stop,
	.show	= ipv6_route_seq_show
};

列解释

#more /proc/net/ipv6_route

# more /proc/net/ipv6_route
00000000000000000000000000000000 00 00000000000000000000000000000000 00 00000000000000000000000000000000 ffffffff 00000001 00000000 00200200       lo

目的地址,长度,源地址(如果没有配置CONFIG_IPV6_SUBTREES显示0),长度,gateway 地址,长度,fib6_metric, refcount,0, flags,device 名称

#define RTF_NONEXTHOP	0x00200000	/* route with no nexthop	*/
举报

相关推荐

0 条评论