mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-02-03 10:14:44 +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:
@@ -3,7 +3,7 @@
|
||||
#include <bpf/bpf_helpers.h>
|
||||
#include <bpf/bpf_tracing.h>
|
||||
#include <bpf/bpf_core_read.h>
|
||||
#include "common.h"
|
||||
#include "replace.h"
|
||||
|
||||
char LICENSE[] SEC("license") = "Dual BSD/GPL";
|
||||
|
||||
@@ -268,7 +268,8 @@ int check_possible_addresses(struct trace_event_raw_sys_exit *ctx) {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// we can use bpf_strncmp here, but it's not available in the kernel version older
|
||||
// we can use bpf_strncmp here,
|
||||
// but it's not available in the kernel version older than 5.17
|
||||
if (bpf_strncmp(name, text_len_max, (const char *)text_find) == 0) {
|
||||
// ***********
|
||||
// We've found out text!
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <argp.h>
|
||||
#include <unistd.h>
|
||||
#include "replace.skel.h"
|
||||
#include "common.h"
|
||||
#include "replace.h"
|
||||
|
||||
|
||||
#include <bpf/bpf.h>
|
||||
|
||||
@@ -26,14 +26,4 @@ struct event {
|
||||
bool success;
|
||||
};
|
||||
|
||||
struct tr_file {
|
||||
char filename[FILENAME_LEN_MAX];
|
||||
unsigned int filename_len;
|
||||
};
|
||||
|
||||
struct tr_text {
|
||||
char text[TEXT_LEN_MAX];
|
||||
unsigned int text_len;
|
||||
};
|
||||
|
||||
#endif // BAD_BPF_COMMON_H
|
||||
Reference in New Issue
Block a user