diff options
author | Donald Hunter <donald.hunter@gmail.com> | 2023-12-15 12:37:09 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-12-19 01:39:43 +0300 |
commit | de2d98743b83cf970f75b7cbf650c08a659121a5 (patch) | |
tree | 96196f01ddb90373e474241af733ee0dca25e112 /scripts | |
parent | 62691b801daa497e36ad77636c3a6cd0f6dda440 (diff) | |
download | linux-de2d98743b83cf970f75b7cbf650c08a659121a5.tar.xz |
doc/netlink: Add sub-message support to netlink-raw
Add a 'sub-message' attribute type with a selector that supports
polymorphic attribute formats for raw netlink families like tc.
A sub-message attribute uses the value of another attribute as a
selector key to choose the right sub-message format. For example if the
following attribute has already been decoded:
{ "kind": "gre" }
and we encounter the following attribute spec:
-
name: data
type: sub-message
sub-message: linkinfo-data-msg
selector: kind
Then we look for a sub-message definition called 'linkinfo-data-msg' and
use the value of the 'kind' attribute i.e. 'gre' as the key to choose
the correct format for the sub-message:
sub-messages:
name: linkinfo-data-msg
formats:
-
value: bridge
attribute-set: linkinfo-bridge-attrs
-
value: gre
attribute-set: linkinfo-gre-attrs
-
value: geneve
attribute-set: linkinfo-geneve-attrs
This would decode the attribute value as a sub-message with the
attribute-set called 'linkinfo-gre-attrs' as the attribute space.
A sub-message can have an optional 'fixed-header' followed by zero or
more attributes from an attribute-set. For example the following
'tc-options-msg' sub-message defines message formats that use a mixture
of fixed-header, attribute-set or both together:
sub-messages:
-
name: tc-options-msg
formats:
-
value: bfifo
fixed-header: tc-fifo-qopt
-
value: cake
attribute-set: tc-cake-attrs
-
value: netem
fixed-header: tc-netem-qopt
attribute-set: tc-netem-attrs
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://lore.kernel.org/r/20231215093720.18774-3-donald.hunter@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions