Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/tools/testing/selftests/bpf/progs/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 830 B image not shown  

Quelle  test_sockmap_ktls.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_endian.h>

int cork_byte;
int push_start;
int push_end;
int apply_bytes;
int pop_start;
int pop_end;

struct {
 __uint(type, BPF_MAP_TYPE_SOCKMAP);
 __uint(max_entries, 20);
 __type(key, int);
 __type(value, int);
} sock_map SEC(".maps");

SEC("sk_msg")
int prog_sk_policy(struct sk_msg_md *msg)
{
 if (cork_byte > 0)
  bpf_msg_cork_bytes(msg, cork_byte);
 if (push_start > 0 && push_end > 0)
  bpf_msg_push_data(msg, push_start, push_end, 0);
 if (pop_start >= 0 && pop_end > 0)
  bpf_msg_pop_data(msg, pop_start, pop_end, 0);

 return SK_PASS;
}

SEC("sk_msg")
int prog_sk_policy_redir(struct sk_msg_md *msg)
{
 int two = 2;

 bpf_msg_apply_bytes(msg, apply_bytes);
 return bpf_msg_redirect_map(msg, &sock_map, two, 0);
}

Messung V0.5
C=98 H=100 G=98

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.