Mercurial > hg > nginx-quic
annotate src/core/ngx_bpf.h @ 8722:02a9ad88e2df quic
QUIC: added missing frame initialization.
Currently, all used fields are initialized, but usage may change in future.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Mon, 06 Dec 2021 11:04:55 +0300 |
parents | d3747ba486e7 |
children |
rev | line source |
---|---|
8268
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
1 |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
2 /* |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
3 * Copyright (C) Nginx, Inc. |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
4 */ |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
5 |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
6 |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
7 #ifndef _NGX_BPF_H_INCLUDED_ |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
8 #define _NGX_BPF_H_INCLUDED_ |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
9 |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
10 |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
11 #include <ngx_config.h> |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
12 #include <ngx_core.h> |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
13 |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
14 #include <linux/bpf.h> |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
15 |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
16 |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
17 typedef struct { |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
18 char *name; |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
19 int offset; |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
20 } ngx_bpf_reloc_t; |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
21 |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
22 typedef struct { |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
23 char *license; |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
24 enum bpf_prog_type type; |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
25 struct bpf_insn *ins; |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
26 size_t nins; |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
27 ngx_bpf_reloc_t *relocs; |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
28 size_t nrelocs; |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
29 } ngx_bpf_program_t; |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
30 |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
31 |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
32 void ngx_bpf_program_link(ngx_bpf_program_t *program, const char *symbol, |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
33 int fd); |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
34 int ngx_bpf_load_program(ngx_log_t *log, ngx_bpf_program_t *program); |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
35 |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
36 int ngx_bpf_map_create(ngx_log_t *log, enum bpf_map_type type, int key_size, |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
37 int value_size, int max_entries, uint32_t map_flags); |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
38 int ngx_bpf_map_update(int fd, const void *key, const void *value, |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
39 uint64_t flags); |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
40 int ngx_bpf_map_delete(int fd, const void *key); |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
41 int ngx_bpf_map_lookup(int fd, const void *key, void *value); |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
42 |
d3747ba486e7
Core: added interface to linux bpf() system call.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
43 #endif /* _NGX_BPF_H_INCLUDED_ */ |