#, fuzzy msgid "" msgstr "" "Project-Id-Version: man-pages-l10n VERSION\n" "POT-Creation-Date: 2014-07-17 17:57+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: man-pages/man7/netlink.7:11 #, no-wrap msgid "NETLINK" msgstr "" #. type: TH #: man-pages/man7/netlink.7:11 #, no-wrap msgid "2013-03-15" msgstr "" #. type: TH #: man-pages/man7/netlink.7:11 #, no-wrap msgid "Linux" msgstr "" #. type: TH #: man-pages/man7/netlink.7:11 #, no-wrap msgid "Linux Programmer's Manual" msgstr "" #. type: SH #: man-pages/man7/netlink.7:12 #, no-wrap msgid "NAME" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:14 msgid "netlink - communication between kernel and user space (AF_NETLINK)" msgstr "" #. type: SH #: man-pages/man7/netlink.7:14 #, no-wrap msgid "SYNOPSIS" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:19 #, no-wrap msgid "" "B<#include Easm/types.hE>\n" "B<#include Esys/socket.hE>\n" "B<#include Elinux/netlink.hE>\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:21 #, no-wrap msgid "" "BIB<, " ">IB<);>\n" msgstr "" #. type: SH #: man-pages/man7/netlink.7:22 #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:31 msgid "" "Netlink is used to transfer information between kernel and user-space " "processes. It consists of a standard sockets-based interface for user space " "processes and an internal kernel API for kernel modules. The internal " "kernel interface is not documented in this manual page. There is also an " "obsolete netlink interface via netlink character devices; this interface is " "not documented here and is provided only for backward compatibility." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:41 msgid "" "Netlink is a datagram-oriented service. Both B and B " "are valid values for I. However, the netlink protocol does not " "distinguish between datagram and raw sockets." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:45 msgid "" "I selects the kernel module or netlink group to communicate " "with. The currently assigned netlink families are:" msgstr "" #. type: TP #: man-pages/man7/netlink.7:45 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:52 msgid "" "Receives routing and link updates and may be used to modify the routing " "tables (both IPv4 and IPv6), IP addresses, link parameters, neighbor setups, " "queueing disciplines, traffic classes and packet classifiers (see " "B(7))." msgstr "" #. type: TP #: man-pages/man7/netlink.7:52 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:55 msgid "Messages from 1-wire subsystem." msgstr "" #. type: TP #: man-pages/man7/netlink.7:55 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:58 msgid "Reserved for user-mode socket protocols." msgstr "" #. type: TP #: man-pages/man7/netlink.7:58 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:64 msgid "" "Transport IPv4 packets from netfilter to user space. Used by I " "kernel module." msgstr "" #. type: TP #: man-pages/man7/netlink.7:64 #, no-wrap msgid "B" msgstr "" #. FIXME More details on NETLINK_INET_DIAG needed. #. type: Plain text #: man-pages/man7/netlink.7:68 msgid "INET socket monitoring." msgstr "" #. type: TP #: man-pages/man7/netlink.7:68 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:71 msgid "Netfilter/iptables ULOG." msgstr "" #. type: TP #: man-pages/man7/netlink.7:71 #, no-wrap msgid "B" msgstr "" #. FIXME More details on NETLINK_XFRM needed. #. type: Plain text #: man-pages/man7/netlink.7:75 msgid "IPsec." msgstr "" #. type: TP #: man-pages/man7/netlink.7:75 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:78 msgid "SELinux event notifications." msgstr "" #. type: TP #: man-pages/man7/netlink.7:78 #, no-wrap msgid "B" msgstr "" #. FIXME More details on NETLINK_ISCSI needed. #. type: Plain text #: man-pages/man7/netlink.7:82 msgid "Open-iSCSI." msgstr "" #. type: TP #: man-pages/man7/netlink.7:82 #, no-wrap msgid "B" msgstr "" #. FIXME More details on NETLINK_AUDIT needed. #. type: Plain text #: man-pages/man7/netlink.7:86 msgid "Auditing." msgstr "" #. type: TP #: man-pages/man7/netlink.7:86 #, no-wrap msgid "B" msgstr "" #. FIXME More details on NETLINK_FIB_LOOKUP needed. #. type: Plain text #: man-pages/man7/netlink.7:90 msgid "Access to FIB lookup from user space." msgstr "" #. type: TP #: man-pages/man7/netlink.7:90 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:96 msgid "" "Kernel connector. See I in the Linux kernel " "source tree for further information." msgstr "" #. type: TP #: man-pages/man7/netlink.7:96 #, no-wrap msgid "B" msgstr "" #. FIXME More details on NETLINK_NETFILTER needed. #. type: Plain text #: man-pages/man7/netlink.7:100 msgid "Netfilter subsystem." msgstr "" #. type: TP #: man-pages/man7/netlink.7:100 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:106 msgid "" "Transport IPv6 packets from netfilter to user space. Used by I " "kernel module." msgstr "" #. type: TP #: man-pages/man7/netlink.7:106 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:109 msgid "DECnet routing messages." msgstr "" #. type: TP #: man-pages/man7/netlink.7:109 #, no-wrap msgid "B" msgstr "" #. FIXME More details on NETLINK_KOBJECT_UEVENT needed. #. type: Plain text #: man-pages/man7/netlink.7:113 msgid "Kernel messages to user space." msgstr "" #. type: TP #: man-pages/man7/netlink.7:113 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:116 msgid "Generic netlink family for simplified netlink usage." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:126 msgid "" "Netlink messages consist of a byte stream with one or multiple I " "headers and associated payload. The byte stream should be accessed only " "with the standard B macros. See B(3) for further " "information." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:134 msgid "" "In multipart messages (multiple I headers with associated payload " "in one byte stream) the first and all following headers have the " "B flag set, except for the last header which has the type " "B." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:138 msgid "After each I the payload follows." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:148 #, no-wrap msgid "" "struct nlmsghdr {\n" " __u32 nlmsg_len; /* Length of message including header. */\n" " __u16 nlmsg_type; /* Type of message content. */\n" " __u16 nlmsg_flags; /* Additional flags. */\n" " __u32 nlmsg_seq; /* Sequence number. */\n" " __u32 nlmsg_pid; /* Sender port ID. */\n" "};\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:161 msgid "" "I can be one of the standard message types: B " "message is to be ignored, B message signals an error and the " "payload contains an I structure, B message terminates " "a multipart message." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:168 #, no-wrap msgid "" "struct nlmsgerr {\n" " int error; /* Negative errno or 0 for acknowledgements */\n" " struct nlmsghdr msg; /* Message header that caused the error */\n" "};\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:176 msgid "" "A netlink family usually specifies more message types, see the appropriate " "manual pages for that, for example, B(7) for B." msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:180 #, no-wrap msgid "Standard flag bits in I\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:181 man-pages/man7/netlink.7:197 man-pages/man7/netlink.7:222 #, no-wrap msgid "_\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:182 #, no-wrap msgid "NLM_F_REQUEST:Must be set on all request messages.\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:183 #, no-wrap msgid "NLM_F_MULTI:T{\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:184 #, no-wrap msgid "The message is part of a multipart message terminated by\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:185 #, no-wrap msgid "B.\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:186 man-pages/man7/netlink.7:202 man-pages/man7/netlink.7:209 #, no-wrap msgid "T}\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:187 #, no-wrap msgid "NLM_F_ACK:Request for an acknowledgment on success.\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:188 #, no-wrap msgid "NLM_F_ECHO:Echo this request.\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:196 #, no-wrap msgid "Additional flag bits for GET requests\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:198 #, no-wrap msgid "NLM_F_ROOT:Return the complete table instead of a single entry.\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:199 #, no-wrap msgid "NLM_F_MATCH:T{\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:200 #, no-wrap msgid "Return all entries matching criteria passed in message content.\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:201 #, no-wrap msgid "Not implemented yet.\n" msgstr "" #. FIXME NLM_F_ATOMIC is not used any more? #. type: tbl table #: man-pages/man7/netlink.7:204 #, no-wrap msgid "NLM_F_ATOMIC:Return an atomic snapshot of the table.\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:205 #, no-wrap msgid "NLM_F_DUMP:T{\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:206 #, no-wrap msgid "Convenience macro; equivalent to\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:207 #, no-wrap msgid ".br\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:208 #, no-wrap msgid "(NLM_F_ROOT|NLM_F_MATCH).\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:217 msgid "" "Note that B requires the B capability or an " "effective UID of 0." msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:221 #, no-wrap msgid "Additional flag bits for NEW requests\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:223 #, no-wrap msgid "NLM_F_REPLACE:Replace existing matching object.\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:224 #, no-wrap msgid "NLM_F_EXCL:Don't replace if the object already exists.\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:225 #, no-wrap msgid "NLM_F_CREATE:Create object if it doesn't already exist.\n" msgstr "" #. type: tbl table #: man-pages/man7/netlink.7:226 #, no-wrap msgid "NLM_F_APPEND:Add to the end of the object list.\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:242 msgid "" "I and I are used to track messages. I " "shows the origin of the message. Note that there isn't a 1:1 relationship " "between I and the PID of the process if the message originated " "from a netlink socket. See the B
section for further " "information." msgstr "" #. FIXME Explain more about nlmsg_seq and nlmsg_pid. #. type: Plain text #: man-pages/man7/netlink.7:249 msgid "Both I and I are opaque to netlink core." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:267 msgid "" "Netlink is not a reliable protocol. It tries its best to deliver a message " "to its destination(s), but may drop messages when an out-of-memory condition " "or other error occurs. For reliable transfer the sender can request an " "acknowledgement from the receiver by setting the B flag. An " "acknowledgment is an B packet with the error field set to 0. " "The application must generate acknowledgements for received messages itself. " " The kernel tries to send an B message for every failed packet. " " A user process should follow this convention too." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:278 msgid "" "However, reliable transmissions from kernel to user are impossible in any " "case. The kernel can't send a netlink message if the socket buffer is full: " "the message will be dropped and the kernel and the user-space process will " "no longer have the same view of kernel state. It is up to the application " "to detect when this happens (via the B error returned by " "B(2)) and resynchronize." msgstr "" #. type: SS #: man-pages/man7/netlink.7:278 #, no-wrap msgid "Address formats" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:288 msgid "" "The I structure describes a netlink client in user space or in " "the kernel. A I can be either unicast (only sent to one peer) " "or sent to netlink multicast groups (I not equal 0)." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:297 #, no-wrap msgid "" "struct sockaddr_nl {\n" " sa_family_t nl_family; /* AF_NETLINK */\n" " unsigned short nl_pad; /* Zero. */\n" " pid_t nl_pid; /* Port ID. */\n" " __u32 nl_groups; /* Multicast groups mask. */\n" "};\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:328 msgid "" "I is the unicast address of netlink socket. It's always 0 if the " "destination is in the kernel. For a user-space process, I is " "usually the PID of the process owning the destination socket. However, " "I identifies a netlink socket, not a process. If a process owns " "several netlink sockets, then I can be equal to the process ID only " "for at most one socket. There are two ways to assign I to a netlink " "socket. If the application sets I before calling B(2), then " "it is up to the application to make sure that I is unique. If the " "application sets it to 0, the kernel takes care of assigning it. The kernel " "assigns the process ID to the first netlink socket the process opens and " "assigns a unique I to every netlink socket that the process " "subsequently creates." msgstr "" #. commit d629b836d151d43332492651dd841d32e57ebe3b #. type: Plain text #: man-pages/man7/netlink.7:365 msgid "" "I is a bit mask with every bit representing a netlink group " "number. Each netlink family has a set of 32 multicast groups. When " "B(2) is called on the socket, the I field in the " "I should be set to a bit mask of the groups which it wishes to " "listen to. The default value for this field is zero which means that no " "multicasts will be received. A socket may multicast messages to any of the " "multicast groups by setting I to a bit mask of the groups it " "wishes to send to when it calls B(2) or does a B(2). " "Only processes with an effective UID of 0 or the B capability " "may send or listen to a netlink multicast group. Since Linux 2.6.13, " "messages can't be broadcast to multiple groups. Any replies to a message " "received for a multicast group should be sent back to the sending PID and " "the multicast group. Some Linux kernel subsystems may additionally allow " "other users to send and/or receive messages. As at Linux 3.0, the " "B, B, B, and " "B groups allow other users to receive messages. No groups " "allow other users to send messages." msgstr "" #. type: SH #: man-pages/man7/netlink.7:365 #, no-wrap msgid "VERSIONS" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:367 msgid "The socket interface to netlink is a new feature of Linux 2.2." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:371 msgid "" "Linux 2.0 supported a more primitive device-based netlink interface (which " "is still available as a compatibility option). This obsolete interface is " "not described here." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:373 msgid "NETLINK_SELINUX appeared in Linux 2.6.4." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:375 msgid "NETLINK_AUDIT appeared in Linux 2.6.6." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:377 msgid "NETLINK_KOBJECT_UEVENT appeared in Linux 2.6.10." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:379 msgid "NETLINK_W1 and NETLINK_FIB_LOOKUP appeared in Linux 2.6.13." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:382 msgid "" "NETLINK_INET_DIAG, NETLINK_CONNECTOR and NETLINK_NETFILTER appeared in Linux " "2.6.14." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:384 msgid "NETLINK_GENERIC and NETLINK_ISCSI appeared in Linux 2.6.15." msgstr "" #. type: SH #: man-pages/man7/netlink.7:384 #, no-wrap msgid "NOTES" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:390 msgid "" "It is often better to use netlink via I or I than via the " "low-level kernel interface." msgstr "" #. type: SH #: man-pages/man7/netlink.7:390 #, no-wrap msgid "BUGS" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:392 msgid "This manual page is not complete." msgstr "" #. type: SH #: man-pages/man7/netlink.7:392 #, no-wrap msgid "EXAMPLE" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:400 msgid "" "The following example creates a B netlink socket which will " "listen to the B (network interface create/delete/up/down " "events) and B (IPv4 addresses add/delete events) " "multicast groups." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:404 #, no-wrap msgid "struct sockaddr_nl sa;\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:408 #, no-wrap msgid "" "memset(&sa, 0, sizeof(sa));\n" "sa.nl_family = AF_NETLINK;\n" "sa.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR;\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:411 #, no-wrap msgid "" "fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);\n" "bind(fd, (struct sockaddr *) &sa, sizeof(sa));\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:418 msgid "" "The next example demonstrates how to send a netlink message to the kernel " "(pid 0). Note that the application must take care of message sequence " "numbers in order to reliably track acknowledgements." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:425 #, no-wrap msgid "" "struct nlmsghdr *nh; /* The nlmsghdr with payload to send. */\n" "struct sockaddr_nl sa;\n" "struct iovec iov = { nh, nh-Enlmsg_len };\n" "struct msghdr msg;\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:433 #, no-wrap msgid "" "msg = { &sa, sizeof(sa), &iov, 1, NULL, 0, 0 };\n" "memset(&sa, 0, sizeof(sa));\n" "sa.nl_family = AF_NETLINK;\n" "nh-Enlmsg_pid = 0;\n" "nh-Enlmsg_seq = ++sequence_number;\n" "/* Request an ack from kernel by setting NLM_F_ACK. */\n" "nh-Enlmsg_flags |= NLM_F_ACK;\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:435 #, no-wrap msgid "sendmsg(fd, &msg, 0);\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:439 msgid "And the last example is about reading netlink message." msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:448 #, no-wrap msgid "" "int len;\n" "char buf[4096];\n" "struct iovec iov = { buf, sizeof(buf) };\n" "struct sockaddr_nl sa;\n" "struct msghdr msg;\n" "struct nlmsghdr *nh;\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:451 #, no-wrap msgid "" "msg = { &sa, sizeof(sa), &iov, 1, NULL, 0, 0 };\n" "len = recvmsg(fd, &msg, 0);\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:457 #, no-wrap msgid "" "for (nh = (struct nlmsghdr *) buf; NLMSG_OK (nh, len);\n" " nh = NLMSG_NEXT (nh, len)) {\n" " /* The end of multipart message. */\n" " if (nh-Enlmsg_type == NLMSG_DONE)\n" " return;\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:461 #, no-wrap msgid "" " if (nh-Enlmsg_type == NLMSG_ERROR)\n" " /* Do some error handling. */\n" " ...\n" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:465 #, no-wrap msgid " /* Continue with parsing payload. */\n" " ...\n" "}\n" msgstr "" #. type: SH #: man-pages/man7/netlink.7:467 #, no-wrap msgid "SEE ALSO" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:472 msgid "B(3), B(3), B(7), B(7)" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:476 msgid "" "E<.UR ftp://ftp.inr.ac.ru\\:/ip-routing\\:/iproute2*> information about " "libnetlink E<.UE>" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:480 msgid "" "E<.UR http://people.suug.ch\\:/~tgr\\:/libnl/> information about libnl E<." "UE>" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:482 msgid "RFC 3549 \"Linux Netlink as an IP Services Protocol\"" msgstr "" #. type: SH #: man-pages/man7/netlink.7:482 #, no-wrap msgid "COLOPHON" msgstr "" #. type: Plain text #: man-pages/man7/netlink.7:490 msgid "" "This page is part of release 3.70 of the Linux I project. A " "description of the project, information about reporting bugs, and the latest " "version of this page, can be found at \\%http://www.kernel.org/doc/man-pages/" "." msgstr ""