diff --git a/src/acct/pam.c b/src/acct/pam.c index dc7f561e..8550aac0 100644 --- a/src/acct/pam.c +++ b/src/acct/pam.c @@ -17,13 +17,13 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include -#include -#include "pam.h" -#include +#include "vpn.h" +#include "acct/pam.h" +#include "sec-mod-acct.h" #include "log.h" @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include "pcl.h" +#include "str.h" #include "auth/pam.h" static int ocserv_conv(int msg_size, const struct pam_message **msg, diff --git a/src/acct/pam.h b/src/acct/pam.h index 055ff025..25458e2e 100644 --- a/src/acct/pam.h +++ b/src/acct/pam.h @@ -18,10 +18,10 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ -#ifndef ACCT_PAM_H -#define ACCT_PAM_H +#ifndef OC_ACCT_PAM_H +#define OC_ACCT_PAM_H -#include +#include "sec-mod-acct.h" extern const struct acct_mod_st pam_acct_funcs; diff --git a/src/acct/radius.c b/src/acct/radius.c index ddcaeaf3..9f13ba88 100644 --- a/src/acct/radius.c +++ b/src/acct/radius.c @@ -17,16 +17,16 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include #include #include -#include +#include "vpn.h" #include #include /* inet_ntop */ -#include "radius.h" +#include "acct/radius.h" #include "auth/common.h" #include "log.h" @@ -39,9 +39,8 @@ #include #endif -#include +#include "sec-mod-acct.h" #include "auth/radius.h" -#include "acct/radius.h" #include "common-config.h" static void acct_radius_vhost_init(void **_vctx, void *pool, void *additional) diff --git a/src/acct/radius.h b/src/acct/radius.h index b6b10a36..a005b196 100644 --- a/src/acct/radius.h +++ b/src/acct/radius.h @@ -18,10 +18,10 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ -#ifndef ACCT_RADIUS_H -#define ACCT_RADIUS_H +#ifndef OC_ACCT_RADIUS_H +#define OC_ACCT_RADIUS_H -#include +#include "sec-mod-auth.h" extern const struct acct_mod_st radius_acct_funcs; diff --git a/src/auth-unix.c b/src/auth-unix.c index 628467b0..5c9d7b95 100644 --- a/src/auth-unix.c +++ b/src/auth-unix.c @@ -17,13 +17,13 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include #include #include -#include +#include "sec-mod-auth.h" #include "auth-unix.h" #include "log.h" diff --git a/src/auth-unix.h b/src/auth-unix.h index 8dbf03ef..bf0844e0 100644 --- a/src/auth-unix.h +++ b/src/auth-unix.h @@ -1,7 +1,7 @@ #ifndef OC_AUTH_UNIX_H #define OC_AUTH_UNIX_H -#include +#include "config.h" #if defined(HAVE_GSSAPI) || defined(HAVE_PAM) #define HAVE_GET_USER_AUTH_GROUP diff --git a/src/auth/common.c b/src/auth/common.c index 6f4d104c..87aff8c0 100644 --- a/src/auth/common.c +++ b/src/auth/common.c @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -#include -#include +#include "config.h" +#include "auth/common.h" const char pass_msg_second[] = "Please enter your challenge password."; const char pass_msg_failed[] = "Login failed.\nPlease enter your password."; diff --git a/src/auth/common.h b/src/auth/common.h index a0854e91..279bf338 100644 --- a/src/auth/common.h +++ b/src/auth/common.h @@ -1,5 +1,5 @@ -#ifndef AUTH_COMMON_H -#define AUTH_COMMON_H +#ifndef OC_AUTH_COMMON_H +#define OC_AUTH_COMMON_H #define MAX_PASSWORD_TRIES 3 diff --git a/src/auth/gssapi.c b/src/auth/gssapi.c index a8045c61..7304b69c 100644 --- a/src/auth/gssapi.c +++ b/src/auth/gssapi.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #ifdef HAVE_GSSAPI @@ -25,7 +25,7 @@ #include #include #include -#include +#include "vpn.h" #include #include "gssapi.h" #include "auth/common.h" @@ -33,7 +33,7 @@ #include #include #include -#include +#include "common/base64-helper.h" #include "common-config.h" #include "log.h" diff --git a/src/auth/gssapi.h b/src/auth/gssapi.h index b5c56aaa..d5c1866c 100644 --- a/src/auth/gssapi.h +++ b/src/auth/gssapi.h @@ -18,10 +18,10 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ -#ifndef GSSAPI_H -#define GSSAPI_H +#ifndef OC_AUTH_GSSAPI_H +#define OC_AUTH_GSSAPI_H -#include +#include "sec-mod-auth.h" extern const struct auth_mod_st gssapi_auth_funcs; diff --git a/src/auth/openidconnect.c b/src/auth/openidconnect.c index 82da4b02..aeb0f870 100644 --- a/src/auth/openidconnect.c +++ b/src/auth/openidconnect.c @@ -14,14 +14,14 @@ * along with this program. If not, see */ -#include +#include "config.h" #include #include #include #include -#include +#include "vpn.h" #include -#include "plain.h" +#include "auth/plain.h" #include "common-config.h" #include "auth/common.h" diff --git a/src/auth/openidconnect.h b/src/auth/openidconnect.h index 9962be6a..be44e2d4 100644 --- a/src/auth/openidconnect.h +++ b/src/auth/openidconnect.h @@ -13,10 +13,10 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ -#ifndef OPENIDCONNECT_H -#define OPENIDCONNECT_H +#ifndef OC_AUTH_OPENIDCONNECT_H +#define OC_AUTH_OPENIDCONNECT_H -#include +#include "sec-mod-auth.h" extern const struct auth_mod_st oidc_auth_funcs; diff --git a/src/auth/pam-stack.h b/src/auth/pam-stack.h index 195272dd..18570576 100644 --- a/src/auth/pam-stack.h +++ b/src/auth/pam-stack.h @@ -19,7 +19,7 @@ #ifndef PAM_STACK_H #define PAM_STACK_H -#include +#include "config.h" #include #ifdef __linux__ #include diff --git a/src/auth/pam.c b/src/auth/pam.c index 139a3d26..1180925c 100644 --- a/src/auth/pam.c +++ b/src/auth/pam.c @@ -17,16 +17,16 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include -#include +#include "vpn.h" #include "pam.h" #include "common-config.h" #include "auth-unix.h" -#include -#include +#include "sec-mod-auth.h" +#include "ccan/hash/hash.h" #include "log.h" #ifdef HAVE_PAM diff --git a/src/auth/pam.h b/src/auth/pam.h index 4209b098..ad191a6c 100644 --- a/src/auth/pam.h +++ b/src/auth/pam.h @@ -18,17 +18,17 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ -#ifndef PAM_H -#define PAM_H +#ifndef OC_AUTH_PAM_H +#define OC_AUTH_PAM_H -#include -#include +#include "config.h" +#include "sec-mod-auth.h" #ifdef HAVE_PAM #include -#include -#include +#include "str.h" +#include "pcl.h" #include "pam-stack.h" extern const struct auth_mod_st pam_auth_funcs; diff --git a/src/auth/plain.c b/src/auth/plain.c index db6f7586..77b26f08 100644 --- a/src/auth/plain.c +++ b/src/auth/plain.c @@ -18,18 +18,18 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include #include -#include +#include "vpn.h" #include -#include "plain.h" +#include "auth/plain.h" #include "common-config.h" #include "auth/common.h" -#include -#include +#include "ccan/htable/htable.h" +#include "ccan/hash/hash.h" #ifdef HAVE_LIBOATH #include #endif diff --git a/src/auth/plain.h b/src/auth/plain.h index 0d386776..994bfb66 100644 --- a/src/auth/plain.h +++ b/src/auth/plain.h @@ -18,10 +18,10 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ -#ifndef PLAIN_H -#define PLAIN_H +#ifndef OC_AUTH_PLAIN_H +#define OC_AUTH_PLAIN_H -#include +#include "sec-mod-auth.h" extern const struct auth_mod_st plain_auth_funcs; diff --git a/src/auth/radius.c b/src/auth/radius.c index 96768f6b..631390a0 100644 --- a/src/auth/radius.c +++ b/src/auth/radius.c @@ -18,18 +18,18 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include #include -#include +#include "vpn.h" #include #include /* inet_ntop */ #include "radius.h" #include "auth/common.h" #include "str.h" -#include +#include "ccan/hash/hash.h" #ifdef HAVE_RADIUS diff --git a/src/auth/radius.h b/src/auth/radius.h index e84c3e22..9a17d181 100644 --- a/src/auth/radius.h +++ b/src/auth/radius.h @@ -18,10 +18,10 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ -#ifndef RADIUS_H -#define RADIUS_H +#ifndef OC_AUTH_RADIUS_H +#define OC_AUTH_RADIUS_H -#include +#include "sec-mod-auth.h" #include "common/common.h" #ifdef HAVE_RADIUS diff --git a/src/common-config.h b/src/common-config.h index 9b98ded8..7b686582 100644 --- a/src/common-config.h +++ b/src/common-config.h @@ -21,9 +21,9 @@ #ifndef OC_COMMON_CONFIG_H #define OC_COMMON_CONFIG_H -#include -#include -#include +#include "config.h" +#include "vpn.h" +#include "ipc.pb-c.h" char *sanitize_config_value(void *pool, const char *value); int _add_multi_line_val(void *pool, char ***varname, size_t *num, diff --git a/src/common/base64-helper.c b/src/common/base64-helper.c index d4d555c8..b49aff60 100644 --- a/src/common/base64-helper.c +++ b/src/common/base64-helper.c @@ -17,10 +17,10 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include -#include "base64-helper.h" +#include "common/base64-helper.h" void oc_base64_encode(const char *in, size_t inlen, char *out, size_t outlen) { diff --git a/src/common/base64-helper.h b/src/common/base64-helper.h index c625f385..e2e1936c 100644 --- a/src/common/base64-helper.h +++ b/src/common/base64-helper.h @@ -18,8 +18,8 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ -#ifndef BASE64_HELPER_H -#define BASE64_HELPER_H +#ifndef OC_COMMON_BASE64_HELPER_H +#define OC_COMMON_BASE64_HELPER_H #include diff --git a/src/common/common.c b/src/common/common.c index b2f9a315..9f5abb95 100644 --- a/src/common/common.c +++ b/src/common/common.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include @@ -34,7 +34,7 @@ #include #include #include -#include "common.h" +#include "common/common.h" #include "defs.h" #include "common/base64-helper.h" #include "log.h" diff --git a/src/common/common.h b/src/common/common.h index e706175e..f361b63d 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -19,12 +19,12 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ -#ifndef COMMON_H -#define COMMON_H +#ifndef OC_COMMON_COMMON_H +#define OC_COMMON_COMMON_H #include #include -#include +#include "ipc.pb-c.h" #include #include #include diff --git a/src/common/hmac.c b/src/common/hmac.c index e51b2a29..8a6405ce 100644 --- a/src/common/hmac.c +++ b/src/common/hmac.c @@ -19,7 +19,7 @@ * along with this program. If not, see */ -#include +#include "config.h" #include #include @@ -27,8 +27,8 @@ #include #include #include -#include -#include +#include "common/common.h" +#include "common/hmac.h" #include bool hmac_init_key(size_t key_length, uint8_t *key) diff --git a/src/common/hmac.h b/src/common/hmac.h index d6c38453..498460e0 100644 --- a/src/common/hmac.h +++ b/src/common/hmac.h @@ -18,9 +18,9 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ +#ifndef OC_COMMON_HMAC_H +#define OC_COMMON_HMAC_H -#ifndef HMAC_H -#define HMAC_H #include #define HMAC_DIGEST_SIZE 32 diff --git a/src/common/snapshot.c b/src/common/snapshot.c index f0dc2d63..b199df8a 100644 --- a/src/common/snapshot.c +++ b/src/common/snapshot.c @@ -19,7 +19,7 @@ * along with this program. If not, see */ -#include +#include "config.h" #include #include #include @@ -30,12 +30,12 @@ #include #include #include -#include +#include "common/common.h" -#include -#include +#include "ccan/htable/htable.h" +#include "ccan/hash/hash.h" -#include +#include "snapshot.h" #define ERRSTR "error: " #define WARNSTR "warning: " diff --git a/src/common/snapshot.h b/src/common/snapshot.h index b55a8481..4b6931e4 100644 --- a/src/common/snapshot.h +++ b/src/common/snapshot.h @@ -18,9 +18,8 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ - -#ifndef SNAPSHOT_H -#define SNAPSHOT_H +#ifndef OC_COMMON_SNAPSHOT_H +#define OC_COMMON_SNAPSHOT_H struct snapshot_t; struct snapshot_iter_t; diff --git a/src/common/sockdiag.c b/src/common/sockdiag.c index 8ee2ceaf..4e1a83f1 100644 --- a/src/common/sockdiag.c +++ b/src/common/sockdiag.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include diff --git a/src/common/sockdiag.h b/src/common/sockdiag.h index a3b32cf4..9dd3c54a 100644 --- a/src/common/sockdiag.h +++ b/src/common/sockdiag.h @@ -18,11 +18,10 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ +#ifndef OC_COMMON_SOCKDIAG_H +#define OC_COMMON_SOCKDIAG_H -#ifndef SOCKDIAG_H -#define SOCKDIAG_H - -#include +#include "config.h" int sockdiag_query_unix_domain_socket_queue_length(const char *socket_name, int *sock_rqueue, diff --git a/src/common/system.c b/src/common/system.c index d4d4ccb9..6d9cfb42 100644 --- a/src/common/system.c +++ b/src/common/system.c @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -#include -#include +#include "config.h" +#include "common/system.h" #include #ifdef __linux__ #include @@ -32,7 +32,7 @@ #include #include #include -#include +#include "defs.h" #include "log.h" void kill_on_parent_kill(int sig) diff --git a/src/common/system.h b/src/common/system.h index 6864fd92..fef781cf 100644 --- a/src/common/system.h +++ b/src/common/system.h @@ -18,10 +18,10 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ -#ifndef DIE_H -#define DIE_H +#ifndef OC_COMMON_SYSTEM_H +#define OC_COMMON_SYSTEM_H -#include +#include "config.h" #include #include diff --git a/src/config-kkdcp.c b/src/config-kkdcp.c index eb27fa0b..143477ce 100644 --- a/src/config-kkdcp.c +++ b/src/config-kkdcp.c @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include diff --git a/src/config-ports.c b/src/config-ports.c index 7705384e..ef3b413e 100644 --- a/src/config-ports.c +++ b/src/config-ports.c @@ -15,17 +15,17 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include -#include +#include "common-config.h" #include #include #include "log.h" -#include +#include "vpn.h" static int append_port(void *pool, FwPortSt ***fw_ports, size_t *n_fw_ports, int port, fw_proto_t proto, unsigned int negate) diff --git a/src/config.c b/src/config.c index a984ebd3..baa469a6 100644 --- a/src/config.c +++ b/src/config.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -27,20 +27,20 @@ #include #include #include -#include -#include +#include "common/common.h" +#include "ip-util.h" #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "inih/ini.h" +#include "auth/pam.h" +#include "acct/pam.h" +#include "auth/radius.h" +#include "acct/radius.h" +#include "auth/plain.h" +#include "auth/gssapi.h" +#include "auth/openidconnect.h" +#include "auth/common.h" +#include "sec-mod-sup-config.h" +#include "sec-mod-acct.h" +#include #include #include @@ -48,16 +48,16 @@ #include #include -#include -#include -#include -#include -#include +#include "vpn.h" +#include "cfg.pb-c.h" +#include "main.h" +#include "tlslib.h" +#include "occtl/ctl.h" #include #include "common-config.h" #include -#include +#include "common/snapshot.h" #define OLD_DEFAULT_CFG_FILE "/etc/ocserv.conf" #define DEFAULT_CFG_FILE "/etc/ocserv/ocserv.conf" diff --git a/src/gettime.h b/src/gettime.h index 4306f18f..24c5d6cf 100644 --- a/src/gettime.h +++ b/src/gettime.h @@ -18,11 +18,10 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ - #ifndef OC_GETTIME_H #define OC_GETTIME_H -#include +#include "config.h" #include #include diff --git a/src/html.c b/src/html.c index 60d4f823..2058c5f8 100644 --- a/src/html.c +++ b/src/html.c @@ -15,14 +15,14 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include #include #include -#include +#include "common/common.h" #include #include diff --git a/src/http-heads.h b/src/http-heads.h index 87a91bbb..f3c20b05 100644 --- a/src/http-heads.h +++ b/src/http-heads.h @@ -1,5 +1,5 @@ -#ifndef HTTP_HEADS_H -#define HTTP_HEADS_H +#ifndef OC_HTTP_HEADS_H +#define OC_HTTP_HEADS_H #include @@ -10,4 +10,4 @@ struct http_headers_st { const struct http_headers_st *in_word_set(const char *str, size_t len); -#endif /* HTTP_HEADS_H */ +#endif diff --git a/src/icmp-ping.c b/src/icmp-ping.c index 42e5ffd8..c4844d84 100644 --- a/src/icmp-ping.c +++ b/src/icmp-ping.c @@ -70,8 +70,8 @@ /* Ported to ocserv by Nikos Mavrogiannopoulos */ -#include -#include +#include "config.h" +#include "main.h" #include #ifdef HAVE_NETINET_IN_SYSTM_H #include @@ -85,7 +85,7 @@ #include #include #include -#include +#include "icmp-ping.h" #include #ifndef ICMP_DEST_UNREACH diff --git a/src/icmp-ping.h b/src/icmp-ping.h index 0f5936c4..3ae8d59c 100644 --- a/src/icmp-ping.h +++ b/src/icmp-ping.h @@ -21,7 +21,7 @@ #ifndef OC_ICMP_PING_H #define OC_ICMP_PING_H -#include +#include "main.h" /* returns the number of positive replies received or * 0 if no host with this IP exists. */ diff --git a/src/inih/ini.c b/src/inih/ini.c index 6ad1f8d3..fddbdc15 100644 --- a/src/inih/ini.c +++ b/src/inih/ini.c @@ -17,7 +17,7 @@ https://github.com/benhoyt/inih /* This is ocserv's addition; needed for our definitions * to take precedence over defaults. */ -#include +#include "config.h" #include #include diff --git a/src/ip-lease.c b/src/ip-lease.c index e7ba7631..e23a9657 100644 --- a/src/ip-lease.c +++ b/src/ip-lease.c @@ -15,16 +15,16 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include -#include -#include -#include +#include "ip-lease.h" +#include "main.h" +#include "ip-util.h" #include -#include +#include "icmp-ping.h" #include static void ip_from_seed(uint8_t *seed, unsigned int seed_size, void *ip, diff --git a/src/ip-lease.h b/src/ip-lease.h index 208172b9..6c028483 100644 --- a/src/ip-lease.h +++ b/src/ip-lease.h @@ -21,11 +21,11 @@ #ifndef OC_IP_LEASE_H #define OC_IP_LEASE_H -#include +#include "vpn.h" #include #include -#include -#include +#include "ccan/hash/hash.h" +#include "main.h" struct ip_lease_st { /* In IPv4 this is the same as rip, in IPv6 diff --git a/src/ip-util.c b/src/ip-util.c index eb8601b8..c30c3989 100644 --- a/src/ip-util.c +++ b/src/ip-util.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include "ip-util.h" #include "common/common.h" #include diff --git a/src/isolate.c b/src/isolate.c index 342bd48b..be58c864 100644 --- a/src/isolate.c +++ b/src/isolate.c @@ -16,14 +16,14 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include #include -#include -#include +#include "worker.h" +#include "main.h" #include #include diff --git a/src/isolate.h b/src/isolate.h index 4486626e..5489f6a8 100644 --- a/src/isolate.h +++ b/src/isolate.h @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - #ifndef OC_ISOLATE_H #define OC_ISOLATE_H diff --git a/src/log.c b/src/log.c index 7e1976cf..5318d91b 100644 --- a/src/log.c +++ b/src/log.c @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include @@ -24,10 +24,10 @@ #include #include #include -#include +#include "common/base64-helper.h" -#include -#include +#include "worker.h" +#include "main.h" #include "sec-mod.h" #include "log.h" diff --git a/src/log.h b/src/log.h index aea9bb34..613c6517 100644 --- a/src/log.h +++ b/src/log.h @@ -183,4 +183,4 @@ inline static unsigned int log_check_priority(int oc_priority, int log_prio, return 1; } -#endif /* OC_LOG_H */ +#endif diff --git a/src/lzs.c b/src/lzs.c index fce1e969..01fdd18a 100644 --- a/src/lzs.c +++ b/src/lzs.c @@ -15,7 +15,7 @@ * Lesser General Public License for more details. */ -#include +#include "config.h" #include #include diff --git a/src/lzs.h b/src/lzs.h index 6d8ea7a9..4962c4e2 100644 --- a/src/lzs.h +++ b/src/lzs.h @@ -14,7 +14,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ - #ifndef OC_LZS_H #define OC_LZS_H diff --git a/src/main-auth.c b/src/main-auth.c index 21286eb7..7ff0c39d 100644 --- a/src/main-auth.c +++ b/src/main-auth.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -33,17 +33,17 @@ #include #include #include -#include -#include -#include -#include +#include "tlslib.h" +#include "script-list.h" +#include "ip-lease.h" +#include "proc-search.h" #include "str.h" -#include -#include -#include -#include -#include +#include "vpn.h" +#include "tun.h" +#include "main.h" +#include "ccan/list/list.h" +#include "common/common.h" int send_cookie_auth_reply(main_server_st *s, struct proc_st *proc, AUTHREP r) { diff --git a/src/main-ban.c b/src/main-ban.c index 007a0e7b..f0cfc61f 100644 --- a/src/main-ban.c +++ b/src/main-ban.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -30,18 +30,18 @@ #include #include #include -#include +#include "common/system.h" #include #include #include -#include -#include -#include -#include -#include +#include "common/common.h" +#include "vpn.h" +#include "tlslib.h" +#include "main.h" +#include "main-ban.h" #include -#include -#include +#include "ccan/hash/hash.h" +#include "ccan/htable/htable.h" #include #include diff --git a/src/main-ctl-unix.c b/src/main-ctl-unix.c index 493b2a23..f829efcd 100644 --- a/src/main-ctl-unix.c +++ b/src/main-ctl-unix.c @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -26,20 +26,20 @@ #include #include #include -#include -#include +#include "main.h" +#include "vpn.h" #include "gnulib/cloexec.h" -#include +#include "ip-lease.h" #include -#include -#include -#include -#include +#include "common/system.h" +#include "main-ctl.h" +#include "main-ban.h" +#include "ccan/container_of/container_of.h" -#include -#include -#include +#include "ctl.pb-c.h" +#include "ipc.pb-c.h" +#include "str.h" typedef struct method_ctx { main_server_st *s; diff --git a/src/main-ctl.h b/src/main-ctl.h index a39c4427..138cb633 100644 --- a/src/main-ctl.h +++ b/src/main-ctl.h @@ -1,7 +1,7 @@ #ifndef OC_MAIN_CTL_H #define OC_MAIN_CTL_H -#include +#include "occtl/ctl.h" #include int ctl_handler_init(main_server_st *s); diff --git a/src/main-limits.c b/src/main-limits.c index 78ba1b6f..d8dc6f3b 100644 --- a/src/main-limits.c +++ b/src/main-limits.c @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include -#include +#include "main.h" #include void init_fd_limits_default(main_server_st *s) diff --git a/src/main-limits.h b/src/main-limits.h index 316a8c24..dc7c7540 100644 --- a/src/main-limits.h +++ b/src/main-limits.h @@ -15,9 +15,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - -#ifndef MAIN_LIMITS_H -#define MAIN_LIMITS_H +#ifndef OC_MAIN_LIMITS_H +#define OC_MAIN_LIMITS_H void init_fd_limits_default(struct main_server_st *s); diff --git a/src/main-log.c b/src/main-log.c index bcdfaf87..e2887e3c 100644 --- a/src/main-log.c +++ b/src/main-log.c @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include @@ -24,10 +24,10 @@ #include #include #include -#include +#include "common/base64-helper.h" -#include -#include +#include "worker.h" +#include "main.h" #include "sec-mod.h" #include "log.h" diff --git a/src/main-proc.c b/src/main-proc.c index fd05eb80..2f56b867 100644 --- a/src/main-proc.c +++ b/src/main-proc.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -29,32 +29,32 @@ #include #include #include -#include +#include "common/system.h" #include #include #include #include #include -#include +#include "tlslib.h" #include #include "gnulib/cloexec.h" -#include "common.h" +#include "common/common.h" #include "str.h" #include "setproctitle.h" -#include -#include -#include -#include -#include -#include +#include "sec-mod.h" +#include "route-add.h" +#include "ip-lease.h" +#include "proc-search.h" +#include "ipc.pb-c.h" +#include "script-list.h" #include #include -#include -#include -#include -#include -#include +#include "vpn.h" +#include "tun.h" +#include "main.h" +#include "main-ban.h" +#include "ccan/list/list.h" struct proc_st *new_proc(main_server_st *s, pid_t pid, int cmd_fd, struct sockaddr_storage *remote_addr, diff --git a/src/main-sec-mod-cmd.c b/src/main-sec-mod-cmd.c index c135e467..7bca5326 100644 --- a/src/main-sec-mod-cmd.c +++ b/src/main-sec-mod-cmd.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -29,27 +29,27 @@ #include #include #include -#include +#include "common/system.h" #include #include #include #include #include -#include -#include "common.h" +#include "tlslib.h" +#include "common/common.h" #include "str.h" #include "setproctitle.h" -#include -#include -#include -#include -#include +#include "sec-mod.h" +#include "ip-lease.h" +#include "route-add.h" +#include "ipc.pb-c.h" +#include "script-list.h" #include "gnulib/cloexec.h" -#include -#include -#include -#include +#include "vpn.h" +#include "main.h" +#include "main-ban.h" +#include "ccan/list/list.h" #ifdef HAVE_MALLOC_TRIM #include diff --git a/src/main-user.c b/src/main-user.c index 023089c6..f4c4b213 100644 --- a/src/main-user.c +++ b/src/main-user.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -32,20 +32,20 @@ #include #include #include -#include +#include "tlslib.h" #ifdef HAVE_LIBUTIL #include #endif -#include +#include "gettime.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include "vpn.h" +#include "str.h" +#include "tun.h" +#include "main.h" +#include "main-ctl.h" +#include "ip-lease.h" +#include "script-list.h" +#include "ccan/list/list.h" #ifndef OCSERV_FW_SCRIPT #define OCSERV_FW_SCRIPT "/usr/libexec/ocserv-fw" diff --git a/src/main-worker-cmd.c b/src/main-worker-cmd.c index 2444c14b..a412d87a 100644 --- a/src/main-worker-cmd.c +++ b/src/main-worker-cmd.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -29,32 +29,32 @@ #include #include #include -#include +#include "common/system.h" #include #include #include #include #include -#include +#include "tlslib.h" #include #include "gnulib/cloexec.h" -#include "common.h" +#include "common/common.h" #include "str.h" #include "setproctitle.h" -#include -#include -#include -#include -#include -#include +#include "sec-mod.h" +#include "route-add.h" +#include "ip-lease.h" +#include "proc-search.h" +#include "ipc.pb-c.h" +#include "script-list.h" #include #include -#include -#include -#include -#include -#include +#include "vpn.h" +#include "tun.h" +#include "main.h" +#include "main-ban.h" +#include "ccan/list/list.h" int set_tun_mtu(main_server_st *s, struct proc_st *proc, unsigned int mtu) { diff --git a/src/main.c b/src/main.c index 09e4aed9..50c2f034 100644 --- a/src/main.c +++ b/src/main.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -28,18 +28,18 @@ #include #include #include -#include +#include "common/system.h" #include #include #include #include #include #include "gnulib/cloexec.h" -#include +#include "script-list.h" #include #include -#include +#include "tlslib.h" #include "setproctitle.h" #ifdef HAVE_LIBWRAP #include @@ -50,22 +50,22 @@ #ifdef HAVE_LIBSYSTEMD #include #endif -#include -#include -#include -#include -#include -#include -#include +#include "main.h" +#include "main-ctl.h" +#include "main-ban.h" +#include "route-add.h" +#include "worker.h" +#include "proc-search.h" +#include "tun.h" #include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ip-lease.h" +#include "ccan/list/list.h" +#include "common/hmac.h" +#include "common/base64-helper.h" +#include "common/snapshot.h" +#include "main-limits.h" +#include "common/sockdiag.h" +#include "namespace.h" #ifdef HAVE_GSSAPI #include diff --git a/src/main.h b/src/main.h index 48c923ad..434ef395 100644 --- a/src/main.h +++ b/src/main.h @@ -27,17 +27,17 @@ #include #include #include -#include -#include +#include "vpn.h" +#include "tlslib.h" #include "ipc.pb-c.h" -#include +#include "common/common.h" #include #include #include #include -#include +#include "common/hmac.h" #include "vhost.h" -#include +#include "namespace.h" #if defined(__FreeBSD__) || defined(__OpenBSD__) #include diff --git a/src/namespace.c b/src/namespace.c index 445277e4..e9dd8e3b 100644 --- a/src/namespace.c +++ b/src/namespace.c @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #if defined(LINUX_NAMESPACES) @@ -30,8 +30,8 @@ #include #include -#include -#include +#include "common-config.h" +#include "namespace.h" /* get default namespace file descriptor to be able to place fd in a given * namespace diff --git a/src/namespace.h b/src/namespace.h index 28fab9ff..9281365b 100644 --- a/src/namespace.h +++ b/src/namespace.h @@ -14,11 +14,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - #ifndef OC_NAMESPACE_H #define OC_NAMESPACE_H -#include +#include "config.h" struct netns_fds { int default_fd; diff --git a/src/occtl/cache.c b/src/occtl/cache.c index f98b2adc..e7021480 100644 --- a/src/occtl/cache.c +++ b/src/occtl/cache.c @@ -19,11 +19,11 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include -#include +#include "occtl/occtl.h" typedef struct uid_entries_st { char *user; diff --git a/src/occtl/ctl.h b/src/occtl/ctl.h index 45ee00a2..b31866a2 100644 --- a/src/occtl/ctl.h +++ b/src/occtl/ctl.h @@ -1,5 +1,5 @@ -#ifndef CTL_H -#define CTL_H +#ifndef OC_OCCTL_CTL_H +#define OC_OCCTL_CTL_H #define OCCTL_UNIX_SOCKET "/var/run/occtl.socket" diff --git a/src/occtl/geoip.c b/src/occtl/geoip.c index 8dd658b4..636de95b 100644 --- a/src/occtl/geoip.c +++ b/src/occtl/geoip.c @@ -17,7 +17,7 @@ * Nikos Mavrogiannopoulos */ -#include +#include "config.h" #include #include #include diff --git a/src/occtl/geoip.h b/src/occtl/geoip.h index 124a6be3..9a5f6cd5 100644 --- a/src/occtl/geoip.h +++ b/src/occtl/geoip.h @@ -16,7 +16,6 @@ * Authors: * Nikos Mavrogiannopoulos */ - #ifndef GEOIP_H #define GEOIP_H diff --git a/src/occtl/ip-cache.c b/src/occtl/ip-cache.c index f0570523..c5e46063 100644 --- a/src/occtl/ip-cache.c +++ b/src/occtl/ip-cache.c @@ -19,12 +19,12 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include -#include -#include +#include "occtl/occtl.h" +#include "common/common.h" typedef struct ip_entries_st { char ip[MAX_IP_STR]; diff --git a/src/occtl/json.c b/src/occtl/json.c index efb82e68..09013345 100644 --- a/src/occtl/json.c +++ b/src/occtl/json.c @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include diff --git a/src/occtl/json.h b/src/occtl/json.h index b546ecd7..bd4f9559 100644 --- a/src/occtl/json.h +++ b/src/occtl/json.h @@ -18,9 +18,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - #ifndef JSON_H #define JSON_H + char *json_escape_val(char *tmp, unsigned int tmp_size, const char *val); #endif diff --git a/src/occtl/maxmind.c b/src/occtl/maxmind.c index 7be53f44..143ca3ad 100644 --- a/src/occtl/maxmind.c +++ b/src/occtl/maxmind.c @@ -18,7 +18,7 @@ * Nikos Mavrogiannopoulos */ -#include +#include "config.h" #include #include #include diff --git a/src/occtl/nl.c b/src/occtl/nl.c index 03c985f1..b0c4a49c 100644 --- a/src/occtl/nl.c +++ b/src/occtl/nl.c @@ -19,12 +19,12 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include #include -#include +#include "occtl/occtl.h" #if defined(HAVE_LIBNL) && defined(__linux__) diff --git a/src/occtl/occtl.c b/src/occtl/occtl.c index f9868c55..d8988921 100644 --- a/src/occtl/occtl.c +++ b/src/occtl/occtl.c @@ -19,16 +19,16 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include #include #include -#include +#include "common/system.h" #include #include -#include +#include "occtl/occtl.h" static int handle_reset_cmd(CONN_TYPE *conn, const char *arg, cmd_params_st *params); diff --git a/src/occtl/occtl.h b/src/occtl/occtl.h index 9cead453..cb3e6315 100644 --- a/src/occtl/occtl.h +++ b/src/occtl/occtl.h @@ -4,7 +4,7 @@ #include #include #include -#include "common.h" +#include "common/common.h" #ifdef HAVE_ORIG_READLINE #include diff --git a/src/occtl/pager.c b/src/occtl/pager.c index 13682dc4..8f3a2991 100644 --- a/src/occtl/pager.c +++ b/src/occtl/pager.c @@ -19,12 +19,12 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include #include -#include +#include "occtl/occtl.h" static const char *get_pager(void) { diff --git a/src/occtl/print.c b/src/occtl/print.c index 247fe953..4bba693a 100644 --- a/src/occtl/print.c +++ b/src/occtl/print.c @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include @@ -28,10 +28,10 @@ #include #include #include -#include -#include -#include -#include +#include "occtl/occtl.h" +#include "common/common.h" +#include "occtl/json.h" +#include "vpn.h" #define MAX_STR_SIZE 512 diff --git a/src/occtl/session-cache.c b/src/occtl/session-cache.c index 5480d3b4..f97a4441 100644 --- a/src/occtl/session-cache.c +++ b/src/occtl/session-cache.c @@ -19,12 +19,12 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include -#include -#include +#include "occtl/occtl.h" +#include "common/common.h" typedef struct session_entries_st { char session[SAFE_ID_SIZE]; diff --git a/src/occtl/time.c b/src/occtl/time.c index 07363cbf..49b2a680 100644 --- a/src/occtl/time.c +++ b/src/occtl/time.c @@ -23,11 +23,11 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include -#include +#include "occtl/occtl.h" #define _(x) x diff --git a/src/occtl/unix.c b/src/occtl/unix.c index 3f65ba0b..42bf3cd9 100644 --- a/src/occtl/unix.c +++ b/src/occtl/unix.c @@ -20,7 +20,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include @@ -30,12 +30,12 @@ #include #include #include -#include -#include -#include -#include +#include "occtl/ctl.h" +#include "ctl.pb-c.h" +#include "occtl/occtl.h" +#include "common/common.h" #include -#include +#include "common/system.h" #include #include #include @@ -45,10 +45,10 @@ #include #include #include -#include +#include "ccan/str/hex/hex.h" #include "geoip.h" -#include -#include +#include "vpn.h" +#include "common/base64-helper.h" /* In JSON output include fields which were no longer available after 0.11.7 */ diff --git a/src/ocpasswd/ocpasswd.c b/src/ocpasswd/ocpasswd.c index 6ee3537e..a18aec8d 100644 --- a/src/ocpasswd/ocpasswd.c +++ b/src/ocpasswd/ocpasswd.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include diff --git a/src/proc-search.c b/src/proc-search.c index df782c27..a9ab7cd7 100644 --- a/src/proc-search.c +++ b/src/proc-search.c @@ -15,13 +15,13 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include -#include -#include -#include +#include "proc-search.h" +#include "main.h" +#include "common/common.h" struct find_ip_st { struct sockaddr_storage *sockaddr; diff --git a/src/proc-search.h b/src/proc-search.h index 528c5563..ac36a235 100644 --- a/src/proc-search.h +++ b/src/proc-search.h @@ -21,11 +21,11 @@ #ifndef OC_PROC_SEARCH_H #define OC_PROC_SEARCH_H -#include +#include "vpn.h" #include #include -#include -#include +#include "ccan/hash/hash.h" +#include "main.h" struct proc_st *proc_search_single_ip(struct main_server_st *s, struct sockaddr_storage *sockaddr, diff --git a/src/route-add.c b/src/route-add.c index 7de506a3..982a9b54 100644 --- a/src/route-add.c +++ b/src/route-add.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -29,10 +29,10 @@ #include #include -#include -#include -#include -#include +#include "route-add.h" +#include "main.h" +#include "str.h" +#include "common/common.h" static int call_script(main_server_st *s, proc_st *proc, const char *cmd) { diff --git a/src/route-add.h b/src/route-add.h index 32d65480..10b3e8f4 100644 --- a/src/route-add.h +++ b/src/route-add.h @@ -21,8 +21,8 @@ #ifndef OC_ROUTE_ADD_H #define OC_ROUTE_ADD_H -#include -#include +#include "vpn.h" +#include "main.h" int apply_iroutes(struct main_server_st *s, struct proc_st *proc); void remove_iroutes(struct main_server_st *s, struct proc_st *proc); diff --git a/src/script-list.h b/src/script-list.h index 52e3e212..81ab115b 100644 --- a/src/script-list.h +++ b/src/script-list.h @@ -21,7 +21,7 @@ #ifndef OC_SCRIPT_LIST_H #define OC_SCRIPT_LIST_H -#include +#include "main.h" #include #include #include diff --git a/src/sec-mod-acct.h b/src/sec-mod-acct.h index dde47c0c..9d166c42 100644 --- a/src/sec-mod-acct.h +++ b/src/sec-mod-acct.h @@ -21,8 +21,8 @@ #ifndef OC_SEC_MOD_ACCT_H #define OC_SEC_MOD_ACCT_H -#include -#include +#include "main.h" +#include "sec-mod-auth.h" typedef struct acct_mod_st { unsigned int type; /* ACCT_TYPE_ */ diff --git a/src/sec-mod-auth.c b/src/sec-mod-auth.c index 5616717c..eae81afc 100644 --- a/src/sec-mod-auth.c +++ b/src/sec-mod-auth.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -33,25 +33,24 @@ #include #include #include -#include -#include -#include +#include "tlslib.h" +#include "script-list.h" +#include "ip-lease.h" #include "str.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "vpn.h" +#include "tun.h" +#include "main.h" +#include "ccan/list/list.h" +#include "sec-mod-auth.h" +#include "auth/plain.h" +#include "common/common.h" +#include "auth/pam.h" +#include "sec-mod.h" +#include "common/base64-helper.h" +#include "sec-mod-sup-config.h" +#include "sec-mod-acct.h" +#include "common/hmac.h" #ifdef HAVE_GSSAPI #include diff --git a/src/sec-mod-auth.h b/src/sec-mod-auth.h index 69c13650..facd6225 100644 --- a/src/sec-mod-auth.h +++ b/src/sec-mod-auth.h @@ -21,8 +21,8 @@ #ifndef OC_SEC_MOD_AUTH_H #define OC_SEC_MOD_AUTH_H -#include -#include +#include "main.h" +#include "sec-mod.h" #define MAX_AUTH_REQS 8 diff --git a/src/sec-mod-cookies.c b/src/sec-mod-cookies.c index a95b406a..2b682467 100644 --- a/src/sec-mod-cookies.c +++ b/src/sec-mod-cookies.c @@ -15,17 +15,17 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include #include -#include -#include -#include -#include -#include +#include "vpn.h" +#include "main.h" +#include "sec-mod.h" +#include "ccan/hash/hash.h" +#include "ccan/htable/htable.h" static void send_empty_reply(void *pool, int fd, sec_mod_st *sec) { diff --git a/src/sec-mod-db.c b/src/sec-mod-db.c index c7d11a3a..66c139c5 100644 --- a/src/sec-mod-db.c +++ b/src/sec-mod-db.c @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -32,18 +32,18 @@ #include #include #include -#include +#include "common/system.h" #include #include #include -#include +#include "common/common.h" #include -#include -#include -#include -#include -#include -#include +#include "vpn.h" +#include "common/base64-helper.h" +#include "tlslib.h" +#include "sec-mod.h" +#include "ccan/hash/hash.h" +#include "ccan/htable/htable.h" #include #include diff --git a/src/sec-mod-resume.c b/src/sec-mod-resume.c index fa74b34d..c61516b5 100644 --- a/src/sec-mod-resume.c +++ b/src/sec-mod-resume.c @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -31,13 +31,13 @@ #include #include #include -#include +#include "ccan/hash/hash.h" -#include -#include -#include -#include -#include +#include "main.h" +#include "sec-mod-resume.h" +#include "common/common.h" +#include "ip-util.h" +#include "tlslib.h" int handle_resume_delete_req(sec_mod_st *sec, const SessionResumeFetchMsg *req) { diff --git a/src/sec-mod-resume.h b/src/sec-mod-resume.h index 4b9f9dfe..f7f5cdde 100644 --- a/src/sec-mod-resume.h +++ b/src/sec-mod-resume.h @@ -21,7 +21,7 @@ #ifndef OC_SEC_MOD_RESUME_H #define OC_SEC_MOD_RESUME_H -#include +#include "sec-mod.h" int handle_resume_delete_req(sec_mod_st *sec, const SessionResumeFetchMsg *req); diff --git a/src/sec-mod-sup-config.c b/src/sec-mod-sup-config.c index f7e5693a..bc128b2f 100644 --- a/src/sec-mod-sup-config.c +++ b/src/sec-mod-sup-config.c @@ -15,20 +15,20 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include "vpn.h" +#include "tun.h" +#include "main.h" +#include "common/common.h" +#include "vpn.h" +#include "sec-mod-sup-config.h" +#include "sup-config/file.h" +#include "sup-config/radius.h" void sup_config_init(sec_mod_st *sec) { diff --git a/src/sec-mod-sup-config.h b/src/sec-mod-sup-config.h index c8ffd5b2..e231cb28 100644 --- a/src/sec-mod-sup-config.h +++ b/src/sec-mod-sup-config.h @@ -21,7 +21,7 @@ #ifndef OC_SEC_MOD_SUP_CONFIG_H #define OC_SEC_MOD_SUP_CONFIG_H -#include +#include "sec-mod.h" #define SUP_CONFIG_FILE 1 #define SUP_CONFIG_RADIUS 2 diff --git a/src/sec-mod.c b/src/sec-mod.c index cbe48dfd..0a38a975 100644 --- a/src/sec-mod.c +++ b/src/sec-mod.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -30,17 +30,17 @@ #include #include #include -#include +#include "common/system.h" #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include "common/common.h" +#include "main.h" +#include "sec-mod.h" +#include "tlslib.h" +#include "ipc.pb-c.h" +#include "sec-mod-sup-config.h" +#include "sec-mod-resume.h" #include "gnulib/cloexec.h" #include diff --git a/src/sec-mod.h b/src/sec-mod.h index 090cf17c..85372907 100644 --- a/src/sec-mod.h +++ b/src/sec-mod.h @@ -22,10 +22,10 @@ #define OC_SEC_MOD_H #include -#include +#include "ccan/htable/htable.h" #include -#include -#include +#include "tlslib.h" +#include "common/hmac.h" #include "common/common.h" #include "vhost.h" diff --git a/src/setproctitle.c b/src/setproctitle.c index 2944d7e4..9ba868bf 100644 --- a/src/setproctitle.c +++ b/src/setproctitle.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include "main.h" diff --git a/src/setproctitle.h b/src/setproctitle.h index 90686667..d0d7f04a 100644 --- a/src/setproctitle.h +++ b/src/setproctitle.h @@ -21,7 +21,7 @@ #ifndef OC_SETPROCTITLE_H #define OC_SETPROCTITLE_H -#include +#include "config.h" #ifndef HAVE_SETPROCTILE diff --git a/src/str.c b/src/str.c index a5894c4d..2fa13035 100644 --- a/src/str.c +++ b/src/str.c @@ -20,13 +20,13 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include #include -#include -#include +#include "str.h" +#include "main.h" #include "vasprintf.h" void trim_trailing_whitespace(char *str) diff --git a/src/str.h b/src/str.h index 6b3289b4..6c58eb5f 100644 --- a/src/str.h +++ b/src/str.h @@ -19,11 +19,10 @@ * along with this program. If not, see * . */ - #ifndef OC_STR_H #define OC_STR_H -#include +#include "config.h" #include #define STR_TAB_INIT(t, s_t) memset(t, 0, s_t) diff --git a/src/subconfig.c b/src/subconfig.c index c8619230..c5bd158d 100644 --- a/src/subconfig.c +++ b/src/subconfig.c @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -24,9 +24,9 @@ #include #include -#include -#include -#include +#include "sec-mod-sup-config.h" +#include "common/common.h" +#include "vpn.h" #include "common-config.h" static void free_expanded_brackets_string(subcfg_val_st out[MAX_SUBOPTIONS], diff --git a/src/sup-config/file.c b/src/sup-config/file.c index 88a08c1f..679ab601 100644 --- a/src/sup-config/file.c +++ b/src/sup-config/file.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -27,17 +27,17 @@ #include #include #include -#include -#include +#include "common/common.h" +#include "ip-util.h" #include -#include "inih/ini.h" +#include #include "log.h" -#include -#include -#include -#include +#include "vpn.h" +#include "main.h" +#include "common-config.h" +#include "sec-mod-sup-config.h" #define READ_RAW_MULTI_LINE(varname, num) \ _add_multi_line_val(pool, &varname, &num, value) diff --git a/src/sup-config/file.h b/src/sup-config/file.h index 241cdc04..13ff25bf 100644 --- a/src/sup-config/file.h +++ b/src/sup-config/file.h @@ -21,7 +21,7 @@ #ifndef SUP_CONFIG_FILE_H #define SUP_CONFIG_FILE_H -#include +#include "sec-mod-sup-config.h" extern struct config_mod_st file_sup_config; diff --git a/src/sup-config/radius.c b/src/sup-config/radius.c index 83af37d9..2f12acee 100644 --- a/src/sup-config/radius.c +++ b/src/sup-config/radius.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -27,15 +27,15 @@ #include #include #include -#include -#include +#include "common/common.h" +#include "ip-util.h" #ifdef HAVE_RADIUS -#include -#include -#include -#include +#include "vpn.h" +#include "main.h" +#include "sec-mod-sup-config.h" +#include "auth/radius.h" #include "log.h" static int get_sup_config(ReloadableConfig *cfg, client_entry_st *entry, diff --git a/src/sup-config/radius.h b/src/sup-config/radius.h index 80e447ad..0bdebd6b 100644 --- a/src/sup-config/radius.h +++ b/src/sup-config/radius.h @@ -21,7 +21,7 @@ #ifndef SUP_CONFIG_RADIUS_H #define SUP_CONFIG_RADIUS_H -#include +#include "sec-mod-sup-config.h" extern struct config_mod_st radius_sup_config; diff --git a/src/tlslib.c b/src/tlslib.c index f3afdbcc..96a032dc 100644 --- a/src/tlslib.c +++ b/src/tlslib.c @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -35,12 +35,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include "tlslib.h" +#include "ccan/hash/hash.h" +#include "vpn.h" +#include "main.h" +#include "worker.h" +#include "common/common.h" #include #include #include diff --git a/src/tlslib.h b/src/tlslib.h index 4ac4c888..f3f49946 100644 --- a/src/tlslib.h +++ b/src/tlslib.h @@ -24,8 +24,8 @@ #include #include -#include -#include +#include "vpn.h" +#include "ccan/htable/htable.h" #include #if GNUTLS_VERSION_NUMBER < 0x030200 diff --git a/src/tun.c b/src/tun.c index 4d42090d..ebe53a55 100644 --- a/src/tun.c +++ b/src/tun.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -34,7 +34,7 @@ #include #include #include "gnulib/cloexec.h" -#include +#include "ip-lease.h" #if defined(HAVE_LINUX_IF_TUN_H) #include @@ -43,10 +43,10 @@ #endif #include -#include -#include -#include -#include +#include "vpn.h" +#include "tun.h" +#include "main.h" +#include "ccan/list/list.h" #include "vhost.h" #include "log.h" diff --git a/src/tun.h b/src/tun.h index 516ce76d..0d1dcac7 100644 --- a/src/tun.h +++ b/src/tun.h @@ -21,9 +21,9 @@ #ifndef OC_TUN_H #define OC_TUN_H -#include +#include "vpn.h" #include -#include +#include "ccan/list/list.h" struct tun_lease_st { char name[IFNAMSIZ]; diff --git a/src/valid-hostname.c b/src/valid-hostname.c index a8402502..7113c0ab 100644 --- a/src/valid-hostname.c +++ b/src/valid-hostname.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include diff --git a/src/vasprintf.c b/src/vasprintf.c index 55759791..2da8d54d 100644 --- a/src/vasprintf.c +++ b/src/vasprintf.c @@ -13,7 +13,7 @@ * Lesser General Public License for more details. */ -#include +#include "config.h" #include #include #include diff --git a/src/vasprintf.h b/src/vasprintf.h index 646c0f2a..d287b3e7 100644 --- a/src/vasprintf.h +++ b/src/vasprintf.h @@ -1,6 +1,6 @@ #ifndef OC_VASPRINTF_H #define OC_VASPRINTF_H -#include +#include "config.h" #include #ifndef HAVE_VASPRINTF diff --git a/src/vhost.h b/src/vhost.h index a93c59e8..5ff6dd46 100644 --- a/src/vhost.h +++ b/src/vhost.h @@ -22,9 +22,9 @@ #define OC_VHOST_H /* Virtual host entries; common between main and sec-mod */ -#include +#include "config.h" #include "tlslib.h" -#include +#include "cfg.pb-c.h" #define MAX_PIN_SIZE GNUTLS_PKCS11_MAX_PIN_LEN typedef struct pin_st { diff --git a/src/vpn.h b/src/vpn.h index ff7ce3d5..23e6a0d7 100644 --- a/src/vpn.h +++ b/src/vpn.h @@ -21,20 +21,20 @@ #ifndef OC_VPN_H #define OC_VPN_H -#include +#include "config.h" #include #include -#include -#include +#include "ccan/htable/htable.h" +#include "ccan/list/list.h" #include #include #include #include #include -#include +#include "auth/common.h" -#include -#include +#include "ipc.pb-c.h" +#include "cfg.pb-c.h" #ifdef __GNUC__ #define _OCSERV_GCC_VERSION \ @@ -297,7 +297,7 @@ struct dtls_st; #define DEFAULT_CONFIG_ENTRIES 96 -#include +#include "tun.h" unsigned int extract_prefix(char *network); @@ -314,7 +314,7 @@ enum option_types { OPTION_MULTI_LINE }; -#include +#include "ip-util.h" void reload_cfg_file(void *pool, struct list_head *configs, unsigned int sec_mod); diff --git a/src/worker-auth.c b/src/worker-auth.c index cfaf3384..656f7ebf 100644 --- a/src/worker-auth.c +++ b/src/worker-auth.c @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -33,15 +33,15 @@ #include #include #include -#include -#include +#include "ipc.pb-c.h" +#include "common/base64-helper.h" -#include +#include "vpn.h" #include "html.h" -#include -#include -#include -#include +#include "worker.h" +#include "worker-tun.h" +#include "common/common.h" +#include "tlslib.h" #include diff --git a/src/worker-bandwidth.c b/src/worker-bandwidth.c index 7de46b5f..5e0c94cc 100644 --- a/src/worker-bandwidth.c +++ b/src/worker-bandwidth.c @@ -17,12 +17,12 @@ * along with this program. If not, see . */ -#include +#include "config.h" -#include -#include -#include -#include +#include "vpn.h" +#include "worker.h" +#include "worker-bandwidth.h" +#include "gettime.h" #include diff --git a/src/worker-bandwidth.h b/src/worker-bandwidth.h index 7ac1784f..dc5ff63f 100644 --- a/src/worker-bandwidth.h +++ b/src/worker-bandwidth.h @@ -21,7 +21,7 @@ #ifndef OC_WORKER_BANDWIDTH_H #define OC_WORKER_BANDWIDTH_H -#include +#include "gettime.h" #include #include diff --git a/src/worker-http-handlers.c b/src/worker-http-handlers.c index f825c023..ff4d2d26 100644 --- a/src/worker-http-handlers.c +++ b/src/worker-http-handlers.c @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -34,9 +34,9 @@ #include #include -#include -#include -#include +#include "vpn.h" +#include "worker.h" +#include "tlslib.h" #define HTML_404 "

