Lines Matching refs:Netlink

4 Introduction to Netlink
7 Netlink is often described as an ioctl() replacement.
12 To achieve this Netlink uses a minimal fixed-format metadata header
24 Netlink communication happens over sockets, a socket needs to be
36 A very simplified flow of a Netlink "call" will therefore look
48 Netlink also provides natural support for "dumping", i.e. communicating
70 it is opening a Netlink socket, with all headers provided by the user
71 (hence NETLINK, RAW). The last argument is the protocol within Netlink.
75 Classic vs Generic Netlink
78 Initial implementation of Netlink depended on a static allocation
80 Let us refer to those protocols collectively as **Classic Netlink**.
85 **Generic Netlink** (introduced in 2005) allows for dynamic registration of
89 The following section describes how to use Generic Netlink, as the
90 number of subsystems using Generic Netlink outnumbers the older
92 more Classic Netlink protocols to the kernel.
95 Netlink) differs from Generic Netlink is provided later in this document.
97 Generic Netlink
100 In addition to the Netlink fixed metadata header each Netlink protocol
102 headers stack - Ethernet > IP > TCP we have Netlink > Generic N. > Family.)
104 A Netlink message always starts with struct nlmsghdr, which is followed
105 by a protocol-specific header. In case of Generic Netlink the protocol
108 The practical meaning of the fields in case of Generic Netlink is as follows:
114 __u16 nlmsg_type; /* Generic Netlink Family (subsystem) ID */
126 In Classic Netlink :c:member:`nlmsghdr.nlmsg_type` used to identify
128 (e.g. get information about a netdev). Generic Netlink needs to mux
134 control messages both in Classic Netlink and Generic Netlink.
137 There are 3 usual types of message exchanges on a Netlink socket:
143 Classic Netlink is very flexible and presumably allows other types
162 :c:member:`nlmsghdr.nlmsg_pid` is the Netlink equivalent of an address.
173 Netlink message types
181 There are only 4 Netlink control messages defined:
190 the ``NLM_F_ACK`` flag is set on the request Netlink will not respond
243 It also serves as an example of Generic Netlink communication.
245 Generic Netlink is itself a subsystem exposed via the Generic Netlink API.
246 To avoid a circular dependency Generic Netlink has a statically allocated
248 The Generic Netlink family implements a command used to find out information
251 To get information about the Generic Netlink family named for example
252 ``"test1"`` we need to send a message on the previously opened Generic Netlink
253 socket. The message should target the Generic Netlink Family (1), be a
279 The length fields in Netlink (:c:member:`nlmsghdr.nlmsg_len`
346 Note that Generic Netlink sockets are not associated or bound to a single
377 Extended ACKs greatly improve the usability of Netlink and should
400 the Generic Netlink family, including which operations are supported
415 :c:member:`nlmsghdr.nlmsg_pid` is the Netlink equivalent of an address.
437 One of the strengths of Netlink is the ability to send event notifications
442 For example the Generic Netlink family itself defines a set of multicast
484 The Netlink headers of the notification are mostly 0 and irrelevant.
516 Netlink sockets are datagram sockets rather than stream sockets,
521 of the recvmsg() system call, *not* a Netlink header).
525 Netlink expects that the user buffer will be at least 8kB or a page
526 size of the CPU architecture, whichever is bigger. Particular Netlink
533 Classic Netlink
536 The main differences between Classic and Generic Netlink are the dynamic
539 Classic Netlink experimented with concepts which were abandoned in Generic
540 Netlink (really, they usually only found use in a small corner of a single
542 with the explicit goal of giving the Generic Netlink
552 Netlink refers to subsystems as families. This is a remnant of using
562 3. Generic Netlink is a family for AF_NETLINK (struct genlmsghdr follows
565 Note that the Generic Netlink Family IDs are in a different "ID space"
566 and overlap with Classic Netlink protocol numbers (e.g. ``NETLINK_CRYPTO``
567 has the Classic Netlink protocol ID of 21 which Generic Netlink will
589 Historically Netlink ignored all unknown attributes. The thinking was that
594 This is no longer the case for new Generic Netlink families and those opting
601 Classic Netlink made liberal use of fixed-format structures within
624 Even though other protocols and Generic Netlink commands often use
640 Classic Netlink defined various flags for its ``GET``, ``NEW``
651 The flags for ``NEW`` are used most commonly in classic Netlink. Unfortunately,
661 A comment in the main Netlink uAPI header states::