8#ifndef P4C_EBPF_RUNTIME_UBPF_H
9#define P4C_EBPF_RUNTIME_UBPF_H
12#include "../../ebpf/runtime/pcap_util.h"
13#include "../../ebpf/runtime/ebpf_registry.h"
16struct standard_metadata;
18extern uint64_t entry(
void *,
struct standard_metadata *);
19typedef uint64_t (*packet_filter)(
void *dp,
struct standard_metadata *std_meta);
21void *run_and_record_output(packet_filter entry,
const char *pcap_base, pcap_list_t *pkt_list,
int debug);
23static void inline init_ubpf_table_test(
char *name,
unsigned int key_size,
unsigned int value_size) {
28 .value_size = value_size,
35#define ubpf_printf(fmt, args) \
36 ubpf_printf_test(fmt, args)
37#define ubpf_packet_data(ctx) \
38 ubpf_packet_data_test(ctx)
39#define ubpf_adjust_head(ctx, ofs) \
40 ubpf_adjust_head_test(ctx, ofs)
41#define ubpf_truncate_packet(ctx, maxlen) \
42 ubpf_truncate_packet_test(ctx, maxlen)
43#define ubpf_map_lookup(table, key) \
44 registry_lookup_table_elem(#table, key)
45#define ubpf_map_update(table, key, value) \
46 registry_update_table(#table, key, value, 0)
48#define INIT_UBPF_TABLE(name, key_size, value_size) init_ubpf_table_test("&"name, key_size, value_size)
50#define RUN(entry, pcap_base, num_pcaps, input_list, debug) \
51 run_and_record_output(entry, pcap_base, input_list, debug)
52#define INIT_EBPF_TABLES(debug)
53#define DELETE_EBPF_TABLES(debug)
A helper structure used to describe attributes.
Definition ebpf_registry.h:27