sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget:/translations/zh_CN/userspace-api/netlink/genetlink-legacymodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget:/translations/zh_TW/userspace-api/netlink/genetlink-legacymodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget:/translations/it_IT/userspace-api/netlink/genetlink-legacymodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget:/translations/ja_JP/userspace-api/netlink/genetlink-legacymodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget:/translations/ko_KR/userspace-api/netlink/genetlink-legacymodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget:/translations/sp_SP/userspace-api/netlink/genetlink-legacymodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h%SPDX-License-Identifier: BSD-3-Clauseh]h%SPDX-License-Identifier: BSD-3-Clause}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhT/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/genetlink-legacy.rsthKubhsection)}(hhh](htitle)}(hANetlink specification support for legacy Generic Netlink familiesh]hANetlink specification support for legacy Generic Netlink families}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hThis document describes the many additional quirks and properties required to describe older Generic Netlink families which form the ``genetlink-legacy`` protocol level.h](hThis document describes the many additional quirks and properties required to describe older Generic Netlink families which form the }(hhhhhNhNubhliteral)}(h``genetlink-legacy``h]hgenetlink-legacy}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh protocol level.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(h Specificationh]h Specification}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hGlobalsh]hGlobals}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(h>Attributes listed directly at the root level of the spec file.h]h>Attributes listed directly at the root level of the spec file.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hversionh]hversion}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h-Generic Netlink family version, default is 1.h]h-Generic Netlink family version, default is 1.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h``version`` has historically been used to introduce family changes which may break backwards compatibility. Since compatibility breaking changes are generally not allowed ``version`` is very rarely used.h](h)}(h ``version``h]hversion}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj<ubh has historically been used to introduce family changes which may break backwards compatibility. Since compatibility breaking changes are generally not allowed }(hj<hhhNhNubh)}(h ``version``h]hversion}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj<ubh is very rarely used.}(hj<hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]versionah ]h"]versionah$]h&]uh1hhhhhhhhKubeh}(h]globalsah ]h"]globalsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hAttribute type nestsh]hAttribute type nests}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzhhhhhKubh)}(hNew Netlink families should use ``multi-attr`` to define arrays. Older families (e.g. ``genetlink`` control family) attempted to define array types reusing attribute type to carry information.h](h New Netlink families should use }(hjhhhNhNubh)}(h``multi-attr``h]h multi-attr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh( to define arrays. Older families (e.g. }(hjhhhNhNubh)}(h ``genetlink``h]h genetlink}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh] control family) attempted to define array types reusing attribute type to carry information.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjzhhubh)}(h;For reference the ``multi-attr`` array may look like this::h](hFor reference the }(hjhhhNhNubh)}(h``multi-attr``h]h multi-attr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh array may look like this:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK#hjzhhubh literal_block)}(h[ARRAY-ATTR] [INDEX (optionally)] [MEMBER1] [MEMBER2] [SOME-OTHER-ATTR] [ARRAY-ATTR] [INDEX (optionally)] [MEMBER1] [MEMBER2]h]h[ARRAY-ATTR] [INDEX (optionally)] [MEMBER1] [MEMBER2] [SOME-OTHER-ATTR] [ARRAY-ATTR] [INDEX (optionally)] [MEMBER1] [MEMBER2]}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhK%hjzhhubh)}(h-where ``ARRAY-ATTR`` is the array entry type.h](hwhere }(hjhhhNhNubh)}(h``ARRAY-ATTR``h]h ARRAY-ATTR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh is the array entry type.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK/hjzhhubh)}(hhh](h)}(h indexed-arrayh]h indexed-array}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhK2ubh)}(h``indexed-array`` wraps the entire array in an extra attribute (hence limiting its size to 64kB). The ``ENTRY`` nests are special and have the index of the entry as their type instead of normal attribute type.h](h)}(h``indexed-array``h]h indexed-array}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhU wraps the entire array in an extra attribute (hence limiting its size to 64kB). The }(hjhhhNhNubh)}(h ``ENTRY``h]hENTRY}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhb nests are special and have the index of the entry as their type instead of normal attribute type.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK4hj hhubh)}(hA ``sub-type`` is needed to describe what type in the ``ENTRY``. A ``nest`` ``sub-type`` means there are nest arrays in the ``ENTRY``, with the structure looks like::h](hA }(hjLhhhNhNubh)}(h ``sub-type``h]hsub-type}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhjLubh( is needed to describe what type in the }(hjLhhhNhNubh)}(h ``ENTRY``h]hENTRY}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjLubh. A }(hjLhhhNhNubh)}(h``nest``h]hnest}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjLubh }(hjLhhhNhNubh)}(h ``sub-type``h]hsub-type}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjLubh$ means there are nest arrays in the }(hjLhhhNhNubh)}(h ``ENTRY``h]hENTRY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjLubh , with the structure looks like:}(hjLhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK8hj hhubj)}(hj[SOME-OTHER-ATTR] [ARRAY-ATTR] [ENTRY] [MEMBER1] [MEMBER2] [ENTRY] [MEMBER1] [MEMBER2]h]hj[SOME-OTHER-ATTR] [ARRAY-ATTR] [ENTRY] [MEMBER1] [MEMBER2] [ENTRY] [MEMBER1] [MEMBER2]}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhKWhere the first level of nest has the policy index as it’s attribute type, it contains a single nest which has the attribute index as its type. Inside the attr-index nest are the policy attributes. Modern Netlink families should have instead defined this as a flat structure, the nesting serves no good purpose here.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK\hj.hhubeh}(h] type-valueah ]h"] type-valueah$]h&]uh1hhjzhhhhhKNubeh}(h]attribute-type-nestsah ]h"]attribute type nestsah$]h&]uh1hhhhhhhhKubeh}(h] specificationah ]h"] specificationah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(h Operationsh]h Operations}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKcubh)}(hhh](h)}(hEnum (message ID) modelh]hEnum (message ID) model}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKfubh)}(hhh](h)}(hunifiedh]hunified}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKiubh)}(hXModern families use the ``unified`` message ID model, which uses a single enumeration for all messages within family. Requests and responses share the same message ID. Notifications have separate IDs from the same space. For example given the following list of operations:h](hModern families use the }(hjhhhNhNubh)}(h ``unified``h]hunified}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh message ID model, which uses a single enumeration for all messages within family. Requests and responses share the same message ID. Notifications have separate IDs from the same space. For example given the following list of operations:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKkhjhhubj)}(ho- name: a value: 1 do: ... - name: b do: ... - name: c value: 4 notify: a - name: d do: ...h]ho- name: a value: 1 do: ... - name: b do: ... - name: c value: 4 notify: a - name: d do: ...}hjsbah}(h]h ]h"]h$]h&]hhforcelanguageyamlhighlight_args}uh1jhhhKqhjhhubh)}(hRequests and responses for operation ``a`` will have the ID of 1, the requests and responses of ``b`` - 2 (since there is no explicit ``value`` it's previous operation ``+ 1``). Notification ``c`` will use the ID of 4, operation ``d`` 5 etc.h](h%Requests and responses for operation }(hjhhhNhNubh)}(h``a``h]ha}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh6 will have the ID of 1, the requests and responses of }(hjhhhNhNubh)}(h``b``h]hb}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh! - 2 (since there is no explicit }(hjhhhNhNubh)}(h ``value``h]hvalue}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh it’s previous operation }(hjhhhNhNubh)}(h``+ 1``h]h+ 1}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh). Notification }(hjhhhNhNubh)}(h``c``h]hc}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh! will use the ID of 4, operation }(hjhhhNhNubh)}(h``d``h]hd}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh 5 etc.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]unifiedah ]h"]unifiedah$]h&]uh1hhjhhhhhKiubh)}(hhh](h)}(h directionalh]h directional}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hThe ``directional`` model splits the ID assignment by the direction of the message. Messages from and to the kernel can't be confused with each other so this conserves the ID space (at the cost of making the programming more cumbersome).h](hThe }(hjhhhNhNubh)}(h``directional``h]h directional}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh model splits the ID assignment by the direction of the message. Messages from and to the kernel can’t be confused with each other so this conserves the ID space (at the cost of making the programming more cumbersome).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXeIn this case ``value`` attribute should be specified in the ``request`` ``reply`` sections of the operations (if an operation has both ``do`` and ``dump`` the IDs are shared, ``value`` should be set in ``do``). For notifications the ``value`` is provided at the op level but it only allocates a ``reply`` (i.e. a "from-kernel" ID). Let's look at an example:h](h In this case }(hjhhhNhNubh)}(h ``value``h]hvalue}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh& attribute should be specified in the }(hjhhhNhNubh)}(h ``request``h]hrequest}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh }(hjhhhNhNubh)}(h ``reply``h]hreply}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh6 sections of the operations (if an operation has both }(hjhhhNhNubh)}(h``do``h]hdo}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh and }(hjhhhNhNubh)}(h``dump``h]hdump}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh the IDs are shared, }(hjhhhNhNubh)}(h ``value``h]hvalue}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh should be set in }(hjhhhNhNubh)}(h``do``h]hdo}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh). For notifications the }(hjhhhNhNubh)}(h ``value``h]hvalue}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh5 is provided at the op level but it only allocates a }(hjhhhNhNubh)}(h ``reply``h]hreply}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh; (i.e. a “from-kernel” ID). Let’s look at an example:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(h- name: a do: request: value: 2 attributes: ... reply: value: 1 attributes: ... - name: b notify: a - name: c notify: a value: 7 - name: d do: ...h]h- name: a do: request: value: 2 attributes: ... reply: value: 1 attributes: ... - name: b notify: a - name: c notify: a value: 7 - name: d do: ...}hjtsbah}(h]h ]h"]h$]h&]hhj j yamlj}uh1jhhhKhjhhubh)}(hXIn this case ``a`` will use 2 when sending the message to the kernel and expects message with ID 1 in response. Notification ``b`` allocates a "from-kernel" ID which is 2. ``c`` allocates "from-kernel" ID of 7. If operation ``d`` does not set ``values`` explicitly in the spec it will be allocated 3 for the request (``a`` is the previous operation with a request section and the value of 2) and 8 for response (``c`` is the previous operation in the "from-kernel" direction).h](h In this case }(hjhhhNhNubh)}(h``a``h]ha}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhk will use 2 when sending the message to the kernel and expects message with ID 1 in response. Notification }(hjhhhNhNubh)}(h``b``h]hb}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh. allocates a “from-kernel” ID which is 2. }(hjhhhNhNubh)}(h``c``h]hc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh3 allocates “from-kernel” ID of 7. If operation }(hjhhhNhNubh)}(h``d``h]hd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh does not set }(hjhhhNhNubh)}(h ``values``h]hvalues}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh@ explicitly in the spec it will be allocated 3 for the request (}(hjhhhNhNubh)}(h``a``h]ha}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhZ is the previous operation with a request section and the value of 2) and 8 for response (}(hjhhhNhNubh)}(h``c``h]hc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh? is the previous operation in the “from-kernel” direction).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] directionalah ]h"] directionalah$]h&]uh1hhjhhhhhKubeh}(h]enum-message-id-modelah ]h"]enum (message id) modelah$]h&]uh1hhjhhhhhKfubeh}(h] operationsah ]h"] operationsah$]h&]uh1hhhhhhhhKcubh)}(hhh](h)}(h Other quirksh]h Other quirks}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj(hhhhhKubh)}(hhh](h)}(h Structuresh]h Structures}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9hhhhhKubh)}(hLegacy families can define C structures both to be used as the contents of an attribute and as a fixed message header. Structures are defined in ``definitions`` and referenced in operations or attributes.h](hLegacy families can define C structures both to be used as the contents of an attribute and as a fixed message header. Structures are defined in }(hjJhhhNhNubh)}(h``definitions``h]h definitions}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjJubh- and referenced in operations or attributes.}(hjJhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj9hhubh)}(hhh](h)}(hmembersh]hmembers}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjjhhhhhKubh block_quote)}(hX- ``name`` - The attribute name of the struct member - ``type`` - One of the scalar types ``u8``, ``u16``, ``u32``, ``u64``, ``s8``, ``s16``, ``s32``, ``s64``, ``string``, ``binary`` or ``bitfield32``. - ``byte-order`` - ``big-endian`` or ``little-endian`` - ``doc``, ``enum``, ``enum-as-flags``, ``display-hint`` - Same as for :ref:`attribute definitions ` h]h bullet_list)}(hhh](h list_item)}(h2``name`` - The attribute name of the struct memberh]h)}(hjh](h)}(h``name``h]hname}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh* - The attribute name of the struct member}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h``type`` - One of the scalar types ``u8``, ``u16``, ``u32``, ``u64``, ``s8``, ``s16``, ``s32``, ``s64``, ``string``, ``binary`` or ``bitfield32``.h]h)}(h``type`` - One of the scalar types ``u8``, ``u16``, ``u32``, ``u64``, ``s8``, ``s16``, ``s32``, ``s64``, ``string``, ``binary`` or ``bitfield32``.h](h)}(h``type``h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh - One of the scalar types }(hjhhhNhNubh)}(h``u8``h]hu8}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }(hjhhhNhNubh)}(h``u16``h]hu16}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }hjsbh)}(h``u32``h]hu32}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }hjsbh)}(h``u64``h]hu64}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }hjsbh)}(h``s8``h]hs8}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }(hjhhhNhNubh)}(h``s16``h]hs16}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }hjsbh)}(h``s32``h]hs32}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }hjsbh)}(h``s64``h]hs64}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }hjsbh)}(h ``string``h]hstring}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }hjsbh)}(h ``binary``h]hbinary}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh or }(hjhhhNhNubh)}(h``bitfield32``h]h bitfield32}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h4``byte-order`` - ``big-endian`` or ``little-endian``h]h)}(hjh](h)}(h``byte-order``h]h byte-order}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh - }(hjhhhNhNubh)}(h``big-endian``h]h big-endian}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh or }(hjhhhNhNubh)}(h``little-endian``h]h little-endian}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hy``doc``, ``enum``, ``enum-as-flags``, ``display-hint`` - Same as for :ref:`attribute definitions ` h]h)}(hx``doc``, ``enum``, ``enum-as-flags``, ``display-hint`` - Same as for :ref:`attribute definitions `h](h)}(h``doc``h]hdoc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }(hjhhhNhNubh)}(h``enum``h]henum}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }hjsbh)}(h``enum-as-flags``h]h enum-as-flags}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }hjsbh)}(h``display-hint``h]h display-hint}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh - Same as for }(hjhhhNhNubh)}(h3:ref:`attribute definitions `h]hinline)}(hj0h]hattribute definitions}(hj4hhhNhNubah}(h]h ](xrefstdstd-refeh"]h$]h&]uh1j2hj.ubah}(h]h ]h"]h$]h&]refdoc&userspace-api/netlink/genetlink-legacy refdomainj?reftyperef refexplicitrefwarn reftargetattribute_propertiesuh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]bullet-uh1jhhhKhj}ubah}(h]h ]h"]h$]h&]uh1j{hhhKhjjhhubh)}(hNote that structures defined in YAML are implicitly packed according to C conventions. For example, the following struct is 4 bytes, not 6 bytes:h]hNote that structures defined in YAML are implicitly packed according to C conventions. For example, the following struct is 4 bytes, not 6 bytes:}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjjhhubj)}(h5struct { u8 a; u16 b; u8 c; }h]h5struct { u8 a; u16 b; u8 c; }}hj{sbah}(h]h ]h"]h$]h&]hhj j cj}uh1jhhhKhjjhhubh)}(hAny padding must be explicitly added and C-like languages should infer the need for explicit padding from whether the members are naturally aligned.h]hAny padding must be explicitly added and C-like languages should infer the need for explicit padding from whether the members are naturally aligned.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjjhhubh)}(h;Here is the struct definition from above, declared in YAML:h]h;Here is the struct definition from above, declared in YAML:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjjhhubj)}(hdefinitions: - name: message-header type: struct members: - name: a type: u8 - name: b type: u16 - name: c type: u8h]hdefinitions: - name: message-header type: struct members: - name: a type: u8 - name: b type: u16 - name: c type: u8}hjsbah}(h]h ]h"]h$]h&]hhj j yamlj}uh1jhhhKhjjhhubeh}(h]membersah ]h"]membersah$]h&]uh1hhj9hhhhhKubh)}(hhh](h)}(h Fixed Headersh]h Fixed Headers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hFixed message headers can be added to operations using ``fixed-header``. The default ``fixed-header`` can be set in ``operations`` and it can be set or overridden for each operation.h](h7Fixed message headers can be added to operations using }(hjhhhNhNubh)}(h``fixed-header``h]h fixed-header}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh. The default }(hjhhhNhNubh)}(h``fixed-header``h]h fixed-header}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh can be set in }(hjhhhNhNubh)}(h``operations``h]h operations}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh4 and it can be set or overridden for each operation.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hoperations: fixed-header: message-header list: - name: get fixed-header: custom-header attribute-set: message-attrsh]hoperations: fixed-header: message-header list: - name: get fixed-header: custom-header attribute-set: message-attrs}hj sbah}(h]h ]h"]h$]h&]hhj j yamlj}uh1jhhhKhjhhubeh}(h] fixed-headersah ]h"] fixed headersah$]h&]uh1hhj9hhhhhKubh)}(hhh](h)}(h Attributesh]h Attributes}(hj/ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj, hhhhhKubh)}(hA ``binary`` attribute can be interpreted as a C structure using a ``struct`` property with the name of the structure definition. The ``struct`` property implies ``sub-type: struct`` so it is not necessary to specify a sub-type.h](hA }(hj= hhhNhNubh)}(h ``binary``h]hbinary}(hjE hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj= ubh7 attribute can be interpreted as a C structure using a }(hj= hhhNhNubh)}(h ``struct``h]hstruct}(hjW hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj= ubh9 property with the name of the structure definition. The }(hj= hhhNhNubh)}(h ``struct``h]hstruct}(hji hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj= ubh property implies }(hj= hhhNhNubh)}(h``sub-type: struct``h]hsub-type: struct}(hj{ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj= ubh. so it is not necessary to specify a sub-type.}(hj= hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj, hhubj)}(hattribute-sets: - name: stats-attrs attributes: - name: stats type: binary struct: vport-statsh]hattribute-sets: - name: stats-attrs attributes: - name: stats type: binary struct: vport-stats}hj sbah}(h]h ]h"]h$]h&]hhj j yamlj}uh1jhhhMhj, hhubeh}(h] attributesah ]h"] attributesah$]h&]uh1hhj9hhhhhKubeh}(h] structuresah ]h"] structuresah$]h&]uh1hhj(hhhhhKubh)}(hhh](h)}(hC Arraysh]hC Arrays}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hLegacy families also use ``binary`` attributes to encapsulate C arrays. The ``sub-type`` is used to identify the type of scalar to extract.h](hLegacy families also use }(hj hhhNhNubh)}(h ``binary``h]hbinary}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh) attributes to encapsulate C arrays. The }(hj hhhNhNubh)}(h ``sub-type``h]hsub-type}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh3 is used to identify the type of scalar to extract.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hBattributes: - name: ports type: binary sub-type: u32h]hBattributes: - name: ports type: binary sub-type: u32}hj sbah}(h]h ]h"]h$]h&]hhj j yamlj}uh1jhhhMhj hhubeh}(h]c-arraysah ]h"]c arraysah$]h&]uh1hhj(hhhhhMubh)}(hhh](h)}(hMulti-message DOh]hMulti-message DO}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hNew Netlink families should never respond to a DO operation with multiple replies, with ``NLM_F_MULTI`` set. Use a filtered dump instead.h](hXNew Netlink families should never respond to a DO operation with multiple replies, with }(hj hhhNhNubh)}(h``NLM_F_MULTI``h]h NLM_F_MULTI}(hj' hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh" set. Use a filtered dump instead.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hAt the spec level we can define a ``dumps`` property for the ``do``, perhaps with values of ``combine`` and ``multi-object`` depending on how the parsing should be implemented (parse into a single reply vs list of objects i.e. pretty much a dump).h](h"At the spec level we can define a }(hj? hhhNhNubh)}(h ``dumps``h]hdumps}(hjG hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubh property for the }(hj? hhhNhNubh)}(h``do``h]hdo}(hjY hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubh, perhaps with values of }(hj? hhhNhNubh)}(h ``combine``h]hcombine}(hjk hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubh and }(hj? hhhNhNubh)}(h``multi-object``h]h multi-object}(hj} hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubh{ depending on how the parsing should be implemented (parse into a single reply vs list of objects i.e. pretty much a dump).}(hj? hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM!hj hhubeh}(h]multi-message-doah ]h"]multi-message doah$]h&]uh1hhj(hhhhhMubeh}(h] other-quirksah ]h"] other quirksah$]h&]uh1hhhhhhhhKubeh}(h]Anetlink-specification-support-for-legacy-generic-netlink-familiesah ]h"]Anetlink specification support for legacy generic netlink familiesah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j j jjjwjtjojljjj+j(jjj%j"jjjjjjj j j j jjj) j& j j j j j j u nametypes}(j jjwjojj+jj%jjjj j jj) j j j uh}(j hjhjthjljjjzj(j jj.j"jjjjjjjj j(j j9jjjj& jj j, j j j j u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.