summaryrefslogtreecommitdiff
path: root/man7/netlink.7
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2007-12-19 05:53:30 +0000
committerMichael Kerrisk <mtk.manpages@gmail.com>2007-12-19 05:53:30 +0000
commita08ea57c202088519f95dfa510434668adc3803f (patch)
tree2444cf9a408bbf6449fff630e86ede0b21af0ded /man7/netlink.7
parent8a35999094a6c7f5125fb9d0f87704d0e029dc7a (diff)
Make the standard indent for code samples, shell session
logs, etc. to be ".in +4n".
Diffstat (limited to 'man7/netlink.7')
-rw-r--r--man7/netlink.724
1 files changed, 12 insertions, 12 deletions
diff --git a/man7/netlink.7 b/man7/netlink.7
index bac30acc..eae64acb 100644
--- a/man7/netlink.7
+++ b/man7/netlink.7
@@ -134,7 +134,7 @@ After each
.I nlmsghdr
the payload follows.
-.in +0.25i
+.in +4n
.nf
struct nlmsghdr {
__u32 nlmsg_len; /* Length of message including header. */
@@ -144,7 +144,7 @@ struct nlmsghdr {
__u32 nlmsg_pid; /* PID of the sending process. */
};
.fi
-.in -0.25i
+.in
.I nlmsg_type
can be one of the standard message types:
@@ -157,14 +157,14 @@ structure,
.B NLMSG_DONE
message terminates a multipart message.
-.in +0.25i
+.in +4n
.nf
struct nlmsgerr {
int error; /* Negative errno or 0 for acknowledgements */
struct nlmsghdr msg; /* Message header that caused the error */
};
.fi
-.in -0.25i
+.in
A netlink family usually specifies more message types, see the
appropriate manual pages for that, for example,
@@ -282,7 +282,7 @@ netlink multicast groups
.RI ( nl_groups
not equal 0).
-.in +0.25i
+.in +4n
.nf
struct sockaddr_nl {
sa_family_t nl_family; /* AF_NETLINK */
@@ -291,7 +291,7 @@ struct sockaddr_nl {
__u32 nl_groups; /* Multicast groups mask. */
};
.fi
-.in -0.25i
+.in
.I nl_pid
is the unicast address of netlink socket.
@@ -381,7 +381,7 @@ netlink socket which will listen to the
.B RTMGRP_IPV4_IFADDR
(IPv4 addresses add/delete events) multicast groups.
-.in +0.25i
+.in +4n
.nf
struct sockaddr_nl sa;
@@ -392,14 +392,14 @@ snl.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR;
fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
bind(fd, (struct sockaddr*)&sa, sizeof(sa));
.fi
-.in -0.25i
+.in
The next example demonstrates how to send a netlink message to the
kernel (pid 0).
Note that application must take care of message sequence numbers
in order to reliably track acknowledgements.
-.in +0.25i
+.in +4n
.nf
struct nlmsghdr *nh; /* The nlmsghdr with payload to send. */
struct sockaddr_nl sa;
@@ -416,11 +416,11 @@ nh\->nlmsg_flags |= NLM_F_ACK;
sendmsg(fd, &msg, 0);
.fi
-.in -0.25i
+.in
And the last example is about reading netlink message.
-.in +0.25i
+.in +4n
.nf
int len;
char buf[4096];
@@ -446,7 +446,7 @@ for (nh = (struct nlmsghdr *) buf; NLMSG_OK (nh, len);
...
}
.fi
-.in -0.25i
+.in
.SH "SEE ALSO"
.BR cmsg (3),
.BR netlink (3),