我想通过编程来对linux下的路有表作修改。在一本资料上看到对于RT netlink接口而言,来自位于net/ipv4/fib_frontend.c的函数inet_rtm_newroute(),inet_rtm_delroute()和inet_dump_fib()都在位于net/ipv4/devinet.c中的表inet_rtnetlink_table[]中被注册。所以可以调用它们来添加、删除、查看路由表条目并处理相应的消息。其中inet_rtm_newroute()函数源代码如下:
int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
{
struct fib_table * tb;
struct rtattr **rta = arg;
struct rtmsg *r = NLMSG_DATA(nlh);
if (inet_check_attr(r, rta))
return -EINVAL;
tb = fib_new_table(r->rtm_table);
if (tb)
return tb->tb_insert(tb, r, (struct kern_rta*)rta, nlh, &NETLINK_CB(skb));
return -ENOBUFS;
}请问哪位高手详细解释下这个函数各个参数的意义以及这个函数的用法。
在下不胜感激

