summaryrefslogtreecommitdiffstats
path: root/templates/man2/bpf.2.pot
blob: ff7ec86bc737a7492b788d9f75a3f71a7b6c22ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-03-01 16:53+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. type: TH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "bpf"
msgstr ""

#. type: TH
#: archlinux fedora-40 fedora-rawhide mageia-cauldron
#, no-wrap
msgid "2023-11-01"
msgstr ""

#. type: TH
#: archlinux fedora-40 fedora-rawhide mageia-cauldron
#, no-wrap
msgid "Linux man-pages 6.06"
msgstr ""

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "NAME"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "bpf - perform a command on an extended BPF map or program"
msgstr ""

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "SYNOPSIS"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<#include E<lt>linux/bpf.hE<gt>>\n"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<int bpf(int >I<cmd>B<, union bpf_attr *>I<attr>B<, unsigned int >I<size>B<);>\n"
msgstr ""

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "DESCRIPTION"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The B<bpf>()  system call performs a range of operations related to extended "
"Berkeley Packet Filters.  Extended BPF (or eBPF) is similar to the original "
"(\"classic\") BPF (cBPF) used to filter network packets.  For both cBPF and "
"eBPF programs, the kernel statically analyzes the programs before loading "
"them, in order to ensure that they cannot harm the running system."
msgstr ""

#.  See 'enum bpf_func_id' in include/uapi/linux/bpf.h
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"eBPF extends cBPF in multiple ways, including the ability to call a fixed "
"set of in-kernel helper functions (via the B<BPF_CALL> opcode extension "
"provided by eBPF)  and access shared data structures such as eBPF maps."
msgstr ""

#. type: SS
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "Extended BPF Design/Architecture"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"eBPF maps are a generic data structure for storage of different data types.  "
"Data types are generally treated as binary blobs, so a user just specifies "
"the size of the key and the size of the value at map-creation time.  In "
"other words, a key/value for a given map can have an arbitrary structure."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"A user process can create multiple maps (with key/value-pairs being opaque "
"bytes of data) and access them via file descriptors.  Different eBPF "
"programs can access the same maps in parallel.  It's up to the user process "
"and eBPF program to decide what they store inside maps."
msgstr ""

#.  Defined by the kernel constant MAX_TAIL_CALL_CNT in include/linux/bpf.h
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"There's one special map type, called a program array.  This type of map "
"stores file descriptors referring to other eBPF programs.  When a lookup in "
"the map is performed, the program flow is redirected in-place to the "
"beginning of another eBPF program and does not return back to the calling "
"program.  The level of nesting has a fixed limit of 32, so that infinite "
"loops cannot be crafted.  At run time, the program file descriptors stored "
"in the map can be modified, so program functionality can be altered based on "
"specific requirements.  All programs referred to in a program-array map must "
"have been previously loaded into the kernel via B<bpf>().  If a map lookup "
"fails, the current program continues its execution.  See "
"B<BPF_MAP_TYPE_PROG_ARRAY> below for further details."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Generally, eBPF programs are loaded by the user process and automatically "
"unloaded when the process exits.  In some cases, for example, B<tc-bpf>(8), "
"the program will continue to stay alive inside the kernel even after the "
"process that loaded the program exits.  In that case, the tc subsystem holds "
"a reference to the eBPF program after the file descriptor has been closed by "
"the user-space program.  Thus, whether a specific program continues to live "
"inside the kernel depends on how it is further attached to a given kernel "
"subsystem after it was loaded via B<bpf>()."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Each eBPF program is a set of instructions that is safe to run until its "
"completion.  An in-kernel verifier statically determines that the eBPF "
"program terminates and is safe to execute.  During verification, the kernel "
"increments reference counts for each of the maps that the eBPF program uses, "
"so that the attached maps can't be removed until the program is unloaded."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"eBPF programs can be attached to different events.  These events can be the "
"arrival of network packets, tracing events, classification events by network "
"queueing disciplines (for eBPF programs attached to a B<tc>(8)  classifier), "
"and other types that may be added in the future.  A new event triggers "
"execution of the eBPF program, which may store information about the event "
"in eBPF maps.  Beyond storing data, eBPF programs may call a fixed set of in-"
"kernel helper functions."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The same eBPF program can be attached to multiple events and different eBPF "
"programs can access the same map:"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid ""
"tracing     tracing    tracing    packet      packet     packet\n"
"event A     event B    event C    on eth0     on eth1    on eth2\n"
" |             |         |          |           |          \\[ha]\n"
" |             |         |          |           v          |\n"
" --E<gt> tracing E<lt>--     tracing      socket    tc ingress   tc egress\n"
"      prog_1          prog_2      prog_3    classifier    action\n"
"      |  |              |           |         prog_4      prog_5\n"
"   |---  -----|  |------|          map_3        |           |\n"
" map_1       map_2                              --| map_4 |--\n"
msgstr ""

#. type: SS
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "Arguments"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The operation to be performed by the B<bpf>()  system call is determined by "
"the I<cmd> argument.  Each operation takes an accompanying argument, "
"provided via I<attr>, which is a pointer to a union of type I<bpf_attr> (see "
"below).  The unused fields and padding must be zeroed out before the call.  "
"The I<size> argument is the size of the union pointed to by I<attr>."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "The value provided in I<cmd> is one of the following:"
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_MAP_CREATE>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Create a map and return a file descriptor that refers to the map.  The close-"
"on-exec file descriptor flag (see B<fcntl>(2))  is automatically enabled for "
"the new file descriptor."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_MAP_LOOKUP_ELEM>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Look up an element by key in a specified map and return its value."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_MAP_UPDATE_ELEM>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Create or update an element (key/value pair) in a specified map."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_MAP_DELETE_ELEM>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Look up and delete an element by key in a specified map."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_MAP_GET_NEXT_KEY>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Look up an element by key in a specified map and return the key of the next "
"element."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_PROG_LOAD>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Verify and load an eBPF program, returning a new file descriptor associated "
"with the program.  The close-on-exec file descriptor flag (see B<fcntl>(2))  "
"is automatically enabled for the new file descriptor."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The I<bpf_attr> union consists of various anonymous structures that are used "
"by different B<bpf>()  commands:"
msgstr ""

#.                  commit 2541517c32be2531e0da59dfd7efc1ce844644f5
#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
#, no-wrap
msgid ""
"union bpf_attr {\n"
"    struct {    /* Used by BPF_MAP_CREATE */\n"
"        __u32         map_type;\n"
"        __u32         key_size;    /* size of key in bytes */\n"
"        __u32         value_size;  /* size of value in bytes */\n"
"        __u32         max_entries; /* maximum number of entries\n"
"                                      in a map */\n"
"    };\n"
"\\&\n"
"    struct {    /* Used by BPF_MAP_*_ELEM and BPF_MAP_GET_NEXT_KEY\n"
"                   commands */\n"
"        __u32         map_fd;\n"
"        __aligned_u64 key;\n"
"        union {\n"
"            __aligned_u64 value;\n"
"            __aligned_u64 next_key;\n"
"        };\n"
"        __u64         flags;\n"
"    };\n"
"\\&\n"
"    struct {    /* Used by BPF_PROG_LOAD */\n"
"        __u32         prog_type;\n"
"        __u32         insn_cnt;\n"
"        __aligned_u64 insns;      /* \\[aq]const struct bpf_insn *\\[aq] */\n"
"        __aligned_u64 license;    /* \\[aq]const char *\\[aq] */\n"
"        __u32         log_level;  /* verbosity level of verifier */\n"
"        __u32         log_size;   /* size of user buffer */\n"
"        __aligned_u64 log_buf;    /* user supplied \\[aq]char *\\[aq]\n"
"                                     buffer */\n"
"        __u32         kern_version;\n"
"                                  /* checked when prog_type=kprobe\n"
"                                     (since Linux 4.1) */\n"
"    };\n"
"} __attribute__((aligned(8)));\n"
msgstr ""

#. type: SS
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "eBPF maps"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Maps are a generic data structure for storage of different types of data.  "
"They allow sharing of data between eBPF kernel programs, and also between "
"kernel and user-space applications."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Each map type has the following attributes:"
msgstr ""

#. type: IP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "\\[bu]"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "type"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "maximum number of elements"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "key size in bytes"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "value size in bytes"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The following wrapper functions demonstrate how various B<bpf>()  commands "
"can be used to access the maps.  The functions use the I<cmd> argument to "
"invoke different operations."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The B<BPF_MAP_CREATE> command creates a new map, returning a new file "
"descriptor that refers to the map."
msgstr ""

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
#, no-wrap
msgid ""
"int\n"
"bpf_create_map(enum bpf_map_type map_type,\n"
"               unsigned int key_size,\n"
"               unsigned int value_size,\n"
"               unsigned int max_entries)\n"
"{\n"
"    union bpf_attr attr = {\n"
"        .map_type    = map_type,\n"
"        .key_size    = key_size,\n"
"        .value_size  = value_size,\n"
"        .max_entries = max_entries\n"
"    };\n"
"\\&\n"
"    return bpf(BPF_MAP_CREATE, &attr, sizeof(attr));\n"
"}\n"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The new map has the type specified by I<map_type>, and attributes as "
"specified in I<key_size>, I<value_size>, and I<max_entries>.  On success, "
"this operation returns a file descriptor.  On error, -1 is returned and "
"I<errno> is set to B<EINVAL>, B<EPERM>, or B<ENOMEM>."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The I<key_size> and I<value_size> attributes will be used by the verifier "
"during program loading to check that the program is calling "
"B<bpf_map_*_elem>()  helper functions with a correctly initialized I<key> "
"and to check that the program doesn't access the map element I<value> beyond "
"the specified I<value_size>.  For example, when a map is created with a "
"I<key_size> of 8 and the eBPF program calls"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "bpf_map_lookup_elem(map_fd, fp - 4)\n"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "the program will be rejected, since the in-kernel helper function"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "bpf_map_lookup_elem(map_fd, void *key)\n"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"expects to read 8 bytes from the location pointed to by I<key>, but the "
"I<fp\\ -\\ 4> (where I<fp> is the top of the stack)  starting address will "
"cause out-of-bounds stack access."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Similarly, when a map is created with a I<value_size> of 1 and the eBPF "
"program contains"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid ""
"value = bpf_map_lookup_elem(...);\n"
"*(u32 *) value = 1;\n"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"the program will be rejected, since it accesses the I<value> pointer beyond "
"the specified 1 byte I<value_size> limit."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Currently, the following values are supported for I<map_type>:"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid ""
"enum bpf_map_type {\n"
"    BPF_MAP_TYPE_UNSPEC,  /* Reserve 0 as invalid map type */\n"
"    BPF_MAP_TYPE_HASH,\n"
"    BPF_MAP_TYPE_ARRAY,\n"
"    BPF_MAP_TYPE_PROG_ARRAY,\n"
"    BPF_MAP_TYPE_PERF_EVENT_ARRAY,\n"
"    BPF_MAP_TYPE_PERCPU_HASH,\n"
"    BPF_MAP_TYPE_PERCPU_ARRAY,\n"
"    BPF_MAP_TYPE_STACK_TRACE,\n"
"    BPF_MAP_TYPE_CGROUP_ARRAY,\n"
"    BPF_MAP_TYPE_LRU_HASH,\n"
"    BPF_MAP_TYPE_LRU_PERCPU_HASH,\n"
"    BPF_MAP_TYPE_LPM_TRIE,\n"
"    BPF_MAP_TYPE_ARRAY_OF_MAPS,\n"
"    BPF_MAP_TYPE_HASH_OF_MAPS,\n"
"    BPF_MAP_TYPE_DEVMAP,\n"
"    BPF_MAP_TYPE_SOCKMAP,\n"
"    BPF_MAP_TYPE_CPUMAP,\n"
"    BPF_MAP_TYPE_XSKMAP,\n"
"    BPF_MAP_TYPE_SOCKHASH,\n"
"    BPF_MAP_TYPE_CGROUP_STORAGE,\n"
"    BPF_MAP_TYPE_REUSEPORT_SOCKARRAY,\n"
"    BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE,\n"
"    BPF_MAP_TYPE_QUEUE,\n"
"    BPF_MAP_TYPE_STACK,\n"
"    /* See /usr/include/linux/bpf.h for the full list. */\n"
"};\n"
msgstr ""

#.  FIXME We need an explanation of why one might choose each of
#.  these map implementations
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"I<map_type> selects one of the available map implementations in the kernel.  "
"For all map types, eBPF programs access maps with the same "
"B<bpf_map_lookup_elem>()  and B<bpf_map_update_elem>()  helper functions.  "
"Further details of the various map types are given below."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The B<BPF_MAP_LOOKUP_ELEM> command looks up an element with a given I<key> "
"in the map referred to by the file descriptor I<fd>."
msgstr ""

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
#, no-wrap
msgid ""
"int\n"
"bpf_lookup_elem(int fd, const void *key, void *value)\n"
"{\n"
"    union bpf_attr attr = {\n"
"        .map_fd = fd,\n"
"        .key    = ptr_to_u64(key),\n"
"        .value  = ptr_to_u64(value),\n"
"    };\n"
"\\&\n"
"    return bpf(BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr));\n"
"}\n"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"If an element is found, the operation returns zero and stores the element's "
"value into I<value>, which must point to a buffer of I<value_size> bytes."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"If no element is found, the operation returns -1 and sets I<errno> to "
"B<ENOENT>."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The B<BPF_MAP_UPDATE_ELEM> command creates or updates an element with a "
"given I<key/value> in the map referred to by the file descriptor I<fd>."
msgstr ""

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
#, no-wrap
msgid ""
"int\n"
"bpf_update_elem(int fd, const void *key, const void *value,\n"
"                uint64_t flags)\n"
"{\n"
"    union bpf_attr attr = {\n"
"        .map_fd = fd,\n"
"        .key    = ptr_to_u64(key),\n"
"        .value  = ptr_to_u64(value),\n"
"        .flags  = flags,\n"
"    };\n"
"\\&\n"
"    return bpf(BPF_MAP_UPDATE_ELEM, &attr, sizeof(attr));\n"
"}\n"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "The I<flags> argument should be specified as one of the following:"
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_ANY>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Create a new element or update an existing element."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_NOEXIST>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Create a new element only if it did not exist."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_EXIST>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Update an existing element."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"On success, the operation returns zero.  On error, -1 is returned and "
"I<errno> is set to B<EINVAL>, B<EPERM>, B<ENOMEM>, or B<E2BIG>.  B<E2BIG> "
"indicates that the number of elements in the map reached the I<max_entries> "
"limit specified at map creation time.  B<EEXIST> will be returned if "
"I<flags> specifies B<BPF_NOEXIST> and the element with I<key> already exists "
"in the map.  B<ENOENT> will be returned if I<flags> specifies B<BPF_EXIST> "
"and the element with I<key> doesn't exist in the map."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The B<BPF_MAP_DELETE_ELEM> command deletes the element whose key is I<key> "
"from the map referred to by the file descriptor I<fd>."
msgstr ""

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
#, no-wrap
msgid ""
"int\n"
"bpf_delete_elem(int fd, const void *key)\n"
"{\n"
"    union bpf_attr attr = {\n"
"        .map_fd = fd,\n"
"        .key    = ptr_to_u64(key),\n"
"    };\n"
"\\&\n"
"    return bpf(BPF_MAP_DELETE_ELEM, &attr, sizeof(attr));\n"
"}\n"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"On success, zero is returned.  If the element is not found, -1 is returned "
"and I<errno> is set to B<ENOENT>."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The B<BPF_MAP_GET_NEXT_KEY> command looks up an element by I<key> in the map "
"referred to by the file descriptor I<fd> and sets the I<next_key> pointer to "
"the key of the next element."
msgstr ""

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
#, no-wrap
msgid ""
"int\n"
"bpf_get_next_key(int fd, const void *key, void *next_key)\n"
"{\n"
"    union bpf_attr attr = {\n"
"        .map_fd   = fd,\n"
"        .key      = ptr_to_u64(key),\n"
"        .next_key = ptr_to_u64(next_key),\n"
"    };\n"
"\\&\n"
"    return bpf(BPF_MAP_GET_NEXT_KEY, &attr, sizeof(attr));\n"
"}\n"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"If I<key> is found, the operation returns zero and sets the I<next_key> "
"pointer to the key of the next element.  If I<key> is not found, the "
"operation returns zero and sets the I<next_key> pointer to the key of the "
"first element.  If I<key> is the last element, -1 is returned and I<errno> "
"is set to B<ENOENT>.  Other possible I<errno> values are B<ENOMEM>, "
"B<EFAULT>, B<EPERM>, and B<EINVAL>.  This method can be used to iterate over "
"all elements in the map."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<close(map_fd)>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Delete the map referred to by the file descriptor I<map_fd>.  When the user-"
"space program that created a map exits, all maps will be deleted "
"automatically (but see NOTES)."
msgstr ""

#. type: SS
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "eBPF map types"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "The following map types are supported:"
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_MAP_TYPE_HASH>"
msgstr ""

#.  commit 0f8e4bd8a1fc8c4185f1630061d0a1f2d197a475
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Hash-table maps have the following characteristics:"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Maps are created and destroyed by user-space programs.  Both user-space and "
"eBPF programs can perform lookup, update, and delete operations."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "The kernel takes care of allocating and freeing key/value pairs."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The B<map_update_elem>()  helper will fail to insert new element when the "
"I<max_entries> limit is reached.  (This ensures that eBPF programs cannot "
"exhaust memory.)"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "B<map_update_elem>()  replaces existing elements atomically."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Hash-table maps are optimized for speed of lookup."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_MAP_TYPE_ARRAY>"
msgstr ""

#.  commit 28fbcfa08d8ed7c5a50d41a0433aad222835e8e3
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Array maps have the following characteristics:"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Optimized for fastest possible lookup.  In the future the verifier/JIT "
"compiler may recognize lookup() operations that employ a constant key and "
"optimize it into constant pointer.  It is possible to optimize a non-"
"constant key into direct pointer arithmetic as well, since pointers and "
"I<value_size> are constant for the life of the eBPF program.  In other "
"words, B<array_map_lookup_elem>()  may be 'inlined' by the verifier/JIT "
"compiler while preserving concurrent access to this map from user space."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "All array elements pre-allocated and zero initialized at init time"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "The key is an array index, and must be exactly four bytes."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"B<map_delete_elem>()  fails with the error B<EINVAL>, since elements cannot "
"be deleted."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"B<map_update_elem>()  replaces elements in a B<nonatomic> fashion; for "
"atomic updates, a hash-table map should be used instead.  There is however "
"one special case that can also be used with arrays: the atomic built-in "
"B<__sync_fetch_and_add()> can be used on 32 and 64 bit atomic counters.  For "
"example, it can be applied on the whole value itself if it represents a "
"single counter, or in case of a structure containing multiple counters, it "
"could be used on individual counters.  This is quite often useful for "
"aggregation and accounting of events."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Among the uses for array maps are the following:"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"As \"global\" eBPF variables: an array of 1 element whose key is (index) 0 "
"and where the value is a collection of 'global' variables which eBPF "
"programs can use to keep state between events."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Aggregation of tracing events into a fixed set of buckets."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Accounting of networking events, for example, number of packets and packet "
"sizes."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_MAP_TYPE_PROG_ARRAY> (since Linux 4.2)"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"A program array map is a special kind of array map whose map values contain "
"only file descriptors referring to other eBPF programs.  Thus, both the "
"I<key_size> and I<value_size> must be exactly four bytes.  This map is used "
"in conjunction with the B<bpf_tail_call>()  helper."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"This means that an eBPF program with a program array map attached to it can "
"call from kernel side into"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid ""
"void bpf_tail_call(void *context, void *prog_map,\n"
"                   unsigned int index);\n"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"and therefore replace its own program flow with the one from the program at "
"the given program array slot, if present.  This can be regarded as kind of a "
"jump table to a different eBPF program.  The invoked program will then reuse "
"the same stack.  When a jump into the new program has been performed, it "
"won't return to the old program anymore."
msgstr ""

#.  MAX_TAIL_CALL_CNT
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"If no eBPF program is found at the given index of the program array (because "
"the map slot doesn't contain a valid program file descriptor, the specified "
"lookup index/key is out of bounds, or the limit of 32 nested calls has been "
"exceed), execution continues with the current eBPF program.  This can be "
"used as a fall-through for default cases."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"A program array map is useful, for example, in tracing or networking, to "
"handle individual system calls or protocols in their own subprograms and use "
"their identifiers as an individual map index.  This approach may result in "
"performance benefits, and also makes it possible to overcome the maximum "
"instruction limit of a single eBPF program.  In dynamic environments, a user-"
"space daemon might atomically replace individual subprograms at run-time "
"with newer versions to alter overall program behavior, for instance, if "
"global policies change."
msgstr ""

#. type: SS
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "eBPF programs"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The B<BPF_PROG_LOAD> command is used to load an eBPF program into the "
"kernel.  The return value for this command is a new file descriptor "
"associated with this eBPF program."
msgstr ""

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
#, no-wrap
msgid ""
"char bpf_log_buf[LOG_BUF_SIZE];\n"
"\\&\n"
"int\n"
"bpf_prog_load(enum bpf_prog_type type,\n"
"              const struct bpf_insn *insns, int insn_cnt,\n"
"              const char *license)\n"
"{\n"
"    union bpf_attr attr = {\n"
"        .prog_type = type,\n"
"        .insns     = ptr_to_u64(insns),\n"
"        .insn_cnt  = insn_cnt,\n"
"        .license   = ptr_to_u64(license),\n"
"        .log_buf   = ptr_to_u64(bpf_log_buf),\n"
"        .log_size  = LOG_BUF_SIZE,\n"
"        .log_level = 1,\n"
"    };\n"
"\\&\n"
"    return bpf(BPF_PROG_LOAD, &attr, sizeof(attr));\n"
"}\n"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "I<prog_type> is one of the available program types:"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid ""
"enum bpf_prog_type {\n"
"    BPF_PROG_TYPE_UNSPEC,        /* Reserve 0 as invalid\n"
"                                    program type */\n"
"    BPF_PROG_TYPE_SOCKET_FILTER,\n"
"    BPF_PROG_TYPE_KPROBE,\n"
"    BPF_PROG_TYPE_SCHED_CLS,\n"
"    BPF_PROG_TYPE_SCHED_ACT,\n"
"    BPF_PROG_TYPE_TRACEPOINT,\n"
"    BPF_PROG_TYPE_XDP,\n"
"    BPF_PROG_TYPE_PERF_EVENT,\n"
"    BPF_PROG_TYPE_CGROUP_SKB,\n"
"    BPF_PROG_TYPE_CGROUP_SOCK,\n"
"    BPF_PROG_TYPE_LWT_IN,\n"
"    BPF_PROG_TYPE_LWT_OUT,\n"
"    BPF_PROG_TYPE_LWT_XMIT,\n"
"    BPF_PROG_TYPE_SOCK_OPS,\n"
"    BPF_PROG_TYPE_SK_SKB,\n"
"    BPF_PROG_TYPE_CGROUP_DEVICE,\n"
"    BPF_PROG_TYPE_SK_MSG,\n"
"    BPF_PROG_TYPE_RAW_TRACEPOINT,\n"
"    BPF_PROG_TYPE_CGROUP_SOCK_ADDR,\n"
"    BPF_PROG_TYPE_LWT_SEG6LOCAL,\n"
"    BPF_PROG_TYPE_LIRC_MODE2,\n"
"    BPF_PROG_TYPE_SK_REUSEPORT,\n"
"    BPF_PROG_TYPE_FLOW_DISSECTOR,\n"
"    /* See /usr/include/linux/bpf.h for the full list. */\n"
"};\n"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "For further details of eBPF program types, see below."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "The remaining fields of I<bpf_attr> are set as follows:"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "I<insns> is an array of I<struct bpf_insn> instructions."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"I<insn_cnt> is the number of instructions in the program referred to by "
"I<insns>."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"I<license> is a license string, which must be GPL compatible to call helper "
"functions marked I<gpl_only>.  (The licensing rules are the same as for "
"kernel modules, so that also dual licenses, such as \"Dual BSD/GPL\", may be "
"used.)"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"I<log_buf> is a pointer to a caller-allocated buffer in which the in-kernel "
"verifier can store the verification log.  This log is a multi-line string "
"that can be checked by the program author in order to understand how the "
"verifier came to the conclusion that the eBPF program is unsafe.  The format "
"of the output can change at any time as the verifier evolves."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"I<log_size> size of the buffer pointed to by I<log_buf>.  If the size of the "
"buffer is not large enough to store all verifier messages, -1 is returned "
"and I<errno> is set to B<ENOSPC>."
msgstr ""

