1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2022 Felix Fietkau <nbd@nbd.name>
10 #include <libubox/vlist.h>
11 #include <libubox/blobmsg.h>
12 #include <libubox/utils.h>
21 #include "auth-data.h"
23 extern const char *mssfix_path
;
24 extern const char *data_dir
;
27 #define D(format, ...) \
30 fprintf(stderr, "%s(%d) " format "\n", \
31 __func__, __LINE__, ##__VA_ARGS__); \
34 #define D_NET(net, format, ...) D("network %s " format, network_name(net), ##__VA_ARGS__)
35 #define D_HOST(net, host, format, ...) D_NET(net, "host %s " format, network_host_name(host), ##__VA_ARGS__)
36 #define D_PEER(net, peer, format, ...) D_NET(net, "host %s " format, network_peer_name(peer), ##__VA_ARGS__)
37 #define D_SERVICE(net, service, format, ...) D_NET(net, "service %s " format, network_service_name(service), ##__VA_ARGS__)
39 #define UNETD_DATA_DIR "/etc/unetd"
40 #define UNETD_MSS_BPF_PATH "/lib/bpf/mss.o"
41 #define UNETD_MSS_PRIO_BASE 0x130
43 void unetd_write_hosts(void);
44 int unetd_attach_mssfix(int ifindex
, int mtu
);