Re: [PATCH net-next v7 04/25] ovpn: add basic netlink support
From: Antonio Quartulli <antonio@openvpn.net>
Date: 2024-09-25 11:36:55
Donald, On 18/09/2024 12:07, Donald Hunter wrote: [...]
nl80211 is maybe not a good example to follow because it predates the
ynl specs and code generation. The netdev.yaml spec is a good example of
a modern genetlink spec. It specifies ops for 'dev-add-ntf' and
'dev-del-ntf' that both reuse the definition from 'dev-get' with the
'notify: dev-get' attribute:
-
name: dev-get
doc: Get / dump information about a netdev.
attribute-set: dev
do:
request:
attributes:
- ifindex
reply: &dev-all
attributes:
- ifindex
- xdp-features
- xdp-zc-max-segs
- xdp-rx-metadata-features
- xsk-features
dump:
reply: *dev-all
-
name: dev-add-ntf
doc: Notification about device appearing.
notify: dev-get
mcgrp: mgmt
-
name: dev-del-ntf
doc: Notification about device disappearing.
notify: dev-get
mcgrp: mgmt
The notify ops get distinct ids so they should never be confused with
normal command responses.I see most (if not all) modules have named ops dev-del/add/get, while in ovpn I am going with new/del-dev (action and object are inverted). Do you think it'd make sense to change all the op names to follow the convention used by the other modules? Cheers, -- Antonio Quartulli OpenVPN Inc.