#. type: Plain text
#: archlinux fedora-40 fedora-rawhide mageia-cauldron
msgid ""
"I<log_level> verbosity level of the verifier.  A value of zero means that "
"the verifier will not provide a log; in this case, I<log_buf> must be a null "
"pointer, and I<log_size> must be zero."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Applying B<close>(2)  to the file descriptor returned by B<BPF_PROG_LOAD> "
"will unload the eBPF program (but see NOTES)."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Maps are accessible from eBPF programs and are used to exchange data between "
"eBPF programs and between eBPF programs and user-space programs.  For "
"example, eBPF programs can process various events (like kprobe, packets) and "
"store their data into a map, and user-space programs can then fetch data "
"from the map.  Conversely, user-space programs can use a map as a "
"configuration mechanism, populating the map with values checked by the eBPF "
"program, which then modifies its behavior on the fly according to those "
"values."
msgstr ""

#. type: SS
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "eBPF program types"
msgstr ""

#
#.  FIXME
#.  Somewhere in this page we need a general introduction to the
#.  bpf_context. For example, how does a BPF program access the
#.  context?
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The eBPF program type (I<prog_type>)  determines the subset of kernel helper "
"functions that the program may call.  The program type also determines the "
"program input (context)\\[em]the format of I<struct bpf_context> (which is "
"the data blob passed into the eBPF program as the first argument)."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"For example, a tracing program does not have the exact same subset of helper "
"functions as a socket filter program (though they may have some helpers in "
"common).  Similarly, the input (context) for a tracing program is a set of "
"register values, while for a socket filter it is a network packet."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The set of functions available to eBPF programs of a given type may increase "
"in the future."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "The following program types are supported:"
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_PROG_TYPE_SOCKET_FILTER> (since Linux 3.19)"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Currently, the set of functions for B<BPF_PROG_TYPE_SOCKET_FILTER> is:"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid ""
"bpf_map_lookup_elem(map_fd, void *key)\n"
"                    /* look up key in a map_fd */\n"
"bpf_map_update_elem(map_fd, void *key, void *value)\n"
"                    /* update key/value */\n"
"bpf_map_delete_elem(map_fd, void *key)\n"
"                    /* delete key in a map_fd */\n"
msgstr ""

#
#.  FIXME: We need some text here to explain how the program
#.  accesses __sk_buff.
#.  See 'struct __sk_buff' and commit 9bac3d6d548e5
#.  Alexei commented:
#.  Actually now in case of SOCKET_FILTER, SCHED_CLS, SCHED_ACT
#.  the program can now access skb fields.
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "The I<bpf_context> argument is a pointer to a I<struct __sk_buff>."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_PROG_TYPE_KPROBE> (since Linux 4.1)"
msgstr ""

#.  commit 94caee8c312d96522bcdae88791aaa9ebcd5f22c
#.  commit a8cb5f556b567974d75ea29c15181c445c541b1f
#.  FIXME Document this program type
#. 	  Describe allowed helper functions for this program type
#. 	  Describe bpf_context for this program type
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "[To be documented]"
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_PROG_TYPE_SCHED_CLS> (since Linux 4.1)"
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<BPF_PROG_TYPE_SCHED_ACT> (since Linux 4.1)"
msgstr ""

#. type: SS
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "Events"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Once a program is loaded, it can be attached to an event.  Various kernel "
"subsystems have different ways to do so."
msgstr ""

#.  commit 89aa075832b0da4402acebd698d0411dcc82d03e
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Since Linux 3.19, the following call will attach the program I<prog_fd> to "
"the socket I<sockfd>, which was created by an earlier call to B<socket>(2):"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid ""
"setsockopt(sockfd, SOL_SOCKET, SO_ATTACH_BPF,\n"
"           &prog_fd, sizeof(prog_fd));\n"
msgstr ""

#.  commit 2541517c32be2531e0da59dfd7efc1ce844644f5
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Since Linux 4.1, the following call may be used to attach the eBPF program "
"referred to by the file descriptor I<prog_fd> to a perf event file "
"descriptor, I<event_fd>, that was created by a previous call to "
"B<perf_event_open>(2):"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "ioctl(event_fd, PERF_EVENT_IOC_SET_BPF, prog_fd);\n"
msgstr ""

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "RETURN VALUE"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "For a successful call, the return value depends on the operation:"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "The new file descriptor associated with the eBPF map."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "The new file descriptor associated with the eBPF program."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "All other commands"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Zero."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
msgstr ""

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "ERRORS"
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<E2BIG>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The eBPF program is too large or a map reached the I<max_entries> limit "
"(maximum number of elements)."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<EACCES>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"For B<BPF_PROG_LOAD>, even though all program instructions are valid, the "
"program has been rejected because it was deemed unsafe.  This may be because "
"it may have accessed a disallowed memory region or an uninitialized stack/"
"register or because the function constraints don't match the actual types or "
"because there was a misaligned memory access.  In this case, it is "
"recommended to call B<bpf>()  again with I<log_level = 1> and examine "
"I<log_buf> for the specific reason provided by the verifier."
msgstr ""

#. type: TP
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
#, no-wrap
msgid "B<EAGAIN>"
msgstr ""

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
msgid ""
"For B<BPF_PROG_LOAD>, indicates that needed resources are blocked.  This "
"happens when the verifier detects pending signals while it is checking the "
"validity of the bpf program.  In this case, just call B<bpf>()  again with "
"the same parameters."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<EBADF>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "I<fd> is not an open file descriptor."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<EFAULT>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"One of the pointers (I<key> or I<value> or I<log_buf> or I<insns>)  is "
"outside the accessible address space."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<EINVAL>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "The value specified in I<cmd> is not recognized by this kernel."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "For B<BPF_MAP_CREATE>, either I<map_type> or attributes are invalid."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"For B<BPF_MAP_*_ELEM> commands, some of the fields of I<union bpf_attr> that "
"are not used by this command are not set to zero."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"For B<BPF_PROG_LOAD>, indicates an attempt to load an invalid program.  eBPF "
"programs can be deemed invalid due to unrecognized instructions, the use of "
"reserved fields, jumps out of range, infinite loops or calls of unknown "
"functions."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<ENOENT>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"For B<BPF_MAP_LOOKUP_ELEM> or B<BPF_MAP_DELETE_ELEM>, indicates that the "
"element with the given I<key> was not found."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<ENOMEM>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Cannot allocate sufficient memory."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<EPERM>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The call was made without sufficient privilege (without the B<CAP_SYS_ADMIN> "
"capability)."
msgstr ""

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "STANDARDS"
msgstr ""

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-leap-15-6 opensuse-tumbleweed
msgid "Linux."
msgstr ""

