Co-authored-by: Alan Jowett <alanjo@microsoft.com>
This commit is contained in:
saxena-anurag 2021-09-30 09:37:46 -07:00 коммит произвёл GitHub
Родитель a3d035bc38
Коммит deea7819c9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -43,6 +43,12 @@ xdp_hook_t(xdp_md_t* context);
#define EBPF_HELPER(return_type, name, args) typedef return_type(*name##_t) args
#endif
typedef enum
{
BPF_FUNC_xdp_adjust_head = XDP_EXT_HELPER_FN_BASE + 1,
BPF_FUNC_csum_diff = XDP_EXT_HELPER_FN_BASE + 2,
} ebpf_nethook_helper_id_t;
/**
* @brief Adjust XDP context data pointer.
*
@ -54,7 +60,7 @@ xdp_hook_t(xdp_md_t* context);
*/
EBPF_HELPER(int, bpf_xdp_adjust_head, (xdp_md_t * ctx, int delta));
#ifndef __doxygen
#define bpf_xdp_adjust_head ((bpf_xdp_adjust_head_t)XDP_EXT_HELPER_FN_BASE + 1)
#define bpf_xdp_adjust_head ((bpf_xdp_adjust_head_t)BPF_FUNC_xdp_adjust_head)
#endif
/**
@ -69,7 +75,7 @@ EBPF_HELPER(int, bpf_xdp_adjust_head, (xdp_md_t * ctx, int delta));
*/
EBPF_HELPER(int, bpf_csum_diff, (void* from, int from_size, void* to, int to_size, int seed));
#ifndef __doxygen
#define bpf_csum_diff ((bpf_csum_diff_t)XDP_EXT_HELPER_FN_BASE + 2)
#define bpf_csum_diff ((bpf_csum_diff_t)BPF_FUNC_csum_diff)
#endif
// BIND hook