404 Not Found

\r\n" #define HTML_401 "

401 Unauthorized

\r\n" diff --git a/src/worker-http.c b/src/worker-http.c index e8c9280d..bb60ec44 100644 --- a/src/worker-http.c +++ b/src/worker-http.c @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include @@ -32,11 +32,11 @@ #endif #include -#include +#include "common/base64-helper.h" #include -#include -#include +#include "vpn.h" +#include "worker.h" #define CS_AES128_GCM "OC-DTLS1_2-AES128-GCM" #define CS_AES256_GCM "OC-DTLS1_2-AES256-GCM" diff --git a/src/worker-kkdcp.c b/src/worker-kkdcp.c index 4cf42ad5..e0f8d0eb 100644 --- a/src/worker-kkdcp.c +++ b/src/worker-kkdcp.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -25,9 +25,9 @@ #include #include -#include -#include -#include "common.h" +#include "vpn.h" +#include "worker.h" +#include "common/common.h" #ifdef HAVE_GSSAPI diff --git a/src/worker-latency.c b/src/worker-latency.c index de30372d..38d14fc2 100644 --- a/src/worker-latency.c +++ b/src/worker-latency.c @@ -18,15 +18,15 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include #include #include -#include -#include +#include "worker.h" +#include "worker-latency.h" ssize_t dtls_pull_latency(gnutls_transport_ptr_t ptr, void *data, size_t size) { diff --git a/src/worker-log.c b/src/worker-log.c index c067b009..9ff1a6a9 100644 --- a/src/worker-log.c +++ b/src/worker-log.c @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include #include @@ -24,10 +24,10 @@ #include #include #include -#include +#include "common/base64-helper.h" -#include -#include +#include "worker.h" +#include "main.h" #include "sec-mod.h" #include "log.h" diff --git a/src/worker-misc.c b/src/worker-misc.c index 54c4dc41..a8c01e73 100644 --- a/src/worker-misc.c +++ b/src/worker-misc.c @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -39,9 +39,9 @@ #include #include -#include -#include -#include +#include "vpn.h" +#include "worker.h" +#include "tlslib.h" #ifdef HAVE_SIGALTSTACK #include diff --git a/src/worker-privs.c b/src/worker-privs.c index 33098ad1..0da0b6f9 100644 --- a/src/worker-privs.c +++ b/src/worker-privs.c @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -#include -#include +#include "config.h" +#include "worker.h" #ifdef HAVE_LIBSECCOMP diff --git a/src/worker-proxyproto.c b/src/worker-proxyproto.c index abf4f0c6..b8c57d00 100644 --- a/src/worker-proxyproto.c +++ b/src/worker-proxyproto.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -25,7 +25,7 @@ #include #include -#include +#include "worker.h" /* This file implements the Proxy Protocol v2, as described in: * http://www.haproxy.org/download/1.6/doc/proxy-protocol.txt diff --git a/src/worker-resume.c b/src/worker-resume.c index e0ad83b3..019a5ed3 100644 --- a/src/worker-resume.c +++ b/src/worker-resume.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -33,11 +33,11 @@ #include #include -#include -#include -#include "common.h" +#include "vpn.h" +#include "worker.h" +#include "common/common.h" #include "ipc.pb-c.h" -#include +#include "tlslib.h" static int recv_resume_fetch_reply(worker_st *ws, int sd, gnutls_datum_t *sdata) { diff --git a/src/worker-svc.c b/src/worker-svc.c index d72b7f40..13843530 100644 --- a/src/worker-svc.c +++ b/src/worker-svc.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -26,12 +26,12 @@ #include #include #include -#include +#include "common/base64-helper.h" -#include +#include "vpn.h" #include "html.h" -#include -#include +#include "worker.h" +#include "tlslib.h" int get_svc_handler(worker_st *ws, unsigned int http_ver) { diff --git a/src/worker-tun.c b/src/worker-tun.c index 43ac4df6..41fa0a80 100644 --- a/src/worker-tun.c +++ b/src/worker-tun.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include @@ -34,7 +34,7 @@ #include #include #include "gnulib/cloexec.h" -#include +#include "ip-lease.h" #if defined(HAVE_LINUX_IF_TUN_H) #include @@ -43,10 +43,10 @@ #endif #include -#include -#include -#include -#include +#include "vpn.h" +#include "tun.h" +#include "main.h" +#include "ccan/list/list.h" #include "vhost.h" #include "log.h" #include "worker-tun.h" diff --git a/src/worker-vpn.c b/src/worker-vpn.c index c2dca661..a51b14b1 100644 --- a/src/worker-vpn.c +++ b/src/worker-vpn.c @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -#include +#include "config.h" #ifdef WITH_COVERAGE #include @@ -52,13 +52,13 @@ static inline void worker_exit(int status) #include #include #include -#include +#include "common/system.h" #include -#include -#include -#include +#include "gettime.h" +#include "common/common.h" +#include "html.h" #include -#include +#include "worker-bandwidth.h" #include #include #include @@ -69,16 +69,16 @@ static inline void worker_exit(int status) #define IPV6_PATHMTU 61 #endif -#include +#include "vpn.h" #include "ipc.pb-c.h" -#include -#include +#include "worker.h" +#include "tlslib.h" #include #if defined(CAPTURE_LATENCY_SUPPORT) #include #include -#include +#include "worker-latency.h" #endif #define MIN_MTU(ws) (((ws)->vinfo.ipv6 != NULL) ? 1280 : 800) diff --git a/src/worker.c b/src/worker.c index 9ec9ec4e..f84e0c10 100644 --- a/src/worker.c +++ b/src/worker.c @@ -16,12 +16,12 @@ * along with this program. If not, see . */ -#include +#include "config.h" #include #include -#include +#include "common/system.h" #include "setproctitle.h" #ifdef HAVE_LIBWRAP #include @@ -30,11 +30,11 @@ #ifdef HAVE_LIBSYSTEMD #include #endif -#include -#include -#include -#include -#include +#include "main.h" +#include "worker.h" +#include "common/base64-helper.h" +#include "common/snapshot.h" +#include "isolate.h" #ifdef HAVE_GSSAPI #include diff --git a/src/worker.h b/src/worker.h index 358de2fa..cc63dc67 100644 --- a/src/worker.h +++ b/src/worker.h @@ -21,24 +21,23 @@ #ifndef OC_WORKER_H #define OC_WORKER_H -#include +#include "config.h" #include #include #include #include #include -#include -#include -#include -#include -#include +#include "vpn.h" +#include "tlslib.h" +#include "str.h" +#include "worker-bandwidth.h" #include #include #include -#include +#include "common/hmac.h" #include "vhost.h" -#include "ev.h" +#include #include "common/common.h" #include "log.h"