#. type: SH
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "HISTORY"
msgstr ""

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-leap-15-6 opensuse-tumbleweed
msgid "Linux 3.18."
msgstr ""

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "NOTES"
msgstr ""

#.  commit 1be7f75d1668d6296b80bf35dcf6762393530afc
#.  [Linux 5.6] mtk: The list of available functions is, I think, governed
#.  by the check in net/core/filter.c::bpf_base_func_proto().
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Prior to Linux 4.4, all B<bpf>()  commands require the caller to have the "
"B<CAP_SYS_ADMIN> capability.  From Linux 4.4 onwards, an unprivileged user "
"may create limited programs of type B<BPF_PROG_TYPE_SOCKET_FILTER> and "
"associated maps.  However they may not store kernel pointers within the maps "
"and are presently limited to the following helper functions:"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "get_random"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "get_smp_processor_id"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "tail_call"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "ktime_get_ns"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Unprivileged access may be blocked by writing the value 1 to the file I</"
"proc/sys/kernel/unprivileged_bpf_disabled>."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"eBPF objects (maps and programs) can be shared between processes.  For "
"example, after B<fork>(2), the child inherits file descriptors referring to "
"the same eBPF objects.  In addition, file descriptors referring to eBPF "
"objects can be transferred over UNIX domain sockets.  File descriptors "
"referring to eBPF objects can be duplicated in the usual way, using "
"B<dup>(2)  and similar calls.  An eBPF object is deallocated only after all "
"file descriptors referring to the object have been closed."
msgstr ""

#.  There are also examples for the tc classifier, in the iproute2
#.  project, in examples/bpf
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"eBPF programs can be written in a restricted C that is compiled (using the "
"B<clang> compiler) into eBPF bytecode.  Various features are omitted from "
"this restricted C, such as loops, global variables, variadic functions, "
"floating-point numbers, and passing structures as function arguments.  Some "
"examples can be found in the I<samples/bpf/*_kern.c> files in the kernel "
"source tree."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The kernel contains a just-in-time (JIT) compiler that translates eBPF "
"bytecode into native machine code for better performance.  Before Linux "
"4.15, the JIT compiler is disabled by default, but its operation can be "
"controlled by writing one of the following integer strings to the file I</"
"proc/sys/net/core/bpf_jit_enable>:"
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<0>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Disable JIT compilation (default)."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<1>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Normal compilation."
msgstr ""

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<2>"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Debugging mode.  The generated opcodes are dumped in hexadecimal into the "
"kernel log.  These opcodes can then be disassembled using the program "
"I<tools/net/bpf_jit_disasm.c> provided in the kernel source tree."
msgstr ""

#.  commit 290af86629b25ffd1ed6232c4e9107da031705cb
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Since Linux 4.15, the kernel may configured with the "
"B<CONFIG_BPF_JIT_ALWAYS_ON> option.  In this case, the JIT compiler is "
"always enabled, and the I<bpf_jit_enable> is initialized to 1 and is "
"immutable.  (This kernel configuration option was provided as a mitigation "
"for one of the Spectre attacks against the BPF interpreter.)"
msgstr ""

#.  Last reviewed in Linux 4.18-rc by grepping for BPF_ALU64 in arch/
#.  and by checking the documentation for bpf_jit_enable in
#.  Documentation/sysctl/net.txt
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The JIT compiler for eBPF is currently available for the following "
"architectures:"
msgstr ""

#.  commit 0a14842f5a3c0e88a1e59fac5c3025db39721f74
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "x86-64 (since Linux 3.18; cBPF since Linux 3.0);"
msgstr ""

#.  commit ddecdfcea0ae891f782ae853771c867ab51024c2
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "ARM32 (since Linux 3.18; cBPF since Linux 3.4);"
msgstr ""

#.  commit 2809a2087cc44b55e4377d7b9be3f7f5d2569091
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "SPARC 32 (since Linux 3.18; cBPF since Linux 3.5);"
msgstr ""

#.  commit e54bcde3d69d40023ae77727213d14f920eb264a
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "ARM-64 (since Linux 3.18);"
msgstr ""

#.  commit c10302efe569bfd646b4c22df29577a4595b4580
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "s390 (since Linux 4.1; cBPF since Linux 3.7);"
msgstr ""

#.  commit 0ca87f05ba8bdc6791c14878464efc901ad71e99
#.  commit 156d0e290e969caba25f1851c52417c14d141b24
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "PowerPC 64 (since Linux 4.8; cBPF since Linux 3.1);"
msgstr ""

#.  commit 7a12b5031c6b947cc13918237ae652b536243b76
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "SPARC 64 (since Linux 4.12);"
msgstr ""

#.  commit 03f5781be2c7b7e728d724ac70ba10799cc710d7
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "x86-32 (since Linux 4.18);"
msgstr ""

#.  commit c6610de353da5ca6eee5b8960e838a87a90ead0c
#.  commit f381bf6d82f032b7410185b35d000ea370ac706b
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "MIPS 64 (since Linux 4.18; cBPF since Linux 3.16);"
msgstr ""

#.  commit 2353ecc6f91fd15b893fa01bf85a1c7a823ee4f2
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "riscv (since Linux 5.1)."
msgstr ""

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "EXAMPLES"
msgstr ""

