1.netdevice.h(/include/linux/)
新版本内核:struct net_device *dev_get_by_name(struct net *net, const char *name)
老版本内核:struct net_device *dev_get_by_name(const char *name)
在老版本内核下编译通过的协议在新版内核上编译需要修改为dev_get_by_name(&init_net, const char *name)
2.skbuff.h(/include/linux/)
老版本内核:struct sk_buff结构体 ,h中包含传输层报文头,nh中包含网络层的报文头,mac中包含链路层报文头
新版本内核:修改对应关系如下
h-->transport_header;
nh-->network_header;
mac-->mac_header
3.Linux/include/linux/netlink.h
extern struct sock *netlink_kernel_create(int unit, void (*input)(struct sock *sk, int len));
extern struct sock *netlink_kernel_create(struct net *net,
int unit,
unsigned int groups,
void (*input)(struct sk_buff *skb),
struct mutex *cb_mutex,
struct module *module);
本文档指导如何将基于老版本Linux内核的网络编程迁移到新版本内核。主要内容包括netdevice.h中dev_get_by_name函数参数的变化、skbuff.h中sk_buff结构体字段名称的更新以及netlink.h中netlink_kernel_create函数原型的调整。
33

被折叠的 条评论
为什么被折叠?



