Xsphinx.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/intromodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/zh_TW/userspace-api/netlink/intromodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/it_IT/userspace-api/netlink/intromodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/ja_JP/userspace-api/netlink/intromodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/ko_KR/userspace-api/netlink/intromodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/sp_SP/userspace-api/netlink/intromodnameN 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:spacepreserveuh1hhhhhhI/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro.rsthKubhsection)}(hhh](htitle)}(hIntroduction to Netlinkh]hIntroduction to Netlink}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hNetlink is often described as an ioctl() replacement. It aims to replace fixed-format C structures as supplied to ioctl() with a format which allows an easy way to add or extended the arguments.h]hNetlink is often described as an ioctl() replacement. It aims to replace fixed-format C structures as supplied to ioctl() with a format which allows an easy way to add or extended the arguments.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hTo achieve this Netlink uses a minimal fixed-format metadata header followed by multiple attributes in the TLV (type, length, value) format.h]hTo achieve this Netlink uses a minimal fixed-format metadata header followed by multiple attributes in the TLV (type, length, value) format.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hXUnfortunately the protocol has evolved over the years, in an organic and undocumented fashion, making it hard to coherently explain. To make the most practical sense this document starts by describing netlink as it is used today and dives into more "historical" uses in later sections.h]hX!Unfortunately the protocol has evolved over the years, in an organic and undocumented fashion, making it hard to coherently explain. To make the most practical sense this document starts by describing netlink as it is used today and dives into more “historical” uses in later sections.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hOpening a socketh]hOpening a socket}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hNNetlink communication happens over sockets, a socket needs to be opened first:h]hNNetlink communication happens over sockets, a socket needs to be opened first:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh literal_block)}(h3fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC);h]h3fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC);}hjsbah}(h]h ]h"]h$]h&]hhforcelanguagechighlight_args}uh1jhhhKhhhhubh)}(hXThe use of sockets allows for a natural way of exchanging information in both directions (to and from the kernel). The operations are still performed synchronously when applications send() the request but a separate recv() system call is needed to read the reply.h]hXThe use of sockets allows for a natural way of exchanging information in both directions (to and from the kernel). The operations are still performed synchronously when applications send() the request but a separate recv() system call is needed to read the reply.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hNA very simplified flow of a Netlink "call" will therefore look something like:h]hRA very simplified flow of a Netlink “call” will therefore look something like:}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK$hhhhubj)}(hfd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); /* format the request */ send(fd, &request, sizeof(request)); n = recv(fd, &response, RSP_BUFFER_SIZE); /* interpret the response */h]hfd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); /* format the request */ send(fd, &request, sizeof(request)); n = recv(fd, &response, RSP_BUFFER_SIZE); /* interpret the response */}hjEsbah}(h]h ]h"]h$]h&]hhj$j%j&j'}uh1jhhhK'hhhhubh)}(hNetlink also provides natural support for "dumping", i.e. communicating to user space all objects of a certain type (e.g. dumping all network interfaces).h]hNetlink also provides natural support for “dumping”, i.e. communicating to user space all objects of a certain type (e.g. dumping all network interfaces).}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hhhhubj)}(hXfd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); /* format the dump request */ send(fd, &request, sizeof(request)); while (1) { n = recv(fd, &buffer, RSP_BUFFER_SIZE); /* one recv() call can read multiple messages, hence the loop below */ for (nl_msg in buffer) { if (nl_msg.nlmsg_type == NLMSG_DONE) goto dump_finished; /* process the object */ } } dump_finished:h]hXfd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); /* format the dump request */ send(fd, &request, sizeof(request)); while (1) { n = recv(fd, &buffer, RSP_BUFFER_SIZE); /* one recv() call can read multiple messages, hence the loop below */ for (nl_msg in buffer) { if (nl_msg.nlmsg_type == NLMSG_DONE) goto dump_finished; /* process the object */ } } dump_finished:}hjbsbah}(h]h ]h"]h$]h&]hhj$j%j&j'}uh1jhhhK4hhhhubh)}(hX)The first two arguments of the socket() call require little explanation - it is opening a Netlink socket, with all headers provided by the user (hence NETLINK, RAW). The last argument is the protocol within Netlink. This field used to identify the subsystem with which the socket will communicate.h]hX)The first two arguments of the socket() call require little explanation - it is opening a Netlink socket, with all headers provided by the user (hence NETLINK, RAW). The last argument is the protocol within Netlink. This field used to identify the subsystem with which the socket will communicate.}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhhhhubh)}(hhh](h)}(hClassic vs Generic Netlinkh]hClassic vs Generic Netlink}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKLubh)}(hXInitial implementation of Netlink depended on a static allocation of IDs to subsystems and provided little supporting infrastructure. Let us refer to those protocols collectively as **Classic Netlink**. The list of them is defined on top of the ``include/uapi/linux/netlink.h`` file, they include among others - general networking (NETLINK_ROUTE), iSCSI (NETLINK_ISCSI), and audit (NETLINK_AUDIT).h](hInitial implementation of Netlink depended on a static allocation of IDs to subsystems and provided little supporting infrastructure. Let us refer to those protocols collectively as }(hjhhhNhNubhstrong)}(h**Classic Netlink**h]hClassic Netlink}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh,. The list of them is defined on top of the }(hjhhhNhNubhliteral)}(h ``include/uapi/linux/netlink.h``h]hinclude/uapi/linux/netlink.h}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhx file, they include among others - general networking (NETLINK_ROUTE), iSCSI (NETLINK_ISCSI), and audit (NETLINK_AUDIT).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKNhjhhubh)}(h**Generic Netlink** (introduced in 2005) allows for dynamic registration of subsystems (and subsystem ID allocation), introspection and simplifies implementing the kernel side of the interface.h](j)}(h**Generic Netlink**h]hGeneric Netlink}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh (introduced in 2005) allows for dynamic registration of subsystems (and subsystem ID allocation), introspection and simplifies implementing the kernel side of the interface.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKUhjhhubh)}(hXThe following section describes how to use Generic Netlink, as the number of subsystems using Generic Netlink outnumbers the older protocols by an order of magnitude. There are also no plans for adding more Classic Netlink protocols to the kernel. Basic information on how communicating with core networking parts of the Linux kernel (or another of the 20 subsystems using Classic Netlink) differs from Generic Netlink is provided later in this document.h]hXThe following section describes how to use Generic Netlink, as the number of subsystems using Generic Netlink outnumbers the older protocols by an order of magnitude. There are also no plans for adding more Classic Netlink protocols to the kernel. Basic information on how communicating with core networking parts of the Linux kernel (or another of the 20 subsystems using Classic Netlink) differs from Generic Netlink is provided later in this document.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhjhhubeh}(h]classic-vs-generic-netlinkah ]h"]classic vs generic netlinkah$]h&]uh1hhhhhhhhKLubeh}(h]opening-a-socketah ]h"]opening a socketah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hGeneric Netlinkh]hGeneric Netlink}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKbubh)}(hIn addition to the Netlink fixed metadata header each Netlink protocol defines its own fixed metadata header. (Similarly to how network headers stack - Ethernet > IP > TCP we have Netlink > Generic N. > Family.)h]hIn addition to the Netlink fixed metadata header each Netlink protocol defines its own fixed metadata header. (Similarly to how network headers stack - Ethernet > IP > TCP we have Netlink > Generic N. > Family.)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhjhhubh)}(hA Netlink message always starts with struct nlmsghdr, which is followed by a protocol-specific header. In case of Generic Netlink the protocol header is struct genlmsghdr.h]hA Netlink message always starts with struct nlmsghdr, which is followed by a protocol-specific header. In case of Generic Netlink the protocol header is struct genlmsghdr.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhjhhubh)}(hMThe practical meaning of the fields in case of Generic Netlink is as follows:h]hMThe practical meaning of the fields in case of Generic Netlink is as follows:}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKlhjhhubj)}(hX8struct nlmsghdr { __u32 nlmsg_len; /* Length of message including headers */ __u16 nlmsg_type; /* Generic Netlink Family (subsystem) ID */ __u16 nlmsg_flags; /* Flags - request or dump */ __u32 nlmsg_seq; /* Sequence number */ __u32 nlmsg_pid; /* Port ID, set to 0 */ }; struct genlmsghdr { __u8 cmd; /* Command, as defined by the Family */ __u8 version; /* Irrelevant, set to 1 */ __u16 reserved; /* Reserved, set to 0 */ }; /* TLV attributes follow... */h]hX8struct nlmsghdr { __u32 nlmsg_len; /* Length of message including headers */ __u16 nlmsg_type; /* Generic Netlink Family (subsystem) ID */ __u16 nlmsg_flags; /* Flags - request or dump */ __u32 nlmsg_seq; /* Sequence number */ __u32 nlmsg_pid; /* Port ID, set to 0 */ }; struct genlmsghdr { __u8 cmd; /* Command, as defined by the Family */ __u8 version; /* Irrelevant, set to 1 */ __u16 reserved; /* Reserved, set to 0 */ }; /* TLV attributes follow... */}hj;sbah}(h]h ]h"]h$]h&]hhj$j%j&j'}uh1jhhhKnhjhhubh)}(hXqIn Classic Netlink :c:member:`nlmsghdr.nlmsg_type` used to identify which operation within the subsystem the message was referring to (e.g. get information about a netdev). Generic Netlink needs to mux multiple subsystems in a single protocol so it uses this field to identify the subsystem, and :c:member:`genlmsghdr.cmd` identifies the operation instead. (See :ref:`res_fam` for information on how to find the Family ID of the subsystem of interest.) Note that the first 16 values (0 - 15) of this field are reserved for control messages both in Classic Netlink and Generic Netlink. See :ref:`nl_msg_type` for more details.h](hIn Classic Netlink }(hjJhhhNhNubh)}(h:c:member:`nlmsghdr.nlmsg_type`h]j)}(hjTh]hnlmsghdr.nlmsg_type}(hjVhhhNhNubah}(h]h ](xrefj&c-membereh"]h$]h&]uh1jhjRubah}(h]h ]h"]h$]h&]refdocuserspace-api/netlink/intro refdomainj&reftypemember refexplicitrefwarn reftargetnlmsghdr.nlmsg_typeuh1hhhhK~hjJubh used to identify which operation within the subsystem the message was referring to (e.g. get information about a netdev). Generic Netlink needs to mux multiple subsystems in a single protocol so it uses this field to identify the subsystem, and }(hjJhhhNhNubh)}(h:c:member:`genlmsghdr.cmd`h]j)}(hjzh]hgenlmsghdr.cmd}(hj|hhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhjxubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrgenlmsghdr.cmduh1hhhhK~hjJubh( identifies the operation instead. (See }(hjJhhhNhNubh)}(h:ref:`res_fam`h]hinline)}(hjh]hres_fam}(hjhhhNhNubah}(h]h ](j`stdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjl refdomainjreftyperef refexplicitrefwarnjrres_famuh1hhhhK~hjJubh for information on how to find the Family ID of the subsystem of interest.) Note that the first 16 values (0 - 15) of this field are reserved for control messages both in Classic Netlink and Generic Netlink. See }(hjJhhhNhNubh)}(h:ref:`nl_msg_type`h]j)}(hjh]h nl_msg_type}(hjhhhNhNubah}(h]h ](j`stdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjl refdomainjreftyperef refexplicitrefwarnjr nl_msg_typeuh1hhhhK~hjJubh for more details.}(hjJhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK~hjhhubh)}(hAThere are 3 usual types of message exchanges on a Netlink socket:h]hAThere are 3 usual types of message exchanges on a Netlink socket:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh block_quote)}(h- performing a single action (``do``); - dumping information (``dump``); - getting asynchronous notifications (``multicast``). h]h bullet_list)}(hhh](h list_item)}(h$performing a single action (``do``);h]h)}(hjh](hperforming a single action (}(hj hhhNhNubj)}(h``do``h]hdo}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh);}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hdumping information (``dump``);h]h)}(hj1h](hdumping information (}(hj3hhhNhNubj)}(h``dump``h]hdump}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj3ubh);}(hj3hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj/ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h4getting asynchronous notifications (``multicast``). h]h)}(h3getting asynchronous notifications (``multicast``).h](h$getting asynchronous notifications (}(hj\hhhNhNubj)}(h ``multicast``h]h multicast}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj\ubh).}(hj\hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjXubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]bullet-uh1jhhhKhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjhhubh)}(hClassic Netlink is very flexible and presumably allows other types of exchanges to happen, but in practice those are the three that get used.h]hClassic Netlink is very flexible and presumably allows other types of exchanges to happen, but in practice those are the three that get used.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hAsynchronous notifications are sent by the kernel and received by the user sockets which subscribed to them. ``do`` and ``dump`` requests are initiated by the user. :c:member:`nlmsghdr.nlmsg_flags` should be set as follows:h](hmAsynchronous notifications are sent by the kernel and received by the user sockets which subscribed to them. }(hjhhhNhNubj)}(h``do``h]hdo}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h``dump``h]hdump}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh% requests are initiated by the user. }(hjhhhNhNubh)}(h :c:member:`nlmsghdr.nlmsg_flags`h]j)}(hjh]hnlmsghdr.nlmsg_flags}(hjhhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrnlmsghdr.nlmsg_flagsuh1hhhhKhjubh should be set as follows:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hg- for ``do``: ``NLM_F_REQUEST | NLM_F_ACK`` - for ``dump``: ``NLM_F_REQUEST | NLM_F_ACK | NLM_F_DUMP`` h]j)}(hhh](j)}(h)for ``do``: ``NLM_F_REQUEST | NLM_F_ACK``h]h)}(hjh](hfor }(hjhhhNhNubj)}(h``do``h]hdo}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh: }(hjhhhNhNubj)}(h``NLM_F_REQUEST | NLM_F_ACK``h]hNLM_F_REQUEST | NLM_F_ACK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h9for ``dump``: ``NLM_F_REQUEST | NLM_F_ACK | NLM_F_DUMP`` h]h)}(h8for ``dump``: ``NLM_F_REQUEST | NLM_F_ACK | NLM_F_DUMP``h](hfor }(hj5hhhNhNubj)}(h``dump``h]hdump}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj5ubh: }(hj5hhhNhNubj)}(h*``NLM_F_REQUEST | NLM_F_ACK | NLM_F_DUMP``h]h&NLM_F_REQUEST | NLM_F_ACK | NLM_F_DUMP}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj5ubeh}(h]h ]h"]h$]h&]uh1hhhhKhj1ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jjuh1jhhhKhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjhhubh)}(hX}:c:member:`nlmsghdr.nlmsg_seq` should be a set to a monotonically increasing value. The value gets echoed back in responses and doesn't matter in practice, but setting it to an increasing value for each message sent is considered good hygiene. The purpose of the field is matching responses to requests. Asynchronous notifications will have :c:member:`nlmsghdr.nlmsg_seq` of ``0``.h](h)}(h:c:member:`nlmsghdr.nlmsg_seq`h]j)}(hj{h]hnlmsghdr.nlmsg_seq}(hj}hhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhjyubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrnlmsghdr.nlmsg_sequh1hhhhKhjuubhX9 should be a set to a monotonically increasing value. The value gets echoed back in responses and doesn’t matter in practice, but setting it to an increasing value for each message sent is considered good hygiene. The purpose of the field is matching responses to requests. Asynchronous notifications will have }(hjuhhhNhNubh)}(h:c:member:`nlmsghdr.nlmsg_seq`h]j)}(hjh]hnlmsghdr.nlmsg_seq}(hjhhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrnlmsghdr.nlmsg_sequh1hhhhKhjuubh of }(hjuhhhNhNubj)}(h``0``h]h0}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjuubh.}(hjuhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h:c:member:`nlmsghdr.nlmsg_pid` is the Netlink equivalent of an address. This field can be set to ``0`` when talking to the kernel. See :ref:`nlmsg_pid` for the (uncommon) uses of the field.h](h)}(h:c:member:`nlmsghdr.nlmsg_pid`h]j)}(hjh]hnlmsghdr.nlmsg_pid}(hjhhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrnlmsghdr.nlmsg_piduh1hhhhKhjubhC is the Netlink equivalent of an address. This field can be set to }(hjhhhNhNubj)}(h``0``h]h0}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh! when talking to the kernel. See }(hjhhhNhNubh)}(h:ref:`nlmsg_pid`h]j)}(hjh]h nlmsg_pid}(hjhhhNhNubah}(h]h ](j`stdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjl refdomainjreftyperef refexplicitrefwarnjr nlmsg_piduh1hhhhKhjubh& for the (uncommon) uses of the field.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe expected use for :c:member:`genlmsghdr.version` was to allow versioning of the APIs provided by the subsystems. No subsystem to date made significant use of this field, so setting it to ``1`` seems like a safe bet.h](hThe expected use for }(hj:hhhNhNubh)}(h:c:member:`genlmsghdr.version`h]j)}(hjDh]hgenlmsghdr.version}(hjFhhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhjBubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrgenlmsghdr.versionuh1hhhhKhj:ubh was to allow versioning of the APIs provided by the subsystems. No subsystem to date made significant use of this field, so setting it to }(hj:hhhNhNubj)}(h``1``h]h1}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1jhj:ubh seems like a safe bet.}(hj:hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubhtarget)}(h.. _nl_msg_type:h]h}(h]h ]h"]h$]h&]refid nl-msg-typeuh1j}hKhjhhhhubh)}(hhh](h)}(hNetlink message typesh]hNetlink message types}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hAs previously mentioned :c:member:`nlmsghdr.nlmsg_type` carries protocol specific values but the first 16 identifiers are reserved (first subsystem specific message type should be equal to ``NLMSG_MIN_TYPE`` which is ``0x10``).h](hAs previously mentioned }(hjhhhNhNubh)}(h:c:member:`nlmsghdr.nlmsg_type`h]j)}(hjh]hnlmsghdr.nlmsg_type}(hjhhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrnlmsghdr.nlmsg_typeuh1hhhhKhjubh carries protocol specific values but the first 16 identifiers are reserved (first subsystem specific message type should be equal to }(hjhhhNhNubj)}(h``NLMSG_MIN_TYPE``h]hNLMSG_MIN_TYPE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh which is }(hjhhhNhNubj)}(h``0x10``h]h0x10}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h2There are only 4 Netlink control messages defined:h]h2There are only 4 Netlink control messages defined:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(h- ``NLMSG_NOOP`` - ignore the message, not used in practice; - ``NLMSG_ERROR`` - carries the return code of an operation; - ``NLMSG_DONE`` - marks the end of a dump; - ``NLMSG_OVERRUN`` - socket buffer has overflown, not used to date. h]j)}(hhh](j)}(h:``NLMSG_NOOP`` - ignore the message, not used in practice;h]h)}(hjh](j)}(h``NLMSG_NOOP``h]h NLMSG_NOOP}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh, - ignore the message, not used in practice;}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h:``NLMSG_ERROR`` - carries the return code of an operation;h]h)}(hj-h](j)}(h``NLMSG_ERROR``h]h NLMSG_ERROR}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/ubh+ - carries the return code of an operation;}(hj/hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj+ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h)``NLMSG_DONE`` - marks the end of a dump;h]h)}(hjRh](j)}(h``NLMSG_DONE``h]h NLMSG_DONE}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjTubh - marks the end of a dump;}(hjThhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjPubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hC``NLMSG_OVERRUN`` - socket buffer has overflown, not used to date. h]h)}(hB``NLMSG_OVERRUN`` - socket buffer has overflown, not used to date.h](j)}(h``NLMSG_OVERRUN``h]h NLMSG_OVERRUN}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjyubh1 - socket buffer has overflown, not used to date.}(hjyhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjuubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jjuh1jhhhKhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjhhubh)}(hXC``NLMSG_ERROR`` and ``NLMSG_DONE`` are of practical importance. They carry return codes for operations. Note that unless the ``NLM_F_ACK`` flag is set on the request Netlink will not respond with ``NLMSG_ERROR`` if there is no error. To avoid having to special-case this quirk it is recommended to always set ``NLM_F_ACK``.h](j)}(h``NLMSG_ERROR``h]h NLMSG_ERROR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h``NLMSG_DONE``h]h NLMSG_DONE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh[ are of practical importance. They carry return codes for operations. Note that unless the }(hjhhhNhNubj)}(h ``NLM_F_ACK``h]h NLM_F_ACK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh: flag is set on the request Netlink will not respond with }(hjhhhNhNubj)}(h``NLMSG_ERROR``h]h NLMSG_ERROR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhb if there is no error. To avoid having to special-case this quirk it is recommended to always set }(hjhhhNhNubj)}(h ``NLM_F_ACK``h]h NLM_F_ACK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h?The format of ``NLMSG_ERROR`` is described by struct nlmsgerr::h](hThe format of }(hj hhhNhNubj)}(h``NLMSG_ERROR``h]h NLMSG_ERROR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh! is described by struct nlmsgerr:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hX---------------------------------------------- | struct nlmsghdr - response header | ---------------------------------------------- | int error | ---------------------------------------------- | struct nlmsghdr - original request header | ---------------------------------------------- | ** optionally (1) payload of the request | ---------------------------------------------- | ** optionally (2) extended ACK | ----------------------------------------------h]hX---------------------------------------------- | struct nlmsghdr - response header | ---------------------------------------------- | int error | ---------------------------------------------- | struct nlmsghdr - original request header | ---------------------------------------------- | ** optionally (1) payload of the request | ---------------------------------------------- | ** optionally (2) extended ACK | ----------------------------------------------}hj+sbah}(h]h ]h"]h$]h&]hhuh1jhhhKhjhhubh)}(hX!There are two instances of struct nlmsghdr here, first of the response and second of the request. ``NLMSG_ERROR`` carries the information about the request which led to the error. This could be useful when trying to match requests to responses or re-parse the request to dump it into logs.h](hbThere are two instances of struct nlmsghdr here, first of the response and second of the request. }(hj9hhhNhNubj)}(h``NLMSG_ERROR``h]h NLMSG_ERROR}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh carries the information about the request which led to the error. This could be useful when trying to match requests to responses or re-parse the request to dump it into logs.}(hj9hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXlThe payload of the request is not echoed in messages reporting success (``error == 0``) or if ``NETLINK_CAP_ACK`` setsockopt() was set. The latter is common and perhaps recommended as having to read a copy of every request back from the kernel is rather wasteful. The absence of request payload is indicated by ``NLM_F_CAPPED`` in :c:member:`nlmsghdr.nlmsg_flags`.h](hHThe payload of the request is not echoed in messages reporting success (}(hjYhhhNhNubj)}(h``error == 0``h]h error == 0}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYubh) or if }(hjYhhhNhNubj)}(h``NETLINK_CAP_ACK``h]hNETLINK_CAP_ACK}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYubh setsockopt() was set. The latter is common and perhaps recommended as having to read a copy of every request back from the kernel is rather wasteful. The absence of request payload is indicated by }(hjYhhhNhNubj)}(h``NLM_F_CAPPED``h]h NLM_F_CAPPED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYubh in }(hjYhhhNhNubh)}(h :c:member:`nlmsghdr.nlmsg_flags`h]j)}(hjh]hnlmsghdr.nlmsg_flags}(hjhhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrnlmsghdr.nlmsg_flagsuh1hhhhKhjYubh.}(hjYhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe second optional element of ``NLMSG_ERROR`` are the extended ACK attributes. See :ref:`ext_ack` for more details. The presence of extended ACK is indicated by ``NLM_F_ACK_TLVS`` in :c:member:`nlmsghdr.nlmsg_flags`.h](hThe second optional element of }(hjhhhNhNubj)}(h``NLMSG_ERROR``h]h NLMSG_ERROR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh& are the extended ACK attributes. See }(hjhhhNhNubh)}(h:ref:`ext_ack`h]j)}(hjh]hext_ack}(hjhhhNhNubah}(h]h ](j`stdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjl refdomainjreftyperef refexplicitrefwarnjrext_ackuh1hhhhKhjubh@ for more details. The presence of extended ACK is indicated by }(hjhhhNhNubj)}(h``NLM_F_ACK_TLVS``h]hNLM_F_ACK_TLVS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh in }(hjhhhNhNubh)}(h :c:member:`nlmsghdr.nlmsg_flags`h]j)}(hjh]hnlmsghdr.nlmsg_flags}(hjhhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrnlmsghdr.nlmsg_flagsuh1hhhhKhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hg``NLMSG_DONE`` is simpler, the request is never echoed but the extended ACK attributes may be present::h](j)}(h``NLMSG_DONE``h]h NLMSG_DONE}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubhX is simpler, the request is never echoed but the extended ACK attributes may be present:}(hj9hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hXH---------------------------------------------- | struct nlmsghdr - response header | ---------------------------------------------- | int error | ---------------------------------------------- | ** optionally extended ACK | ----------------------------------------------h]hXH---------------------------------------------- | struct nlmsghdr - response header | ---------------------------------------------- | int error | ---------------------------------------------- | ** optionally extended ACK | ----------------------------------------------}hjUsbah}(h]h ]h"]h$]h&]hhuh1jhhhKhjhhubh)}(hNote that some implementations may issue custom ``NLMSG_DONE`` messages in reply to ``do`` action requests. In that case the payload is implementation-specific and may also be absent.h](h0Note that some implementations may issue custom }(hjchhhNhNubj)}(h``NLMSG_DONE``h]h NLMSG_DONE}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjcubh messages in reply to }(hjchhhNhNubj)}(h``do``h]hdo}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjcubh] action requests. In that case the payload is implementation-specific and may also be absent.}(hjchhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj~)}(h .. _res_fam:h]h}(h]h ]h"]h$]h&]jres-famuh1j}hKhjhhhhubeh}(h](netlink-message-typesjeh ]h"](netlink message types nl_msg_typeeh$]h&]uh1hhjhhhhhKexpect_referenced_by_name}jjsexpect_referenced_by_id}jjsubh)}(hhh](h)}(hResolving the Family IDh]hResolving the Family ID}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h~This section explains how to find the Family ID of a subsystem. It also serves as an example of Generic Netlink communication.h]h~This section explains how to find the Family ID of a subsystem. It also serves as an example of Generic Netlink communication.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXSGeneric Netlink is itself a subsystem exposed via the Generic Netlink API. To avoid a circular dependency Generic Netlink has a statically allocated Family ID (``GENL_ID_CTRL`` which is equal to ``NLMSG_MIN_TYPE``). The Generic Netlink family implements a command used to find out information about other families (``CTRL_CMD_GETFAMILY``).h](hGeneric Netlink is itself a subsystem exposed via the Generic Netlink API. To avoid a circular dependency Generic Netlink has a statically allocated Family ID (}(hjhhhNhNubj)}(h``GENL_ID_CTRL``h]h GENL_ID_CTRL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh which is equal to }(hjhhhNhNubj)}(h``NLMSG_MIN_TYPE``h]hNLMSG_MIN_TYPE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhf). The Generic Netlink family implements a command used to find out information about other families (}(hjhhhNhNubj)}(h``CTRL_CMD_GETFAMILY``h]hCTRL_CMD_GETFAMILY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXTo get information about the Generic Netlink family named for example ``"test1"`` we need to send a message on the previously opened Generic Netlink socket. The message should target the Generic Netlink Family (1), be a ``do`` (2) call to ``CTRL_CMD_GETFAMILY`` (3). A ``dump`` version of this call would make the kernel respond with information about *all* the families it knows about. Last but not least the name of the family in question has to be specified (4) as an attribute with the appropriate type::h](hFTo get information about the Generic Netlink family named for example }(hj hhhNhNubj)}(h ``"test1"``h]h"test1"}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh we need to send a message on the previously opened Generic Netlink socket. The message should target the Generic Netlink Family (1), be a }(hj hhhNhNubj)}(h``do``h]hdo}(hj* hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh (2) call to }(hj hhhNhNubj)}(h``CTRL_CMD_GETFAMILY``h]hCTRL_CMD_GETFAMILY}(hj< hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh (3). A }(hj hhhNhNubj)}(h``dump``h]hdump}(hjN hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhK version of this call would make the kernel respond with information about }(hj hhhNhNubhemphasis)}(h*all*h]hall}(hjb hhhNhNubah}(h]h ]h"]h$]h&]uh1j` hj ubh the families it knows about. Last but not least the name of the family in question has to be specified (4) as an attribute with the appropriate type:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hX#struct nlmsghdr: __u32 nlmsg_len: 32 __u16 nlmsg_type: GENL_ID_CTRL // (1) __u16 nlmsg_flags: NLM_F_REQUEST | NLM_F_ACK // (2) __u32 nlmsg_seq: 1 __u32 nlmsg_pid: 0 struct genlmsghdr: __u8 cmd: CTRL_CMD_GETFAMILY // (3) __u8 version: 2 /* or 1, doesn't matter */ __u16 reserved: 0 struct nlattr: // (4) __u16 nla_len: 10 __u16 nla_type: CTRL_ATTR_FAMILY_NAME char data: test1\0 (padding:) char data: \0\0h]hX#struct nlmsghdr: __u32 nlmsg_len: 32 __u16 nlmsg_type: GENL_ID_CTRL // (1) __u16 nlmsg_flags: NLM_F_REQUEST | NLM_F_ACK // (2) __u32 nlmsg_seq: 1 __u32 nlmsg_pid: 0 struct genlmsghdr: __u8 cmd: CTRL_CMD_GETFAMILY // (3) __u8 version: 2 /* or 1, doesn't matter */ __u16 reserved: 0 struct nlattr: // (4) __u16 nla_len: 10 __u16 nla_type: CTRL_ATTR_FAMILY_NAME char data: test1\0 (padding:) char data: \0\0}hjz sbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjhhubh)}(hX7The length fields in Netlink (:c:member:`nlmsghdr.nlmsg_len` and :c:member:`nlattr.nla_len`) always *include* the header. Attribute headers in netlink must be aligned to 4 bytes from the start of the message, hence the extra ``\0\0`` after ``CTRL_ATTR_FAMILY_NAME``. The attribute lengths *exclude* the padding.h](hThe length fields in Netlink (}(hj hhhNhNubh)}(h:c:member:`nlmsghdr.nlmsg_len`h]j)}(hj h]hnlmsghdr.nlmsg_len}(hj hhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrnlmsghdr.nlmsg_lenuh1hhhhMhj ubh and }(hj hhhNhNubh)}(h:c:member:`nlattr.nla_len`h]j)}(hj h]hnlattr.nla_len}(hj hhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrnlattr.nla_lenuh1hhhhMhj ubh ) always }(hj hhhNhNubja )}(h *include*h]hinclude}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j` hj ubht the header. Attribute headers in netlink must be aligned to 4 bytes from the start of the message, hence the extra }(hj hhhNhNubj)}(h``\0\0``h]h\0\0}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh after }(hj hhhNhNubj)}(h``CTRL_ATTR_FAMILY_NAME``h]hCTRL_ATTR_FAMILY_NAME}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh. The attribute lengths }(hj hhhNhNubja )}(h *exclude*h]hexclude}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j` hj ubh the padding.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(htIf the family is found kernel will reply with two messages, the response with all the information about the family::h]hsIf the family is found kernel will reply with two messages, the response with all the information about the family:}(hj$ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM!hjhhubj)}(hXR/* Message #1 - reply */ struct nlmsghdr: __u32 nlmsg_len: 136 __u16 nlmsg_type: GENL_ID_CTRL __u16 nlmsg_flags: 0 __u32 nlmsg_seq: 1 /* echoed from our request */ __u32 nlmsg_pid: 5831 /* The PID of our user space process */ struct genlmsghdr: __u8 cmd: CTRL_CMD_GETFAMILY __u8 version: 2 __u16 reserved: 0 struct nlattr: __u16 nla_len: 10 __u16 nla_type: CTRL_ATTR_FAMILY_NAME char data: test1\0 (padding:) data: \0\0 struct nlattr: __u16 nla_len: 6 __u16 nla_type: CTRL_ATTR_FAMILY_ID __u16: 123 /* The Family ID we are after */ (padding:) char data: \0\0 struct nlattr: __u16 nla_len: 9 __u16 nla_type: CTRL_ATTR_FAMILY_VERSION __u16: 1 /* ... etc, more attributes will follow. */h]hXR/* Message #1 - reply */ struct nlmsghdr: __u32 nlmsg_len: 136 __u16 nlmsg_type: GENL_ID_CTRL __u16 nlmsg_flags: 0 __u32 nlmsg_seq: 1 /* echoed from our request */ __u32 nlmsg_pid: 5831 /* The PID of our user space process */ struct genlmsghdr: __u8 cmd: CTRL_CMD_GETFAMILY __u8 version: 2 __u16 reserved: 0 struct nlattr: __u16 nla_len: 10 __u16 nla_type: CTRL_ATTR_FAMILY_NAME char data: test1\0 (padding:) data: \0\0 struct nlattr: __u16 nla_len: 6 __u16 nla_type: CTRL_ATTR_FAMILY_ID __u16: 123 /* The Family ID we are after */ (padding:) char data: \0\0 struct nlattr: __u16 nla_len: 9 __u16 nla_type: CTRL_ATTR_FAMILY_VERSION __u16: 1 /* ... etc, more attributes will follow. */}hj2 sbah}(h]h ]h"]h$]h&]hhuh1jhhhM$hjhhubh)}(hNAnd the error code (success) since ``NLM_F_ACK`` had been set on the request::h](h#And the error code (success) since }(hj@ hhhNhNubj)}(h ``NLM_F_ACK``h]h NLM_F_ACK}(hjH hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj@ ubh had been set on the request:}(hj@ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMHhjhhubj)}(hX/* Message #2 - the ACK */ struct nlmsghdr: __u32 nlmsg_len: 36 __u16 nlmsg_type: NLMSG_ERROR __u16 nlmsg_flags: NLM_F_CAPPED /* There won't be a payload */ __u32 nlmsg_seq: 1 /* echoed from our request */ __u32 nlmsg_pid: 5831 /* The PID of our user space process */ int error: 0 struct nlmsghdr: /* Copy of the request header as we sent it */ __u32 nlmsg_len: 32 __u16 nlmsg_type: GENL_ID_CTRL __u16 nlmsg_flags: NLM_F_REQUEST | NLM_F_ACK __u32 nlmsg_seq: 1 __u32 nlmsg_pid: 0h]hX/* Message #2 - the ACK */ struct nlmsghdr: __u32 nlmsg_len: 36 __u16 nlmsg_type: NLMSG_ERROR __u16 nlmsg_flags: NLM_F_CAPPED /* There won't be a payload */ __u32 nlmsg_seq: 1 /* echoed from our request */ __u32 nlmsg_pid: 5831 /* The PID of our user space process */ int error: 0 struct nlmsghdr: /* Copy of the request header as we sent it */ __u32 nlmsg_len: 32 __u16 nlmsg_type: GENL_ID_CTRL __u16 nlmsg_flags: NLM_F_REQUEST | NLM_F_ACK __u32 nlmsg_seq: 1 __u32 nlmsg_pid: 0}hj` sbah}(h]h ]h"]h$]h&]hhuh1jhhhMJhjhhubh)}(hpThe order of attributes (struct nlattr) is not guaranteed so the user has to walk the attributes and parse them.h]hpThe order of attributes (struct nlattr) is not guaranteed so the user has to walk the attributes and parse them.}(hjn hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM[hjhhubh)}(hXNote that Generic Netlink sockets are not associated or bound to a single family. A socket can be used to exchange messages with many different families, selecting the recipient family on message-by-message basis using the :c:member:`nlmsghdr.nlmsg_type` field.h](hNote that Generic Netlink sockets are not associated or bound to a single family. A socket can be used to exchange messages with many different families, selecting the recipient family on message-by-message basis using the }(hj| hhhNhNubh)}(h:c:member:`nlmsghdr.nlmsg_type`h]j)}(hj h]hnlmsghdr.nlmsg_type}(hj hhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrnlmsghdr.nlmsg_typeuh1hhhhM^hj| ubh field.}(hj| hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM^hjhhubj~)}(h .. _ext_ack:h]h}(h]h ]h"]h$]h&]jext-ackuh1j}hMchjhhhhubeh}(h](resolving-the-family-idjeh ]h"](resolving the family idres_fameh$]h&]uh1hhjhhhhhKj}j jsj}jjsubh)}(hhh](h)}(h Extended ACKh]h Extended ACK}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMfubh)}(hExtended ACK controls reporting of additional error/warning TLVs in ``NLMSG_ERROR`` and ``NLMSG_DONE`` messages. To maintain backward compatibility this feature has to be explicitly enabled by setting the ``NETLINK_EXT_ACK`` setsockopt() to ``1``.h](hDExtended ACK controls reporting of additional error/warning TLVs in }(hj hhhNhNubj)}(h``NLMSG_ERROR``h]h NLMSG_ERROR}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh and }(hj hhhNhNubj)}(h``NLMSG_DONE``h]h NLMSG_DONE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhg messages. To maintain backward compatibility this feature has to be explicitly enabled by setting the }(hj hhhNhNubj)}(h``NETLINK_EXT_ACK``h]hNETLINK_EXT_ACK}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh setsockopt() to }(hj hhhNhNubj)}(h``1``h]h1}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhhj hhubh)}(hTypes of extended ack attributes are defined in enum nlmsgerr_attrs. The most commonly used attributes are ``NLMSGERR_ATTR_MSG``, ``NLMSGERR_ATTR_OFFS`` and ``NLMSGERR_ATTR_MISS_*``.h](hkTypes of extended ack attributes are defined in enum nlmsgerr_attrs. The most commonly used attributes are }(hj* hhhNhNubj)}(h``NLMSGERR_ATTR_MSG``h]hNLMSGERR_ATTR_MSG}(hj2 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj* ubh, }(hj* hhhNhNubj)}(h``NLMSGERR_ATTR_OFFS``h]hNLMSGERR_ATTR_OFFS}(hjD hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj* ubh and }(hj* hhhNhNubj)}(h``NLMSGERR_ATTR_MISS_*``h]hNLMSGERR_ATTR_MISS_*}(hjV hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj* ubh.}(hj* hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMmhj hhubh)}(h``NLMSGERR_ATTR_MSG`` carries a message in English describing the encountered problem. These messages are far more detailed than what can be expressed thru standard UNIX error codes.h](j)}(h``NLMSGERR_ATTR_MSG``h]hNLMSGERR_ATTR_MSG}(hjr hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjn ubh carries a message in English describing the encountered problem. These messages are far more detailed than what can be expressed thru standard UNIX error codes.}(hjn hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMqhj hhubh)}(hH``NLMSGERR_ATTR_OFFS`` points to the attribute which caused the problem.h](j)}(h``NLMSGERR_ATTR_OFFS``h]hNLMSGERR_ATTR_OFFS}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh2 points to the attribute which caused the problem.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMuhj hhubh)}(h]``NLMSGERR_ATTR_MISS_TYPE`` and ``NLMSGERR_ATTR_MISS_NEST`` inform about a missing attribute.h](j)}(h``NLMSGERR_ATTR_MISS_TYPE``h]hNLMSGERR_ATTR_MISS_TYPE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh and }(hj hhhNhNubj)}(h``NLMSGERR_ATTR_MISS_NEST``h]hNLMSGERR_ATTR_MISS_NEST}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh" inform about a missing attribute.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMwhj hhubh)}(hqExtended ACKs can be reported on errors as well as in case of success. The latter should be treated as a warning.h]hqExtended ACKs can be reported on errors as well as in case of success. The latter should be treated as a warning.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMzhj hhubh)}(hExtended ACKs greatly improve the usability of Netlink and should always be enabled, appropriately parsed and reported to the user.h]hExtended ACKs greatly improve the usability of Netlink and should always be enabled, appropriately parsed and reported to the user.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM}hj hhubeh}(h]( extended-ackj eh ]h"]( extended ackext_ackeh$]h&]uh1hhjhhhhhMfj}j j sj}j j subeh}(h]generic-netlinkah ]h"]generic netlinkah$]h&]uh1hhhhhhhhKbubh)}(hhh](h)}(hAdvanced topicsh]hAdvanced topics}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hhh](h)}(hDump consistencyh]hDump consistency}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hSome of the data structures kernel uses for storing objects make it hard to provide an atomic snapshot of all the objects in a dump (without impacting the fast-paths updating them).h]hSome of the data structures kernel uses for storing objects make it hard to provide an atomic snapshot of all the objects in a dump (without impacting the fast-paths updating them).}(hj% hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hKernel may set the ``NLM_F_DUMP_INTR`` flag on any message in a dump (including the ``NLMSG_DONE`` message) if the dump was interrupted and may be inconsistent (e.g. missing objects). User space should retry the dump if it sees the flag set.h](hKernel may set the }(hj3 hhhNhNubj)}(h``NLM_F_DUMP_INTR``h]hNLM_F_DUMP_INTR}(hj; hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj3 ubh. flag on any message in a dump (including the }(hj3 hhhNhNubj)}(h``NLMSG_DONE``h]h NLMSG_DONE}(hjM hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj3 ubh message) if the dump was interrupted and may be inconsistent (e.g. missing objects). User space should retry the dump if it sees the flag set.}(hj3 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h]dump-consistencyah ]h"]dump consistencyah$]h&]uh1hhj hhhhhMubh)}(hhh](h)}(h Introspectionh]h Introspection}(hjp hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjm hhhhhMubh)}(hXThe basic introspection abilities are enabled by access to the Family object as reported in :ref:`res_fam`. User can query information about the Generic Netlink family, including which operations are supported by the kernel and what attributes the kernel understands. Family information includes the highest ID of an attribute kernel can parse, a separate command (``CTRL_CMD_GETPOLICY``) provides detailed information about supported attributes, including ranges of values the kernel accepts.h](h\The basic introspection abilities are enabled by access to the Family object as reported in }(hj~ hhhNhNubh)}(h:ref:`res_fam`h]j)}(hj h]hres_fam}(hj hhhNhNubah}(h]h ](j`stdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocjl refdomainj reftyperef refexplicitrefwarnjrres_famuh1hhhhMhj~ ubhX. User can query information about the Generic Netlink family, including which operations are supported by the kernel and what attributes the kernel understands. Family information includes the highest ID of an attribute kernel can parse, a separate command (}(hj~ hhhNhNubj)}(h``CTRL_CMD_GETPOLICY``h]hCTRL_CMD_GETPOLICY}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj~ ubhj) provides detailed information about supported attributes, including ranges of values the kernel accepts.}(hj~ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjm hhubh)}(hQuerying family information is useful in cases when user space needs to make sure that the kernel has support for a feature before issuing a request.h]hQuerying family information is useful in cases when user space needs to make sure that the kernel has support for a feature before issuing a request.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjm hhubj~)}(h.. _nlmsg_pid:h]h}(h]h ]h"]h$]h&]j nlmsg-piduh1j}hMhjm hhhhubeh}(h] introspectionah ]h"] introspectionah$]h&]uh1hhj hhhhhMubh)}(hhh](h)}(h nlmsg_pidh]h nlmsg_pid}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hXJ:c:member:`nlmsghdr.nlmsg_pid` is the Netlink equivalent of an address. It is referred to as Port ID, sometimes Process ID because for historical reasons if the application does not select (bind() to) an explicit Port ID kernel will automatically assign it the ID equal to its Process ID (as reported by the getpid() system call).h](h)}(h:c:member:`nlmsghdr.nlmsg_pid`h]j)}(hj h]hnlmsghdr.nlmsg_pid}(hj hhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrnlmsghdr.nlmsg_piduh1hhhhMhj ubhX, is the Netlink equivalent of an address. It is referred to as Port ID, sometimes Process ID because for historical reasons if the application does not select (bind() to) an explicit Port ID kernel will automatically assign it the ID equal to its Process ID (as reported by the getpid() system call).}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hSimilarly to the bind() semantics of the TCP/IP network protocols the value of zero means "assign automatically", hence it is common for applications to leave the :c:member:`nlmsghdr.nlmsg_pid` field initialized to ``0``.h](hSimilarly to the bind() semantics of the TCP/IP network protocols the value of zero means “assign automatically”, hence it is common for applications to leave the }(hj! hhhNhNubh)}(h:c:member:`nlmsghdr.nlmsg_pid`h]j)}(hj+ h]hnlmsghdr.nlmsg_pid}(hj- hhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhj) ubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrnlmsghdr.nlmsg_piduh1hhhhMhj! ubh field initialized to }(hj! hhhNhNubj)}(h``0``h]h0}(hjL hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj! ubh.}(hj! hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hXThe field is still used today in rare cases when kernel needs to send a unicast notification. User space application can use bind() to associate its socket with a specific PID, it then communicates its PID to the kernel. This way the kernel can reach the specific user space process.h]hXThe field is still used today in rare cases when kernel needs to send a unicast notification. User space application can use bind() to associate its socket with a specific PID, it then communicates its PID to the kernel. This way the kernel can reach the specific user space process.}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hThis sort of communication is utilized in UMH (User Mode Helper)-like scenarios when kernel needs to trigger user space processing or ask user space for a policy decision.h]hThis sort of communication is utilized in UMH (User Mode Helper)-like scenarios when kernel needs to trigger user space processing or ask user space for a policy decision.}(hjr hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h](j id1eh ]h"] nlmsg_pidah$] nlmsg_pidah&]uh1hhj hhhhhM referencedKj}j j sj}j j subh)}(hhh](h)}(hMulticast notificationsh]hMulticast notifications}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hOne of the strengths of Netlink is the ability to send event notifications to user space. This is a unidirectional form of communication (kernel -> user) and does not involve any control messages like ``NLMSG_ERROR`` or ``NLMSG_DONE``.h](hOne of the strengths of Netlink is the ability to send event notifications to user space. This is a unidirectional form of communication (kernel -> user) and does not involve any control messages like }(hj hhhNhNubj)}(h``NLMSG_ERROR``h]h NLMSG_ERROR}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh or }(hj hhhNhNubj)}(h``NLMSG_DONE``h]h NLMSG_DONE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hFor example the Generic Netlink family itself defines a set of multicast notifications about registered families. When a new family is added the sockets subscribed to the notifications will get the following message::h]hFor example the Generic Netlink family itself defines a set of multicast notifications about registered families. When a new family is added the sockets subscribed to the notifications will get the following message:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hXstruct nlmsghdr: __u32 nlmsg_len: 136 __u16 nlmsg_type: GENL_ID_CTRL __u16 nlmsg_flags: 0 __u32 nlmsg_seq: 0 __u32 nlmsg_pid: 0 struct genlmsghdr: __u8 cmd: CTRL_CMD_NEWFAMILY __u8 version: 2 __u16 reserved: 0 struct nlattr: __u16 nla_len: 10 __u16 nla_type: CTRL_ATTR_FAMILY_NAME char data: test1\0 (padding:) data: \0\0 struct nlattr: __u16 nla_len: 6 __u16 nla_type: CTRL_ATTR_FAMILY_ID __u16: 123 /* The Family ID we are after */ (padding:) char data: \0\0 struct nlattr: __u16 nla_len: 9 __u16 nla_type: CTRL_ATTR_FAMILY_VERSION __u16: 1 /* ... etc, more attributes will follow. */h]hXstruct nlmsghdr: __u32 nlmsg_len: 136 __u16 nlmsg_type: GENL_ID_CTRL __u16 nlmsg_flags: 0 __u32 nlmsg_seq: 0 __u32 nlmsg_pid: 0 struct genlmsghdr: __u8 cmd: CTRL_CMD_NEWFAMILY __u8 version: 2 __u16 reserved: 0 struct nlattr: __u16 nla_len: 10 __u16 nla_type: CTRL_ATTR_FAMILY_NAME char data: test1\0 (padding:) data: \0\0 struct nlattr: __u16 nla_len: 6 __u16 nla_type: CTRL_ATTR_FAMILY_ID __u16: 123 /* The Family ID we are after */ (padding:) char data: \0\0 struct nlattr: __u16 nla_len: 9 __u16 nla_type: CTRL_ATTR_FAMILY_VERSION __u16: 1 /* ... etc, more attributes will follow. */}hj sbah}(h]h ]h"]h$]h&]hhuh1jhhhMhj hhubh)}(heThe notification contains the same information as the response to the ``CTRL_CMD_GETFAMILY`` request.h](hFThe notification contains the same information as the response to the }(hj hhhNhNubj)}(h``CTRL_CMD_GETFAMILY``h]hCTRL_CMD_GETFAMILY}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh request.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hThe Netlink headers of the notification are mostly 0 and irrelevant. The :c:member:`nlmsghdr.nlmsg_seq` may be either zero or a monotonically increasing notification sequence number maintained by the family.h](hIThe Netlink headers of the notification are mostly 0 and irrelevant. The }(hj hhhNhNubh)}(h:c:member:`nlmsghdr.nlmsg_seq`h]j)}(hjh]hnlmsghdr.nlmsg_seq}(hjhhhNhNubah}(h]h ](j`j&c-membereh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypemember refexplicitrefwarnjrnlmsghdr.nlmsg_sequh1hhhhMhj ubhh may be either zero or a monotonically increasing notification sequence number maintained by the family.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hXuTo receive notifications the user socket must subscribe to the relevant notification group. Much like the Family ID, the Group ID for a given multicast group is dynamic and can be found inside the Family information. The ``CTRL_ATTR_MCAST_GROUPS`` attribute contains nests with names (``CTRL_ATTR_MCAST_GRP_NAME``) and IDs (``CTRL_ATTR_MCAST_GRP_ID``) of the groups family.h](hTo receive notifications the user socket must subscribe to the relevant notification group. Much like the Family ID, the Group ID for a given multicast group is dynamic and can be found inside the Family information. The }(hj<hhhNhNubj)}(h``CTRL_ATTR_MCAST_GROUPS``h]hCTRL_ATTR_MCAST_GROUPS}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj<ubh& attribute contains nests with names (}(hj<hhhNhNubj)}(h``CTRL_ATTR_MCAST_GRP_NAME``h]hCTRL_ATTR_MCAST_GRP_NAME}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj<ubh ) and IDs (}(hj<hhhNhNubj)}(h``CTRL_ATTR_MCAST_GRP_ID``h]hCTRL_ATTR_MCAST_GRP_ID}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj<ubh) of the groups family.}(hj<hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hLOnce the Group ID is known a setsockopt() call adds the socket to the group:h]hLOnce the Group ID is known a setsockopt() call adds the socket to the group:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hunsigned int group_id; /* .. find the group ID... */ setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &group_id, sizeof(group_id));h]hunsigned int group_id; /* .. find the group ID... */ setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &group_id, sizeof(group_id));}hjsbah}(h]h ]h"]h$]h&]hhj$j%j&j'}uh1jhhhMhj hhubh)}(h*The socket will now receive notifications.h]h*The socket will now receive notifications.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hIt is recommended to use separate sockets for receiving notifications and sending requests to the kernel. The asynchronous nature of notifications means that they may get mixed in with the responses making the message handling much harder.h]hIt is recommended to use separate sockets for receiving notifications and sending requests to the kernel. The asynchronous nature of notifications means that they may get mixed in with the responses making the message handling much harder.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h]multicast-notificationsah ]h"]multicast notificationsah$]h&]uh1hhj hhhhhMubh)}(hhh](h)}(h Buffer sizingh]h Buffer sizing}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hXNetlink sockets are datagram sockets rather than stream sockets, meaning that each message must be received in its entirety by a single recv()/recvmsg() system call. If the buffer provided by the user is too short, the message will be truncated and the ``MSG_TRUNC`` flag set in struct msghdr (struct msghdr is the second argument of the recvmsg() system call, *not* a Netlink header).h](hNetlink sockets are datagram sockets rather than stream sockets, meaning that each message must be received in its entirety by a single recv()/recvmsg() system call. If the buffer provided by the user is too short, the message will be truncated and the }(hjhhhNhNubj)}(h ``MSG_TRUNC``h]h MSG_TRUNC}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh_ flag set in struct msghdr (struct msghdr is the second argument of the recvmsg() system call, }(hjhhhNhNubja )}(h*not*h]hnot}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j` hjubh a Netlink header).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h?Upon truncation the remaining part of the message is discarded.h]h?Upon truncation the remaining part of the message is discarded.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXRNetlink expects that the user buffer will be at least 8kB or a page size of the CPU architecture, whichever is bigger. Particular Netlink families may, however, require a larger buffer. 32kB buffer is recommended for most efficient handling of dumps (larger buffer fits more dumped objects and therefore fewer recvmsg() calls are needed).h]hXRNetlink expects that the user buffer will be at least 8kB or a page size of the CPU architecture, whichever is bigger. Particular Netlink families may, however, require a larger buffer. 32kB buffer is recommended for most efficient handling of dumps (larger buffer fits more dumped objects and therefore fewer recvmsg() calls are needed).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj~)}(h.. _classic_netlink:h]h}(h]h ]h"]h$]h&]jclassic-netlinkuh1j}hMhjhhhhubeh}(h] buffer-sizingah ]h"] buffer sizingah$]h&]uh1hhj hhhhhMubeh}(h]advanced-topicsah ]h"]advanced topicsah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hClassic Netlinkh]hClassic Netlink}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj;hhhhhMubh)}(hX5The main differences between Classic and Generic Netlink are the dynamic allocation of subsystem identifiers and availability of introspection. In theory the protocol does not differ significantly, however, in practice Classic Netlink experimented with concepts which were abandoned in Generic Netlink (really, they usually only found use in a small corner of a single subsystem). This section is meant as an explainer of a few of such concepts, with the explicit goal of giving the Generic Netlink users the confidence to ignore them when reading the uAPI headers.h]hX5The main differences between Classic and Generic Netlink are the dynamic allocation of subsystem identifiers and availability of introspection. In theory the protocol does not differ significantly, however, in practice Classic Netlink experimented with concepts which were abandoned in Generic Netlink (really, they usually only found use in a small corner of a single subsystem). This section is meant as an explainer of a few of such concepts, with the explicit goal of giving the Generic Netlink users the confidence to ignore them when reading the uAPI headers.}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj;hhubh)}(hMost of the concepts and examples here refer to the ``NETLINK_ROUTE`` family, which covers much of the configuration of the Linux networking stack. Real documentation of that family, deserves a chapter (or a book) of its own.h](h4Most of the concepts and examples here refer to the }(hjZhhhNhNubj)}(h``NETLINK_ROUTE``h]h NETLINK_ROUTE}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZubh family, which covers much of the configuration of the Linux networking stack. Real documentation of that family, deserves a chapter (or a book) of its own.}(hjZhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM%hj;hhubh)}(hhh](h)}(hFamiliesh]hFamilies}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzhhhhhM*ubh)}(hNetlink refers to subsystems as families. This is a remnant of using sockets and the concept of protocol families, which are part of message demultiplexing in ``NETLINK_ROUTE``.h](hNetlink refers to subsystems as families. This is a remnant of using sockets and the concept of protocol families, which are part of message demultiplexing in }(hjhhhNhNubj)}(h``NETLINK_ROUTE``h]h NETLINK_ROUTE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM,hjzhhubh)}(hySadly every layer of encapsulation likes to refer to whatever it's carrying as "families" making the term very confusing:h]hSadly every layer of encapsulation likes to refer to whatever it’s carrying as “families” making the term very confusing:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM0hjzhhubj)}(hX91. AF_NETLINK is a bona fide socket protocol family 2. AF_NETLINK's documentation refers to what comes after its own header (struct nlmsghdr) in a message as a "Family Header" 3. Generic Netlink is a family for AF_NETLINK (struct genlmsghdr follows struct nlmsghdr), yet it also calls its users "Families". h]henumerated_list)}(hhh](j)}(h0AF_NETLINK is a bona fide socket protocol familyh]h)}(hjh]h0AF_NETLINK is a bona fide socket protocol family}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM3hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hxAF_NETLINK's documentation refers to what comes after its own header (struct nlmsghdr) in a message as a "Family Header"h]h)}(hxAF_NETLINK's documentation refers to what comes after its own header (struct nlmsghdr) in a message as a "Family Header"h]h~AF_NETLINK’s documentation refers to what comes after its own header (struct nlmsghdr) in a message as a “Family Header”}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM4hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hGeneric Netlink is a family for AF_NETLINK (struct genlmsghdr follows struct nlmsghdr), yet it also calls its users "Families". h]h)}(hGeneric Netlink is a family for AF_NETLINK (struct genlmsghdr follows struct nlmsghdr), yet it also calls its users "Families".h]hGeneric Netlink is a family for AF_NETLINK (struct genlmsghdr follows struct nlmsghdr), yet it also calls its users “Families”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhM3hjzhhubh)}(hXNote that the Generic Netlink Family IDs are in a different "ID space" and overlap with Classic Netlink protocol numbers (e.g. ``NETLINK_CRYPTO`` has the Classic Netlink protocol ID of 21 which Generic Netlink will happily allocate to one of its families as well).h](hNote that the Generic Netlink Family IDs are in a different “ID space” and overlap with Classic Netlink protocol numbers (e.g. }(hjhhhNhNubj)}(h``NETLINK_CRYPTO``h]hNETLINK_CRYPTO}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhw has the Classic Netlink protocol ID of 21 which Generic Netlink will happily allocate to one of its families as well).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM9hjzhhubeh}(h]familiesah ]h"]familiesah$]h&]uh1hhj;hhhhhM*ubh)}(hhh](h)}(hStrict checkingh]hStrict checking}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjBhhhhhM?ubh)}(hX_The ``NETLINK_GET_STRICT_CHK`` socket option enables strict input checking in ``NETLINK_ROUTE``. It was needed because historically kernel did not validate the fields of structures it didn't process. This made it impossible to start using those fields later without risking regressions in applications which initialized them incorrectly or not at all.h](hThe }(hjShhhNhNubj)}(h``NETLINK_GET_STRICT_CHK``h]hNETLINK_GET_STRICT_CHK}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjSubh0 socket option enables strict input checking in }(hjShhhNhNubj)}(h``NETLINK_ROUTE``h]h NETLINK_ROUTE}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjSubhX. It was needed because historically kernel did not validate the fields of structures it didn’t process. This made it impossible to start using those fields later without risking regressions in applications which initialized them incorrectly or not at all.}(hjShhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMAhjBhhubh)}(hX``NETLINK_GET_STRICT_CHK`` declares that the application is initializing all fields correctly. It also opts into validating that message does not contain trailing data and requests that kernel rejects attributes with type higher than largest attribute type known to the kernel.h](j)}(h``NETLINK_GET_STRICT_CHK``h]hNETLINK_GET_STRICT_CHK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh declares that the application is initializing all fields correctly. It also opts into validating that message does not contain trailing data and requests that kernel rejects attributes with type higher than largest attribute type known to the kernel.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMGhjBhhubh)}(hD``NETLINK_GET_STRICT_CHK`` is not used outside of ``NETLINK_ROUTE``.h](j)}(h``NETLINK_GET_STRICT_CHK``h]hNETLINK_GET_STRICT_CHK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is not used outside of }(hjhhhNhNubj)}(h``NETLINK_ROUTE``h]h NETLINK_ROUTE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMLhjBhhubeh}(h]strict-checkingah ]h"]strict checkingah$]h&]uh1hhj;hhhhhM?ubh)}(hhh](h)}(hUnknown attributesh]hUnknown attributes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMOubh)}(hHistorically Netlink ignored all unknown attributes. The thinking was that it would free the application from having to probe what kernel supports. The application could make a request to change the state and check which parts of the request "stuck".h]hHistorically Netlink ignored all unknown attributes. The thinking was that it would free the application from having to probe what kernel supports. The application could make a request to change the state and check which parts of the request “stuck”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMQhjhhubh)}(hThis is no longer the case for new Generic Netlink families and those opting in to strict checking. See enum netlink_validation for validation types performed.h]hThis is no longer the case for new Generic Netlink families and those opting in to strict checking. See enum netlink_validation for validation types performed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMVhjhhubeh}(h]unknown-attributesah ]h"]unknown attributesah$]h&]uh1hhj;hhhhhMOubh)}(hhh](h)}(hFixed metadata and structuresh]hFixed metadata and structures}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhM[ubh)}(hX>Classic Netlink made liberal use of fixed-format structures within the messages. Messages would commonly have a structure with a considerable number of fields after struct nlmsghdr. It was also common to put structures with multiple members inside attributes, without breaking each member into an attribute of its own.h]hX>Classic Netlink made liberal use of fixed-format structures within the messages. Messages would commonly have a structure with a considerable number of fields after struct nlmsghdr. It was also common to put structures with multiple members inside attributes, without breaking each member into an attribute of its own.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM]hj hhubh)}(hThis has caused problems with validation and extensibility and therefore using binary structures is actively discouraged for new attributes.h]hThis has caused problems with validation and extensibility and therefore using binary structures is actively discouraged for new attributes.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMchj hhubeh}(h]fixed-metadata-and-structuresah ]h"]fixed metadata and structuresah$]h&]uh1hhj;hhhhhM[ubh)}(hhh](h)}(h Request typesh]h Request types}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjAhhhhhMhubh)}(hXT``NETLINK_ROUTE`` categorized requests into 4 types ``NEW``, ``DEL``, ``GET``, and ``SET``. Each object can handle all or some of those requests (objects being netdevs, routes, addresses, qdiscs etc.) Request type is defined by the 2 lowest bits of the message type, so commands for new objects would always be allocated with a stride of 4.h](j)}(h``NETLINK_ROUTE``h]h NETLINK_ROUTE}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjRubh# categorized requests into 4 types }(hjRhhhNhNubj)}(h``NEW``h]hNEW}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjRubh, }(hjRhhhNhNubj)}(h``DEL``h]hDEL}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjRubh, }hjRsbj)}(h``GET``h]hGET}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjRubh, and }(hjRhhhNhNubj)}(h``SET``h]hSET}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjRubh. Each object can handle all or some of those requests (objects being netdevs, routes, addresses, qdiscs etc.) Request type is defined by the 2 lowest bits of the message type, so commands for new objects would always be allocated with a stride of 4.}(hjRhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMjhjAhhubh)}(hEach object would also have its own fixed metadata shared by all request types (e.g. struct ifinfomsg for netdev requests, struct ifaddrmsg for address requests, struct tcmsg for qdisc requests).h]hEach object would also have its own fixed metadata shared by all request types (e.g. struct ifinfomsg for netdev requests, struct ifaddrmsg for address requests, struct tcmsg for qdisc requests).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMphjAhhubh)}(hEven though other protocols and Generic Netlink commands often use the same verbs in their message names (``GET``, ``SET``) the concept of request types did not find wider adoption.h](hjEven though other protocols and Generic Netlink commands often use the same verbs in their message names (}(hjhhhNhNubj)}(h``GET``h]hGET}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, }(hjhhhNhNubj)}(h``SET``h]hSET}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh;) the concept of request types did not find wider adoption.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMthjAhhubeh}(h] request-typesah ]h"] request typesah$]h&]uh1hhj;hhhhhMhubh)}(hhh](h)}(hNotification echoh]hNotification echo}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMyubh)}(h``NLM_F_ECHO`` requests for notifications resulting from the request to be queued onto the requesting socket. This is useful to discover the impact of the request.h](j)}(h``NLM_F_ECHO``h]h NLM_F_ECHO}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh requests for notifications resulting from the request to be queued onto the requesting socket. This is useful to discover the impact of the request.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM{hjhhubh)}(h6Note that this feature is not universally implemented.h]h6Note that this feature is not universally implemented.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]notification-echoah ]h"]notification echoah$]h&]uh1hhj;hhhhhMyubh)}(hhh](h)}(h!Other request-type-specific flagsh]h!Other request-type-specific flags}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjAhhhhhMubh)}(hXClassic Netlink defined various flags for its ``GET``, ``NEW`` and ``DEL`` requests in the upper byte of nlmsg_flags in struct nlmsghdr. Since request types have not been generalized the request type specific flags are rarely used (and considered deprecated for new families).h](h.Classic Netlink defined various flags for its }(hjRhhhNhNubj)}(h``GET``h]hGET}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjRubh, }(hjRhhhNhNubj)}(h``NEW``h]hNEW}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjRubh and }(hjRhhhNhNubj)}(h``DEL``h]hDEL}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjRubh requests in the upper byte of nlmsg_flags in struct nlmsghdr. Since request types have not been generalized the request type specific flags are rarely used (and considered deprecated for new families).}(hjRhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjAhhubh)}(hFor ``GET`` - ``NLM_F_ROOT`` and ``NLM_F_MATCH`` are combined into ``NLM_F_DUMP``, and not used separately. ``NLM_F_ATOMIC`` is never used.h](hFor }(hjhhhNhNubj)}(h``GET``h]hGET}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh - }(hjhhhNhNubj)}(h``NLM_F_ROOT``h]h NLM_F_ROOT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h``NLM_F_MATCH``h]h NLM_F_MATCH}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh are combined into }(hjhhhNhNubj)}(h``NLM_F_DUMP``h]h NLM_F_DUMP}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, and not used separately. }(hjhhhNhNubj)}(h``NLM_F_ATOMIC``h]h NLM_F_ATOMIC}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is never used.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjAhhubh)}(hgFor ``DEL`` - ``NLM_F_NONREC`` is only used by nftables and ``NLM_F_BULK`` only by FDB some operations.h](hFor }(hjhhhNhNubj)}(h``DEL``h]hDEL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh - }(hjhhhNhNubj)}(h``NLM_F_NONREC``h]h NLM_F_NONREC}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is only used by nftables and }(hjhhhNhNubj)}(h``NLM_F_BULK``h]h NLM_F_BULK}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh only by FDB some operations.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjAhhubh)}(hXUThe flags for ``NEW`` are used most commonly in classic Netlink. Unfortunately, the meaning is not crystal clear. The following description is based on the best guess of the intention of the authors, and in practice all families stray from it in one way or another. ``NLM_F_REPLACE`` asks to replace an existing object, if no matching object exists the operation should fail. ``NLM_F_EXCL`` has the opposite semantics and only succeeds if object already existed. ``NLM_F_CREATE`` asks for the object to be created if it does not exist, it can be combined with ``NLM_F_REPLACE`` and ``NLM_F_EXCL``.h](hThe flags for }(hjBhhhNhNubj)}(h``NEW``h]hNEW}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjBubh are used most commonly in classic Netlink. Unfortunately, the meaning is not crystal clear. The following description is based on the best guess of the intention of the authors, and in practice all families stray from it in one way or another. }(hjBhhhNhNubj)}(h``NLM_F_REPLACE``h]h NLM_F_REPLACE}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjBubh] asks to replace an existing object, if no matching object exists the operation should fail. }(hjBhhhNhNubj)}(h``NLM_F_EXCL``h]h NLM_F_EXCL}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjBubhI has the opposite semantics and only succeeds if object already existed. }(hjBhhhNhNubj)}(h``NLM_F_CREATE``h]h NLM_F_CREATE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjBubhQ asks for the object to be created if it does not exist, it can be combined with }(hjBhhhNhNubj)}(h``NLM_F_REPLACE``h]h NLM_F_REPLACE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjBubh and }(hjBhhhNhNubj)}(h``NLM_F_EXCL``h]h NLM_F_EXCL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjBubh.}(hjBhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjAhhubh)}(h2A comment in the main Netlink uAPI header states::h]h1A comment in the main Netlink uAPI header states:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjAhhubj)}(h4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL 4.4BSD CHANGE NLM_F_REPLACE True CHANGE NLM_F_CREATE|NLM_F_REPLACE Append NLM_F_CREATE Check NLM_F_EXCLh]h4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL 4.4BSD CHANGE NLM_F_REPLACE True CHANGE NLM_F_CREATE|NLM_F_REPLACE Append NLM_F_CREATE Check NLM_F_EXCL}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjAhhubh)}(hX!which seems to indicate that those flags predate request types. ``NLM_F_REPLACE`` without ``NLM_F_CREATE`` was initially used instead of ``SET`` commands. ``NLM_F_EXCL`` without ``NLM_F_CREATE`` was used to check if object exists without creating it, presumably predating ``GET`` commands.h](h@which seems to indicate that those flags predate request types. }(hjhhhNhNubj)}(h``NLM_F_REPLACE``h]h NLM_F_REPLACE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh without }(hjhhhNhNubj)}(h``NLM_F_CREATE``h]h NLM_F_CREATE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh was initially used instead of }(hjhhhNhNubj)}(h``SET``h]hSET}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh commands. }(hjhhhNhNubj)}(h``NLM_F_EXCL``h]h NLM_F_EXCL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh without }hjsbj)}(h``NLM_F_CREATE``h]h NLM_F_CREATE}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhN was used to check if object exists without creating it, presumably predating }(hjhhhNhNubj)}(h``GET``h]hGET}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh commands.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjAhhubh)}(h``NLM_F_APPEND`` indicates that if one key can have multiple objects associated with it (e.g. multiple next-hop objects for a route) the new object should be added to the list rather than replacing the entire list.h](j)}(h``NLM_F_APPEND``h]h NLM_F_APPEND}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjRubh indicates that if one key can have multiple objects associated with it (e.g. multiple next-hop objects for a route) the new object should be added to the list rather than replacing the entire list.}(hjRhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjAhhubeh}(h]!other-request-type-specific-flagsah ]h"]!other request-type-specific flagsah$]h&]uh1hhj;hhhhhMubeh}(h](j*id2eh ]h"](classic netlinkclassic_netlinkeh$]h&]uh1hhhhhhhhMj}j|j sj}j*j subh)}(hhh](h)}(huAPI referenceh]huAPI reference}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singlenlmsghdr (C struct) c.nlmsghdrhNtauh1jhjhhhNhNubhdesc)}(hhh](hdesc_signature)}(hnlmsghdrh]hdesc_signature_line)}(hstruct nlmsghdrh](hdesc_sig_keyword)}(hstructh]hstruct}(hjhhhNhNubah}(h]h ]kah"]h$]h&]uh1jhjhhhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKubhdesc_sig_space)}(h h]h }(hjhhhNhNubah}(h]h ]wah"]h$]h&]uh1jhjhhhjhKubh desc_name)}(hnlmsghdrh]h desc_sig_name)}(hjh]hnlmsghdr}(hjhhhNhNubah}(h]h ]nah"]h$]h&]uh1jhjubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1jhjhhhjhKubeh}(h]h ]h"]h$]h&]hh add_permalinkuh1jsphinx_line_type declaratorhjhhhjhKubah}(h]jah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1jhjhKhjhhubh desc_content)}(hhh]h)}(h0fixed format metadata header of Netlink messagesh]h0fixed format metadata header of Netlink messages}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhK-hj hhubah}(h]h ]h"]h$]h&]uh1j hjhhhjhKubeh}(h]h ](j&structeh"]h$]h&]domainj&objtypej&desctypej&noindex noindexentrynocontentsentryuh1jhhhjhNhNubh container)}(hXv**Definition**:: struct nlmsghdr { __u32 nlmsg_len; __u16 nlmsg_type; __u16 nlmsg_flags; __u32 nlmsg_seq; __u32 nlmsg_pid; }; **Members** ``nlmsg_len`` Length of message including header ``nlmsg_type`` Message content type ``nlmsg_flags`` Additional flags ``nlmsg_seq`` Sequence number ``nlmsg_pid`` Sending process port IDh](h)}(h**Definition**::h](j)}(h**Definition**h]h Definition}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj6ubh:}(hj6hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhK1hj2ubj)}(hstruct nlmsghdr { __u32 nlmsg_len; __u16 nlmsg_type; __u16 nlmsg_flags; __u32 nlmsg_seq; __u32 nlmsg_pid; };h]hstruct nlmsghdr { __u32 nlmsg_len; __u16 nlmsg_type; __u16 nlmsg_flags; __u32 nlmsg_seq; __u32 nlmsg_pid; };}hjSsbah}(h]h ]h"]h$]h&]hhuh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhK3hj2ubh)}(h **Members**h]j)}(hjdh]hMembers}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjbubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhK;hj2ubhdefinition_list)}(hhh](hdefinition_list_item)}(h1``nlmsg_len`` Length of message including header h](hterm)}(h ``nlmsg_len``h]j)}(hjh]h nlmsg_len}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhK/hjubh definition)}(hhh]h)}(h"Length of message including headerh]h"Length of message including header}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK/hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK/hj|ubj)}(h$``nlmsg_type`` Message content type h](j)}(h``nlmsg_type``h]j)}(hjh]h nlmsg_type}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhK0hjubj)}(hhh]h)}(hMessage content typeh]hMessage content type}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK0hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK0hj|ubj)}(h!``nlmsg_flags`` Additional flags h](j)}(h``nlmsg_flags``h]j)}(hjh]h nlmsg_flags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhK1hjubj)}(hhh]h)}(hAdditional flagsh]hAdditional flags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK1hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK1hj|ubj)}(h``nlmsg_seq`` Sequence number h](j)}(h ``nlmsg_seq``h]j)}(hj6h]h nlmsg_seq}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhK2hj0ubj)}(hhh]h)}(hSequence numberh]hSequence number}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKhK2hjLubah}(h]h ]h"]h$]h&]uh1jhj0ubeh}(h]h ]h"]h$]h&]uh1jhjKhK2hj|ubj)}(h%``nlmsg_pid`` Sending process port IDh](j)}(h ``nlmsg_pid``h]j)}(hjoh]h nlmsg_pid}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjmubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhK2hjiubj)}(hhh]h)}(hSending process port IDh]hSending process port ID}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhK3hjubah}(h]h ]h"]h$]h&]uh1jhjiubeh}(h]h ]h"]h$]h&]uh1jhjhK2hj|ubeh}(h]h ]h"]h$]h&]uh1jzhj2ubeh}(h]h ] kernelindentah"]h$]h&]uh1j0hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jnlmsgerr_attrs (C enum)c.nlmsgerr_attrshNtauh1jhjhhhNhNubj)}(hhh](j)}(hnlmsgerr_attrsh]j)}(henum nlmsgerr_attrsh](j)}(henumh]henum}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhK9ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhK9ubj)}(hnlmsgerr_attrsh]j)}(hjh]hnlmsgerr_attrs}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhK9ubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjhhhjhK9ubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhK9hjhhubj )}(hhh]h)}(hnlmsgerr attributesh]hnlmsgerr attributes}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhj hhubah}(h]h ]h"]h$]h&]uh1j hjhhhjhK9ubeh}(h]h ](j&enumeh"]h$]h&]j*j&j+j$j,j$j-j.j/uh1jhhhjhNhNubj1)}(hX(**Constants** ``NLMSGERR_ATTR_UNUSED`` unused ``NLMSGERR_ATTR_MSG`` error message string (string) ``NLMSGERR_ATTR_OFFS`` offset of the invalid attribute in the original message, counting from the beginning of the header (u32) ``NLMSGERR_ATTR_COOKIE`` arbitrary subsystem specific cookie to be used - in the success case - to identify a created object or operation or similar (binary) ``NLMSGERR_ATTR_POLICY`` policy for a rejected attribute ``NLMSGERR_ATTR_MISS_TYPE`` type of a missing required attribute, ``NLMSGERR_ATTR_MISS_NEST`` will not be present if the attribute was missing at the message level ``NLMSGERR_ATTR_MISS_NEST`` offset of the nest where attribute was missing ``__NLMSGERR_ATTR_MAX`` number of attributes ``NLMSGERR_ATTR_MAX`` highest attribute numberh](h)}(h **Constants**h]j)}(hj.h]h Constants}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj,ubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhj(ubj{)}(hhh](j)}(h ``NLMSGERR_ATTR_UNUSED`` unused h](j)}(h``NLMSGERR_ATTR_UNUSED``h]j)}(hjMh]hNLMSGERR_ATTR_UNUSED}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjKubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhjGubj)}(hhh]h)}(hunusedh]hunused}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbhKhjcubah}(h]h ]h"]h$]h&]uh1jhjGubeh}(h]h ]h"]h$]h&]uh1jhjbhKhjDubj)}(h4``NLMSGERR_ATTR_MSG`` error message string (string) h](j)}(h``NLMSGERR_ATTR_MSG``h]j)}(hjh]hNLMSGERR_ATTR_MSG}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhjubj)}(hhh]h)}(herror message string (string)h]herror message string (string)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjDubj)}(h``NLMSGERR_ATTR_OFFS`` offset of the invalid attribute in the original message, counting from the beginning of the header (u32) h](j)}(h``NLMSGERR_ATTR_OFFS``h]j)}(hjh]hNLMSGERR_ATTR_OFFS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhjubj)}(hhh]h)}(hhoffset of the invalid attribute in the original message, counting from the beginning of the header (u32)h]hhoffset of the invalid attribute in the original message, counting from the beginning of the header (u32)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjDubj)}(h``NLMSGERR_ATTR_COOKIE`` arbitrary subsystem specific cookie to be used - in the success case - to identify a created object or operation or similar (binary) h](j)}(h``NLMSGERR_ATTR_COOKIE``h]j)}(hjh]hNLMSGERR_ATTR_COOKIE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhjubj)}(hhh]h)}(harbitrary subsystem specific cookie to be used - in the success case - to identify a created object or operation or similar (binary)h]harbitrary subsystem specific cookie to be used - in the success case - to identify a created object or operation or similar (binary)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjDubj)}(h9``NLMSGERR_ATTR_POLICY`` policy for a rejected attribute h](j)}(h``NLMSGERR_ATTR_POLICY``h]j)}(hj3h]hNLMSGERR_ATTR_POLICY}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj1ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhj-ubj)}(hhh]h)}(hpolicy for a rejected attributeh]hpolicy for a rejected attribute}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjHhKhjIubah}(h]h ]h"]h$]h&]uh1jhj-ubeh}(h]h ]h"]h$]h&]uh1jhjHhKhjDubj)}(h``NLMSGERR_ATTR_MISS_TYPE`` type of a missing required attribute, ``NLMSGERR_ATTR_MISS_NEST`` will not be present if the attribute was missing at the message level h](j)}(h``NLMSGERR_ATTR_MISS_TYPE``h]j)}(hjlh]hNLMSGERR_ATTR_MISS_TYPE}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhjfubj)}(hhh]h)}(htype of a missing required attribute, ``NLMSGERR_ATTR_MISS_NEST`` will not be present if the attribute was missing at the message levelh](h&type of a missing required attribute, }(hjhhhNhNubj)}(h``NLMSGERR_ATTR_MISS_NEST``h]hNLMSGERR_ATTR_MISS_NEST}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhF will not be present if the attribute was missing at the message level}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhjubah}(h]h ]h"]h$]h&]uh1jhjfubeh}(h]h ]h"]h$]h&]uh1jhjhKhjDubj)}(hK``NLMSGERR_ATTR_MISS_NEST`` offset of the nest where attribute was missing h](j)}(h``NLMSGERR_ATTR_MISS_NEST``h]j)}(hjh]hNLMSGERR_ATTR_MISS_NEST}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhjubj)}(hhh]h)}(h.offset of the nest where attribute was missingh]h.offset of the nest where attribute was missing}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjDubj)}(h-``__NLMSGERR_ATTR_MAX`` number of attributes h](j)}(h``__NLMSGERR_ATTR_MAX``h]j)}(hjh]h__NLMSGERR_ATTR_MAX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhjubj)}(hhh]h)}(hnumber of attributesh]hnumber of attributes}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjDubj)}(h.``NLMSGERR_ATTR_MAX`` highest attribute numberh](j)}(h``NLMSGERR_ATTR_MAX``h]j)}(hj*h]hNLMSGERR_ATTR_MAX}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj(ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhj$ubj)}(hhh]h)}(hhighest attribute numberh]hhighest attribute number}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKhj@ubah}(h]h ]h"]h$]h&]uh1jhj$ubeh}(h]h ]h"]h$]h&]uh1jhj?hKhjDubeh}(h]h ]h"]h$]h&]uh1jzhj(ubeh}(h]h ] kernelindentah"]h$]h&]uh1j0hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jnetlink_attribute_type (C enum)c.netlink_attribute_typehNtauh1jhjhhhNhNubj)}(hhh](j)}(hnetlink_attribute_typeh]j)}(henum netlink_attribute_typeh](j)}(hjh]henum}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhKubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhKubj)}(hnetlink_attribute_typeh]j)}(hj~h]hnetlink_attribute_type}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhKubeh}(h]h ]h"]h$]h&]hhjuh1jjjhj|hhhjhKubah}(h]jwah ](jjeh"]h$]h&]jj)jhuh1jhjhKhjyhhubj )}(hhh]h)}(htype of an attributeh]htype of an attribute}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMhjhhubah}(h]h ]h"]h$]h&]uh1j hjyhhhjhKubeh}(h]h ](j&enumeh"]h$]h&]j*j&j+jj,jj-j.j/uh1jhhhjhNhNubj1)}(hX**Constants** ``NL_ATTR_TYPE_INVALID`` unused ``NL_ATTR_TYPE_FLAG`` flag attribute (present/not present) ``NL_ATTR_TYPE_U8`` 8-bit unsigned attribute ``NL_ATTR_TYPE_U16`` 16-bit unsigned attribute ``NL_ATTR_TYPE_U32`` 32-bit unsigned attribute ``NL_ATTR_TYPE_U64`` 64-bit unsigned attribute ``NL_ATTR_TYPE_S8`` 8-bit signed attribute ``NL_ATTR_TYPE_S16`` 16-bit signed attribute ``NL_ATTR_TYPE_S32`` 32-bit signed attribute ``NL_ATTR_TYPE_S64`` 64-bit signed attribute ``NL_ATTR_TYPE_BINARY`` binary data, min/max length may be specified ``NL_ATTR_TYPE_STRING`` string, min/max length may be specified ``NL_ATTR_TYPE_NUL_STRING`` NUL-terminated string, min/max length may be specified ``NL_ATTR_TYPE_NESTED`` nested, i.e. the content of this attribute consists of sub-attributes. The nested policy and maxtype inside may be specified. ``NL_ATTR_TYPE_NESTED_ARRAY`` nested array, i.e. the content of this attribute contains sub-attributes whose type is irrelevant (just used to separate the array entries) and each such array entry has attributes again, the policy for those inner ones and the corresponding maxtype may be specified. ``NL_ATTR_TYPE_BITFIELD32`` :c:type:`struct nla_bitfield32 ` attribute ``NL_ATTR_TYPE_SINT`` 32-bit or 64-bit signed attribute, aligned to 4B ``NL_ATTR_TYPE_UINT`` 32-bit or 64-bit unsigned attribute, aligned to 4Bh](h)}(h **Constants**h]j)}(hjh]h Constants}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMhjubj{)}(hhh](j)}(h ``NL_ATTR_TYPE_INVALID`` unused h](j)}(h``NL_ATTR_TYPE_INVALID``h]j)}(hjh]hNL_ATTR_TYPE_INVALID}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMhjubj)}(hhh]h)}(hunusedh]hunused}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjubj)}(h;``NL_ATTR_TYPE_FLAG`` flag attribute (present/not present) h](j)}(h``NL_ATTR_TYPE_FLAG``h]j)}(hj@h]hNL_ATTR_TYPE_FLAG}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMhj:ubj)}(hhh]h)}(h$flag attribute (present/not present)h]h$flag attribute (present/not present)}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjUhMhjVubah}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1jhjUhMhjubj)}(h-``NL_ATTR_TYPE_U8`` 8-bit unsigned attribute h](j)}(h``NL_ATTR_TYPE_U8``h]j)}(hjyh]hNL_ATTR_TYPE_U8}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjwubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM"hjsubj)}(hhh]h)}(h8-bit unsigned attributeh]h8-bit unsigned attribute}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM"hjubah}(h]h ]h"]h$]h&]uh1jhjsubeh}(h]h ]h"]h$]h&]uh1jhjhM"hjubj)}(h/``NL_ATTR_TYPE_U16`` 16-bit unsigned attribute h](j)}(h``NL_ATTR_TYPE_U16``h]j)}(hjh]hNL_ATTR_TYPE_U16}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM%hjubj)}(hhh]h)}(h16-bit unsigned attributeh]h16-bit unsigned attribute}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM%hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhM%hjubj)}(h/``NL_ATTR_TYPE_U32`` 32-bit unsigned attribute h](j)}(h``NL_ATTR_TYPE_U32``h]j)}(hjh]hNL_ATTR_TYPE_U32}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM(hjubj)}(hhh]h)}(h32-bit unsigned attributeh]h32-bit unsigned attribute}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM(hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhM(hjubj)}(h/``NL_ATTR_TYPE_U64`` 64-bit unsigned attribute h](j)}(h``NL_ATTR_TYPE_U64``h]j)}(hj$h]hNL_ATTR_TYPE_U64}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM+hjubj)}(hhh]h)}(h64-bit unsigned attributeh]h64-bit unsigned attribute}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9hM+hj:ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj9hM+hjubj)}(h+``NL_ATTR_TYPE_S8`` 8-bit signed attribute h](j)}(h``NL_ATTR_TYPE_S8``h]j)}(hj]h]hNL_ATTR_TYPE_S8}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj[ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM.hjWubj)}(hhh]h)}(h8-bit signed attributeh]h8-bit signed attribute}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjrhM.hjsubah}(h]h ]h"]h$]h&]uh1jhjWubeh}(h]h ]h"]h$]h&]uh1jhjrhM.hjubj)}(h-``NL_ATTR_TYPE_S16`` 16-bit signed attribute h](j)}(h``NL_ATTR_TYPE_S16``h]j)}(hjh]hNL_ATTR_TYPE_S16}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM1hjubj)}(hhh]h)}(h16-bit signed attributeh]h16-bit signed attribute}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM1hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhM1hjubj)}(h-``NL_ATTR_TYPE_S32`` 32-bit signed attribute h](j)}(h``NL_ATTR_TYPE_S32``h]j)}(hjh]hNL_ATTR_TYPE_S32}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM4hjubj)}(hhh]h)}(h32-bit signed attributeh]h32-bit signed attribute}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM4hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhM4hjubj)}(h-``NL_ATTR_TYPE_S64`` 64-bit signed attribute h](j)}(h``NL_ATTR_TYPE_S64``h]j)}(hjh]hNL_ATTR_TYPE_S64}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM7hjubj)}(hhh]h)}(h64-bit signed attributeh]h64-bit signed attribute}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM7hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhM7hjubj)}(hE``NL_ATTR_TYPE_BINARY`` binary data, min/max length may be specified h](j)}(h``NL_ATTR_TYPE_BINARY``h]j)}(hjAh]hNL_ATTR_TYPE_BINARY}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM:hj;ubj)}(hhh]h)}(h,binary data, min/max length may be specifiedh]h,binary data, min/max length may be specified}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjVhM:hjWubah}(h]h ]h"]h$]h&]uh1jhj;ubeh}(h]h ]h"]h$]h&]uh1jhjVhM:hjubj)}(h@``NL_ATTR_TYPE_STRING`` string, min/max length may be specified h](j)}(h``NL_ATTR_TYPE_STRING``h]j)}(hjzh]hNL_ATTR_TYPE_STRING}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjxubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM=hjtubj)}(hhh]h)}(h'string, min/max length may be specifiedh]h'string, min/max length may be specified}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM=hjubah}(h]h ]h"]h$]h&]uh1jhjtubeh}(h]h ]h"]h$]h&]uh1jhjhM=hjubj)}(hS``NL_ATTR_TYPE_NUL_STRING`` NUL-terminated string, min/max length may be specified h](j)}(h``NL_ATTR_TYPE_NUL_STRING``h]j)}(hjh]hNL_ATTR_TYPE_NUL_STRING}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMAhjubj)}(hhh]h)}(h6NUL-terminated string, min/max length may be specifiedh]h6NUL-terminated string, min/max length may be specified}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM@hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMAhjubj)}(h``NL_ATTR_TYPE_NESTED`` nested, i.e. the content of this attribute consists of sub-attributes. The nested policy and maxtype inside may be specified. h](j)}(h``NL_ATTR_TYPE_NESTED``h]j)}(hjh]hNL_ATTR_TYPE_NESTED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMFhjubj)}(hhh]h)}(h}nested, i.e. the content of this attribute consists of sub-attributes. The nested policy and maxtype inside may be specified.h]h}nested, i.e. the content of this attribute consists of sub-attributes. The nested policy and maxtype inside may be specified.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMDhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMFhjubj)}(hX*``NL_ATTR_TYPE_NESTED_ARRAY`` nested array, i.e. the content of this attribute contains sub-attributes whose type is irrelevant (just used to separate the array entries) and each such array entry has attributes again, the policy for those inner ones and the corresponding maxtype may be specified. h](j)}(h``NL_ATTR_TYPE_NESTED_ARRAY``h]j)}(hj'h]hNL_ATTR_TYPE_NESTED_ARRAY}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMMhj!ubj)}(hhh]h)}(hX nested array, i.e. the content of this attribute contains sub-attributes whose type is irrelevant (just used to separate the array entries) and each such array entry has attributes again, the policy for those inner ones and the corresponding maxtype may be specified.h]hX nested array, i.e. the content of this attribute contains sub-attributes whose type is irrelevant (just used to separate the array entries) and each such array entry has attributes again, the policy for those inner ones and the corresponding maxtype may be specified.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMIhj=ubah}(h]h ]h"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]uh1jhj<hMMhjubj)}(hW``NL_ATTR_TYPE_BITFIELD32`` :c:type:`struct nla_bitfield32 ` attribute h](j)}(h``NL_ATTR_TYPE_BITFIELD32``h]j)}(hjah]hNL_ATTR_TYPE_BITFIELD32}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1jhj_ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMPhj[ubj)}(hhh]h)}(h::c:type:`struct nla_bitfield32 ` attributeh](h)}(h0:c:type:`struct nla_bitfield32 `h]j)}(hjh]hstruct nla_bitfield32}(hjhhhNhNubah}(h]h ](j`j&c-typeeh"]h$]h&]uh1jhj~ubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypetype refexplicitrefwarn c:parent_keysphinx.domains.c LookupKey)}data]sbjrnla_bitfield32uh1hhjvhMPhjzubh attribute}(hjzhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjvhMPhjwubah}(h]h ]h"]h$]h&]uh1jhj[ubeh}(h]h ]h"]h$]h&]uh1jhjvhMPhjubj)}(hG``NL_ATTR_TYPE_SINT`` 32-bit or 64-bit signed attribute, aligned to 4B h](j)}(h``NL_ATTR_TYPE_SINT``h]j)}(hjh]hNL_ATTR_TYPE_SINT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMShjubj)}(hhh]h)}(h032-bit or 64-bit signed attribute, aligned to 4Bh]h032-bit or 64-bit signed attribute, aligned to 4B}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMShjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMShjubj)}(hH``NL_ATTR_TYPE_UINT`` 32-bit or 64-bit unsigned attribute, aligned to 4Bh](j)}(h``NL_ATTR_TYPE_UINT``h]j)}(hjh]hNL_ATTR_TYPE_UINT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMUhjubj)}(hhh]h)}(h232-bit or 64-bit unsigned attribute, aligned to 4Bh]h232-bit or 64-bit unsigned attribute, aligned to 4B}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMVhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMUhjubeh}(h]h ]h"]h$]h&]uh1jzhjubeh}(h]h ] kernelindentah"]h$]h&]uh1j0hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!netlink_policy_type_attr (C enum)c.netlink_policy_type_attrhNtauh1jhjhhhNhNubj)}(hhh](j)}(hnetlink_policy_type_attrh]j)}(henum netlink_policy_type_attrh](j)}(hjh]henum}(hjThhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjPhhhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM\ubj)}(h h]h }(hjbhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjPhhhjahM\ubj)}(hnetlink_policy_type_attrh]j)}(hjNh]hnetlink_policy_type_attr}(hjthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjpubah}(h]h ](jjeh"]h$]h&]hhuh1jhjPhhhjahM\ubeh}(h]h ]h"]h$]h&]hhjuh1jjjhjLhhhjahM\ubah}(h]jGah ](jjeh"]h$]h&]jj)jhuh1jhjahM\hjIhhubj )}(hhh]h)}(hpolicy type attributesh]hpolicy type attributes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMMhjhhubah}(h]h ]h"]h$]h&]uh1j hjIhhhjahM\ubeh}(h]h ](j&enumeh"]h$]h&]j*j&j+jj,jj-j.j/uh1jhhhjhNhNubj1)}(hX`**Constants** ``NL_POLICY_TYPE_ATTR_UNSPEC`` unused ``NL_POLICY_TYPE_ATTR_TYPE`` type of the attribute, :c:type:`enum netlink_attribute_type ` (U32) ``NL_POLICY_TYPE_ATTR_MIN_VALUE_S`` minimum value for signed integers (S64) ``NL_POLICY_TYPE_ATTR_MAX_VALUE_S`` maximum value for signed integers (S64) ``NL_POLICY_TYPE_ATTR_MIN_VALUE_U`` minimum value for unsigned integers (U64) ``NL_POLICY_TYPE_ATTR_MAX_VALUE_U`` maximum value for unsigned integers (U64) ``NL_POLICY_TYPE_ATTR_MIN_LENGTH`` minimum length for binary attributes, no minimum if not given (U32) ``NL_POLICY_TYPE_ATTR_MAX_LENGTH`` maximum length for binary attributes, no maximum if not given (U32) ``NL_POLICY_TYPE_ATTR_POLICY_IDX`` sub policy for nested and nested array types (U32) ``NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE`` maximum sub policy attribute for nested and nested array types, this can in theory be < the size of the policy pointed to by the index, if limited inside the nesting (U32) ``NL_POLICY_TYPE_ATTR_BITFIELD32_MASK`` valid mask for the bitfield32 type (U32) ``NL_POLICY_TYPE_ATTR_PAD`` pad attribute for 64-bit alignment ``NL_POLICY_TYPE_ATTR_MASK`` mask of valid bits for unsigned integers (U64) ``__NL_POLICY_TYPE_ATTR_MAX`` number of attributes ``NL_POLICY_TYPE_ATTR_MAX`` highest attribute numberh](h)}(h **Constants**h]j)}(hjh]h Constants}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMQhjubj{)}(hhh](j)}(h&``NL_POLICY_TYPE_ATTR_UNSPEC`` unused h](j)}(h``NL_POLICY_TYPE_ATTR_UNSPEC``h]j)}(hjh]hNL_POLICY_TYPE_ATTR_UNSPEC}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uCh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMThjubj)}(hhh]h)}(hunusedh]hunused}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMThjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMThjubj)}(hy``NL_POLICY_TYPE_ATTR_TYPE`` type of the attribute, :c:type:`enum netlink_attribute_type ` (U32) h](j)}(h``NL_POLICY_TYPE_ATTR_TYPE``h]j)}(hjh]hNL_POLICY_TYPE_ATTR_TYPE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMXhj ubj)}(hhh]h)}(h[type of the attribute, :c:type:`enum netlink_attribute_type ` (U32)h](htype of the attribute, }(hj)hhhNhNubh)}(h>:c:type:`enum netlink_attribute_type `h]j)}(hj3h]henum netlink_attribute_type}(hj5hhhNhNubah}(h]h ](j`j&c-typeeh"]h$]h&]uh1jhj1ubah}(h]h ]h"]h$]h&]refdocjl refdomainj&reftypetype refexplicitrefwarnjjjrnetlink_attribute_typeuh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMWhj)ubh (U32)}(hj)hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjPhMWhj&ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj%hMXhjubj)}(hL``NL_POLICY_TYPE_ATTR_MIN_VALUE_S`` minimum value for signed integers (S64) h](j)}(h#``NL_POLICY_TYPE_ATTR_MIN_VALUE_S``h]j)}(hjmh]hNL_POLICY_TYPE_ATTR_MIN_VALUE_S}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1jhjkubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM\hjgubj)}(hhh]h)}(h'minimum value for signed integers (S64)h]h'minimum value for signed integers (S64)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM[hjubah}(h]h ]h"]h$]h&]uh1jhjgubeh}(h]h ]h"]h$]h&]uh1jhjhM\hjubj)}(hL``NL_POLICY_TYPE_ATTR_MAX_VALUE_S`` maximum value for signed integers (S64) h](j)}(h#``NL_POLICY_TYPE_ATTR_MAX_VALUE_S``h]j)}(hjh]hNL_POLICY_TYPE_ATTR_MAX_VALUE_S}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM`hjubj)}(hhh]h)}(h'maximum value for signed integers (S64)h]h'maximum value for signed integers (S64)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM_hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhM`hjubj)}(hN``NL_POLICY_TYPE_ATTR_MIN_VALUE_U`` minimum value for unsigned integers (U64) h](j)}(h#``NL_POLICY_TYPE_ATTR_MIN_VALUE_U``h]j)}(hjh]hNL_POLICY_TYPE_ATTR_MIN_VALUE_U}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMdhjubj)}(hhh]h)}(h)minimum value for unsigned integers (U64)h]h)minimum value for unsigned integers (U64)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMchjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMdhjubj)}(hN``NL_POLICY_TYPE_ATTR_MAX_VALUE_U`` maximum value for unsigned integers (U64) h](j)}(h#``NL_POLICY_TYPE_ATTR_MAX_VALUE_U``h]j)}(hj h]hNL_POLICY_TYPE_ATTR_MAX_VALUE_U}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMhhj ubj)}(hhh]h)}(h)maximum value for unsigned integers (U64)h]h)maximum value for unsigned integers (U64)}(hj4 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMghj1 ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj0 hMhhjubj)}(hg``NL_POLICY_TYPE_ATTR_MIN_LENGTH`` minimum length for binary attributes, no minimum if not given (U32) h](j)}(h"``NL_POLICY_TYPE_ATTR_MIN_LENGTH``h]j)}(hjU h]hNL_POLICY_TYPE_ATTR_MIN_LENGTH}(hjW hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjS ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMlhjO ubj)}(hhh]h)}(hCminimum length for binary attributes, no minimum if not given (U32)h]hCminimum length for binary attributes, no minimum if not given (U32)}(hjn hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMkhjk ubah}(h]h ]h"]h$]h&]uh1jhjO ubeh}(h]h ]h"]h$]h&]uh1jhjj hMlhjubj)}(hg``NL_POLICY_TYPE_ATTR_MAX_LENGTH`` maximum length for binary attributes, no maximum if not given (U32) h](j)}(h"``NL_POLICY_TYPE_ATTR_MAX_LENGTH``h]j)}(hj h]hNL_POLICY_TYPE_ATTR_MAX_LENGTH}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMphj ubj)}(hhh]h)}(hCmaximum length for binary attributes, no maximum if not given (U32)h]hCmaximum length for binary attributes, no maximum if not given (U32)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMohj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj hMphjubj)}(hV``NL_POLICY_TYPE_ATTR_POLICY_IDX`` sub policy for nested and nested array types (U32) h](j)}(h"``NL_POLICY_TYPE_ATTR_POLICY_IDX``h]j)}(hj h]hNL_POLICY_TYPE_ATTR_POLICY_IDX}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMthj ubj)}(hhh]h)}(h2sub policy for nested and nested array types (U32)h]h2sub policy for nested and nested array types (U32)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMshj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj hMthjubj)}(h``NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE`` maximum sub policy attribute for nested and nested array types, this can in theory be < the size of the policy pointed to by the index, if limited inside the nesting (U32) h](j)}(h&``NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE``h]j)}(hj!h]h"NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMzhj ubj)}(hhh]h)}(hmaximum sub policy attribute for nested and nested array types, this can in theory be < the size of the policy pointed to by the index, if limited inside the nesting (U32)h]hmaximum sub policy attribute for nested and nested array types, this can in theory be < the size of the policy pointed to by the index, if limited inside the nesting (U32)}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMwhj!ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj!hMzhjubj)}(hQ``NL_POLICY_TYPE_ATTR_BITFIELD32_MASK`` valid mask for the bitfield32 type (U32) h](j)}(h'``NL_POLICY_TYPE_ATTR_BITFIELD32_MASK``h]j)}(hj=!h]h#NL_POLICY_TYPE_ATTR_BITFIELD32_MASK}(hj?!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj;!ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM~hj7!ubj)}(hhh]h)}(h(valid mask for the bitfield32 type (U32)h]h(valid mask for the bitfield32 type (U32)}(hjV!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhM}hjS!ubah}(h]h ]h"]h$]h&]uh1jhj7!ubeh}(h]h ]h"]h$]h&]uh1jhjR!hM~hjubj)}(h?``NL_POLICY_TYPE_ATTR_PAD`` pad attribute for 64-bit alignment h](j)}(h``NL_POLICY_TYPE_ATTR_PAD``h]j)}(hjw!h]hNL_POLICY_TYPE_ATTR_PAD}(hjy!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhju!ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMhjq!ubj)}(hhh]h)}(h"pad attribute for 64-bit alignmenth]h"pad attribute for 64-bit alignment}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!hMhj!ubah}(h]h ]h"]h$]h&]uh1jhjq!ubeh}(h]h ]h"]h$]h&]uh1jhj!hMhjubj)}(hL``NL_POLICY_TYPE_ATTR_MASK`` mask of valid bits for unsigned integers (U64) h](j)}(h``NL_POLICY_TYPE_ATTR_MASK``h]j)}(hj!h]hNL_POLICY_TYPE_ATTR_MASK}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMhj!ubj)}(hhh]h)}(h.mask of valid bits for unsigned integers (U64)h]h.mask of valid bits for unsigned integers (U64)}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!hMhj!ubah}(h]h ]h"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]uh1jhj!hMhjubj)}(h3``__NL_POLICY_TYPE_ATTR_MAX`` number of attributes h](j)}(h``__NL_POLICY_TYPE_ATTR_MAX``h]j)}(hj!h]h__NL_POLICY_TYPE_ATTR_MAX}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMhj!ubj)}(hhh]h)}(hnumber of attributesh]hnumber of attributes}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!hMhj!ubah}(h]h ]h"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]uh1jhj!hMhjubj)}(h4``NL_POLICY_TYPE_ATTR_MAX`` highest attribute numberh](j)}(h``NL_POLICY_TYPE_ATTR_MAX``h]j)}(hj""h]hNL_POLICY_TYPE_ATTR_MAX}(hj$"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj "ubah}(h]h ]h"]h$]h&]uh1jhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMhj"ubj)}(hhh]h)}(hhighest attribute numberh]hhighest attribute number}(hj;"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhi/var/lib/git/docbuild/linux/Documentation/userspace-api/netlink/intro:687: ./include/uapi/linux/netlink.hhMhj8"ubah}(h]h ]h"]h$]h&]uh1jhj"ubeh}(h]h ]h"]h$]h&]uh1jhj7"hMhjubeh}(h]h ]h"]h$]h&]uh1jzhjubeh}(h]h ] kernelindentah"]h$]h&]uh1j0hjhhhNhNubeh}(h]uapi-referenceah ]h"]uapi referenceah$]h&]uh1hhhhhhhhMubeh}(h]introduction-to-netlinkah ]h"]introduction to netlinkah$]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}(j]jaj]jaj ]j aj ]j aj*]j aunameids}(jp"jm"jjjjj j jjjjj jj j j j j j j8j5jj jg j j j j jjj0j-j|j*j{jxj?j<jjj jj>j;jjj>j;jsjpjh"je"u nametypes}(jp"jjj jjj j j j j8jj j j jj0j|j{j?jj j>jj>jsjh"uh}(jm"hjhjjj jjjjjjjj jj j j j j5j jg j j jm j j j j jj j-jj*j;jxj;j<jzjjBjjj;j jjAj;jjpjAje"jjjjjjwj|jGjLu footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}j"KsRparse_messages]hsystem_message)}(hhh]h)}(h,Duplicate implicit target name: "nlmsg_pid".h]h0Duplicate implicit target name: “nlmsg_pid”.}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"ubah}(h]h ]h"]h$]h&]j alevelKtypeINFOsourcehlineMuh1j"hj hhhhhMubatransform_messages](j")}(hhh]h)}(hhh]h1Hyperlink target "nl-msg-type" is not referenced.}hj #sbah}(h]h ]h"]h$]h&]uh1hhj#ubah}(h]h ]h"]h$]h&]levelKtypej#sourcehlineKuh1j"ubj")}(hhh]h)}(hhh]h-Hyperlink target "res-fam" is not referenced.}hj:#sbah}(h]h ]h"]h$]h&]uh1hhj7#ubah}(h]h ]h"]h$]h&]levelKtypej#sourcehlineKuh1j"ubj")}(hhh]h)}(hhh]h-Hyperlink target "ext-ack" is not referenced.}hjT#sbah}(h]h ]h"]h$]h&]uh1hhjQ#ubah}(h]h ]h"]h$]h&]levelKtypej#sourcehlineMcuh1j"ubj")}(hhh]h)}(hhh]h/Hyperlink target "nlmsg-pid" is not referenced.}hjn#sbah}(h]h ]h"]h$]h&]uh1hhjk#ubah}(h]h ]h"]h$]h&]levelKtypej#sourcehlineMuh1j"ubj")}(hhh]h)}(hhh]h5Hyperlink target "classic-netlink" is not referenced.}hj#sbah}(h]h ]h"]h$]h&]uh1hhj#ubah}(h]h ]h"]h$]h&]levelKtypej#sourcehlineMuh1j"ube transformerN include_log] decorationNhhub.