Skip to content

Commit

Permalink
libxdp: add run config
Browse files Browse the repository at this point in the history
  • Loading branch information
hack3ric committed Jan 15, 2025
1 parent 34b4f17 commit 58bf68f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions bpf/ingress.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
#include "common/try.h"
#include "main.h"

#ifdef MIMIC_USE_LIBXDP
#include <xdp/xdp_helpers.h>
struct {
__uint(priority, 5);
__uint(XDP_PASS, 1);
} XDP_RUN_CONFIG(my_xdp_func);
#endif

// Move back n bytes, shrink socket buffer and restore data.
//
// XXX: Not handling TCP options appended by middleboxes
Expand Down
5 changes: 4 additions & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ struct args {
struct filter_settings gsettings;
unsigned int filter_count;
int xdp_mode;
#ifdef MIMIC_USE_LIBXDP
bool use_libxdp;
#endif
} run;
struct show_args {
const char* ifname;
Expand All @@ -41,7 +43,8 @@ extern const struct argp show_argp;

int subcmd_run(struct run_args* args);

int show_overview(int ifindex, int whitelist_fd, struct filter_settings* gsettings, int log_verbosity);
int show_overview(int ifindex, int whitelist_fd, struct filter_settings* gsettings,
int log_verbosity);
int subcmd_show(struct show_args* args);

struct lock_content {
Expand Down

0 comments on commit 58bf68f

Please sign in to comment.