#.                                 == atomic64_add
#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
#, no-wrap
msgid ""
"/* bpf+sockets example:\n"
" * 1. create array map of 256 elements\n"
" * 2. load program that counts number of packets received\n"
" *    r0 = skb-E<gt>data[ETH_HLEN + offsetof(struct iphdr, protocol)]\n"
" *    map[r0]++\n"
" * 3. attach prog_fd to raw socket via setsockopt()\n"
" * 4. print number of received TCP/UDP packets every second\n"
" */\n"
"int\n"
"main(int argc, char *argv[])\n"
"{\n"
"    int sock, map_fd, prog_fd, key;\n"
"    long long value = 0, tcp_cnt, udp_cnt;\n"
"\\&\n"
"    map_fd = bpf_create_map(BPF_MAP_TYPE_ARRAY, sizeof(key),\n"
"                            sizeof(value), 256);\n"
"    if (map_fd E<lt> 0) {\n"
"        printf(\"failed to create map \\[aq]%s\\[aq]\\en\", strerror(errno));\n"
"        /* likely not run as root */\n"
"        return 1;\n"
"    }\n"
"\\&\n"
"    struct bpf_insn prog[] = {\n"
"        BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),        /* r6 = r1 */\n"
"        BPF_LD_ABS(BPF_B, ETH_HLEN + offsetof(struct iphdr, protocol)),\n"
"                                /* r0 = ip-E<gt>proto */\n"
"        BPF_STX_MEM(BPF_W, BPF_REG_10, BPF_REG_0, -4),\n"
"                                /* *(u32 *)(fp - 4) = r0 */\n"
"        BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),       /* r2 = fp */\n"
"        BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -4),      /* r2 = r2 - 4 */\n"
"        BPF_LD_MAP_FD(BPF_REG_1, map_fd),           /* r1 = map_fd */\n"
"        BPF_CALL_FUNC(BPF_FUNC_map_lookup_elem),\n"
"                                /* r0 = map_lookup(r1, r2) */\n"
"        BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 2),\n"
"                                /* if (r0 == 0) goto pc+2 */\n"
"        BPF_MOV64_IMM(BPF_REG_1, 1),                /* r1 = 1 */\n"
"        BPF_XADD(BPF_DW, BPF_REG_0, BPF_REG_1, 0, 0),\n"
"                                /* lock *(u64 *) r0 += r1 */\n"
"        BPF_MOV64_IMM(BPF_REG_0, 0),                /* r0 = 0 */\n"
"        BPF_EXIT_INSN(),                            /* return r0 */\n"
"    };\n"
"\\&\n"
"    prog_fd = bpf_prog_load(BPF_PROG_TYPE_SOCKET_FILTER, prog,\n"
"                            sizeof(prog) / sizeof(prog[0]), \"GPL\");\n"
"\\&\n"
"    sock = open_raw_sock(\"lo\");\n"
"\\&\n"
"    assert(setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &prog_fd,\n"
"                      sizeof(prog_fd)) == 0);\n"
"\\&\n"
"    for (;;) {\n"
"        key = IPPROTO_TCP;\n"
"        assert(bpf_lookup_elem(map_fd, &key, &tcp_cnt) == 0);\n"
"        key = IPPROTO_UDP;\n"
"        assert(bpf_lookup_elem(map_fd, &key, &udp_cnt) == 0);\n"
"        printf(\"TCP %lld UDP %lld packets\\en\", tcp_cnt, udp_cnt);\n"
"        sleep(1);\n"
"    }\n"
"\\&\n"
"    return 0;\n"
"}\n"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Some complete working code can be found in the I<samples/bpf> directory in "
"the kernel source tree."
msgstr ""

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "SEE ALSO"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "B<seccomp>(2), B<bpf-helpers>(7), B<socket>(7), B<tc>(8), B<tc-bpf>(8)"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Both classic and extended BPF are explained in the kernel source file "
"I<Documentation/networking/filter.txt>."
msgstr ""

#. type: TH
#: debian-bookworm
#, no-wrap
msgid "2023-02-05"
msgstr ""

#. type: TH
#: debian-bookworm
#, no-wrap
msgid "Linux man-pages 6.03"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"union bpf_attr {\n"
"    struct {    /* Used by BPF_MAP_CREATE */\n"
"        __u32         map_type;\n"
"        __u32         key_size;    /* size of key in bytes */\n"
"        __u32         value_size;  /* size of value in bytes */\n"
"        __u32         max_entries; /* maximum number of entries\n"
"                                      in a map */\n"
"    };\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    struct {    /* Used by BPF_MAP_*_ELEM and BPF_MAP_GET_NEXT_KEY\n"
"                   commands */\n"
"        __u32         map_fd;\n"
"        __aligned_u64 key;\n"
"        union {\n"
"            __aligned_u64 value;\n"
"            __aligned_u64 next_key;\n"
"        };\n"
"        __u64         flags;\n"
"    };\n"
msgstr ""

#.                  commit 2541517c32be2531e0da59dfd7efc1ce844644f5
#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    struct {    /* Used by BPF_PROG_LOAD */\n"
"        __u32         prog_type;\n"
"        __u32         insn_cnt;\n"
"        __aligned_u64 insns;      /* \\[aq]const struct bpf_insn *\\[aq] */\n"
"        __aligned_u64 license;    /* \\[aq]const char *\\[aq] */\n"
"        __u32         log_level;  /* verbosity level of verifier */\n"
"        __u32         log_size;   /* size of user buffer */\n"
"        __aligned_u64 log_buf;    /* user supplied \\[aq]char *\\[aq]\n"
"                                     buffer */\n"
"        __u32         kern_version;\n"
"                                  /* checked when prog_type=kprobe\n"
"                                     (since Linux 4.1) */\n"
"    };\n"
"} __attribute__((aligned(8)));\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"int\n"
"bpf_create_map(enum bpf_map_type map_type,\n"
"               unsigned int key_size,\n"
"               unsigned int value_size,\n"
"               unsigned int max_entries)\n"
"{\n"
"    union bpf_attr attr = {\n"
"        .map_type    = map_type,\n"
"        .key_size    = key_size,\n"
"        .value_size  = value_size,\n"
"        .max_entries = max_entries\n"
"    };\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    return bpf(BPF_MAP_CREATE, &attr, sizeof(attr));\n"
"}\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"int\n"
"bpf_lookup_elem(int fd, const void *key, void *value)\n"
"{\n"
"    union bpf_attr attr = {\n"
"        .map_fd = fd,\n"
"        .key    = ptr_to_u64(key),\n"
"        .value  = ptr_to_u64(value),\n"
"    };\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    return bpf(BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr));\n"
"}\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"int\n"
"bpf_update_elem(int fd, const void *key, const void *value,\n"
"                uint64_t flags)\n"
"{\n"
"    union bpf_attr attr = {\n"
"        .map_fd = fd,\n"
"        .key    = ptr_to_u64(key),\n"
"        .value  = ptr_to_u64(value),\n"
"        .flags  = flags,\n"
"    };\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    return bpf(BPF_MAP_UPDATE_ELEM, &attr, sizeof(attr));\n"
"}\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"int\n"
"bpf_delete_elem(int fd, const void *key)\n"
"{\n"
"    union bpf_attr attr = {\n"
"        .map_fd = fd,\n"
"        .key    = ptr_to_u64(key),\n"
"    };\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    return bpf(BPF_MAP_DELETE_ELEM, &attr, sizeof(attr));\n"
"}\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"int\n"
"bpf_get_next_key(int fd, const void *key, void *next_key)\n"
"{\n"
"    union bpf_attr attr = {\n"
"        .map_fd   = fd,\n"
"        .key      = ptr_to_u64(key),\n"
"        .next_key = ptr_to_u64(next_key),\n"
"    };\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    return bpf(BPF_MAP_GET_NEXT_KEY, &attr, sizeof(attr));\n"
"}\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "char bpf_log_buf[LOG_BUF_SIZE];\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"int\n"
"bpf_prog_load(enum bpf_prog_type type,\n"
"              const struct bpf_insn *insns, int insn_cnt,\n"
"              const char *license)\n"
"{\n"
"    union bpf_attr attr = {\n"
"        .prog_type = type,\n"
"        .insns     = ptr_to_u64(insns),\n"
"        .insn_cnt  = insn_cnt,\n"
"        .license   = ptr_to_u64(license),\n"
"        .log_buf   = ptr_to_u64(bpf_log_buf),\n"
"        .log_size  = LOG_BUF_SIZE,\n"
"        .log_level = 1,\n"
"    };\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    return bpf(BPF_PROG_LOAD, &attr, sizeof(attr));\n"
"}\n"
msgstr ""

