forked from pluginized-protocols/libxbgp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatic_injection.h
71 lines (52 loc) · 1.47 KB
/
static_injection.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
// Created by thomas on 1/07/20.
//
#ifndef UBPF_TOOLS_STATIC_INJECTION_H
#define UBPF_TOOLS_STATIC_INJECTION_H
#include <include/ebpf_mod_struct.h>
#include <linux/limits.h>
#include "insertion_point.h"
#include "utlist.h"
#include "uthash.h"
// 256 MiB
#define MAX_MEM_PARSE 268435456
struct insertion_point_parser {
struct insertion_point_parser *next;
struct insertion_point_parser *prev;
size_t name_insertion_len;
const char *name_insertion;
int insertion_point_id;
const char *pluglet_name;
size_t pluglet_name_len;
anchor_t anchor;
int seq;
};
struct job_plugin_parser {
unsigned long long int schedule;
struct insertion_point_parser *parser;
};
struct obj_code_list_parser {
UT_hash_handle hh;
int jit;
int permissions;
int add_memchecks;
int use_libffi;
size_t path_len;
char path_code[PATH_MAX];
size_t name_len;
char name[0];
};
struct global_opts_parser {
int extra_mem;
int shared_mem;
int memory_mgt;
int jit_all;
char pluglet_dir[PATH_MAX];
size_t plugin_name_len;
char plugin_name[NAME_MAX];
};
int str_to_id_insertion_point(insertion_point_info_t *info, const char *str, size_t len);
int str_anchor_to_enum(const char *anchor_str, anchor_t *anchor);
int load_extension_code(const char *path, const char *extension_code_dir, proto_ext_fun_t *api_proto,
insertion_point_info_t *points_info);
#endif //UBPF_TOOLS_STATIC_INJECTION_H