资讯专栏INFORMATION COLUMN

整理Generic Netlink 编程过程中遇到的坑

aikin / 1963人阅读

摘要:接口变更删除了函数删除了宏函数提交链接内核开发者日志删除了常量定义提交日志链接内核开发者日志接口变更删除了函数提交日志链接内核开发者日志

Linux 4.10 API接口变更 1. 删除了API函数__genl_register_family_with_ops(family, ops, n_ops). 2. 删除了API宏函数genl_register_family_with_ops(family, ops).

git提交链接:
https://github.com/torvalds/l...

# 内核开发者日志
genetlink: statically initialize families

Instead of providing macros/inline functions to initialize
the families, make all users initialize them statically and
get rid of the macros.

This reduces the kernel code size by about 1.6k on x86-64
(with allyesconfig).

Signed-off-by: Johannes Berg 
Signed-off-by: David S. Miller 
3. 删除了常量定义GENL_ID_GENERATE

git提交日志链接:
https://github.com/torvalds/l...

# 内核开发者日志3
genetlink: no longer support using static family IDs

Static family IDs have never really been used, the only
use case was the workaround I introduced for those users
that assumed their family ID was also their multicast
group ID.

Additionally, because static family IDs would never be
reserved by the generic netlink code, using a relatively
low ID would only work for built-in families that can be
registered immediately after generic netlink is started,
which is basically only the control family (apart from
the workaround code, which I also had to add code for so
it would reserve those IDs)

Thus, anything other than GENL_ID_GENERATE is flawed and
luckily not used except in the cases I mentioned. Move
those workarounds into a few lines of code, and then get
rid of GENL_ID_GENERATE entirely, making it more robust.

Signed-off-by: Johannes Berg 
Signed-off-by: David S. Miller 
Linux 3.13.0 API接口变更

删除了API函数genl_register_ops() / genl_unregister_ops()

git提交日志链接:
https://github.com/torvalds/l...

# 内核开发者日志
genetlink: remove genl_register_ops/genl_unregister_ops

genl_register_ops() is still needed for internal registration,
but is no longer available to users of the API.

Signed-off-by: Johannes Berg 
Signed-off-by: David S. Miller 

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/63619.html

相关文章

  • 整理Generic Netlink 编程过程遇到的坑

    摘要:接口变更删除了函数删除了宏函数提交链接内核开发者日志删除了常量定义提交日志链接内核开发者日志接口变更删除了函数提交日志链接内核开发者日志 Linux 4.10 API接口变更 1. 删除了API函数__genl_register_family_with_ops(family, ops, n_ops). 2. 删除了API宏函数genl_register_family_with_ops(...

    awokezhou 评论0 收藏0
  • 整理Generic Netlink 编程过程遇到的坑

    摘要:接口变更删除了函数删除了宏函数提交链接内核开发者日志删除了常量定义提交日志链接内核开发者日志接口变更删除了函数提交日志链接内核开发者日志 Linux 4.10 API接口变更 1. 删除了API函数__genl_register_family_with_ops(family, ops, n_ops). 2. 删除了API宏函数genl_register_family_with_ops(...

    Cobub 评论0 收藏0
  • generic netlink 编程快速入门

    摘要:一消息结构消息在以流的形式在程序之间进行传递,一个流中可能包含多个消息。对于每个消息消息来说,为了便于维护和方便使用,还需要一些有关记录消息的信息。成员指明了该响应函数对其能够处理的信息的要求。版本号最大属性数该命令族的名为。 一、generic netlink 消息结构 消息在以流的形式在程序之间进行传递,一个流中可能包含多个消息。showImg(https://segmentfau...

    verano 评论0 收藏0
  • ovs源码阅读--netlink使用

    摘要:是一种用于用户态进程和内核态进程之间的通信机制。它通过为内核模块提供一组特殊的,并为用户程序提供了一组标准的接口的方式,实现了全双工的通讯连接。只要的返回值大于,函数就会再次被调用,并被要求在中填入数据。 netlink netlink socket是一种用于用户态进程和内核态进程之间的通信机制。它通过为内核模块提供一组特殊的API,并为用户程序提供了一组标准的socket接口的方式,...

    SwordFly 评论0 收藏0
  • ovs源码阅读--netlink使用

    摘要:是一种用于用户态进程和内核态进程之间的通信机制。它通过为内核模块提供一组特殊的,并为用户程序提供了一组标准的接口的方式,实现了全双工的通讯连接。只要的返回值大于,函数就会再次被调用,并被要求在中填入数据。 netlink netlink socket是一种用于用户态进程和内核态进程之间的通信机制。它通过为内核模块提供一组特殊的API,并为用户程序提供了一组标准的socket接口的方式,...

    Yang_River 评论0 收藏0

发表评论

0条评论

aikin

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<