mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-02-09 05:14:37 +08:00
Add http and translate for signal (#73)
* use BPF_NO_GLOBAL_DATA to avoid error on old kernel versions or libbpf versions, use BPF_NO_GLOBAL_DATA * add translate of replace * add socket * add socket http impl * improve userspace program * add desc for http * update translate to eng * add ci for 32
This commit is contained in:
29
src/27-replace/replace.h
Normal file
29
src/27-replace/replace.h
Normal file
@@ -0,0 +1,29 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
#ifndef BAD_BPF_COMMON_H
|
||||
#define BAD_BPF_COMMON_H
|
||||
|
||||
// These are used by a number of
|
||||
// different programs to sync eBPF Tail Call
|
||||
// login between user space and kernel
|
||||
#define PROG_00 0
|
||||
#define PROG_01 1
|
||||
#define PROG_02 2
|
||||
|
||||
// Used when replacing text
|
||||
#define FILENAME_LEN_MAX 50
|
||||
#define TEXT_LEN_MAX 20
|
||||
|
||||
// Simple message structure to get events from eBPF Programs
|
||||
// in the kernel to user spcae
|
||||
#define TASK_COMM_LEN 16
|
||||
#define LOCAL_BUFF_SIZE 64
|
||||
#define loop_size 64
|
||||
#define text_len_max 20
|
||||
|
||||
struct event {
|
||||
int pid;
|
||||
char comm[TASK_COMM_LEN];
|
||||
bool success;
|
||||
};
|
||||
|
||||
#endif // BAD_BPF_COMMON_H
|
||||
Reference in New Issue
Block a user