Debian Codegraph @

templates/man7/packet.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:33+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 "packet"
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 "packet - packet interface on device level"
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/if_packet.hE<gt>>\n"
66 "B<#include E<lt>net/ethernet.hE<gt> /* the L2 protocols */>\n"
67 msgstr ""
68
69 #. type: Plain text
70 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
71 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
72 #, no-wrap
73 msgid "B<packet_socket = socket(AF_PACKET, int >I<socket_type>B<, int >I<protocol>B<);>\n"
74 msgstr ""
75
76 #. type: SH
77 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
78 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
79 #, no-wrap
80 msgid "DESCRIPTION"
81 msgstr ""
82
83 #. type: Plain text
84 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
85 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
86 msgid ""
87 "Packet sockets are used to receive or send raw packets at the device driver "
88 "(OSI Layer 2) level. They allow the user to implement protocol modules in "
89 "user space on top of the physical layer."
90 msgstr ""
91
92 #. type: Plain text
93 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
94 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
95 msgid ""
96 "The I<socket_type> is either B<SOCK_RAW> for raw packets including the link-"
97 "level header or B<SOCK_DGRAM> for cooked packets with the link-level header "
98 "removed. The link-level header information is available in a common format "
99 "in a I<sockaddr_ll> structure. I<protocol> is the IEEE 802.3 protocol "
100 "number in network byte order. See the I<E<lt>linux/if_ether.hE<gt>> include "
101 "file for a list of allowed protocols. When protocol is set to "
102 "B<htons(ETH_P_ALL)>, then all protocols are received. All incoming packets "
103 "of that protocol type will be passed to the packet socket before they are "
104 "passed to the protocols implemented in the kernel. If I<protocol> is set to "
105 "zero, no packets are received. B<bind>(2) can optionally be called with a "
106 "nonzero I<sll_protocol> to start receiving packets for the protocols "
107 "specified."
108 msgstr ""
109
110 #. type: Plain text
111 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
112 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
113 msgid ""
114 "In order to create a packet socket, a process must have the B<CAP_NET_RAW> "
115 "capability in the user namespace that governs its network namespace."
116 msgstr ""
117
118 #. type: Plain text
119 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
120 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
121 msgid ""
122 "B<SOCK_RAW> packets are passed to and from the device driver without any "
123 "changes in the packet data. When receiving a packet, the address is still "
124 "parsed and passed in a standard I<sockaddr_ll> address structure. When "
125 "transmitting a packet, the user-supplied buffer should contain the physical-"
126 "layer header. That packet is then queued unmodified to the network driver "
127 "of the interface defined by the destination address. Some device drivers "
128 "always add other headers. B<SOCK_RAW> is similar to but not compatible with "
129 "the obsolete B<AF_INET/SOCK_PACKET> of Linux 2.0."
130 msgstr ""
131
132 #. type: Plain text
133 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
134 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
135 msgid ""
136 "B<SOCK_DGRAM> operates on a slightly higher level. The physical header is "
137 "removed before the packet is passed to the user. Packets sent through a "
138 "B<SOCK_DGRAM> packet socket get a suitable physical-layer header based on "
139 "the information in the I<sockaddr_ll> destination address before they are "
140 "queued."
141 msgstr ""
142
143 #. type: Plain text
144 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
145 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
146 msgid ""
147 "By default, all packets of the specified protocol type are passed to a "
148 "packet socket. To get packets only from a specific interface use "
149 "B<bind>(2) specifying an address in a I<struct sockaddr_ll> to bind the "
150 "packet socket to an interface. Fields used for binding are I<sll_family> "
151 "(should be B<AF_PACKET>), I<sll_protocol>, and I<sll_ifindex>."
152 msgstr ""
153
154 #. type: Plain text
155 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
156 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
157 msgid "The B<connect>(2) operation is not supported on packet sockets."
158 msgstr ""
159
160 #. type: Plain text
161 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
162 #: opensuse-leap-16-1 opensuse-tumbleweed
163 msgid ""
164 "When the B<MSG_TRUNC> flag is passed to B<recvmsg>(2), B<recv>(2), or "
165 "B<recvfrom>(2), the real size of the packet on the wire is always returned, "
166 "even when it is longer than the buffer."
167 msgstr ""
168
169 #. type: SS
170 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
171 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
172 #, no-wrap
173 msgid "Address types"
174 msgstr ""
175
176 #. type: Plain text
177 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
178 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
179 msgid ""
180 "The I<sockaddr_ll> structure is a device-independent physical-layer address."
181 msgstr ""
182
183 #. type: Plain text
184 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
185 #: opensuse-leap-16-1 opensuse-tumbleweed
186 #, no-wrap
187 msgid ""
188 "struct sockaddr_ll {\n"
189 " unsigned short sll_family; /* Always AF_PACKET */\n"
190 " unsigned short sll_protocol; /* Physical-layer protocol */\n"
191 " int sll_ifindex; /* Interface number */\n"
192 " unsigned short sll_hatype; /* ARP hardware type */\n"
193 " unsigned char sll_pkttype; /* Packet type */\n"
194 " unsigned char sll_halen; /* Size of address */\n"
195 " unsigned char sll_addr[8]; /* Physical-layer address */\n"
196 "};\n"
197 msgstr ""
198
199 #. type: Plain text
200 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
201 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
202 msgid "The fields of this structure are as follows:"
203 msgstr ""
204
205 #. type: TP
206 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
207 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
208 #, no-wrap
209 msgid "I<sll_protocol>"
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 "is the standard ethernet protocol type in network byte order as defined in "
217 "the I<E<lt>linux/if_ether.hE<gt>> include file. It defaults to the socket's "
218 "protocol."
219 msgstr ""
220
221 #. type: TP
222 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
223 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
224 #, no-wrap
225 msgid "I<sll_ifindex>"
226 msgstr ""
227
228 #. type: Plain text
229 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
230 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
231 msgid ""
232 "is the interface index of the interface (see B<netdevice>(7)); 0 matches any "
233 "interface (only permitted for binding). I<sll_hatype> is an ARP type as "
234 "defined in the I<E<lt>linux/if_arp.hE<gt>> include file."
235 msgstr ""
236
237 #. type: TP
238 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
239 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
240 #, no-wrap
241 msgid "I<sll_pkttype>"
242 msgstr ""
243
244 #. type: Plain text
245 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
246 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
247 msgid ""
248 "contains the packet type. Valid types are B<PACKET_HOST> for a packet "
249 "addressed to the local host, B<PACKET_BROADCAST> for a physical-layer "
250 "broadcast packet, B<PACKET_MULTICAST> for a packet sent to a physical-layer "
251 "multicast address, B<PACKET_OTHERHOST> for a packet to some other host that "
252 "has been caught by a device driver in promiscuous mode, and "
253 "B<PACKET_OUTGOING> for a packet originating from the local host that is "
254 "looped back to a packet socket. These types make sense only for receiving."
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<sll_addr>"
262 msgstr ""
263
264 #. type: TQ
265 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
266 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
267 #, no-wrap
268 msgid "I<sll_halen>"
269 msgstr ""
270
271 #. type: Plain text
272 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
273 #: opensuse-leap-16-1 opensuse-tumbleweed
274 msgid ""
275 "contain the physical-layer (e.g., IEEE 802.3) address and its size. The "
276 "exact interpretation depends on the device."
277 msgstr ""
278
279 #. type: Plain text
280 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
281 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
282 msgid ""
283 "When you send packets, it is enough to specify I<sll_family>, I<sll_addr>, "
284 "I<sll_halen>, I<sll_ifindex>, and I<sll_protocol>. The other fields should "
285 "be 0. I<sll_hatype> and I<sll_pkttype> are set on received packets for your "
286 "information."
287 msgstr ""
288
289 #. type: SS
290 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
291 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
292 #, no-wrap
293 msgid "Socket options"
294 msgstr ""
295
296 #. type: Plain text
297 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
298 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
299 msgid ""
300 "Packet socket options are configured by calling B<setsockopt>(2) with level "
301 "B<SOL_PACKET>."
302 msgstr ""
303
304 #. type: TP
305 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
306 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
307 #, no-wrap
308 msgid "B<PACKET_ADD_MEMBERSHIP>"
309 msgstr ""
310
311 #. type: TP
312 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
313 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
314 #, no-wrap
315 msgid "B<PACKET_DROP_MEMBERSHIP>"
316 msgstr ""
317
318 #. type: Plain text
319 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
320 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
321 msgid ""
322 "Packet sockets can be used to configure physical-layer multicasting and "
323 "promiscuous mode. B<PACKET_ADD_MEMBERSHIP> adds a binding and "
324 "B<PACKET_DROP_MEMBERSHIP> drops it. They both expect a I<packet_mreq> "
325 "structure as argument:"
326 msgstr ""
327
328 #. type: Plain text
329 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
330 #: opensuse-leap-16-1 opensuse-tumbleweed
331 #, no-wrap
332 msgid ""
333 "struct packet_mreq {\n"
334 " int mr_ifindex; /* interface index */\n"
335 " unsigned short mr_type; /* action */\n"
336 " unsigned short mr_alen; /* address size */\n"
337 " unsigned char mr_address[8]; /* physical-layer address */\n"
338 "};\n"
339 msgstr ""
340
341 #. type: Plain text
342 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
343 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
344 msgid ""
345 "I<mr_ifindex> contains the interface index for the interface whose status "
346 "should be changed. The I<mr_type> field specifies which action to perform. "
347 "B<PACKET_MR_PROMISC> enables receiving all packets on a shared medium (often "
348 "known as \"promiscuous mode\"), B<PACKET_MR_MULTICAST> binds the socket to "
349 "the physical-layer multicast group specified in I<mr_address> and "
350 "I<mr_alen>, and B<PACKET_MR_ALLMULTI> sets the socket up to receive all "
351 "multicast packets arriving at the interface."
352 msgstr ""
353
354 #. type: Plain text
355 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
356 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
357 msgid ""
358 "In addition, the traditional ioctls B<SIOCSIFFLAGS>, B<SIOCADDMULTI>, "
359 "B<SIOCDELMULTI> can be used for the same purpose."
360 msgstr ""
361
362 #. type: TP
363 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
364 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
365 #, no-wrap
366 msgid "B<PACKET_AUXDATA> (since Linux 2.6.21)"
367 msgstr ""
368
369 #. commit 8dc4194474159660d7f37c495e3fc3f10d0db8cc
370 #. type: Plain text
371 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
372 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
373 msgid ""
374 "If this binary option is enabled, the packet socket passes a metadata "
375 "structure along with each packet in the B<recvmsg>(2) control field. The "
376 "structure can be read with B<cmsg>(3). It is defined as"
377 msgstr ""
378
379 #. commit a0cdfcf39362410d5ea983f4daf67b38de129408 added tp_vlan_tpid
380 #. type: Plain text
381 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
382 #: opensuse-leap-16-1 opensuse-tumbleweed
383 #, no-wrap
384 msgid ""
385 "struct tpacket_auxdata {\n"
386 " __u32 tp_status;\n"
387 " __u32 tp_len; /* packet size */\n"
388 " __u32 tp_snaplen; /* captured size */\n"
389 " __u16 tp_mac;\n"
390 " __u16 tp_net;\n"
391 " __u16 tp_vlan_tci;\n"
392 " __u16 tp_vlan_tpid; /* Since Linux 3.14; earlier, these\n"
393 " were unused padding bytes */\n"
394 "};\n"
395 msgstr ""
396
397 #. type: TP
398 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
399 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
400 #, no-wrap
401 msgid "B<PACKET_FANOUT> (since Linux 3.1)"
402 msgstr ""
403
404 #. commit dc99f600698dcac69b8f56dda9a8a00d645c5ffc
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 "To scale processing across threads, packet sockets can form a fanout group. "
410 "In this mode, each matching packet is enqueued onto only one socket in the "
411 "group. A socket joins a fanout group by calling B<setsockopt>(2) with "
412 "level B<SOL_PACKET> and option B<PACKET_FANOUT>. Each network namespace can "
413 "have up to 65536 independent groups. A socket selects a group by encoding "
414 "the ID in the first 16 bits of the integer option value. The first packet "
415 "socket to join a group implicitly creates it. To successfully join an "
416 "existing group, subsequent packet sockets must have the same protocol, "
417 "device settings, fanout mode, and flags (see below). Packet sockets can "
418 "leave a fanout group only by closing the socket. The group is deleted when "
419 "the last socket is closed."
420 msgstr ""
421
422 #. type: Plain text
423 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
424 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
425 msgid ""
426 "Fanout supports multiple algorithms to spread traffic between sockets, as "
427 "follows:"
428 msgstr ""
429
430 #. type: IP
431 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
432 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
433 #, no-wrap
434 msgid "\\[bu]"
435 msgstr ""
436
437 #. type: Plain text
438 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
439 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
440 msgid ""
441 "The default mode, B<PACKET_FANOUT_HASH>, sends packets from the same flow to "
442 "the same socket to maintain per-flow ordering. For each packet, it chooses "
443 "a socket by taking the packet flow hash modulo the number of sockets in the "
444 "group, where a flow hash is a hash over network-layer address and optional "
445 "transport-layer port fields."
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 msgid ""
452 "The load-balance mode B<PACKET_FANOUT_LB> implements a round-robin algorithm."
453 msgstr ""
454
455 #. type: Plain text
456 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
457 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
458 msgid ""
459 "B<PACKET_FANOUT_CPU> selects the socket based on the CPU that the packet "
460 "arrived on."
461 msgstr ""
462
463 #. type: Plain text
464 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
465 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
466 msgid ""
467 "B<PACKET_FANOUT_ROLLOVER> processes all data on a single socket, moving to "
468 "the next when one becomes backlogged."
469 msgstr ""
470
471 #. type: Plain text
472 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
473 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
474 msgid ""
475 "B<PACKET_FANOUT_RND> selects the socket using a pseudo-random number "
476 "generator."
477 msgstr ""
478
479 #. commit 2d36097d26b5991d71a2cf4a20c1a158f0f1bfcd
480 #. type: Plain text
481 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
482 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
483 msgid ""
484 "B<PACKET_FANOUT_QM> (available since Linux 3.14) selects the socket using "
485 "the recorded queue_mapping of the received skb."
486 msgstr ""
487
488 #. type: Plain text
489 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
490 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
491 msgid ""
492 "Fanout modes can take additional options. IP fragmentation causes packets "
493 "from the same flow to have different flow hashes. The flag "
494 "B<PACKET_FANOUT_FLAG_DEFRAG>, if set, causes packets to be defragmented "
495 "before fanout is applied, to preserve order even in this case. Fanout mode "
496 "and options are communicated in the second 16 bits of the integer option "
497 "value. The flag B<PACKET_FANOUT_FLAG_ROLLOVER> enables the roll over "
498 "mechanism as a backup strategy: if the original fanout algorithm selects a "
499 "backlogged socket, the packet rolls over to the next available one."
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<PACKET_LOSS> (with B<PACKET_TX_RING>)"
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 "When a malformed packet is encountered on a transmit ring, the default is to "
514 "reset its I<tp_status> to B<TP_STATUS_WRONG_FORMAT> and abort the "
515 "transmission immediately. The malformed packet blocks itself and "
516 "subsequently enqueued packets from being sent. The format error must be "
517 "fixed, the associated I<tp_status> reset to B<TP_STATUS_SEND_REQUEST>, and "
518 "the transmission process restarted via B<send>(2). However, if "
519 "B<PACKET_LOSS> is set, any malformed packet will be skipped, its "
520 "I<tp_status> reset to B<TP_STATUS_AVAILABLE>, and the transmission process "
521 "continued."
522 msgstr ""
523
524 #. type: TP
525 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
526 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
527 #, no-wrap
528 msgid "B<PACKET_RESERVE> (with B<PACKET_RX_RING>)"
529 msgstr ""
530
531 #. type: Plain text
532 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
533 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
534 msgid ""
535 "By default, a packet receive ring writes packets immediately following the "
536 "metadata structure and alignment padding. This integer option reserves "
537 "additional headroom."
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 "B<PACKET_RX_RING>"
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 "Create a memory-mapped ring buffer for asynchronous packet reception. The "
552 "packet socket reserves a contiguous region of application address space, "
553 "lays it out into an array of packet slots and copies packets (up to "
554 "I<tp_snaplen>) into subsequent slots. Each packet is preceded by a "
555 "metadata structure similar to I<tpacket_auxdata>. The protocol fields "
556 "encode the offset to the data from the start of the metadata header. "
557 "I<tp_net> stores the offset to the network layer. If the packet socket is "
558 "of type B<SOCK_DGRAM>, then I<tp_mac> is the same. If it is of type "
559 "B<SOCK_RAW>, then that field stores the offset to the link-layer frame. "
560 "Packet socket and application communicate the head and tail of the ring "
561 "through the I<tp_status> field. The packet socket owns all slots with "
562 "I<tp_status> equal to B<TP_STATUS_KERNEL>. After filling a slot, it changes "
563 "the status of the slot to transfer ownership to the application. During "
564 "normal operation, the new I<tp_status> value has at least the "
565 "B<TP_STATUS_USER> bit set to signal that a received packet has been stored. "
566 "When the application has finished processing a packet, it transfers "
567 "ownership of the slot back to the socket by setting I<tp_status> equal to "
568 "B<TP_STATUS_KERNEL>."
569 msgstr ""
570
571 #. type: Plain text
572 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
573 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
574 msgid ""
575 "Packet sockets implement multiple variants of the packet ring. The "
576 "implementation details are described in I<Documentation/networking/"
577 "packet_mmap.rst> in the Linux kernel source tree."
578 msgstr ""
579
580 #. type: TP
581 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
582 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
583 #, no-wrap
584 msgid "B<PACKET_STATISTICS>"
585 msgstr ""
586
587 #. type: Plain text
588 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
589 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
590 msgid "Retrieve packet socket statistics in the form of a structure"
591 msgstr ""
592
593 #. type: Plain text
594 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
595 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
596 #, no-wrap
597 msgid ""
598 "struct tpacket_stats {\n"
599 " unsigned int tp_packets; /* Total packet count */\n"
600 " unsigned int tp_drops; /* Dropped packet count */\n"
601 "};\n"
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 "Receiving statistics resets the internal counters. The statistics structure "
609 "differs when using a ring of variant B<TPACKET_V3>."
610 msgstr ""
611
612 #. type: TP
613 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
614 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
615 #, no-wrap
616 msgid "B<PACKET_TIMESTAMP> (with B<PACKET_RX_RING>; since Linux 2.6.36)"
617 msgstr ""
618
619 #. commit 614f60fa9d73a9e8fdff3df83381907fea7c5649
620 #. type: Plain text
621 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
622 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
623 msgid ""
624 "The packet receive ring always stores a timestamp in the metadata header. "
625 "By default, this is a software generated timestamp generated when the packet "
626 "is copied into the ring. This integer option selects the type of "
627 "timestamp. Besides the default, it support the two hardware formats "
628 "described in I<Documentation/networking/timestamping.rst> in the Linux "
629 "kernel source tree."
630 msgstr ""
631
632 #. type: TP
633 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
634 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
635 #, no-wrap
636 msgid "B<PACKET_TX_RING> (since Linux 2.6.31)"
637 msgstr ""
638
639 #. commit 69e3c75f4d541a6eb151b3ef91f34033cb3ad6e1
640 #. type: Plain text
641 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
642 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
643 msgid ""
644 "Create a memory-mapped ring buffer for packet transmission. This option is "
645 "similar to B<PACKET_RX_RING> and takes the same arguments. The application "
646 "writes packets into slots with I<tp_status> equal to B<TP_STATUS_AVAILABLE> "
647 "and schedules them for transmission by changing I<tp_status> to "
648 "B<TP_STATUS_SEND_REQUEST>. When packets are ready to be transmitted, the "
649 "application calls B<send>(2) or a variant thereof. The I<buf> and I<len> "
650 "fields of this call are ignored. If an address is passed using "
651 "B<sendto>(2) or B<sendmsg>(2), then that overrides the socket default. On "
652 "successful transmission, the socket resets I<tp_status> to "
653 "B<TP_STATUS_AVAILABLE>. It immediately aborts the transmission on error "
654 "unless B<PACKET_LOSS> is set."
655 msgstr ""
656
657 #. type: TP
658 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
659 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
660 #, no-wrap
661 msgid "B<PACKET_VERSION> (with B<PACKET_RX_RING>; since Linux 2.6.27)"
662 msgstr ""
663
664 #. commit bbd6ef87c544d88c30e4b762b1b61ef267a7d279
665 #. type: Plain text
666 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
667 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
668 msgid ""
669 "By default, B<PACKET_RX_RING> creates a packet receive ring of variant "
670 "B<TPACKET_V1>. To create another variant, configure the desired variant by "
671 "setting this integer option before creating the ring."
672 msgstr ""
673
674 #. type: TP
675 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
676 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
677 #, no-wrap
678 msgid "B<PACKET_QDISC_BYPASS> (since Linux 3.14)"
679 msgstr ""
680
681 #. commit d346a3fae3ff1d99f5d0c819bf86edf9094a26a1
682 #. type: Plain text
683 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
684 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
685 msgid ""
686 "By default, packets sent through packet sockets pass through the kernel's "
687 "qdisc (traffic control) layer, which is fine for the vast majority of use "
688 "cases. For traffic generator appliances using packet sockets that intend to "
689 "brute-force flood the network\\[em]for example, to test devices under load "
690 "in a similar fashion to pktgen\\[em]this layer can be bypassed by setting "
691 "this integer option to 1. A side effect is that packet buffering in the "
692 "qdisc layer is avoided, which will lead to increased drops when network "
693 "device transmit queues are busy; therefore, use at your own risk."
694 msgstr ""
695
696 #. type: SS
697 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
698 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
699 #, no-wrap
700 msgid "Ioctls"
701 msgstr ""
702
703 #. FIXME Document SIOCGSTAMPNS
704 #. type: Plain text
705 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
706 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
707 msgid ""
708 "B<SIOCGSTAMP> can be used to receive the timestamp of the last received "
709 "packet. Argument is a I<struct timeval> variable."
710 msgstr ""
711
712 #. type: Plain text
713 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
714 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
715 msgid ""
716 "In addition, all standard ioctls defined in B<netdevice>(7) and "
717 "B<socket>(7) are valid on packet sockets."
718 msgstr ""
719
720 #. type: SS
721 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
722 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
723 #, no-wrap
724 msgid "Error handling"
725 msgstr ""
726
727 #. type: Plain text
728 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
729 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
730 msgid ""
731 "Packet sockets do no error handling other than errors occurred while passing "
732 "the packet to the device driver. They don't have the concept of a pending "
733 "error."
734 msgstr ""
735
736 #. type: SH
737 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
738 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
739 #, no-wrap
740 msgid "ERRORS"
741 msgstr ""
742
743 #. type: TP
744 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
745 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
746 #, no-wrap
747 msgid "B<EADDRNOTAVAIL>"
748 msgstr ""
749
750 #. type: Plain text
751 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
752 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
753 msgid "Unknown multicast group address passed."
754 msgstr ""
755
756 #. type: TP
757 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
758 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
759 #, no-wrap
760 msgid "B<EFAULT>"
761 msgstr ""
762
763 #. type: Plain text
764 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
765 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
766 msgid "User passed invalid memory address."
767 msgstr ""
768
769 #. type: TP
770 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
771 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
772 #, no-wrap
773 msgid "B<EINVAL>"
774 msgstr ""
775
776 #. type: Plain text
777 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
778 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
779 msgid "Invalid argument."
780 msgstr ""
781
782 #. type: TP
783 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
784 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
785 #, no-wrap
786 msgid "B<EMSGSIZE>"
787 msgstr ""
788
789 #. type: Plain text
790 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
791 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
792 msgid "Packet is bigger than interface MTU."
793 msgstr ""
794
795 #. type: TP
796 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
797 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
798 #, no-wrap
799 msgid "B<ENETDOWN>"
800 msgstr ""
801
802 #. type: Plain text
803 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
804 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
805 msgid "Interface is not up."
806 msgstr ""
807
808 #. type: TP
809 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
810 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
811 #, no-wrap
812 msgid "B<ENOBUFS>"
813 msgstr ""
814
815 #. type: Plain text
816 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
817 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
818 msgid "Not enough memory to allocate the packet."
819 msgstr ""
820
821 #. type: TP
822 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
823 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
824 #, no-wrap
825 msgid "B<ENODEV>"
826 msgstr ""
827
828 #. type: Plain text
829 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
830 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
831 msgid "Unknown device name or interface index specified in interface address."
832 msgstr ""
833
834 #. type: TP
835 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
836 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
837 #, no-wrap
838 msgid "B<ENOENT>"
839 msgstr ""
840
841 #. type: Plain text
842 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
843 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
844 msgid "No packet received."
845 msgstr ""
846
847 #. type: TP
848 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
849 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
850 #, no-wrap
851 msgid "B<ENOTCONN>"
852 msgstr ""
853
854 #. type: Plain text
855 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
856 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
857 msgid "No interface address passed."
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<ENXIO>"
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 "Interface address contained an invalid interface index."
871 msgstr ""
872
873 #. type: TP
874 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
875 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
876 #, no-wrap
877 msgid "B<EPERM>"
878 msgstr ""
879
880 #. type: Plain text
881 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
882 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
883 msgid "User has insufficient privileges to carry out this operation."
884 msgstr ""
885
886 #. type: Plain text
887 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
888 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
889 msgid "In addition, other errors may be generated by the low-level driver."
890 msgstr ""
891
892 #. type: SH
893 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
894 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
895 #, no-wrap
896 msgid "VERSIONS"
897 msgstr ""
898
899 #. type: Plain text
900 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
901 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
902 msgid ""
903 "B<AF_PACKET> is a new feature in Linux 2.2. Earlier Linux versions "
904 "supported only B<SOCK_PACKET>."
905 msgstr ""
906
907 #. type: SH
908 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
909 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
910 #, no-wrap
911 msgid "NOTES"
912 msgstr ""
913
914 #. type: Plain text
915 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
916 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
917 msgid ""
918 "For portable programs it is suggested to use B<AF_PACKET> via B<pcap>(3); "
919 "although this covers only a subset of the B<AF_PACKET> features."
920 msgstr ""
921
922 #. type: Plain text
923 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
924 #: opensuse-leap-16-1 opensuse-tumbleweed
925 msgid ""
926 "The B<SOCK_DGRAM> packet sockets make no attempt to create or parse the IEEE "
927 "802.2 LLC header for a IEEE 802.3 frame. When B<ETH_P_802_3> is specified "
928 "as protocol for sending the kernel creates the 802.3 frame and fills out the "
929 "size field; the user has to supply the LLC header to get a fully conforming "
930 "packet. Incoming 802.3 packets are not multiplexed on the DSAP/SSAP "
931 "protocol fields; instead they are supplied to the user as protocol "
932 "B<ETH_P_802_2> with the LLC header prefixed. It is thus not possible to "
933 "bind to B<ETH_P_802_3>; bind to B<ETH_P_802_2> instead and do the protocol "
934 "multiplex yourself. The default for sending is the standard Ethernet DIX "
935 "encapsulation with the protocol filled in."
936 msgstr ""
937
938 #. type: Plain text
939 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
940 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
941 msgid "Packet sockets are not subject to the input or output firewall chains."
942 msgstr ""
943
944 #. type: SS
945 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
946 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
947 #, no-wrap
948 msgid "Compatibility"
949 msgstr ""
950
951 #. type: Plain text
952 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
953 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
954 msgid "In Linux 2.0, the only way to get a packet socket was with the call:"
955 msgstr ""
956
957 #. type: Plain text
958 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
959 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
960 #, no-wrap
961 msgid "socket(AF_INET, SOCK_PACKET, protocol)\n"
962 msgstr ""
963
964 #. type: Plain text
965 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
966 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
967 msgid ""
968 "This is still supported, but deprecated and strongly discouraged. The main "
969 "difference between the two methods is that B<SOCK_PACKET> uses the old "
970 "I<struct sockaddr_pkt> to specify an interface, which doesn't provide "
971 "physical-layer independence."
972 msgstr ""
973
974 #. type: Plain text
975 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
976 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
977 #, no-wrap
978 msgid ""
979 "struct sockaddr_pkt {\n"
980 " unsigned short spkt_family;\n"
981 " unsigned char spkt_device[14];\n"
982 " unsigned short spkt_protocol;\n"
983 "};\n"
984 msgstr ""
985
986 #. type: Plain text
987 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
988 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
989 msgid ""
990 "I<spkt_family> contains the device type, I<spkt_protocol> is the IEEE 802.3 "
991 "protocol type as defined in I<E<lt>sys/if_ether.hE<gt>> and I<spkt_device> "
992 "is the device name as a null-terminated string, for example, eth0."
993 msgstr ""
994
995 #. type: Plain text
996 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
997 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
998 msgid "This structure is obsolete and should not be used in new code."
999 msgstr ""
1000
1001 #. type: SH
1002 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1003 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1004 #, no-wrap
1005 msgid "BUGS"
1006 msgstr ""
1007
1008 #. type: SS
1009 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1010 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1011 #, no-wrap
1012 msgid "LLC header handling"
1013 msgstr ""
1014
1015 #. type: Plain text
1016 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1017 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1018 msgid "The IEEE 802.2/803.3 LLC handling could be considered as a bug."
1019 msgstr ""
1020
1021 #. type: SS
1022 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1023 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1024 #, no-wrap
1025 msgid "MSG_TRUNC issues"
1026 msgstr ""
1027
1028 #. type: Plain text
1029 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1030 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1031 msgid ""
1032 "The B<MSG_TRUNC> B<recvmsg>(2) extension is an ugly hack and should be "
1033 "replaced by a control message. There is currently no way to get the "
1034 "original destination address of packets via B<SOCK_DGRAM>."
1035 msgstr ""
1036
1037 #. type: SS
1038 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1039 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1040 #, no-wrap
1041 msgid "spkt_device device name truncation"
1042 msgstr ""
1043
1044 #. type: Plain text
1045 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
1046 #: opensuse-leap-16-1 opensuse-tumbleweed
1047 msgid ""
1048 "The I<spkt_device> field of I<sockaddr_pkt> has a size of 14 bytes, which is "
1049 "less than the constant B<IFNAMSIZ> defined in I<E<lt>net/if.hE<gt>> which is "
1050 "16 bytes and describes the system limit for a network interface name. This "
1051 "means the names of network devices longer than 14 bytes will be truncated to "
1052 "fit into I<spkt_device>. All these sizes include the terminating null byte "
1053 "(\\[aq]\\[rs]0\\[aq]))."
1054 msgstr ""
1055
1056 #. type: Plain text
1057 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1058 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1059 msgid ""
1060 "Issues from this with old code typically show up with very long interface "
1061 "names used by the B<Predictable Network Interface Names> feature enabled by "
1062 "default in many modern Linux distributions."
1063 msgstr ""
1064
1065 #. type: Plain text
1066 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1067 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1068 msgid ""
1069 "The preferred solution is to rewrite code to avoid B<SOCK_PACKET>. Possible "
1070 "user solutions are to disable B<Predictable Network Interface Names> or to "
1071 "rename the interface to a name of at most 13 bytes, for example using the "
1072 "B<ip>(8) tool."
1073 msgstr ""
1074
1075 #. type: SS
1076 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1077 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1078 #, no-wrap
1079 msgid "Documentation issues"
1080 msgstr ""
1081
1082 #. .SH CREDITS
1083 #. This man page was written by Andi Kleen with help from Matthew Wilcox.
1084 #. AF_PACKET in Linux 2.2 was implemented
1085 #. by Alexey Kuznetsov, based on code by Alan Cox and others.
1086 #. type: Plain text
1087 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1088 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1089 msgid "Socket filters are not documented."
1090 msgstr ""
1091
1092 #. type: SH
1093 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1094 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1095 #, no-wrap
1096 msgid "SEE ALSO"
1097 msgstr ""
1098
1099 #. type: Plain text
1100 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1101 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1102 msgid ""
1103 "B<socket>(2), B<pcap>(3), B<capabilities>(7), B<ip>(7), B<raw>(7), "
1104 "B<socket>(7), B<ip>(8),"
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 ""
1111 "RFC\\ 894 for the standard IP Ethernet encapsulation. RFC\\ 1700 for the "
1112 "IEEE 802.3 IP encapsulation."
1113 msgstr ""
1114
1115 #. type: Plain text
1116 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1117 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1118 msgid ""
1119 "The I<E<lt>linux/if_ether.hE<gt>> include file for physical-layer protocols."
1120 msgstr ""
1121
1122 #. type: Plain text
1123 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1124 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1125 msgid ""
1126 "The Linux kernel source tree. I<Documentation/networking/filter.rst> "
1127 "describes how to apply Berkeley Packet Filters to packet sockets. I<tools/"
1128 "testing/selftests/net/psock_tpacket.c> contains example source code for all "
1129 "available versions of B<PACKET_RX_RING> and B<PACKET_TX_RING>."
1130 msgstr ""
1131
1132 #. type: TH
1133 #: debian-trixie
1134 #, no-wrap
1135 msgid "2024-06-15"
1136 msgstr ""
1137
1138 #. type: TH
1139 #: debian-trixie
1140 #, no-wrap
1141 msgid "Linux man-pages 6.9.1"
1142 msgstr ""
1143
1144 #. type: Plain text
1145 #: debian-trixie
1146 msgid ""
1147 "When the B<MSG_TRUNC> flag is passed to B<recvmsg>(2), B<recv>(2), or "
1148 "B<recvfrom>(2), the real length of the packet on the wire is always "
1149 "returned, even when it is longer than the buffer."
1150 msgstr ""
1151
1152 #. type: Plain text
1153 #: debian-trixie
1154 #, no-wrap
1155 msgid ""
1156 "struct sockaddr_ll {\n"
1157 " unsigned short sll_family; /* Always AF_PACKET */\n"
1158 " unsigned short sll_protocol; /* Physical-layer protocol */\n"
1159 " int sll_ifindex; /* Interface number */\n"
1160 " unsigned short sll_hatype; /* ARP hardware type */\n"
1161 " unsigned char sll_pkttype; /* Packet type */\n"
1162 " unsigned char sll_halen; /* Length of address */\n"
1163 " unsigned char sll_addr[8]; /* Physical-layer address */\n"
1164 "};\n"
1165 msgstr ""
1166
1167 #. type: Plain text
1168 #: debian-trixie
1169 msgid ""
1170 "contain the physical-layer (e.g., IEEE 802.3) address and its length. The "
1171 "exact interpretation depends on the device."
1172 msgstr ""
1173
1174 #. type: Plain text
1175 #: debian-trixie
1176 #, no-wrap
1177 msgid ""
1178 "struct packet_mreq {\n"
1179 " int mr_ifindex; /* interface index */\n"
1180 " unsigned short mr_type; /* action */\n"
1181 " unsigned short mr_alen; /* address length */\n"
1182 " unsigned char mr_address[8]; /* physical-layer address */\n"
1183 "};\n"
1184 msgstr ""
1185
1186 #. commit a0cdfcf39362410d5ea983f4daf67b38de129408 added tp_vlan_tpid
1187 #. type: Plain text
1188 #: debian-trixie
1189 #, no-wrap
1190 msgid ""
1191 "struct tpacket_auxdata {\n"
1192 " __u32 tp_status;\n"
1193 " __u32 tp_len; /* packet length */\n"
1194 " __u32 tp_snaplen; /* captured length */\n"
1195 " __u16 tp_mac;\n"
1196 " __u16 tp_net;\n"
1197 " __u16 tp_vlan_tci;\n"
1198 " __u16 tp_vlan_tpid; /* Since Linux 3.14; earlier, these\n"
1199 " were unused padding bytes */\n"
1200 "};\n"
1201 msgstr ""
1202
1203 #. type: Plain text
1204 #: debian-trixie
1205 msgid ""
1206 "The B<SOCK_DGRAM> packet sockets make no attempt to create or parse the IEEE "
1207 "802.2 LLC header for a IEEE 802.3 frame. When B<ETH_P_802_3> is specified "
1208 "as protocol for sending the kernel creates the 802.3 frame and fills out the "
1209 "length field; the user has to supply the LLC header to get a fully "
1210 "conforming packet. Incoming 802.3 packets are not multiplexed on the DSAP/"
1211 "SSAP protocol fields; instead they are supplied to the user as protocol "
1212 "B<ETH_P_802_2> with the LLC header prefixed. It is thus not possible to "
1213 "bind to B<ETH_P_802_3>; bind to B<ETH_P_802_2> instead and do the protocol "
1214 "multiplex yourself. The default for sending is the standard Ethernet DIX "
1215 "encapsulation with the protocol filled in."
1216 msgstr ""
1217
1218 #. type: Plain text
1219 #: debian-trixie
1220 msgid ""
1221 "The I<spkt_device> field of I<sockaddr_pkt> has a size of 14 bytes, which is "
1222 "less than the constant B<IFNAMSIZ> defined in I<E<lt>net/if.hE<gt>> which is "
1223 "16 bytes and describes the system limit for a network interface name. This "
1224 "means the names of network devices longer than 14 bytes will be truncated to "
1225 "fit into I<spkt_device>. All these lengths include the terminating null "
1226 "byte (\\[aq]\\[rs]0\\[aq]))."
1227 msgstr ""
1228
1229 #. type: TH
1230 #: fedora-44 fedora-rawhide
1231 #, no-wrap
1232 msgid "2024-11-17"
1233 msgstr ""
1234
1235 #. type: TH
1236 #: fedora-44 fedora-rawhide
1237 #, no-wrap
1238 msgid "Linux man-pages 6.13"
1239 msgstr ""
1240
1241 #. type: TH
1242 #: mageia-cauldron
1243 #, no-wrap
1244 msgid "Linux man-pages 6.17"
1245 msgstr ""
1246
1247 #. type: TH
1248 #: opensuse-leap-16-1 opensuse-tumbleweed
1249 #, no-wrap
1250 msgid "Linux man-pages (unreleased)"
1251 msgstr ""