Fix error.
This commit is contained in:
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
|
|||||||
SetLibBPFLogMode(silent);
|
SetLibBPFLogMode(silent);
|
||||||
|
|
||||||
// Load BPF object.
|
// Load BPF object.
|
||||||
struct xdp_program *prog = LoadBpfObj(XDP_OBJ_PATH, strict);
|
struct xdp_program *prog = LoadBpfObj(XDP_OBJ_PATH);
|
||||||
|
|
||||||
if (prog == NULL)
|
if (prog == NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ int FindMapFd(struct xdp_program *prog, const char *map_name)
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
static int silent_libbpf_log(enum libbpf_print_level level, const char *format, va_list args)
|
static int LibBPFSilent(enum libbpf_print_level level, const char *format, va_list args)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ void SetLibBPFLogMode(int silent)
|
|||||||
{
|
{
|
||||||
if (silent)
|
if (silent)
|
||||||
{
|
{
|
||||||
libbpf_set_print(silent_libbpf_log);
|
libbpf_set_print(LibBPFSilent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,11 +69,10 @@ void SetLibBPFLogMode(int silent)
|
|||||||
* Loads a BPF object file.
|
* Loads a BPF object file.
|
||||||
*
|
*
|
||||||
* @param file_name The path to the BPF object file.
|
* @param file_name The path to the BPF object file.
|
||||||
* @param strict Whether to enable strict mode.
|
|
||||||
*
|
*
|
||||||
* @return XDP program structure (pointer) or NULL.
|
* @return XDP program structure (pointer) or NULL.
|
||||||
*/
|
*/
|
||||||
struct xdp_program *LoadBpfObj(const char *file_name, int strict)
|
struct xdp_program *LoadBpfObj(const char *file_name)
|
||||||
{
|
{
|
||||||
struct xdp_program *prog = xdp_program__open_file(file_name, "xdp_prog", NULL);
|
struct xdp_program *prog = xdp_program__open_file(file_name, "xdp_prog", NULL);
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,6 @@
|
|||||||
|
|
||||||
int FindMapFd(struct xdp_program *prog, const char *map_name);
|
int FindMapFd(struct xdp_program *prog, const char *map_name);
|
||||||
void SetLibBPFLogMode(int silent);
|
void SetLibBPFLogMode(int silent);
|
||||||
struct xdp_program *LoadBpfObj(const char *file_name, int strict);
|
struct xdp_program *LoadBpfObj(const char *file_name);
|
||||||
int AttachXdp(struct xdp_program *prog, char** mode, int ifidx, u8 detach, cmdline_t *cmd);
|
int AttachXdp(struct xdp_program *prog, char** mode, int ifidx, u8 detach, cmdline_t *cmd);
|
||||||
void UpdateFilters(int filters_map, config__t *cfg);
|
void UpdateFilters(int filters_map, config__t *cfg);
|
||||||
Reference in New Issue
Block a user