2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2016-11-11 19:41:16 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
#include "unit.h"
|
|
|
|
|
2018-02-16 11:55:33 +01:00
|
|
|
enum {
|
|
|
|
BPF_FIREWALL_UNSUPPORTED = 0,
|
|
|
|
BPF_FIREWALL_SUPPORTED = 1,
|
|
|
|
BPF_FIREWALL_SUPPORTED_WITH_MULTI = 2,
|
|
|
|
};
|
|
|
|
|
2016-11-11 19:41:16 +01:00
|
|
|
int bpf_firewall_supported(void);
|
|
|
|
|
|
|
|
int bpf_firewall_compile(Unit *u);
|
|
|
|
int bpf_firewall_install(Unit *u);
|
2019-04-23 12:14:20 +02:00
|
|
|
int bpf_firewall_load_custom(Unit *u);
|
2016-11-11 19:41:16 +01:00
|
|
|
|
|
|
|
int bpf_firewall_read_accounting(int map_fd, uint64_t *ret_bytes, uint64_t *ret_packets);
|
|
|
|
int bpf_firewall_reset_accounting(int map_fd);
|
2019-06-04 15:01:27 +02:00
|
|
|
|
|
|
|
void emit_bpf_firewall_warning(Unit *u);
|