# Arabic translation of manpages # This file is distributed under the same license as the manpages-l10n package. # Copyright © of this file: # زايد السعيدي , 2026. msgid "" msgstr "" "Project-Id-Version: manpages-l10n 4.30.2\n" "POT-Creation-Date: 2026-06-05 06:19+0200\n" "PO-Revision-Date: 2026-05-17 17:42+0400\n" "Last-Translator: Zayed Al-Saidi \n" "Language-Team: Arabic \n" "Language: ar\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" "X-Generator: Lokalize 23.08.5\n" #. type: TH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "bpf" msgstr "bpf" #. type: TH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "2026-02-10" msgstr "10 فبراير 2026" #. type: TH #: archlinux debian-unstable #, no-wrap msgid "Linux man-pages 6.18" msgstr "صفحات دليل لينكس 6.18" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "NAME" msgstr "الاسم" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "bpf - perform a command on an extended BPF map or program" msgstr "bpf - تنفيذ أمر على برنامج أو خريطة BPF ممتدة" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "SYNOPSIS" msgstr "موجز" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B<#include Elinux/bpf.hE>\n" msgstr "B<#include Elinux/bpf.hE>\n" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "BIB<, union bpf_attr *>IB<, unsigned int >IB<);>\n" msgstr "BIB<, union bpf_attr *>IB<, unsigned int >IB<);>\n" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "DESCRIPTION" msgstr "الوصف" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B() 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 "" "يُنفذ استدعاء النظام B() مجموعة من العمليات المتعلقة بمرشحات حزم بيركلي " "الممتدة (Berkeley Packet Filters). إن BPF الممتد (أو eBPF) مشابه لـ BPF " "الأصلي (\"التقليدي\" أو cBPF) المستخدم لترشيح حزم الشبكة. وبالنسبة لبرامج " "cBPF و eBPF معًا، تحلل النواة البرامج سكونيًا قبل تحميلها، وذلك لضمان عدم " "إلحاقها الضرر بالنظام المشغل." #. See 'enum bpf_func_id' in include/uapi/linux/bpf.h #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 opcode extension " "provided by eBPF) and access shared data structures such as eBPF maps." msgstr "" "يوسع eBPF نظام cBPF بطرق متعددة، بما في ذلك القدرة على استدعاء مجموعة ثابتة " "من الدوال المساعدة داخل النواة (عبر امتداد شفرة العملية B الذي " "يوفره eBPF) والوصول إلى هياكل البيانات المشتركة مثل خرائط eBPF." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Extended BPF Design/Architecture" msgstr "تصميم/معمارية BPF الممتد" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "خرائط eBPF هي هيكل بيانات عام لتخزين أنواع مختلفة من البيانات. تُعامل أنواع " "البيانات عمومًا ككتل ثنائية، لذا يحدد المستخدم حجم المفتاح وحجم القيمة عند " "وقت إنشاء الخريطة فقط. بمعنى آخر، يمكن أن يكون للمفتاح/القيمة في خريطة معينة " "هيكل تعسفي." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "يمكن لعملية المستخدم إنشاء خرائط متعددة (تكون فيها أزواج المفتاح/القيمة " "عبارة عن بايتات بيانات مبهمة) والوصول إليها عبر واصفات الملفات. يمكن لبرامج " "eBPF المختلفة الوصول إلى الخرائط نفسها بالتوازي. ويعود الأمر لعملية المستخدم " "وبرنامج eBPF لتقرير ما سيخزن داخل الخرائط." #. Defined by the kernel constant MAX_TAIL_CALL_CNT in include/linux/bpf.h #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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(). If a map lookup " "fails, the current program continues its execution. See " "B below for further details." msgstr "" "ثمة نوع خاص من الخرائط يسمى مصفوفة البرامج. يخزن هذا النوع من الخرائط واصفات " "ملفات تشير إلى برامج eBPF أخرى. عند إجراء بحث في الخريطة، يُعاد توجيه تدفق " "البرنامج في مكانه إلى بداية برنامج eBPF آخر ولا يعود إلى البرنامج المستدعِي. " "لمستوى التعشيش حد ثابت هو 32، حتى لا يمكن صياغة حلقات لانهائية. في وقت " "التشغيل، يمكن تعديل واصفات ملفات البرامج المخزنة في الخريطة، وبذلك يمكن " "تغيير وظائف البرنامج بناءً على متطلبات محددة. يجب أن تكون جميع البرامج المشار " "إليها في خريطة مصفوفة البرامج قد حُمّلت مسبقًا في النواة عبر B(). إذا فشل " "البحث في الخريطة، يكمل البرنامج الحالي تنفيذه. انظر " "B أدناه لمزيد من التفاصيل." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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(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()." msgstr "" "عمومًا، تُحمّل برامج eBPF بواسطة عملية المستخدم وتُفرّغ آليًا عند خروج العملية. في " "بعض الحالات، مثل B(8)، سيستمر البرنامج حيًا داخل النواة حتى بعد خروج " "العملية التي حمّلت البرنامج. في هذه الحالة، يحتفظ نظام tc الفرعي بمرجع " "لبرنامج eBPF بعد أن يُغلق واصف الملف بواسطة برنامج مساحة المستخدم. وبالتالي، " "فإن بقاء برنامج معين داخل النواة يعتمد على كيفية ربطه بنظام فرعي معين للنواة " "بعد تحميله عبر B()." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "كل برنامج eBPF هو مجموعة من التعليمات الآمن تشغيلها حتى اكتمالها. يحدد مدقق " "داخل النواة سكونيًا أن برنامج eBPF ينتهي وأنه آمن للتنفيذ. أثناء التحقق، تزيد " "النواة عدادات المراجع لكل خريطة يستخدمها برنامج eBPF، بحيث لا يمكن إزالة " "الخرائط المتصلة حتى يُفرّغ البرنامج." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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(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 "" "يمكن ربط برامج eBPF بأحداث مختلفة. قد تكون هذه الأحداث وصول حزم الشبكة، أو " "أحداث التتبع، أو أحداث التصنيف بواسطة ضوابط طوابير الشبكة (لبرامج eBPF " "المربوطة بمصنف B(8))، وأنواع أخرى قد تُضاف مستقبلاً. يقدح الحدث الجديد " "تنفيذ برنامج eBPF، والذي قد يخزن معلومات عن الحدث في خرائط eBPF. وإلى جانب " "تخزين البيانات، قد تستدعي برامج eBPF مجموعة ثابتة من الدوال المساعدة داخل " "النواة." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The same eBPF program can be attached to multiple events and different eBPF " "programs can access the same map:" msgstr "" "يمكن ربط برنامج eBPF نفسه بأحداث متعددة، ويمكن لبرامج eBPF مختلفة الوصول إلى " "الخريطة ذاتها:" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 tracing E-- 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 "" "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 tracing E-- 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" #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Arguments" msgstr "المعطيات" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The operation to be performed by the B() system call is determined by " "the I argument. Each operation takes an accompanying argument, " "provided via I, which is a pointer to a union of type I (see " "below). The unused fields and padding must be zeroed out before the call. " "The I argument is the size of the union pointed to by I." msgstr "" "تُحدد العملية المطلوب تنفيذها بواسطة استدعاء النظام B() عبر المعطى " "I. تأخذ كل عملية معطى مصاحبًا يُوفر عبر I، وهو مؤشر إلى اتحاد " "(union) من النوع I (انظر أدناه). يجب تصفير الحقول غير المستخدمة " "والحشوات (padding) قبل الاستدعاء. المعطى I هو حجم الاتحاد الذي يشير " "إليه I." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The value provided in I is one of the following:" msgstr "القيمة المقدمة في I هي واحدة مما يلي:" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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(2)) is automatically enabled for " "the new file descriptor." msgstr "" "إنشاء خريطة وإرجاع واصف ملف يشير إليها. يُفعّل علم واصف ملف الإغلاق عند " "التنفيذ (انظر B(2)) آليًا لواصف الملف الجديد." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Look up an element by key in a specified map and return its value." msgstr "البحث عن عنصر بواسطة المفتاح في خريطة محددة وإرجاع قيمته." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Create or update an element (key/value pair) in a specified map." msgstr "إنشاء عنصر أو تحديثه (زوج مفتاح/قيمة) في خريطة محددة." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Look up and delete an element by key in a specified map." msgstr "البحث عن عنصر بواسطة المفتاح وحذفه في خريطة محددة." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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(2)) " "is automatically enabled for the new file descriptor." msgstr "" "التحقق من برنامج eBPF وتحميله، مع إرجاع واصف ملف جديد مرتبط بالبرنامج. يُفعّل " "علم واصف ملف الإغلاق عند التنفيذ (انظر B(2)) آليًا لواصف الملف الجديد." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The I union consists of various anonymous structures that are used " "by different B() commands:" msgstr "" "يتكون اتحاد I من هياكل مجهولة مختلفة تُستخدم بواسطة أوامر B() " "المختلفة:" #. commit 2541517c32be2531e0da59dfd7efc1ce844644f5 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "union bpf_attr {\n" " struct { /* تُستخدم بواسطة BPF_MAP_CREATE */\n" " __u32 map_type;\n" " __u32 key_size; /* حجم المفتاح بالبايت */\n" " __u32 value_size; /* حجم القيمة بالبايت */\n" " __u32 max_entries; /* أقصى عدد من المدخلات\n" " في الخريطة */\n" " };\n" "\\&\n" " struct { /* تُستخدم بواسطة أوامر BPF_MAP_*_ELEM و BPF_MAP_GET_NEXT_KEY */\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 { /* تُستخدم بواسطة 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; /* مستوى إسهاب المدقق */\n" " __u32 log_size; /* حجم مخزن المستخدم المؤقت */\n" " __aligned_u64 log_buf; /* مخزن \\[aq]char *\\[aq] المؤقت\n" " الذي يوفره المستخدم */\n" " __u32 kern_version;\n" " /* يُفحص عندما prog_type=kprobe\n" " (منذ لينكس 4.1) */\n" " };\n" "} __attribute__((aligned(8)));\n" #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "eBPF maps" msgstr "خرائط eBPF" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "الخرائط هي هيكل بيانات عام لتخزين أنواع مختلفة من البيانات. وهي تتيح مشاركة " "البيانات بين برامج eBPF في النواة، وكذلك بين النواة وتطبيقات مساحة المستخدم." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Each map type has the following attributes:" msgstr "لكل نوع خريطة السمات التالية:" #. type: IP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\[bu]" msgstr "\\[bu]" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "type" msgstr "النوع" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "maximum number of elements" msgstr "أقصى عدد من العناصر" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "key size in bytes" msgstr "حجم المفتاح بالبايت" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "value size in bytes" msgstr "حجم القيمة بالبايت" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The following wrapper functions demonstrate how various B() commands " "can be used to access the maps. The functions use the I argument to " "invoke different operations." msgstr "" "توضح الدوال المغلفة التالية كيفية استخدام أوامر B() المختلفة للوصول إلى " "الخرائط. تستخدم الدوال المعطى I لاستدعاء عمليات مختلفة." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B command creates a new map, returning a new file " "descriptor that refers to the map." msgstr "" "يُنشئ الأمر B خريطة جديدة، ويُرجع واصف ملف جديد يشير إلى " "الخريطة." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "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" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The new map has the type specified by I, and attributes as " "specified in I, I, and I. On success, " "this operation returns a file descriptor. On error, -1 is returned and " "I is set to B, B, or B." msgstr "" "للخريطة الجديدة النوع المحدد بواسطة I، والسمات المحددة في " "I و I و I. عند النجاح، تُرجع هذه العملية " "واصف ملف. عند حدوث خطأ، يُرجع -1 ويُضبط I على B أو B أو " "B." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The I and I attributes will be used by the verifier " "during program loading to check that the program is calling " "B() helper functions with a correctly initialized I " "and to check that the program doesn't access the map element I beyond " "the specified I. For example, when a map is created with a " "I of 8 and the eBPF program calls" msgstr "" "ستُستخدم سمتا I و I بواسطة المدقق أثناء تحميل البرنامج " "للتحقق من أن البرنامج يستدعي الدوال المساعدة B() مع I " "مُهيأ بشكل صحيح وللتحقق من أن البرنامج لا يصل إلى عنصر الخريطة I بما " "يتجاوز I المحدد. على سبيل المثال، عندما تُنشأ خريطة بـ " "I قدره 8 ويستدعي برنامج eBPF" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "bpf_map_lookup_elem(map_fd, fp - 4)\n" msgstr "bpf_map_lookup_elem(map_fd, fp - 4)\n" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "the program will be rejected, since the in-kernel helper function" msgstr "سيُرفض البرنامج، لأن الدالة المساعدة داخل النواة" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "bpf_map_lookup_elem(map_fd, void *key)\n" msgstr "bpf_map_lookup_elem(map_fd, void *key)\n" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "expects to read 8 bytes from the location pointed to by I, but the " "I (where I is the top of the stack) starting address will " "cause out-of-bounds stack access." msgstr "" "تتوقع قراءة 8 بايت من الموقع الذي يشير إليه I، لكن عنوان البدء I (حيث I هو قمة المكدس) سيؤدي إلى وصول للمكدس خارج الحدود." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Similarly, when a map is created with a I of 1 and the eBPF " "program contains" msgstr "" "وبالمثل، عندما تُنشأ خريطة بـ I قدره 1 ويحتوي برنامج eBPF على" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "value = bpf_map_lookup_elem(...);\n" "*(u32 *) value = 1;\n" msgstr "" "value = bpf_map_lookup_elem(...);\n" "*(u32 *) value = 1;\n" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "the program will be rejected, since it accesses the I pointer beyond " "the specified 1 byte I limit." msgstr "" "سيُرفض البرنامج، لأنه يصل إلى مؤشر I بما يتجاوز حد 1 بايت لـ " "I المحدد." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Currently, the following values are supported for I:" msgstr "حاليًا، القيم التالية مدعومة لـ I:" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: 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 "" "enum bpf_map_type {\n" " BPF_MAP_TYPE_UNSPEC, /* حجز 0 كنوع خريطة غير صالح */\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" " /* انظر /usr/include/linux/bpf.h للقائمة الكاملة. */\n" "};\n" #. FIXME We need an explanation of why one might choose each of #. these map implementations #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "I selects one of the available map implementations in the kernel. " "For all map types, eBPF programs access maps with the same " "B() and B() helper functions. " "Further details of the various map types are given below." msgstr "" "يختار I أحد تطبيقات الخرائط المتاحة في النواة. بالنسبة لجميع أنواع " "الخرائط، تصل برامج eBPF إلى الخرائط باستخدام نفس الدوال المساعدة " "B() و B(). ترد مزيد من التفاصيل " "حول أنواع الخرائط المختلفة أدناه." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B command looks up an element with a given I " "in the map referred to by the file descriptor I." msgstr "" "يبحث الأمر B عن عنصر بـ I معين في الخريطة التي " "يشير إليها واصف الملف I." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "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" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "If an element is found, the operation returns zero and stores the element's " "value into I, which must point to a buffer of I bytes." msgstr "" "إذا عُثر على عنصر، تُرجع العملية صفرًا وتخزن قيمة العنصر في I، والذي يجب " "أن يشير إلى مخزن مؤقت بحجم I بايت." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "If no element is found, the operation returns -1 and sets I to " "B." msgstr "إذا لم يُعثر على أي عنصر، تُرجع العملية -1 وتُضبط I على B." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B command creates or updates an element with a " "given I in the map referred to by the file descriptor I." msgstr "" "يُنشئ الأمر B عنصرًا أو يحدثه بـ I معطيين في " "الخريطة التي يشير إليها واصف الملف I." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "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" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The I argument should be specified as one of the following:" msgstr "يجب تحديد المعطى I كواحد مما يلي:" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Create a new element or update an existing element." msgstr "إنشاء عنصر جديد أو تحديث عنصر موجود." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Create a new element only if it did not exist." msgstr "أنشئ عنصراً جديداً فقط إذا لم يكن موجوداً." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Update an existing element." msgstr "حدّث عنصراً موجوداً بالفعل." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "On success, the operation returns zero. On error, -1 is returned and " "I is set to B, B, B, or B. B " "indicates that the number of elements in the map reached the I " "limit specified at map creation time. B will be returned if " "I specifies B and the element with I already exists " "in the map. B will be returned if I specifies B " "and the element with I doesn't exist in the map." msgstr "" "عند النجاح، تُعيد العملية صفراً. عند حدوث خطأ، يُعاد -1 ويُضبط I على " "B، أو B، أو B، أو B. تشير B إلى أن عدد " "العناصر في الخريطة قد وصل إلى حد I المحدد وقت إنشاء الخريطة. " "تُعاد B إذا حددت I القيمة B وكان العنصر ذو " "المفتاح I موجوداً بالفعل في الخريطة. وتُعاد B إذا حددت I " "القيمة B وكان العنصر ذو المفتاح I غير موجود في الخريطة." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B command deletes the element whose key is I " "from the map referred to by the file descriptor I." msgstr "" "يحذف الأمر B العنصر الذي مفتاحه I من الخريطة " "المشار إليها بواسطة واصف الملف I." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "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" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "On success, zero is returned. If the element is not found, -1 is returned " "and I is set to B." msgstr "" "عند النجاح، يُعاد صفر. إذا لم يُعثر على العنصر، يُعاد -1 ويُضبط I على " "B." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B command looks up an element by I in the map " "referred to by the file descriptor I and sets the I pointer to " "the key of the next element." msgstr "" "يبحث الأمر B عن عنصر بواسطة I في الخريطة المشار " "إليها بواسطة واصف الملف I ويضبط مؤشر I على مفتاح العنصر التالي." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "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" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "If I is found, the operation returns zero and sets the I " "pointer to the key of the next element. If I is not found, the " "operation returns zero and sets the I pointer to the key of the " "first element. If I is the last element, -1 is returned and I " "is set to B. Other possible I values are B, " "B, B, and B. This method can be used to iterate over " "all elements in the map." msgstr "" "إذا وُجد I، تُعيد العملية صفراً وتضبط مؤشر I على مفتاح العنصر " "التالي. إذا لم يُعثر على I، تُعيد العملية صفراً وتضبط مؤشر I على " "مفتاح العنصر الأول. إذا كان I هو العنصر الأخير، يُعاد -1 ويُضبط I " "على B. قيم I المحتملة الأخرى هي B و B و " "B و B. يمكن استخدام هذا الأسلوب للتكرار عبر جميع العناصر في " "الخريطة." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Delete the map referred to by the file descriptor I. When the user-" "space program that created a map exits, all maps will be deleted " "automatically (but see NOTES)." msgstr "" "احذف الخريطة المشار إليها بواسطة واصف الملف I. عندما يخرج برنامج " "مساحة المستخدم الذي أنشأ الخريطة، ستُحذف جميع الخرائط آلياً (لكن انظر " "الملاحظات NOTES)." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "eBPF map types" msgstr "أنواع خرائط eBPF" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The following map types are supported:" msgstr "أنواع الخرائط التالية مدعومة:" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. commit 0f8e4bd8a1fc8c4185f1630061d0a1f2d197a475 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Hash-table maps have the following characteristics:" msgstr "تتميز خرائط جدول التجزئة (Hash-table) بالخصائص التالية:" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "تُنشأ الخرائط وتُدمر بواسطة برامج مساحة المستخدم. يمكن لكل من برامج مساحة " "المستخدم وبرامج eBPF إجراء عمليات البحث والتحديث والحذف." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The kernel takes care of allocating and freeing key/value pairs." msgstr "تتولى النواة مسؤولية تخصيص وتحرير أزواج المفتاح/القيمة." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B() helper will fail to insert new element when the " "I limit is reached. (This ensures that eBPF programs cannot " "exhaust memory.)" msgstr "" "سيفشل المساعد B() في إدراج عنصر جديد عند الوصول إلى حد " "I. (يضمن هذا عدم استنفاد برامج eBPF للذاكرة.)" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "B() replaces existing elements atomically." msgstr "يستبدل B() العناصر الموجودة بشكل ذري." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Hash-table maps are optimized for speed of lookup." msgstr "خُصصت خرائط جدول التجزئة لتكون محسنة لسرعة البحث." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. commit 28fbcfa08d8ed7c5a50d41a0433aad222835e8e3 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Array maps have the following characteristics:" msgstr "تتميز خرائط المصفوفة (Array) بالخصائص التالية:" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 are constant for the life of the eBPF program. In other " "words, B() may be 'inlined' by the verifier/JIT " "compiler while preserving concurrent access to this map from user space." msgstr "" "خُصصت لتكون محسنة لأسرع بحث ممكن. في المستقبل، قد يتعرف المدقق أو مصرف JIT " "على عمليات lookup() التي تستخدم مفتاحاً ثابتاً ويحسنها إلى مؤشر ثابت. من " "الممكن أيضًا تحسين المفتاح غير الثابت إلى حسابات مؤشرات مباشرة، بما أن " "المؤشرات و I ثابتة طوال عمر برنامج eBPF. بمعنى آخر، قد يُضمن " "B() داخلياً بواسطة المدقق أو مصرف JIT مع الحفاظ على " "الوصول المتزامن لهذه الخريطة من مساحة المستخدم." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "All array elements pre-allocated and zero initialized at init time" msgstr "جميع عناصر المصفوفة مخصصة مسبقاً ومصفرة عند التهيئة." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The key is an array index, and must be exactly four bytes." msgstr "المفتاح هو فهرس مصفوفة، ويجب أن يكون أربعة بايتات بالضبط." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "B() fails with the error B, since elements cannot " "be deleted." msgstr "يفشل B() بالخطأ B، حيث لا يمكن حذف العناصر." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "B() replaces elements in a B 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 "" "يستبدل B() العناصر بطريقة غير ذرية (nonatomic)؛ وللتحديثات " "الذرية، يجب استخدام خريطة جدول تجزئة بدلاً من ذلك. ومع ذلك، توجد حالة خاصة " "واحدة يمكن استخدامها أيضًا مع المصفوفات: يمكن استخدام البنية الذرية المدمجة " "B<__sync_fetch_and_add()> على العدادات الذرية ذات 32 و 64 بت. على سبيل " "المثال، يمكن تطبيقها على القيمة بأكملها إذا كانت تمثل عداداً واحداً، أو في " "حالة وجود بنية تحتوي على عدادات متعددة، يمكن استخدامها على عدادات فردية. " "وهذا مفيد غالباً لتجميع وحساب الأحداث." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Among the uses for array maps are the following:" msgstr "من بين استخدامات خرائط المصفوفة ما يلي:" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "كمتغيرات eBPF \"عالمية\": مصفوفة من عنصر واحد مفتاحها هو (الفهرس) 0 وتكون " "القيمة فيها عبارة عن مجموعة من المتغيرات 'العالمية' التي يمكن لبرامج eBPF " "استخدامها للحفاظ على الحالة بين الأحداث." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Aggregation of tracing events into a fixed set of buckets." msgstr "تجميع أحداث التتبع في مجموعة ثابتة من السلال (buckets)." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Accounting of networking events, for example, number of packets and packet " "sizes." msgstr "حساب أحداث الشبكة، مثل عدد الحزم وأحجام الحزم." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B (since Linux 4.2)" msgstr "B (منذ لينكس 4.2)" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 and I must be exactly four bytes. This map is used " "in conjunction with the B() helper." msgstr "" "خريطة مصفوفة البرامج هي نوع خاص من خرائط المصفوفة التي تحتوي قيمها فقط على " "واصفات ملفات تشير إلى برامج eBPF أخرى. وبالتالي، يجب أن يكون كل من " "I و I أربعة بايتات بالضبط. تُستخدم هذه الخريطة " "بالاقتران مع المساعد B()." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "This means that an eBPF program with a program array map attached to it can " "call from kernel side into" msgstr "" "هذا يعني أن برنامج eBPF الذي أُرفقت به خريطة مصفوفة برامج يمكنه الاستدعاء من " "جانب النواة إلى" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "void bpf_tail_call(void *context, void *prog_map,\n" " unsigned int index);\n" msgstr "" "void bpf_tail_call(void *context, void *prog_map,\n" " unsigned int index);\n" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "وبالتالي يستبدل تدفق البرنامج الخاص به بالتدفق الموجود في البرنامج عند فتحة " "مصفوفة البرامج المعطاة، إن وجد. يمكن اعتبار ذلك نوعاً من جدول القفز إلى " "برنامج eBPF مختلف. سيعيد البرنامج المُستدعى استخدام نفس المكدس. عند تنفيذ " "القفزة إلى البرنامج الجديد، لن يعود إلى البرنامج القديم مرة أخرى." #. MAX_TAIL_CALL_CNT #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "إذا لم يُعثر على برنامج eBPF عند الفهرس المعطى لمصفوفة البرامج (بسبب عدم " "احتواء فتحة الخريطة على واصف ملف برنامج صالح، أو لأن فهرس/مفتاح البحث المحدد " "خارج النطاق، أو تجاوز حد 32 استدعاءً متداخلاً)، يستمر التنفيذ مع برنامج eBPF " "الحالي. يمكن استخدام ذلك كمسار احتياطي للحالات المبدئية." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "تعد خريطة مصفوفة البرامج مفيدة، على سبيل المثال، في التتبع أو الشبكات، " "للتعامل مع استدعاءات النظام أو البروتوكولات الفردية في برامجها الفرعية " "الخاصة واستخدام معرفاتها كفهرس خريطة فردي. قد يؤدي هذا النهج إلى فوائد في " "الأداء، كما يجعل من الممكن التغلب على الحد الأقصى للتعليمات لبرنامج eBPF " "واحد. في البيئات الديناميكية، قد يستبدل عفريت (daemon) مساحة المستخدم بشكل " "ذري البرامج الفرعية الفردية في وقت التشغيل بإصدارات أحدث لتغيير سلوك " "البرنامج العام، على سبيل المثال، إذا تغيرت السياسات العالمية." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "eBPF programs" msgstr "برامج eBPF" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B 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 "" "يُستخدم الأمر B لتحميل برنامج eBPF في النواة. القيمة المعادة " "لهذا الأمر هي واصف ملف جديد مرتبط ببرنامج eBPF هذا." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "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" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "I is one of the available program types:" msgstr "يكون I واحداً من أنواع البرامج المتاحة:" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: 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 "" "enum bpf_prog_type {\n" " BPF_PROG_TYPE_UNSPEC, /* حجز 0 كنوع برنامج\n" " غير صالح */\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" " /* انظر /usr/include/linux/bpf.h للقائمة الكاملة. */\n" "};\n" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "For further details of eBPF program types, see below." msgstr "لمزيد من التفاصيل حول أنواع برامج eBPF، انظر أدناه." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The remaining fields of I are set as follows:" msgstr "تُضبط الحقول المتبقية من I على النحو التالي:" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "I is an array of I instructions." msgstr "I عبارة عن مصفوفة من تعليمات I." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "I is the number of instructions in the program referred to by " "I." msgstr "I هو عدد التعليمات في البرنامج المشار إليه بواسطة I." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "I is a license string, which must be GPL compatible to call helper " "functions marked I. (The licensing rules are the same as for " "kernel modules, so that also dual licenses, such as \"Dual BSD/GPL\", may be " "used.)" msgstr "" "I هي سلسلة الترخيص، والتي يجب أن تكون متوافقة مع GPL لاستدعاء " "الدوال المساعدة المميزة بـ I. (قواعد الترخيص هي نفسها المتبعة في " "وحدات النواة، لذا يمكن أيضًا استخدام التراخيص المزدوجة، مثل \"Dual BSD/GPL\".)" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "I 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 "" "I هو مؤشر إلى مخزن مؤقت خصصه المستدعِي (caller) حيث يمكن لمدقق داخل " "النواة تخزين سجل التحقق فيه. هذا السجل عبارة عن سلسلة متعددة الأسطر يمكن " "لمؤلف البرنامج فحصها لفهم كيف توصل المدقق إلى استنتاج مفاده أن برنامج eBPF " "غير آمن. قد يتغير تنسيق المخرجات في أي وقت مع تطور المدقق." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "I size of the buffer pointed to by I. If the size of the " "buffer is not large enough to store all verifier messages, -1 is returned " "and I is set to B." msgstr "" "I هو حجم المخزن المؤقت الذي يشير إليه I. إذا لم يكن حجم " "المخزن المؤقت كبيراً بما يكفي لتخزين جميع رسائل المدقق، يُعاد -1 ويُضبط " "I على B." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "I verbosity level of the verifier. A value of zero means that " "the verifier will not provide a log; in this case, I must be a null " "pointer, and I must be zero." msgstr "" "I هو مستوى إسهاب المدقق. تعني القيمة صفر أن المدقق لن يقدم سجلاً؛ " "في هذه الحالة، يجب أن يكون I مؤشراً فارغاً (null)، ويجب أن يكون " "I صفراً." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Applying B(2) to the file descriptor returned by B " "will unload the eBPF program (but see NOTES)." msgstr "" "يؤدي تطبيق B(2) على واصف الملف المعاد بواسطة B إلى " "إلغاء تحميل برنامج eBPF (ولكن انظر الملاحظات NOTES)." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "يمكن الوصول إلى الخرائط من برامج eBPF وتُستخدم لتبادل البيانات بين برامج eBPF " "وبين برامج eBPF وبرامج مساحة المستخدم. على سبيل المثال، يمكن لبرامج eBPF " "معالجة أحداث مختلفة (مثل kprobe والحزم) وتخزين بياناتها في خريطة، ومن ثم " "يمكن لبرامج مساحة المستخدم جلب البيانات من الخريطة. وعلى العكس، يمكن لبرامج " "مساحة المستخدم استخدام الخريطة كآلية ضبط، فتملأ الخريطة بالقيم التي يفحصها " "برنامج eBPF، والذي يعدل سلوكه بعد ذلك أثناء التشغيل وفقاً لتلك القيم." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "eBPF program types" msgstr "أنواع برامج eBPF" # #. #-#-#-#-# archlinux: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. 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 #. #-#-#-#-# debian-trixie: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. 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 #. #-#-#-#-# debian-unstable: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. 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 #. #-#-#-#-# fedora-44: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. 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 #. #-#-#-#-# fedora-rawhide: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. 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 #. #-#-#-#-# mageia-cauldron: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. 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 #. #-#-#-#-# opensuse-leap-16-1: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. 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 #. #-#-#-#-# opensuse-tumbleweed: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. 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-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The eBPF program type (I) 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 (which is " "the data blob passed into the eBPF program as the first argument)." msgstr "" "يحدد نوع برنامج eBPF (I) المجموعة الفرعية من الدوال المساعدة " "للنواة التي قد يستدعيها البرنامج. كما يحدد نوع البرنامج مدخلات البرنامج " "(السياق) — تنسيق I (وهو كتلة البيانات الممررة إلى برنامج " "eBPF كمعامل أول)." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The set of functions available to eBPF programs of a given type may increase " "in the future." msgstr "قد تزداد مجموعة الدوال المتاحة لبرامج eBPF من نوع معين في المستقبل." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The following program types are supported:" msgstr "أنواع البرامج التالية مدعومة:" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B (since Linux 3.19)" msgstr "B (منذ لينكس 3.19)" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Currently, the set of functions for B is:" msgstr "حالياً، مجموعة الدوال لـ B هي:" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "bpf_map_lookup_elem(map_fd, void *key)\n" " /* ابحث عن مفتاح في map_fd */\n" "bpf_map_update_elem(map_fd, void *key, void *value)\n" " /* حدّث المفتاح/القيمة */\n" "bpf_map_delete_elem(map_fd, void *key)\n" " /* احذف مفتاحاً في map_fd */\n" # #. 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-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The I argument is a pointer to a I." msgstr "المعامل I هو مؤشر إلى I." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B (since Linux 4.1)" msgstr "B (منذ لينكس 4.1)" #. 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-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "[To be documented]" msgstr "[سيُوثّق]" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B (since Linux 4.1)" msgstr "B (منذ لينكس 4.1)" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B (since Linux 4.1)" msgstr "B (منذ لينكس 4.1)" #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Events" msgstr "أحداث" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Since Linux 3.19, the following call will attach the program I to " "the socket I, which was created by an earlier call to B(2):" msgstr "" "بدءًا من لينكس 3.19، سيقوم الاستدعاء التالي بربط البرنامج I بالمقبس " "I، الذي أُنشئ عبر استدعاء سابق لـ B(2):" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "setsockopt(sockfd, SOL_SOCKET, SO_ATTACH_BPF,\n" " &prog_fd, sizeof(prog_fd));\n" msgstr "" "setsockopt(sockfd, SOL_SOCKET, SO_ATTACH_BPF,\n" " &prog_fd, sizeof(prog_fd));\n" #. commit 2541517c32be2531e0da59dfd7efc1ce844644f5 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 to a perf event file " "descriptor, I, that was created by a previous call to " "B(2):" msgstr "" "بدءًا من لينكس 4.1، يمكن استخدام الاستدعاء التالي لربط برنامج eBPF المشار " "إليه بواسطة واصف الملف I بواصف ملف حدث perf، I، الذي أُنشئ " "عبر استدعاء سابق لـ B(2):" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "ioctl(event_fd, PERF_EVENT_IOC_SET_BPF, prog_fd);\n" msgstr "ioctl(event_fd, PERF_EVENT_IOC_SET_BPF, prog_fd);\n" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "RETURN VALUE" msgstr "قيمة الإرجاع" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "For a successful call, the return value depends on the operation:" msgstr "في حالة الاستدعاء الناجح، تعتمد قيمة الإرجاع على العملية:" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The new file descriptor associated with the eBPF map." msgstr "واصف الملف الجديد المرتبط بخريطة eBPF." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The new file descriptor associated with the eBPF program." msgstr "واصف الملف الجديد المرتبط ببرنامج eBPF." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "All other commands" msgstr "كل الأوامر الأخرى" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Zero." msgstr "صفر." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "On error, -1 is returned, and I is set to indicate the error." msgstr "عند الخطأ، تُعاد القيمة -1، ويُضبط I للإشارة إلى الخطأ." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "ERRORS" msgstr "الأخطاء" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The eBPF program is too large or a map reached the I limit " "(maximum number of elements)." msgstr "" "برنامج eBPF كبير جدًا أو وصلت الخريطة إلى حد I (العدد الأقصى " "للعناصر)." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "For B, 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() again with I and examine " "I for the specific reason provided by the verifier." msgstr "" "بالنسبة لـ B، وعلى الرغم من أن جميع تعليمات البرنامج صالحة، " "إلا أنه رُفض لأنه اعتبر غير آمن. قد يكون ذلك بسبب وصوله إلى منطقة ذاكرة غير " "مسموح بها أو مكدس/سجل غير مهيأ، أو لأن قيود الدالة لا تطابق الأنواع الفعلية، " "أو بسبب وجود وصول غير محاذٍ للذاكرة. في هذه الحالة، يُنصح باستدعاء B() " "مجددًا مع ضبط I وفحص I لمعرفة السبب المحدد الذي قدمه " "المدقق." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "For B, 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() again with " "the same parameters." msgstr "" "بالنسبة لـ B، يشير هذا إلى أن الموارد المطلوبة محجوبة. يحدث " "هذا عندما يكتشف المدقق إشارات معلقة أثناء فحصه لصلاحية برنامج bpf. في هذه " "الحالة، ما عليك سوى استدعاء B() مجددًا بنفس المعاملات." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "I is not an open file descriptor." msgstr "I ليس واصف ملف مفتوح." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "One of the pointers (I or I or I or I) is " "outside the accessible address space." msgstr "" "أحد المؤشرات (I أو I أو I أو I) يقع خارج مساحة " "العناوين التي يمكن الوصول إليها." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The value specified in I is not recognized by this kernel." msgstr "القيمة المحددة في I غير معروفة لهذه النواة." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "For B, either I or attributes are invalid." msgstr "بالنسبة لـ B، إما I أو السمات غير صالحة." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "For B commands, some of the fields of I that " "are not used by this command are not set to zero." msgstr "" "بالنسبة لأوامر B، بعض حقول I التي لا " "يستخدمها هذا الأمر لم تُضبط على صفر." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "For B, 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 "" "بالنسبة لـ B، يشير إلى محاولة تحميل برنامج غير صالح. يمكن " "اعتبار برامج eBPF غير صالحة بسبب تعليمات غير معروفة، أو استخدام حقول محجوزة، " "أو قفزات خارج النطاق، أو حلقات لانهائية، أو استدعاء دوال مجهولة." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "For B or B, indicates that the " "element with the given I was not found." msgstr "" "بالنسبة لأوامر B أو B، يشير إلى أن " "العنصر ذا المفتاح I المعطى لم يُعثر عليه." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Cannot allocate sufficient memory." msgstr "تعذر تخصيص ذاكرة كافية." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The call was made without sufficient privilege (without the B " "capability)." msgstr "أُجري الاستدعاء دون امتياز كافٍ (بدون قدرة B)." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "STANDARDS" msgstr "المعايير" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Linux." msgstr "لينكس." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "HISTORY" msgstr "التاريخ" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Linux 3.18." msgstr "لينكس 3.18." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Prior to Linux 4.4, all B() commands require the caller to have the " "B capability. From Linux 4.4 onwards, an unprivileged user " "may create limited programs of type B and " "associated maps. However they may not store kernel pointers within the maps " "and are presently limited to the following helper functions:" msgstr "" "قبل لينكس 4.4، كانت جميع أوامر B() تتطلب أن يمتلك المستدعِي قدرة " "B. بدءًا من لينكس 4.4 فصاعدًا، قد يقوم مستخدم غير ممتلك " "للامتيازات بإنشاء برامج محدودة من النوع B " "والخرائط المرتبطة بها. ومع ذلك، لا يجوز لهم تخزين مؤشرات النواة داخل الخرائط " "وهم مقيدون حاليًا بدوال المساعدة التالية:" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "get_random" msgstr "get_random" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "get_smp_processor_id" msgstr "get_smp_processor_id" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "tail_call" msgstr "tail_call" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "ktime_get_ns" msgstr "ktime_get_ns" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Unprivileged access may be blocked by writing the value 1 to the file I." msgstr "" "يمكن حظر وصول غير ذوي الامتيازات عبر كتابة القيمة 1 إلى الملف I." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "eBPF objects (maps and programs) can be shared between processes. For " "example, after B(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(2) and similar calls. An eBPF object is deallocated only after all " "file descriptors referring to the object have been closed." msgstr "" "يمكن مشاركة كائنات eBPF (الخرائط والبرامج) بين العمليات. على سبيل المثال، " "بعد B(2)، يرث الابن واصفات الملفات التي تشير إلى نفس كائنات eBPF. " "بالإضافة إلى ذلك، يمكن نقل واصفات الملفات التي تشير إلى كائنات eBPF عبر " "مقابس نطاق يونكس. كما يمكن مضاهاة واصفات الملفات التي تشير إلى كائنات eBPF " "بالطريقة المعتادة، باستخدام B(2) والاستدعاءات المماثلة. يُحرر تخصيص كائن " "eBPF فقط بعد إغلاق جميع واصفات الملفات التي تشير إلى ذلك الكائن." #. There are also examples for the tc classifier, in the iproute2 #. project, in examples/bpf #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "eBPF programs can be written in a restricted C that is compiled (using the " "B 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 files in the kernel " "source tree." msgstr "" "يمكن كتابة برامج eBPF بلغة C مقيدة تُصرَّف (باستخدام مصرِّف B) إلى رمز " "بايتات (bytecode) لـ eBPF. حُذفت ميزات متنوعة من لغة C المقيدة هذه، مثل " "الحلقات، والمتغيرات العامة، والدوال متنوعة المعاملات، والأعداد ذات الفاصلة " "العائمة، وتمرير الهياكل كمعاملات للدوال. يمكن العثور على بعض الأمثلة في " "ملفات I في شجرة مصادر النواة." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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:" msgstr "" "تحتوي النواة على مصرِّف في الوقت المناسب (JIT) يترجم رمز بايتات eBPF إلى رمز " "آلة أصيل للحصول على أداء أفضل. قبل لينكس 4.15، كان مصرِّف JIT معطلاً بشكل " "مبدئي، ولكن يمكن التحكم في عمله عبر كتابة إحدى السلاسل الصحيحة التالية إلى " "الملف I:" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B<0>" msgstr "B<0>" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Disable JIT compilation (default)." msgstr "تعطيل تصريف JIT (مبدئي)." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B<1>" msgstr "B<1>" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Normal compilation." msgstr "تصريف عادي." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B<2>" msgstr "B<2>" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 provided in the kernel source tree." msgstr "" "وضع التنقيح. تُفرغ رموز العمليات (opcodes) المولدة بصيغة ست عشرية في سجل " "النواة. يمكن بعد ذلك تفكيك هذه الرموز باستخدام البرنامج I المتوفر في شجرة مصادر النواة." #. commit 290af86629b25ffd1ed6232c4e9107da031705cb #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Since Linux 4.15, the kernel may be configured with the " "B option. In this case, the JIT compiler is " "always enabled, and the I 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 "" "بدءًا من لينكس 4.15، قد تُضبط النواة مع الخيار B. في " "هذه الحالة، يكون مصرِّف JIT مفعلاً دائمًا، ويُهيأ I إلى القيمة 1 " "ويكون غير قابل للتغيير. (وُفر خيار ضبط النواة هذا كتخفيف لإحدى هجمات Spectre " "ضد مفسر BPF.)" #. #-#-#-#-# archlinux: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. type: Plain text #. #-#-#-#-# debian-trixie: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. 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 #. #-#-#-#-# debian-unstable: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. type: Plain text #. #-#-#-#-# fedora-44: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. 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 #. #-#-#-#-# fedora-rawhide: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. 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 #. #-#-#-#-# mageia-cauldron: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. type: Plain text #. #-#-#-#-# opensuse-leap-16-1: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. type: Plain text #. #-#-#-#-# opensuse-tumbleweed: bpf.2.pot (PACKAGE VERSION) #-#-#-#-# #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The JIT compiler for eBPF is currently available for the following " "architectures:" msgstr "يتوفر مصرِّف JIT لـ eBPF حاليًا للمعماريت التالية:" #. commit 0a14842f5a3c0e88a1e59fac5c3025db39721f74 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "x86-64 (since Linux 3.18; cBPF since Linux 3.0);" msgstr "x86-64 (منذ لينكس 3.18؛ cBPF منذ لينكس 3.0)؛" #. commit ddecdfcea0ae891f782ae853771c867ab51024c2 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "ARM32 (since Linux 3.18; cBPF since Linux 3.4);" msgstr "ARM32 (منذ لينكس 3.18؛ cBPF منذ لينكس 3.4)؛" #. commit 2809a2087cc44b55e4377d7b9be3f7f5d2569091 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "SPARC 32 (since Linux 3.18; cBPF since Linux 3.5);" msgstr "SPARC 32 (منذ لينكس 3.18؛ cBPF منذ لينكس 3.5)؛" #. commit e54bcde3d69d40023ae77727213d14f920eb264a #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "ARM-64 (since Linux 3.18);" msgstr "ARM-64 (منذ لينكس 3.18)؛" #. commit c10302efe569bfd646b4c22df29577a4595b4580 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "s390 (since Linux 4.1; cBPF since Linux 3.7);" msgstr "s390 (منذ لينكس 4.1؛ cBPF منذ لينكس 3.7)؛" #. commit 0ca87f05ba8bdc6791c14878464efc901ad71e99 #. commit 156d0e290e969caba25f1851c52417c14d141b24 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "PowerPC 64 (since Linux 4.8; cBPF since Linux 3.1);" msgstr "PowerPC 64 (منذ لينكس 4.8؛ cBPF منذ لينكس 3.1)؛" #. commit 7a12b5031c6b947cc13918237ae652b536243b76 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "SPARC 64 (since Linux 4.12);" msgstr "SPARC 64 (منذ لينكس 4.12)؛" #. commit 03f5781be2c7b7e728d724ac70ba10799cc710d7 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "x86-32 (since Linux 4.18);" msgstr "x86-32 (منذ لينكس 4.18)؛" #. commit c6610de353da5ca6eee5b8960e838a87a90ead0c #. commit f381bf6d82f032b7410185b35d000ea370ac706b #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "MIPS 64 (since Linux 4.18; cBPF since Linux 3.16);" msgstr "MIPS 64 (منذ لينكس 4.18؛ cBPF منذ لينكس 3.16)؛" #. commit 2353ecc6f91fd15b893fa01bf85a1c7a823ee4f2 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "riscv (since Linux 5.1)." msgstr "riscv (منذ لينكس 5.1)." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "EXAMPLES" msgstr "أمثلة" #. == atomic64_add #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "" "#include Estdcountof.hE\n" "\\&\n" "/* bpf+sockets example:\n" " * 1. create array map of 256 elements\n" " * 2. load program that counts number of packets received\n" " * r0 = skb-Edata[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 0) {\n" " printf(\"failed to create map \\[aq]%s\\[aq]\\[rs]n\", 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-Eproto */\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" " countof(prog), \"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\\[rs]n\", tcp_cnt, udp_cnt);\n" " sleep(1);\n" " }\n" "\\&\n" " return 0;\n" "}\n" msgstr "" "#include Estdcountof.hE\n" "\\&\n" "/* bpf+sockets example:\n" " * 1. create array map of 256 elements\n" " * 2. load program that counts number of packets received\n" " * r0 = skb-Edata[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 0) {\n" " printf(\"failed to create map \\[aq]%s\\[aq]\\[rs]n\", 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-Eproto */\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" " countof(prog), \"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\\[rs]n\", tcp_cnt, udp_cnt);\n" " sleep(1);\n" " }\n" "\\&\n" " return 0;\n" "}\n" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Some complete working code can be found in the I directory in " "the kernel source tree." msgstr "" "يمكن العثور على بعض الأكواد العاملة الكاملة في دليل I في شجرة " "مصادر النواة." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "SEE ALSO" msgstr "انظر أيضًا" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "B(2), B(7), B(7), B(8), B(8)" msgstr "B(2), B(7), B(7), B(8), B(8)" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Both classic and extended BPF are explained in the kernel source file " "I." msgstr "" "شُرح كل من BPF التقليدي والممتد في ملف مصدر النواة I." #. type: TH #: debian-trixie #, no-wrap msgid "2024-06-15" msgstr "15 يونيو 2024" #. type: TH #: debian-trixie #, no-wrap msgid "Linux man-pages 6.9.1" msgstr "صفحات دليل لينكس 6.9.1" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, 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 "" "enum bpf_map_type {\n" " BPF_MAP_TYPE_UNSPEC, /* احجز 0 كنوع خريطة غير صالح */\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" " /* انظر /usr/include/linux/bpf.h للقائمة الكاملة. */\n" "};\n" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, 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 "" "enum bpf_prog_type {\n" " BPF_PROG_TYPE_UNSPEC, /* احجز 0 كنوع\n" " برنامج غير صالح */\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" " /* انظر /usr/include/linux/bpf.h للقائمة الكاملة. */\n" "};\n" #. == atomic64_add #. type: Plain text #: debian-trixie #, 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-Edata[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 0) {\n" " printf(\"failed to create map \\[aq]%s\\[aq]\\[rs]n\", 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-Eproto */\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\\[rs]n\", tcp_cnt, udp_cnt);\n" " sleep(1);\n" " }\n" "\\&\n" " return 0;\n" "}\n" msgstr "" "/* bpf+sockets example:\n" " * 1. create array map of 256 elements\n" " * 2. load program that counts number of packets received\n" " * r0 = skb-Edata[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 0) {\n" " printf(\"failed to create map \\[aq]%s\\[aq]\\[rs]n\", 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-Eproto */\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\\[rs]n\", tcp_cnt, udp_cnt);\n" " sleep(1);\n" " }\n" "\\&\n" " return 0;\n" "}\n" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "Both classic and extended BPF are explained in the kernel source file " "I." msgstr "" "شُرح كل من BPF التقليدي والممتد في ملف مصدر النواة I." #. type: TH #: fedora-44 fedora-rawhide #, no-wrap msgid "2025-01-05" msgstr "5 يناير 2025" #. type: TH #: fedora-44 fedora-rawhide #, no-wrap msgid "Linux man-pages 6.13" msgstr "صفحات دليل لينكس 6.13" #. == atomic64_add #. type: Plain text #: fedora-44 fedora-rawhide #, 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-Edata[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 0) {\n" " printf(\"failed to create map \\[aq]%s\\[aq]\\[rs]n\", 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-Eproto */\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\\[rs]n\", tcp_cnt, udp_cnt);\n" " sleep(1);\n" " }\n" "\\&\n" " return 0;\n" "}\n" msgstr "" "/* bpf+sockets example:\n" " * 1. create array map of 256 elements\n" " * 2. load program that counts number of packets received\n" " * r0 = skb-Edata[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 0) {\n" " printf(\"failed to create map \\[aq]%s\\[aq]\\[rs]n\", 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-Eproto */\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\\[rs]n\", tcp_cnt, udp_cnt);\n" " sleep(1);\n" " }\n" "\\&\n" " return 0;\n" "}\n" #. type: TH #: mageia-cauldron #, no-wrap msgid "Linux man-pages 6.17" msgstr "صفحات دليل لينكس 6.17" #. type: TH #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Linux man-pages (unreleased)" msgstr "صفحات دليل لينكس (لم تصدر بعد)"