#. type: Plain text
#: debian-bookworm debian-unstable opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"I<log_level> verbosity level of the verifier.  A value of zero means that "
"the verifier will not provide a log; in this case, I<log_buf> must be a NULL "
"pointer, and I<log_size> must be zero."
msgstr ""

#. type: SH
#: debian-bookworm
#, no-wrap
msgid "VERSIONS"
msgstr ""

#. type: Plain text
#: debian-bookworm
msgid "The B<bpf>()  system call first appeared in Linux 3.18."
msgstr ""

#. type: Plain text
#: debian-bookworm
msgid "The B<bpf>()  system call is Linux-specific."
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"/* bpf+sockets example:\n"
" * 1. create array map of 256 elements\n"
" * 2. load program that counts number of packets received\n"
" *    r0 = skb-E<gt>data[ETH_HLEN + offsetof(struct iphdr, protocol)]\n"
" *    map[r0]++\n"
" * 3. attach prog_fd to raw socket via setsockopt()\n"
" * 4. print number of received TCP/UDP packets every second\n"
" */\n"
"int\n"
"main(int argc, char *argv[])\n"
"{\n"
"    int sock, map_fd, prog_fd, key;\n"
"    long long value = 0, tcp_cnt, udp_cnt;\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    map_fd = bpf_create_map(BPF_MAP_TYPE_ARRAY, sizeof(key),\n"
"                            sizeof(value), 256);\n"
"    if (map_fd E<lt> 0) {\n"
"        printf(\"failed to create map \\[aq]%s\\[aq]\\en\", strerror(errno));\n"
"        /* likely not run as root */\n"
"        return 1;\n"
"    }\n"
msgstr ""

#.                                 == atomic64_add
#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    struct bpf_insn prog[] = {\n"
"        BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),        /* r6 = r1 */\n"
"        BPF_LD_ABS(BPF_B, ETH_HLEN + offsetof(struct iphdr, protocol)),\n"
"                                /* r0 = ip-E<gt>proto */\n"
"        BPF_STX_MEM(BPF_W, BPF_REG_10, BPF_REG_0, -4),\n"
"                                /* *(u32 *)(fp - 4) = r0 */\n"
"        BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),       /* r2 = fp */\n"
"        BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -4),      /* r2 = r2 - 4 */\n"
"        BPF_LD_MAP_FD(BPF_REG_1, map_fd),           /* r1 = map_fd */\n"
"        BPF_CALL_FUNC(BPF_FUNC_map_lookup_elem),\n"
"                                /* r0 = map_lookup(r1, r2) */\n"
"        BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 2),\n"
"                                /* if (r0 == 0) goto pc+2 */\n"
"        BPF_MOV64_IMM(BPF_REG_1, 1),                /* r1 = 1 */\n"
"        BPF_XADD(BPF_DW, BPF_REG_0, BPF_REG_1, 0, 0),\n"
"                                /* lock *(u64 *) r0 += r1 */\n"
"        BPF_MOV64_IMM(BPF_REG_0, 0),                /* r0 = 0 */\n"
"        BPF_EXIT_INSN(),                            /* return r0 */\n"
"    };\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    prog_fd = bpf_prog_load(BPF_PROG_TYPE_SOCKET_FILTER, prog,\n"
"                            sizeof(prog) / sizeof(prog[0]), \"GPL\");\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    sock = open_raw_sock(\"lo\");\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    assert(setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &prog_fd,\n"
"                      sizeof(prog_fd)) == 0);\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    for (;;) {\n"
"        key = IPPROTO_TCP;\n"
"        assert(bpf_lookup_elem(map_fd, &key, &tcp_cnt) == 0);\n"
"        key = IPPROTO_UDP;\n"
"        assert(bpf_lookup_elem(map_fd, &key, &udp_cnt) == 0);\n"
"        printf(\"TCP %lld UDP %lld packets\\en\", tcp_cnt, udp_cnt);\n"
"        sleep(1);\n"
"    }\n"
msgstr ""

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    return 0;\n"
"}\n"
msgstr ""

#. type: TH
#: debian-unstable opensuse-tumbleweed
#, no-wrap
msgid "2023-07-28"
msgstr ""

#. type: TH
#: debian-unstable opensuse-tumbleweed
#, no-wrap
msgid "Linux man-pages 6.05.01"
msgstr ""

#. type: TH
#: opensuse-leap-15-6
#, no-wrap
msgid "2023-03-30"
msgstr ""

#. type: TH
#: opensuse-leap-15-6
#, no-wrap
msgid "Linux man-pages 6.04"
msgstr ""