]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
netlink: specs: support generating code for genl socket priv
authorJakub Kicinski <kuba@kernel.org>
Fri, 8 Mar 2024 19:03:19 +0000 (11:03 -0800)
committerJakub Kicinski <kuba@kernel.org>
Mon, 11 Mar 2024 22:15:42 +0000 (15:15 -0700)
commitba980f8dff548ec4558ca9c5f20ac6545920debb
treea1e151afcf996eb9eed7d5f2e1e7fc84792d073d
parenta0d942960d9b0ba352b2400e1a3b8fb02d911143
netlink: specs: support generating code for genl socket priv

The family struct is auto-generated for new families, support
use of the sock_priv_* mechanism added in commit a731132424ad
("genetlink: introduce per-sock family private storage").

For example if the family wants to use struct sk_buff as its
private struct (unrealistic but just for illustration), it would
add to its spec:

  kernel-family:
    headers: [ "linux/skbuff.h" ]
    sock-priv: struct sk_buff

ynl-gen-c will declare the appropriate priv size and hook
in function prototypes to be implemented by the family.

Link: https://lore.kernel.org/r/20240308190319.2523704-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/netlink/genetlink-c.yaml
Documentation/netlink/genetlink-legacy.yaml
Documentation/netlink/genetlink.yaml
tools/net/ynl/lib/nlspec.py
tools/net/ynl/ynl-gen-c.py