Debian Codegraph @

templates/man7/sock_diag.7.pot

raw
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2026-06-05 06:44+0200\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <[email protected]>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
21 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
22 #, no-wrap
23 msgid "sock_diag"
24 msgstr ""
25
26 #. type: TH
27 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
28 #: opensuse-tumbleweed
29 #, no-wrap
30 msgid "2026-02-08"
31 msgstr ""
32
33 #. type: TH
34 #: archlinux debian-unstable
35 #, no-wrap
36 msgid "Linux man-pages 6.18"
37 msgstr ""
38
39 #. type: SH
40 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
41 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
42 #, no-wrap
43 msgid "NAME"
44 msgstr ""
45
46 #. type: Plain text
47 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
48 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
49 msgid "sock_diag - obtaining information about sockets"
50 msgstr ""
51
52 #. type: SH
53 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
54 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
55 #, no-wrap
56 msgid "SYNOPSIS"
57 msgstr ""
58
59 #. type: Plain text
60 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
61 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
62 #, no-wrap
63 msgid ""
64 "B<#include E<lt>sys/socket.hE<gt>>\n"
65 "B<#include E<lt>linux/sock_diag.hE<gt>>\n"
66 "B<#include E<lt>linux/unix_diag.hE<gt>> /* for UNIX domain sockets */\n"
67 "B<#include E<lt>linux/inet_diag.hE<gt>> /* for IPv4 and IPv6 sockets */\n"
68 msgstr ""
69
70 #. type: Plain text
71 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
72 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
73 #, no-wrap
74 msgid "B<diag_socket = socket(AF_NETLINK, >I<socket_type>B<, NETLINK_SOCK_DIAG);>\n"
75 msgstr ""
76
77 #. type: SH
78 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
79 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
80 #, no-wrap
81 msgid "DESCRIPTION"
82 msgstr ""
83
84 #. type: Plain text
85 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
86 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
87 msgid ""
88 "The sock_diag netlink subsystem provides a mechanism for obtaining "
89 "information about sockets of various address families from the kernel. This "
90 "subsystem can be used to obtain information about individual sockets or "
91 "request a list of sockets."
92 msgstr ""
93
94 #. type: Plain text
95 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
96 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
97 msgid ""
98 "In the request, the caller can specify additional information it would like "
99 "to obtain about the socket, for example, memory information or information "
100 "specific to the address family."
101 msgstr ""
102
103 #. type: Plain text
104 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
105 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
106 msgid ""
107 "When requesting a list of sockets, the caller can specify filters that would "
108 "be applied by the kernel to select a subset of sockets to report. For now, "
109 "there is only the ability to filter sockets by state (connected, listening, "
110 "and so on.)"
111 msgstr ""
112
113 #. type: Plain text
114 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
115 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
116 msgid ""
117 "Note that sock_diag reports only those sockets that have a name; that is, "
118 "either sockets bound explicitly with B<bind>(2) or sockets that were "
119 "automatically bound to an address (e.g., by B<connect>(2)). This is the "
120 "same set of sockets that is available via I</proc/net/unix>, I</proc/net/"
121 "tcp>, I</proc/net/udp>, and so on."
122 msgstr ""
123
124 #. type: SS
125 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
126 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
127 #, no-wrap
128 msgid "Request"
129 msgstr ""
130
131 #. type: Plain text
132 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
133 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
134 msgid ""
135 "The request starts with a I<struct nlmsghdr> header described in "
136 "B<netlink>(7) with I<nlmsg_type> field set to B<SOCK_DIAG_BY_FAMILY>. It "
137 "is followed by a header specific to the address family that starts with a "
138 "common part shared by all address families:"
139 msgstr ""
140
141 #. type: Plain text
142 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
143 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
144 #, no-wrap
145 msgid ""
146 "struct sock_diag_req {\n"
147 " __u8 sdiag_family;\n"
148 " __u8 sdiag_protocol;\n"
149 "};\n"
150 msgstr ""
151
152 #. type: Plain text
153 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
154 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
155 msgid "The fields of this structure are as follows:"
156 msgstr ""
157
158 #. type: TP
159 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
160 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
161 #, no-wrap
162 msgid "I<sdiag_family>"
163 msgstr ""
164
165 #. type: Plain text
166 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
167 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
168 msgid ""
169 "An address family. It should be set to the appropriate B<AF_*> constant."
170 msgstr ""
171
172 #. type: TP
173 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
174 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
175 #, no-wrap
176 msgid "I<sdiag_protocol>"
177 msgstr ""
178
179 #. type: Plain text
180 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
181 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
182 msgid ""
183 "Depends on I<sdiag_family>. It should be set to the appropriate "
184 "B<IPPROTO_*> constant for B<AF_INET> and B<AF_INET6>, and to 0 otherwise."
185 msgstr ""
186
187 #. type: Plain text
188 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
189 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
190 msgid ""
191 "If the I<nlmsg_flags> field of the I<struct nlmsghdr> header has the "
192 "B<NLM_F_DUMP> flag set, it means that a list of sockets is being requested; "
193 "otherwise it is a query about an individual socket."
194 msgstr ""
195
196 #. type: SS
197 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
198 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
199 #, no-wrap
200 msgid "Response"
201 msgstr ""
202
203 #. type: Plain text
204 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
205 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
206 msgid ""
207 "The response starts with a I<struct nlmsghdr> header and is followed by an "
208 "array of objects specific to the address family. The array is to be "
209 "accessed with the standard B<NLMSG_*> macros from the B<netlink>(3) API."
210 msgstr ""
211
212 #. type: Plain text
213 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
214 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
215 msgid ""
216 "Each object is the NLA (netlink attributes) list that is to be accessed with "
217 "the B<RTA_*> macros from B<rtnetlink>(3) API."
218 msgstr ""
219
220 #. type: SS
221 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
222 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
223 #, no-wrap
224 msgid "UNIX domain sockets"
225 msgstr ""
226
227 #. type: Plain text
228 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
229 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
230 msgid ""
231 "For UNIX domain sockets the request is represented in the following "
232 "structure:"
233 msgstr ""
234
235 #. type: Plain text
236 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
237 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
238 #, no-wrap
239 msgid ""
240 "struct unix_diag_req {\n"
241 " __u8 sdiag_family;\n"
242 " __u8 sdiag_protocol;\n"
243 " __u16 pad;\n"
244 " __u32 udiag_states;\n"
245 " __u32 udiag_ino;\n"
246 " __u32 udiag_show;\n"
247 " __u32 udiag_cookie[2];\n"
248 "};\n"
249 msgstr ""
250
251 #. type: Plain text
252 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
253 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
254 msgid "The address family; it should be set to B<AF_UNIX>."
255 msgstr ""
256
257 #. type: TP
258 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
259 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
260 #, no-wrap
261 msgid "I<pad>"
262 msgstr ""
263
264 #. type: Plain text
265 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
266 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
267 msgid "These fields should be set to 0."
268 msgstr ""
269
270 #. type: TP
271 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
272 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
273 #, no-wrap
274 msgid "I<udiag_states>"
275 msgstr ""
276
277 #. type: Plain text
278 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
279 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
280 msgid ""
281 "This is a bit mask that defines a filter of sockets states. Only those "
282 "sockets whose states are in this mask will be reported. Ignored when "
283 "querying for an individual socket. Supported values are:"
284 msgstr ""
285
286 #. type: Plain text
287 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
288 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
289 msgid "1 E<lt>E<lt> B<TCP_ESTABLISHED>"
290 msgstr ""
291
292 #. type: Plain text
293 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
294 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
295 msgid "1 E<lt>E<lt> B<TCP_LISTEN>"
296 msgstr ""
297
298 #. type: TP
299 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
300 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
301 #, no-wrap
302 msgid "I<udiag_ino>"
303 msgstr ""
304
305 #. type: Plain text
306 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
307 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
308 msgid ""
309 "This is an inode number when querying for an individual socket. Ignored "
310 "when querying for a list of sockets."
311 msgstr ""
312
313 #. type: TP
314 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
315 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
316 #, no-wrap
317 msgid "I<udiag_show>"
318 msgstr ""
319
320 #. type: Plain text
321 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
322 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
323 msgid ""
324 "This is a set of flags defining what kind of information to report. Each "
325 "requested kind of information is reported back as a netlink attribute as "
326 "described below:"
327 msgstr ""
328
329 #. type: TP
330 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
331 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
332 #, no-wrap
333 msgid "B<UDIAG_SHOW_NAME>"
334 msgstr ""
335
336 #. type: Plain text
337 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
338 #: opensuse-leap-16-1 opensuse-tumbleweed
339 msgid ""
340 "The attribute reported in answer to this request is B<UNIX_DIAG_NAME>. The "
341 "payload associated with this attribute is the pathname to which the socket "
342 "was bound (a sequence of bytes up to B<UNIX_PATH_MAX> size)."
343 msgstr ""
344
345 #. type: TP
346 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
347 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
348 #, no-wrap
349 msgid "B<UDIAG_SHOW_VFS>"
350 msgstr ""
351
352 #. type: Plain text
353 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
354 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
355 msgid ""
356 "The attribute reported in answer to this request is B<UNIX_DIAG_VFS>. The "
357 "payload associated with this attribute is represented in the following "
358 "structure:"
359 msgstr ""
360
361 #. type: Plain text
362 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
363 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
364 #, no-wrap
365 msgid ""
366 "struct unix_diag_vfs {\n"
367 " __u32 udiag_vfs_dev;\n"
368 " __u32 udiag_vfs_ino;\n"
369 "};\n"
370 msgstr ""
371
372 #. type: TP
373 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
374 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
375 #, no-wrap
376 msgid "I<udiag_vfs_dev>"
377 msgstr ""
378
379 #. type: Plain text
380 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
381 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
382 msgid "The device number of the corresponding on-disk socket inode."
383 msgstr ""
384
385 #. type: TP
386 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
387 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
388 #, no-wrap
389 msgid "I<udiag_vfs_ino>"
390 msgstr ""
391
392 #. type: Plain text
393 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
394 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
395 msgid "The inode number of the corresponding on-disk socket inode."
396 msgstr ""
397
398 #. type: TP
399 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
400 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
401 #, no-wrap
402 msgid "B<UDIAG_SHOW_PEER>"
403 msgstr ""
404
405 #. type: Plain text
406 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
407 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
408 msgid ""
409 "The attribute reported in answer to this request is B<UNIX_DIAG_PEER>. The "
410 "payload associated with this attribute is a __u32 value which is the peer's "
411 "inode number. This attribute is reported for connected sockets only."
412 msgstr ""
413
414 #. type: TP
415 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
416 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
417 #, no-wrap
418 msgid "B<UDIAG_SHOW_ICONS>"
419 msgstr ""
420
421 #. type: Plain text
422 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
423 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
424 msgid ""
425 "The attribute reported in answer to this request is B<UNIX_DIAG_ICONS>. The "
426 "payload associated with this attribute is an array of __u32 values which are "
427 "inode numbers of sockets that has passed the B<connect>(2) call, but hasn't "
428 "been processed with B<accept>(2) yet. This attribute is reported for "
429 "listening sockets only."
430 msgstr ""
431
432 #. type: TP
433 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
434 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
435 #, no-wrap
436 msgid "B<UDIAG_SHOW_RQLEN>"
437 msgstr ""
438
439 #. type: Plain text
440 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
441 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
442 msgid ""
443 "The attribute reported in answer to this request is B<UNIX_DIAG_RQLEN>. The "
444 "payload associated with this attribute is represented in the following "
445 "structure:"
446 msgstr ""
447
448 #. type: Plain text
449 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
450 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
451 #, no-wrap
452 msgid ""
453 "struct unix_diag_rqlen {\n"
454 " __u32 udiag_rqueue;\n"
455 " __u32 udiag_wqueue;\n"
456 "};\n"
457 msgstr ""
458
459 #. type: TP
460 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
461 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
462 #, no-wrap
463 msgid "I<udiag_rqueue>"
464 msgstr ""
465
466 #. type: Plain text
467 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
468 #: opensuse-leap-16-1 opensuse-tumbleweed
469 msgid ""
470 "For listening sockets: the number of pending connections. The size of the "
471 "array associated with the B<UNIX_DIAG_ICONS> response attribute is equal to "
472 "this value."
473 msgstr ""
474
475 #. type: Plain text
476 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
477 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
478 msgid "For established sockets: the amount of data in incoming queue."
479 msgstr ""
480
481 #. type: TP
482 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
483 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
484 #, no-wrap
485 msgid "I<udiag_wqueue>"
486 msgstr ""
487
488 #. type: Plain text
489 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
490 #: opensuse-leap-16-1 opensuse-tumbleweed
491 msgid ""
492 "For listening sockets: the backlog size which equals to the value passed as "
493 "the second argument to B<listen>(2)."
494 msgstr ""
495
496 #. type: Plain text
497 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
498 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
499 msgid "For established sockets: the amount of memory available for sending."
500 msgstr ""
501
502 #. type: TP
503 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
504 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
505 #, no-wrap
506 msgid "B<UDIAG_SHOW_MEMINFO>"
507 msgstr ""
508
509 #. type: Plain text
510 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
511 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
512 msgid ""
513 "The attribute reported in answer to this request is B<UNIX_DIAG_MEMINFO>. "
514 "The payload associated with this attribute is an array of __u32 values "
515 "described below in the subsection \"Socket memory information\"."
516 msgstr ""
517
518 #. type: Plain text
519 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
520 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
521 msgid ""
522 "The following attributes are reported back without any specific request:"
523 msgstr ""
524
525 #. type: TP
526 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
527 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
528 #, no-wrap
529 msgid "B<UNIX_DIAG_SHUTDOWN>"
530 msgstr ""
531
532 #. type: Plain text
533 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
534 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
535 msgid ""
536 "The payload associated with this attribute is __u8 value which represents "
537 "bits of B<shutdown>(2) state."
538 msgstr ""
539
540 #. type: TP
541 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
542 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
543 #, no-wrap
544 msgid "I<udiag_cookie>"
545 msgstr ""
546
547 #. type: Plain text
548 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
549 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
550 msgid ""
551 "This is an array of opaque identifiers that could be used along with "
552 "I<udiag_ino> to specify an individual socket. It is ignored when querying "
553 "for a list of sockets, as well as when all its elements are set to -1."
554 msgstr ""
555
556 #. type: Plain text
557 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
558 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
559 msgid ""
560 "The response to a query for UNIX domain sockets is represented as an array of"
561 msgstr ""
562
563 #. type: Plain text
564 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
565 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
566 #, no-wrap
567 msgid ""
568 "struct unix_diag_msg {\n"
569 " __u8 udiag_family;\n"
570 " __u8 udiag_type;\n"
571 " __u8 udiag_state;\n"
572 " __u8 pad;\n"
573 " __u32 udiag_ino;\n"
574 " __u32 udiag_cookie[2];\n"
575 "};\n"
576 msgstr ""
577
578 #. type: Plain text
579 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
580 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
581 msgid "followed by netlink attributes."
582 msgstr ""
583
584 #. type: TP
585 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
586 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
587 #, no-wrap
588 msgid "I<udiag_family>"
589 msgstr ""
590
591 #. type: Plain text
592 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
593 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
594 msgid "This field has the same meaning as in I<struct unix_diag_req>."
595 msgstr ""
596
597 #. type: TP
598 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
599 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
600 #, no-wrap
601 msgid "I<udiag_type>"
602 msgstr ""
603
604 #. type: Plain text
605 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
606 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
607 msgid ""
608 "This is set to one of B<SOCK_PACKET>, B<SOCK_STREAM>, or B<SOCK_SEQPACKET>."
609 msgstr ""
610
611 #. type: TP
612 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
613 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
614 #, no-wrap
615 msgid "I<udiag_state>"
616 msgstr ""
617
618 #. type: Plain text
619 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
620 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
621 msgid "This is set to one of B<TCP_LISTEN> or B<TCP_ESTABLISHED>."
622 msgstr ""
623
624 #. type: Plain text
625 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
626 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
627 msgid "This field is set to 0."
628 msgstr ""
629
630 #. type: Plain text
631 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
632 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
633 msgid "This is the socket inode number."
634 msgstr ""
635
636 #. type: Plain text
637 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
638 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
639 msgid ""
640 "This is an array of opaque identifiers that could be used in subsequent "
641 "queries."
642 msgstr ""
643
644 #. type: SS
645 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
646 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
647 #, no-wrap
648 msgid "IPv4 and IPv6 sockets"
649 msgstr ""
650
651 #. type: Plain text
652 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
653 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
654 msgid ""
655 "For IPv4 and IPv6 sockets, the request is represented in the following "
656 "structure:"
657 msgstr ""
658
659 #. type: Plain text
660 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
661 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
662 #, no-wrap
663 msgid ""
664 "struct inet_diag_req_v2 {\n"
665 " __u8 sdiag_family;\n"
666 " __u8 sdiag_protocol;\n"
667 " __u8 idiag_ext;\n"
668 " __u8 pad;\n"
669 " __u32 idiag_states;\n"
670 " struct inet_diag_sockid id;\n"
671 "};\n"
672 msgstr ""
673
674 #. type: Plain text
675 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
676 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
677 msgid "where I<struct inet_diag_sockid> is defined as follows:"
678 msgstr ""
679
680 #. type: Plain text
681 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
682 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
683 #, no-wrap
684 msgid ""
685 "struct inet_diag_sockid {\n"
686 " __be16 idiag_sport;\n"
687 " __be16 idiag_dport;\n"
688 " __be32 idiag_src[4];\n"
689 " __be32 idiag_dst[4];\n"
690 " __u32 idiag_if;\n"
691 " __u32 idiag_cookie[2];\n"
692 "};\n"
693 msgstr ""
694
695 #. type: Plain text
696 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
697 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
698 msgid "The fields of I<struct inet_diag_req_v2> are as follows:"
699 msgstr ""
700
701 #. type: Plain text
702 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
703 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
704 msgid ""
705 "This should be set to either B<AF_INET> or B<AF_INET6> for IPv4 or IPv6 "
706 "sockets respectively."
707 msgstr ""
708
709 #. type: Plain text
710 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
711 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
712 msgid ""
713 "This should be set to one of B<IPPROTO_TCP>, B<IPPROTO_UDP>, or "
714 "B<IPPROTO_UDPLITE>."
715 msgstr ""
716
717 #. type: TP
718 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
719 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
720 #, no-wrap
721 msgid "I<idiag_ext>"
722 msgstr ""
723
724 #. type: Plain text
725 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
726 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
727 msgid ""
728 "This is a set of flags defining what kind of extended information to "
729 "report. Each requested kind of information is reported back as a netlink "
730 "attribute as described below:"
731 msgstr ""
732
733 #. type: TP
734 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
735 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
736 #, no-wrap
737 msgid "B<INET_DIAG_TOS>"
738 msgstr ""
739
740 #. type: Plain text
741 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
742 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
743 msgid ""
744 "The payload associated with this attribute is a __u8 value which is the TOS "
745 "of the socket."
746 msgstr ""
747
748 #. type: TP
749 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
750 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
751 #, no-wrap
752 msgid "B<INET_DIAG_TCLASS>"
753 msgstr ""
754
755 #. type: Plain text
756 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
757 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
758 msgid ""
759 "The payload associated with this attribute is a __u8 value which is the "
760 "TClass of the socket. IPv6 sockets only. For LISTEN and CLOSE sockets, "
761 "this is followed by B<INET_DIAG_SKV6ONLY> attribute with associated __u8 "
762 "payload value meaning whether the socket is IPv6-only or not."
763 msgstr ""
764
765 #. type: TP
766 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
767 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
768 #, no-wrap
769 msgid "B<INET_DIAG_MEMINFO>"
770 msgstr ""
771
772 #. type: Plain text
773 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
774 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
775 msgid ""
776 "The payload associated with this attribute is represented in the following "
777 "structure:"
778 msgstr ""
779
780 #. type: Plain text
781 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
782 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
783 #, no-wrap
784 msgid ""
785 "struct inet_diag_meminfo {\n"
786 " __u32 idiag_rmem;\n"
787 " __u32 idiag_wmem;\n"
788 " __u32 idiag_fmem;\n"
789 " __u32 idiag_tmem;\n"
790 "};\n"
791 msgstr ""
792
793 #. type: TP
794 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
795 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
796 #, no-wrap
797 msgid "I<idiag_rmem>"
798 msgstr ""
799
800 #. type: Plain text
801 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
802 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
803 msgid "The amount of data in the receive queue."
804 msgstr ""
805
806 #. type: TP
807 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
808 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
809 #, no-wrap
810 msgid "I<idiag_wmem>"
811 msgstr ""
812
813 #. type: Plain text
814 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
815 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
816 msgid "The amount of data that is queued by TCP but not yet sent."
817 msgstr ""
818
819 #. type: TP
820 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
821 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
822 #, no-wrap
823 msgid "I<idiag_fmem>"
824 msgstr ""
825
826 #. type: Plain text
827 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
828 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
829 msgid "The amount of memory scheduled for future use (TCP only)."
830 msgstr ""
831
832 #. type: TP
833 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
834 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
835 #, no-wrap
836 msgid "I<idiag_tmem>"
837 msgstr ""
838
839 #. type: Plain text
840 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
841 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
842 msgid "The amount of data in send queue."
843 msgstr ""
844
845 #. type: TP
846 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
847 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
848 #, no-wrap
849 msgid "B<INET_DIAG_SKMEMINFO>"
850 msgstr ""
851
852 #. type: Plain text
853 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
854 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
855 msgid ""
856 "The payload associated with this attribute is an array of __u32 values "
857 "described below in the subsection \"Socket memory information\"."
858 msgstr ""
859
860 #. type: TP
861 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
862 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
863 #, no-wrap
864 msgid "B<INET_DIAG_INFO>"
865 msgstr ""
866
867 #. type: Plain text
868 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
869 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
870 msgid ""
871 "The payload associated with this attribute is specific to the address "
872 "family. For TCP sockets, it is an object of type I<struct tcp_info>."
873 msgstr ""
874
875 #. type: TP
876 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
877 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
878 #, no-wrap
879 msgid "B<INET_DIAG_CONG>"
880 msgstr ""
881
882 #. type: Plain text
883 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
884 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
885 msgid ""
886 "The payload associated with this attribute is a string that describes the "
887 "congestion control algorithm used. For TCP sockets only."
888 msgstr ""
889
890 #. type: Plain text
891 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
892 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
893 msgid "This should be set to 0."
894 msgstr ""
895
896 #. type: TP
897 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
898 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
899 #, no-wrap
900 msgid "I<idiag_states>"
901 msgstr ""
902
903 #. type: Plain text
904 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
905 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
906 msgid ""
907 "This is a bit mask that defines a filter of socket states. Only those "
908 "sockets whose states are in this mask will be reported. Ignored when "
909 "querying for an individual socket."
910 msgstr ""
911
912 #. type: TP
913 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
914 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
915 #, no-wrap
916 msgid "I<id>"
917 msgstr ""
918
919 #. type: Plain text
920 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
921 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
922 msgid ""
923 "This is a socket ID object that is used in dump requests, in queries about "
924 "individual sockets, and is reported back in each response. Unlike UNIX "
925 "domain sockets, IPv4 and IPv6 sockets are identified using addresses and "
926 "ports. All values are in network byte order."
927 msgstr ""
928
929 #. type: Plain text
930 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
931 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
932 msgid "The fields of I<struct inet_diag_sockid> are as follows:"
933 msgstr ""
934
935 #. type: TP
936 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
937 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
938 #, no-wrap
939 msgid "I<idiag_sport>"
940 msgstr ""
941
942 #. type: Plain text
943 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
944 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
945 msgid "The source port."
946 msgstr ""
947
948 #. type: TP
949 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
950 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
951 #, no-wrap
952 msgid "I<idiag_dport>"
953 msgstr ""
954
955 #. type: Plain text
956 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
957 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
958 msgid "The destination port."
959 msgstr ""
960
961 #. type: TP
962 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
963 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
964 #, no-wrap
965 msgid "I<idiag_src>"
966 msgstr ""
967
968 #. type: Plain text
969 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
970 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
971 msgid "The source address."
972 msgstr ""
973
974 #. type: TP
975 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
976 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
977 #, no-wrap
978 msgid "I<idiag_dst>"
979 msgstr ""
980
981 #. type: Plain text
982 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
983 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
984 msgid "The destination address."
985 msgstr ""
986
987 #. type: TP
988 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
989 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
990 #, no-wrap
991 msgid "I<idiag_if>"
992 msgstr ""
993
994 #. type: Plain text
995 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
996 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
997 msgid "The interface number the socket is bound to."
998 msgstr ""
999
1000 #. type: TP
1001 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1002 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1003 #, no-wrap
1004 msgid "I<idiag_cookie>"
1005 msgstr ""
1006
1007 #. type: Plain text
1008 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1009 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1010 msgid ""
1011 "This is an array of opaque identifiers that could be used along with other "
1012 "fields of this structure to specify an individual socket. It is ignored "
1013 "when querying for a list of sockets, as well as when all its elements are "
1014 "set to -1."
1015 msgstr ""
1016
1017 #. type: Plain text
1018 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1019 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1020 msgid ""
1021 "The response to a query for IPv4 or IPv6 sockets is represented as an array "
1022 "of"
1023 msgstr ""
1024
1025 #. type: Plain text
1026 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1027 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1028 #, no-wrap
1029 msgid ""
1030 "struct inet_diag_msg {\n"
1031 " __u8 idiag_family;\n"
1032 " __u8 idiag_state;\n"
1033 " __u8 idiag_timer;\n"
1034 " __u8 idiag_retrans;\n"
1035 "\\&\n"
1036 " struct inet_diag_sockid id;\n"
1037 "\\&\n"
1038 " __u32 idiag_expires;\n"
1039 " __u32 idiag_rqueue;\n"
1040 " __u32 idiag_wqueue;\n"
1041 " __u32 idiag_uid;\n"
1042 " __u32 idiag_inode;\n"
1043 "};\n"
1044 msgstr ""
1045
1046 #. type: TP
1047 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1048 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1049 #, no-wrap
1050 msgid "I<idiag_family>"
1051 msgstr ""
1052
1053 #. type: Plain text
1054 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1055 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1056 msgid "This is the same field as in I<struct inet_diag_req_v2>."
1057 msgstr ""
1058
1059 #. type: TP
1060 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1061 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1062 #, no-wrap
1063 msgid "I<idiag_state>"
1064 msgstr ""
1065
1066 #. type: Plain text
1067 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1068 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1069 msgid "This denotes socket state as in I<struct inet_diag_req_v2>."
1070 msgstr ""
1071
1072 #. type: TP
1073 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1074 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1075 #, no-wrap
1076 msgid "I<idiag_timer>"
1077 msgstr ""
1078
1079 #. type: Plain text
1080 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1081 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1082 msgid ""
1083 "For TCP sockets, this field describes the type of timer that is currently "
1084 "active for the socket. It is set to one of the following constants:"
1085 msgstr ""
1086
1087 #. type: TP
1088 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1089 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1090 #, no-wrap
1091 msgid "B<0>"
1092 msgstr ""
1093
1094 #. type: Plain text
1095 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1096 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1097 msgid "no timer is active"
1098 msgstr ""
1099
1100 #. type: TP
1101 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1102 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1103 #, no-wrap
1104 msgid "B<1>"
1105 msgstr ""
1106
1107 #. type: Plain text
1108 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1109 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1110 msgid "a retransmit timer"
1111 msgstr ""
1112
1113 #. type: TP
1114 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1115 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1116 #, no-wrap
1117 msgid "B<2>"
1118 msgstr ""
1119
1120 #. type: Plain text
1121 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1122 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1123 msgid "a keep-alive timer"
1124 msgstr ""
1125
1126 #. type: TP
1127 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1128 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1129 #, no-wrap
1130 msgid "B<3>"
1131 msgstr ""
1132
1133 #. type: Plain text
1134 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1135 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1136 msgid "a TIME_WAIT timer"
1137 msgstr ""
1138
1139 #. type: TP
1140 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1141 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1142 #, no-wrap
1143 msgid "B<4>"
1144 msgstr ""
1145
1146 #. type: Plain text
1147 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1148 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1149 msgid "a zero window probe timer"
1150 msgstr ""
1151
1152 #. type: Plain text
1153 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1154 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1155 msgid "For non-TCP sockets, this field is set to 0."
1156 msgstr ""
1157
1158 #. type: TP
1159 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1160 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1161 #, no-wrap
1162 msgid "I<idiag_retrans>"
1163 msgstr ""
1164
1165 #. type: Plain text
1166 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1167 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1168 msgid ""
1169 "For I<idiag_timer> values 1, 2, and 4, this field contains the number of "
1170 "retransmits. For other I<idiag_timer> values, this field is set to 0."
1171 msgstr ""
1172
1173 #. type: TP
1174 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1175 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1176 #, no-wrap
1177 msgid "I<idiag_expires>"
1178 msgstr ""
1179
1180 #. type: Plain text
1181 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1182 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1183 msgid ""
1184 "For TCP sockets that have an active timer, this field describes its "
1185 "expiration time in milliseconds. For other sockets, this field is set to 0."
1186 msgstr ""
1187
1188 #. type: TP
1189 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1190 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1191 #, no-wrap
1192 msgid "I<idiag_rqueue>"
1193 msgstr ""
1194
1195 #. type: Plain text
1196 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1197 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1198 msgid "For listening sockets: the number of pending connections."
1199 msgstr ""
1200
1201 #. type: Plain text
1202 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1203 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1204 msgid "For other sockets: the amount of data in the incoming queue."
1205 msgstr ""
1206
1207 #. type: TP
1208 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1209 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1210 #, no-wrap
1211 msgid "I<idiag_wqueue>"
1212 msgstr ""
1213
1214 #. type: Plain text
1215 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
1216 #: opensuse-leap-16-1 opensuse-tumbleweed
1217 msgid "For listening sockets: the backlog size."
1218 msgstr ""
1219
1220 #. type: Plain text
1221 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1222 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1223 msgid "For other sockets: the amount of memory available for sending."
1224 msgstr ""
1225
1226 #. type: TP
1227 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1228 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1229 #, no-wrap
1230 msgid "I<idiag_uid>"
1231 msgstr ""
1232
1233 #. type: Plain text
1234 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1235 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1236 msgid "This is the socket owner UID."
1237 msgstr ""
1238
1239 #. type: TP
1240 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1241 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1242 #, no-wrap
1243 msgid "I<idiag_inode>"
1244 msgstr ""
1245
1246 #. type: SS
1247 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1248 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1249 #, no-wrap
1250 msgid "Socket memory information"
1251 msgstr ""
1252
1253 #. type: Plain text
1254 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1255 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1256 msgid ""
1257 "The payload associated with B<UNIX_DIAG_MEMINFO> and B<INET_DIAG_SKMEMINFO> "
1258 "netlink attributes is an array of the following __u32 values:"
1259 msgstr ""
1260
1261 #. type: TP
1262 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1263 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1264 #, no-wrap
1265 msgid "B<SK_MEMINFO_RMEM_ALLOC>"
1266 msgstr ""
1267
1268 #. type: Plain text
1269 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1270 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1271 msgid "The amount of data in receive queue."
1272 msgstr ""
1273
1274 #. type: TP
1275 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1276 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1277 #, no-wrap
1278 msgid "B<SK_MEMINFO_RCVBUF>"
1279 msgstr ""
1280
1281 #. type: Plain text
1282 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1283 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1284 msgid "The receive socket buffer as set by B<SO_RCVBUF>."
1285 msgstr ""
1286
1287 #. type: TP
1288 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1289 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1290 #, no-wrap
1291 msgid "B<SK_MEMINFO_WMEM_ALLOC>"
1292 msgstr ""
1293
1294 #. type: TP
1295 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1296 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1297 #, no-wrap
1298 msgid "B<SK_MEMINFO_SNDBUF>"
1299 msgstr ""
1300
1301 #. type: Plain text
1302 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1303 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1304 msgid "The send socket buffer as set by B<SO_SNDBUF>."
1305 msgstr ""
1306
1307 #. type: TP
1308 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1309 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1310 #, no-wrap
1311 msgid "B<SK_MEMINFO_FWD_ALLOC>"
1312 msgstr ""
1313
1314 #. type: TP
1315 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1316 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1317 #, no-wrap
1318 msgid "B<SK_MEMINFO_WMEM_QUEUED>"
1319 msgstr ""
1320
1321 #. type: Plain text
1322 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1323 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1324 msgid "The amount of data queued by TCP, but not yet sent."
1325 msgstr ""
1326
1327 #. type: TP
1328 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1329 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1330 #, no-wrap
1331 msgid "B<SK_MEMINFO_OPTMEM>"
1332 msgstr ""
1333
1334 #. type: Plain text
1335 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1336 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1337 msgid ""
1338 "The amount of memory allocated for the socket's service needs (e.g., socket "
1339 "filter)."
1340 msgstr ""
1341
1342 #. type: TP
1343 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1344 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1345 #, no-wrap
1346 msgid "B<SK_MEMINFO_BACKLOG>"
1347 msgstr ""
1348
1349 #. type: Plain text
1350 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1351 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1352 msgid "The amount of packets in the backlog (not yet processed)."
1353 msgstr ""
1354
1355 #. type: SH
1356 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1357 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1358 #, no-wrap
1359 msgid "VERSIONS"
1360 msgstr ""
1361
1362 #. type: Plain text
1363 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1364 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1365 msgid ""
1366 "B<NETLINK_INET_DIAG> was introduced in Linux 2.6.14 and supported B<AF_INET> "
1367 "and B<AF_INET6> sockets only. In Linux 3.3, it was renamed to "
1368 "B<NETLINK_SOCK_DIAG> and extended to support B<AF_UNIX> sockets."
1369 msgstr ""
1370
1371 #. type: Plain text
1372 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1373 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1374 msgid ""
1375 "B<UNIX_DIAG_MEMINFO> and B<INET_DIAG_SKMEMINFO> were introduced in Linux 3.6."
1376 msgstr ""
1377
1378 #. type: SH
1379 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1380 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1381 #, no-wrap
1382 msgid "STANDARDS"
1383 msgstr ""
1384
1385 #. type: Plain text
1386 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1387 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1388 msgid "Linux."
1389 msgstr ""
1390
1391 #. type: SH
1392 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1393 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1394 #, no-wrap
1395 msgid "EXAMPLES"
1396 msgstr ""
1397
1398 #. type: Plain text
1399 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1400 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1401 msgid ""
1402 "The following example program prints inode number, peer's inode number, and "
1403 "name of all UNIX domain sockets in the current namespace."
1404 msgstr ""
1405
1406 #. type: Plain text
1407 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
1408 #: opensuse-leap-16-1 opensuse-tumbleweed
1409 #, no-wrap
1410 msgid ""
1411 "#include E<lt>errno.hE<gt>\n"
1412 "#include E<lt>stdio.hE<gt>\n"
1413 "#include E<lt>string.hE<gt>\n"
1414 "#include E<lt>unistd.hE<gt>\n"
1415 "#include E<lt>sys/socket.hE<gt>\n"
1416 "#include E<lt>sys/un.hE<gt>\n"
1417 "#include E<lt>linux/netlink.hE<gt>\n"
1418 "#include E<lt>linux/rtnetlink.hE<gt>\n"
1419 "#include E<lt>linux/sock_diag.hE<gt>\n"
1420 "#include E<lt>linux/unix_diag.hE<gt>\n"
1421 "\\&\n"
1422 "static int\n"
1423 "send_query(int fd)\n"
1424 "{\n"
1425 " struct sockaddr_nl nladdr = {\n"
1426 " .nl_family = AF_NETLINK\n"
1427 " };\n"
1428 " struct\n"
1429 " {\n"
1430 " struct nlmsghdr nlh;\n"
1431 " struct unix_diag_req udr;\n"
1432 " } req = {\n"
1433 " .nlh = {\n"
1434 " .nlmsg_len = sizeof(req),\n"
1435 " .nlmsg_type = SOCK_DIAG_BY_FAMILY,\n"
1436 " .nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP\n"
1437 " },\n"
1438 " .udr = {\n"
1439 " .sdiag_family = AF_UNIX,\n"
1440 " .udiag_states = -1,\n"
1441 " .udiag_show = UDIAG_SHOW_NAME | UDIAG_SHOW_PEER\n"
1442 " }\n"
1443 " };\n"
1444 " struct iovec iov = {\n"
1445 " .iov_base = &req,\n"
1446 " .iov_len = sizeof(req)\n"
1447 " };\n"
1448 " struct msghdr msg = {\n"
1449 " .msg_name = &nladdr,\n"
1450 " .msg_namelen = sizeof(nladdr),\n"
1451 " .msg_iov = &iov,\n"
1452 " .msg_iovlen = 1\n"
1453 " };\n"
1454 "\\&\n"
1455 " for (;;) {\n"
1456 " if (sendmsg(fd, &msg, 0) E<lt> 0) {\n"
1457 " if (errno == EINTR)\n"
1458 " continue;\n"
1459 "\\&\n"
1460 " perror(\"sendmsg\");\n"
1461 " return -1;\n"
1462 " }\n"
1463 "\\&\n"
1464 " return 0;\n"
1465 " }\n"
1466 "}\n"
1467 "\\&\n"
1468 "static int\n"
1469 "print_diag(const struct unix_diag_msg *diag, unsigned int size)\n"
1470 "{\n"
1471 " if (size E<lt> NLMSG_LENGTH(sizeof(*diag))) {\n"
1472 " fputs(\"short response\\[rs]n\", stderr);\n"
1473 " return -1;\n"
1474 " }\n"
1475 " if (diag-E<gt>udiag_family != AF_UNIX) {\n"
1476 " fprintf(stderr, \"unexpected family %u\\[rs]n\", diag-E<gt>udiag_family);\n"
1477 " return -1;\n"
1478 " }\n"
1479 "\\&\n"
1480 " unsigned int rta_len = size - NLMSG_LENGTH(sizeof(*diag));\n"
1481 " unsigned int peer = 0;\n"
1482 " size_t path_len = 0;\n"
1483 " char path[sizeof(((struct sockaddr_un *) 0)-E<gt>sun_path) + 1];\n"
1484 "\\&\n"
1485 " for (struct rtattr *attr = (struct rtattr *) (diag + 1);\n"
1486 " RTA_OK(attr, rta_len); attr = RTA_NEXT(attr, rta_len)) {\n"
1487 " switch (attr-E<gt>rta_type) {\n"
1488 " case UNIX_DIAG_NAME:\n"
1489 " if (!path_len) {\n"
1490 " path_len = RTA_PAYLOAD(attr);\n"
1491 " if (path_len E<gt> sizeof(path) - 1)\n"
1492 " path_len = sizeof(path) - 1;\n"
1493 " memcpy(path, RTA_DATA(attr), path_len);\n"
1494 " path[path_len] = \\[aq]\\[rs]0\\[aq];\n"
1495 " }\n"
1496 " break;\n"
1497 "\\&\n"
1498 " case UNIX_DIAG_PEER:\n"
1499 " if (RTA_PAYLOAD(attr) E<gt>= sizeof(peer))\n"
1500 " peer = *(unsigned int *) RTA_DATA(attr);\n"
1501 " break;\n"
1502 " }\n"
1503 " }\n"
1504 "\\&\n"
1505 " printf(\"inode=%u\", diag-E<gt>udiag_ino);\n"
1506 "\\&\n"
1507 " if (peer)\n"
1508 " printf(\", peer=%u\", peer);\n"
1509 "\\&\n"
1510 " if (path_len)\n"
1511 " printf(\", name=%s%s\", *path ? \"\" : \"@\",\n"
1512 " *path ? path : path + 1);\n"
1513 "\\&\n"
1514 " putchar(\\[aq]\\[rs]n\\[aq]);\n"
1515 " return 0;\n"
1516 "}\n"
1517 "\\&\n"
1518 "static int\n"
1519 "receive_responses(int fd)\n"
1520 "{\n"
1521 " long buf[8192 / sizeof(long)];\n"
1522 " struct sockaddr_nl nladdr;\n"
1523 " struct iovec iov = {\n"
1524 " .iov_base = buf,\n"
1525 " .iov_len = sizeof(buf)\n"
1526 " };\n"
1527 " int flags = 0;\n"
1528 "\\&\n"
1529 " for (;;) {\n"
1530 " struct msghdr msg = {\n"
1531 " .msg_name = &nladdr,\n"
1532 " .msg_namelen = sizeof(nladdr),\n"
1533 " .msg_iov = &iov,\n"
1534 " .msg_iovlen = 1\n"
1535 " };\n"
1536 "\\&\n"
1537 " ssize_t ret = recvmsg(fd, &msg, flags);\n"
1538 "\\&\n"
1539 " if (ret E<lt> 0) {\n"
1540 " if (errno == EINTR)\n"
1541 " continue;\n"
1542 "\\&\n"
1543 " perror(\"recvmsg\");\n"
1544 " return -1;\n"
1545 " }\n"
1546 " if (ret == 0)\n"
1547 " return 0;\n"
1548 "\\&\n"
1549 " if (nladdr.nl_family != AF_NETLINK) {\n"
1550 " fputs(\"!AF_NETLINK\\[rs]n\", stderr);\n"
1551 " return -1;\n"
1552 " }\n"
1553 "\\&\n"
1554 " const struct nlmsghdr *h = (struct nlmsghdr *) buf;\n"
1555 "\\&\n"
1556 " if (!NLMSG_OK(h, ret)) {\n"
1557 " fputs(\"!NLMSG_OK\\[rs]n\", stderr);\n"
1558 " return -1;\n"
1559 " }\n"
1560 "\\&\n"
1561 " for (; NLMSG_OK(h, ret); h = NLMSG_NEXT(h, ret)) {\n"
1562 " if (h-E<gt>nlmsg_type == NLMSG_DONE)\n"
1563 " return 0;\n"
1564 "\\&\n"
1565 " if (h-E<gt>nlmsg_type == NLMSG_ERROR) {\n"
1566 " const struct nlmsgerr *err = NLMSG_DATA(h);\n"
1567 "\\&\n"
1568 " if (h-E<gt>nlmsg_len E<lt> NLMSG_LENGTH(sizeof(*err))) {\n"
1569 " fputs(\"NLMSG_ERROR\\[rs]n\", stderr);\n"
1570 " } else {\n"
1571 " errno = -err-E<gt>error;\n"
1572 " perror(\"NLMSG_ERROR\");\n"
1573 " }\n"
1574 "\\&\n"
1575 " return -1;\n"
1576 " }\n"
1577 "\\&\n"
1578 " if (h-E<gt>nlmsg_type != SOCK_DIAG_BY_FAMILY) {\n"
1579 " fprintf(stderr, \"unexpected nlmsg_type %u\\[rs]n\",\n"
1580 " (unsigned) h-E<gt>nlmsg_type);\n"
1581 " return -1;\n"
1582 " }\n"
1583 "\\&\n"
1584 " if (print_diag(NLMSG_DATA(h), h-E<gt>nlmsg_len))\n"
1585 " return -1;\n"
1586 " }\n"
1587 " }\n"
1588 "}\n"
1589 "\\&\n"
1590 "int\n"
1591 "main(void)\n"
1592 "{\n"
1593 " int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG);\n"
1594 "\\&\n"
1595 " if (fd E<lt> 0) {\n"
1596 " perror(\"socket\");\n"
1597 " return 1;\n"
1598 " }\n"
1599 "\\&\n"
1600 " int ret = send_query(fd) || receive_responses(fd);\n"
1601 "\\&\n"
1602 " close(fd);\n"
1603 " return ret;\n"
1604 "}\n"
1605 msgstr ""
1606
1607 #. type: SH
1608 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1609 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1610 #, no-wrap
1611 msgid "SEE ALSO"
1612 msgstr ""
1613
1614 #. type: Plain text
1615 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1616 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1617 msgid "B<netlink>(3), B<rtnetlink>(3), B<netlink>(7), B<tcp>(7)"
1618 msgstr ""
1619
1620 #. type: TH
1621 #: debian-trixie
1622 #, no-wrap
1623 msgid "2024-06-15"
1624 msgstr ""
1625
1626 #. type: TH
1627 #: debian-trixie
1628 #, no-wrap
1629 msgid "Linux man-pages 6.9.1"
1630 msgstr ""
1631
1632 #. type: Plain text
1633 #: debian-trixie
1634 msgid ""
1635 "The attribute reported in answer to this request is B<UNIX_DIAG_NAME>. The "
1636 "payload associated with this attribute is the pathname to which the socket "
1637 "was bound (a sequence of bytes up to B<UNIX_PATH_MAX> length)."
1638 msgstr ""
1639
1640 #. type: Plain text
1641 #: debian-trixie
1642 msgid ""
1643 "For listening sockets: the number of pending connections. The length of the "
1644 "array associated with the B<UNIX_DIAG_ICONS> response attribute is equal to "
1645 "this value."
1646 msgstr ""
1647
1648 #. type: Plain text
1649 #: debian-trixie
1650 msgid ""
1651 "For listening sockets: the backlog length which equals to the value passed "
1652 "as the second argument to B<listen>(2)."
1653 msgstr ""
1654
1655 #. type: Plain text
1656 #: debian-trixie
1657 msgid "For listening sockets: the backlog length."
1658 msgstr ""
1659
1660 #. type: Plain text
1661 #: debian-trixie
1662 #, no-wrap
1663 msgid ""
1664 "#include E<lt>errno.hE<gt>\n"
1665 "#include E<lt>stdio.hE<gt>\n"
1666 "#include E<lt>string.hE<gt>\n"
1667 "#include E<lt>unistd.hE<gt>\n"
1668 "#include E<lt>sys/socket.hE<gt>\n"
1669 "#include E<lt>sys/un.hE<gt>\n"
1670 "#include E<lt>linux/netlink.hE<gt>\n"
1671 "#include E<lt>linux/rtnetlink.hE<gt>\n"
1672 "#include E<lt>linux/sock_diag.hE<gt>\n"
1673 "#include E<lt>linux/unix_diag.hE<gt>\n"
1674 "\\&\n"
1675 "static int\n"
1676 "send_query(int fd)\n"
1677 "{\n"
1678 " struct sockaddr_nl nladdr = {\n"
1679 " .nl_family = AF_NETLINK\n"
1680 " };\n"
1681 " struct\n"
1682 " {\n"
1683 " struct nlmsghdr nlh;\n"
1684 " struct unix_diag_req udr;\n"
1685 " } req = {\n"
1686 " .nlh = {\n"
1687 " .nlmsg_len = sizeof(req),\n"
1688 " .nlmsg_type = SOCK_DIAG_BY_FAMILY,\n"
1689 " .nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP\n"
1690 " },\n"
1691 " .udr = {\n"
1692 " .sdiag_family = AF_UNIX,\n"
1693 " .udiag_states = -1,\n"
1694 " .udiag_show = UDIAG_SHOW_NAME | UDIAG_SHOW_PEER\n"
1695 " }\n"
1696 " };\n"
1697 " struct iovec iov = {\n"
1698 " .iov_base = &req,\n"
1699 " .iov_len = sizeof(req)\n"
1700 " };\n"
1701 " struct msghdr msg = {\n"
1702 " .msg_name = &nladdr,\n"
1703 " .msg_namelen = sizeof(nladdr),\n"
1704 " .msg_iov = &iov,\n"
1705 " .msg_iovlen = 1\n"
1706 " };\n"
1707 "\\&\n"
1708 " for (;;) {\n"
1709 " if (sendmsg(fd, &msg, 0) E<lt> 0) {\n"
1710 " if (errno == EINTR)\n"
1711 " continue;\n"
1712 "\\&\n"
1713 " perror(\"sendmsg\");\n"
1714 " return -1;\n"
1715 " }\n"
1716 "\\&\n"
1717 " return 0;\n"
1718 " }\n"
1719 "}\n"
1720 "\\&\n"
1721 "static int\n"
1722 "print_diag(const struct unix_diag_msg *diag, unsigned int len)\n"
1723 "{\n"
1724 " if (len E<lt> NLMSG_LENGTH(sizeof(*diag))) {\n"
1725 " fputs(\"short response\\[rs]n\", stderr);\n"
1726 " return -1;\n"
1727 " }\n"
1728 " if (diag-E<gt>udiag_family != AF_UNIX) {\n"
1729 " fprintf(stderr, \"unexpected family %u\\[rs]n\", diag-E<gt>udiag_family);\n"
1730 " return -1;\n"
1731 " }\n"
1732 "\\&\n"
1733 " unsigned int rta_len = len - NLMSG_LENGTH(sizeof(*diag));\n"
1734 " unsigned int peer = 0;\n"
1735 " size_t path_len = 0;\n"
1736 " char path[sizeof(((struct sockaddr_un *) 0)-E<gt>sun_path) + 1];\n"
1737 "\\&\n"
1738 " for (struct rtattr *attr = (struct rtattr *) (diag + 1);\n"
1739 " RTA_OK(attr, rta_len); attr = RTA_NEXT(attr, rta_len)) {\n"
1740 " switch (attr-E<gt>rta_type) {\n"
1741 " case UNIX_DIAG_NAME:\n"
1742 " if (!path_len) {\n"
1743 " path_len = RTA_PAYLOAD(attr);\n"
1744 " if (path_len E<gt> sizeof(path) - 1)\n"
1745 " path_len = sizeof(path) - 1;\n"
1746 " memcpy(path, RTA_DATA(attr), path_len);\n"
1747 " path[path_len] = \\[aq]\\[rs]0\\[aq];\n"
1748 " }\n"
1749 " break;\n"
1750 "\\&\n"
1751 " case UNIX_DIAG_PEER:\n"
1752 " if (RTA_PAYLOAD(attr) E<gt>= sizeof(peer))\n"
1753 " peer = *(unsigned int *) RTA_DATA(attr);\n"
1754 " break;\n"
1755 " }\n"
1756 " }\n"
1757 "\\&\n"
1758 " printf(\"inode=%u\", diag-E<gt>udiag_ino);\n"
1759 "\\&\n"
1760 " if (peer)\n"
1761 " printf(\", peer=%u\", peer);\n"
1762 "\\&\n"
1763 " if (path_len)\n"
1764 " printf(\", name=%s%s\", *path ? \"\" : \"@\",\n"
1765 " *path ? path : path + 1);\n"
1766 "\\&\n"
1767 " putchar(\\[aq]\\[rs]n\\[aq]);\n"
1768 " return 0;\n"
1769 "}\n"
1770 "\\&\n"
1771 "static int\n"
1772 "receive_responses(int fd)\n"
1773 "{\n"
1774 " long buf[8192 / sizeof(long)];\n"
1775 " struct sockaddr_nl nladdr;\n"
1776 " struct iovec iov = {\n"
1777 " .iov_base = buf,\n"
1778 " .iov_len = sizeof(buf)\n"
1779 " };\n"
1780 " int flags = 0;\n"
1781 "\\&\n"
1782 " for (;;) {\n"
1783 " struct msghdr msg = {\n"
1784 " .msg_name = &nladdr,\n"
1785 " .msg_namelen = sizeof(nladdr),\n"
1786 " .msg_iov = &iov,\n"
1787 " .msg_iovlen = 1\n"
1788 " };\n"
1789 "\\&\n"
1790 " ssize_t ret = recvmsg(fd, &msg, flags);\n"
1791 "\\&\n"
1792 " if (ret E<lt> 0) {\n"
1793 " if (errno == EINTR)\n"
1794 " continue;\n"
1795 "\\&\n"
1796 " perror(\"recvmsg\");\n"
1797 " return -1;\n"
1798 " }\n"
1799 " if (ret == 0)\n"
1800 " return 0;\n"
1801 "\\&\n"
1802 " if (nladdr.nl_family != AF_NETLINK) {\n"
1803 " fputs(\"!AF_NETLINK\\[rs]n\", stderr);\n"
1804 " return -1;\n"
1805 " }\n"
1806 "\\&\n"
1807 " const struct nlmsghdr *h = (struct nlmsghdr *) buf;\n"
1808 "\\&\n"
1809 " if (!NLMSG_OK(h, ret)) {\n"
1810 " fputs(\"!NLMSG_OK\\[rs]n\", stderr);\n"
1811 " return -1;\n"
1812 " }\n"
1813 "\\&\n"
1814 " for (; NLMSG_OK(h, ret); h = NLMSG_NEXT(h, ret)) {\n"
1815 " if (h-E<gt>nlmsg_type == NLMSG_DONE)\n"
1816 " return 0;\n"
1817 "\\&\n"
1818 " if (h-E<gt>nlmsg_type == NLMSG_ERROR) {\n"
1819 " const struct nlmsgerr *err = NLMSG_DATA(h);\n"
1820 "\\&\n"
1821 " if (h-E<gt>nlmsg_len E<lt> NLMSG_LENGTH(sizeof(*err))) {\n"
1822 " fputs(\"NLMSG_ERROR\\[rs]n\", stderr);\n"
1823 " } else {\n"
1824 " errno = -err-E<gt>error;\n"
1825 " perror(\"NLMSG_ERROR\");\n"
1826 " }\n"
1827 "\\&\n"
1828 " return -1;\n"
1829 " }\n"
1830 "\\&\n"
1831 " if (h-E<gt>nlmsg_type != SOCK_DIAG_BY_FAMILY) {\n"
1832 " fprintf(stderr, \"unexpected nlmsg_type %u\\[rs]n\",\n"
1833 " (unsigned) h-E<gt>nlmsg_type);\n"
1834 " return -1;\n"
1835 " }\n"
1836 "\\&\n"
1837 " if (print_diag(NLMSG_DATA(h), h-E<gt>nlmsg_len))\n"
1838 " return -1;\n"
1839 " }\n"
1840 " }\n"
1841 "}\n"
1842 "\\&\n"
1843 "int\n"
1844 "main(void)\n"
1845 "{\n"
1846 " int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG);\n"
1847 "\\&\n"
1848 " if (fd E<lt> 0) {\n"
1849 " perror(\"socket\");\n"
1850 " return 1;\n"
1851 " }\n"
1852 "\\&\n"
1853 " int ret = send_query(fd) || receive_responses(fd);\n"
1854 "\\&\n"
1855 " close(fd);\n"
1856 " return ret;\n"
1857 "}\n"
1858 msgstr ""
1859
1860 #. type: TH
1861 #: fedora-44 fedora-rawhide
1862 #, no-wrap
1863 msgid "2024-11-17"
1864 msgstr ""
1865
1866 #. type: TH
1867 #: fedora-44 fedora-rawhide
1868 #, no-wrap
1869 msgid "Linux man-pages 6.13"
1870 msgstr ""
1871
1872 #. type: TH
1873 #: mageia-cauldron
1874 #, no-wrap
1875 msgid "Linux man-pages 6.17"
1876 msgstr ""
1877
1878 #. type: TH
1879 #: opensuse-leap-16-1 opensuse-tumbleweed
1880 #, no-wrap
1881 msgid "Linux man-pages (unreleased)"
1882 msgstr ""