X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=unetd.h;h=365e738c6b22dedefd0dae7006353467ae89c976;hb=HEAD;hp=412aeb4ee79fb6a7ed6658348c08d62fc9038fe2;hpb=f75c2e70c0e494566dbbb20d408309412b4110e6;p=project%2Funetd.git diff --git a/unetd.h b/unetd.h index 412aeb4..365e738 100644 --- a/unetd.h +++ b/unetd.h @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0+ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2022 Felix Fietkau */ @@ -13,13 +13,19 @@ #include "utils.h" #include "siphash.h" #include "wg.h" +#include "pex-msg.h" #include "pex.h" #include "network.h" #include "host.h" #include "service.h" +#include "ubus.h" +#include "auth-data.h" +#include "chacha20.h" -extern bool dummy_mode; +extern const char *mssfix_path; +extern const char *data_dir; extern bool debug; +extern int global_pex_port; #define D(format, ...) \ do { \ @@ -31,11 +37,17 @@ extern bool debug; #define D_NET(net, format, ...) D("network %s " format, network_name(net), ##__VA_ARGS__) #define D_HOST(net, host, format, ...) D_NET(net, "host %s " format, network_host_name(host), ##__VA_ARGS__) #define D_PEER(net, peer, format, ...) D_NET(net, "host %s " format, network_peer_name(peer), ##__VA_ARGS__) +#define D_SERVICE(net, service, format, ...) D_NET(net, "service %s " format, network_service_name(service), ##__VA_ARGS__) +#define UNETD_DATA_DIR "/etc/unetd" +#define UNETD_MSS_BPF_PATH "/lib/bpf/mss.o" +#define UNETD_MSS_PRIO_BASE 0x130 + +#define UNETD_DATA_UPDATE_DELAY (10 * 1000) + +#define UNETD_PEX_HOST_ACITVE_TIMEOUT 60 void unetd_write_hosts(void); -void unetd_ubus_init(void); -void unetd_ubus_netifd_update(struct blob_attr *data); -void unetd_ubus_netifd_add_route(struct network *net, union network_endpoint *ep); +int unetd_attach_mssfix(int ifindex, int mtu); #endif