diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-12-18 17:13:13 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-12-19 21:56:19 +0100 |
commit | b5c80d310527223b93e4133ac2f4c8c063c70a98 (patch) | |
tree | 48ae9e2752b4b94c07f767a019c99a8c2460c014 /src/xdp/common/common_defines.h | |
parent | 22308b05dfbcd8da0230bbd8ba3bbc2a55da7786 (diff) | |
download | vyos-1x-b5c80d310527223b93e4133ac2f4c8c063c70a98.tar.gz vyos-1x-b5c80d310527223b93e4133ac2f4c8c063c70a98.zip |
xdp: T2666: switch to example code provided by xdp-tutorial
Diffstat (limited to 'src/xdp/common/common_defines.h')
-rw-r--r-- | src/xdp/common/common_defines.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/xdp/common/common_defines.h b/src/xdp/common/common_defines.h new file mode 100644 index 000000000..2986d2d67 --- /dev/null +++ b/src/xdp/common/common_defines.h @@ -0,0 +1,38 @@ +#ifndef __COMMON_DEFINES_H +#define __COMMON_DEFINES_H + +#include <net/if.h> +#include <linux/types.h> +#include <stdbool.h> + +struct config { + __u32 xdp_flags; + int ifindex; + char *ifname; + char ifname_buf[IF_NAMESIZE]; + int redirect_ifindex; + char *redirect_ifname; + char redirect_ifname_buf[IF_NAMESIZE]; + bool do_unload; + bool reuse_maps; + char pin_dir[512]; + char filename[512]; + char progsec[32]; + char src_mac[18]; + char dest_mac[18]; + __u16 xsk_bind_flags; + int xsk_if_queue; + bool xsk_poll_mode; +}; + +/* Defined in common_params.o */ +extern int verbose; + +/* Exit return codes */ +#define EXIT_OK 0 /* == EXIT_SUCCESS (stdlib.h) man exit(3) */ +#define EXIT_FAIL 1 /* == EXIT_FAILURE (stdlib.h) man exit(3) */ +#define EXIT_FAIL_OPTION 2 +#define EXIT_FAIL_XDP 30 +#define EXIT_FAIL_BPF 40 + +#endif /* __COMMON_DEFINES_H */ |