From: Willy Tarreau Date: Thu, 4 Jun 2020 08:36:03 +0000 (+0200) Subject: REORG: include: move auth.h to haproxy/auth{,-t}.h X-Git-Tag: v2.2-dev9~74 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ac13aeaa891a8f2a4cbe8319118ccb0e214a74db;p=thirdparty%2Fhaproxy.git REORG: include: move auth.h to haproxy/auth{,-t}.h The STATS_DEFAULT_REALM and STATS_DEFAULT_URI were moved to defaults.h. It was required to include types/pattern.h and types/sample.h since they are mentioned in function prototypes. It would be wise to merge this with uri_auth.h later. --- diff --git a/include/common/uri_auth.h b/include/common/uri_auth.h index 33596534e4..9250f54f90 100644 --- a/include/common/uri_auth.h +++ b/include/common/uri_auth.h @@ -14,8 +14,8 @@ #define _COMMON_URI_AUTH_H +#include #include -#include /* This is a list of proxies we are allowed to see. Later, it should go in the * user list, but before this we need to support de/re-authentication. @@ -41,21 +41,6 @@ struct uri_auth { struct uri_auth *next; /* Used at deinit() to build a list of unique elements */ }; -/* This is the default statistics URI */ -#ifdef CONFIG_STATS_DEFAULT_URI -#define STATS_DEFAULT_URI CONFIG_STATS_DEFAULT_URI -#else -#define STATS_DEFAULT_URI "/haproxy?stats" -#endif - -/* This is the default statistics realm */ -#ifdef CONFIG_STATS_DEFAULT_REALM -#define STATS_DEFAULT_REALM CONFIG_STATS_DEFAULT_REALM -#else -#define STATS_DEFAULT_REALM "HAProxy Statistics" -#endif - - struct stats_admin_rule { struct list list; /* list linked to from the proxy */ struct acl_cond *cond; /* acl condition to meet */ diff --git a/include/types/auth.h b/include/haproxy/auth-t.h similarity index 84% rename from include/types/auth.h rename to include/haproxy/auth-t.h index f9b56f1ad2..83f2c7c43c 100644 --- a/include/types/auth.h +++ b/include/haproxy/auth-t.h @@ -1,5 +1,6 @@ /* - * User authentication & authorization. + * include/haproxy/auth-t.h + * Types definitions for user authentication & authorization. * * Copyright 2010 Krzysztof Piotr Oledzki * @@ -10,14 +11,13 @@ * */ -#ifndef _TYPES_AUTH_H -#define _TYPES_AUTH_H +#ifndef _HAPROXY_AUTH_T_H +#define _HAPROXY_AUTH_T_H +#include #include #include -#include - #define AU_O_INSECURE 0x00000001 /* insecure, unencrypted password */ struct auth_groups { @@ -48,7 +48,7 @@ struct userlist { struct auth_groups *groups; }; -#endif /* _TYPES_AUTH_H */ +#endif /* _HAPROXY_AUTH_T_H */ /* * Local variables: diff --git a/include/proto/auth.h b/include/haproxy/auth.h similarity index 78% rename from include/proto/auth.h rename to include/haproxy/auth.h index 853e38cbba..39cc0aab1d 100644 --- a/include/proto/auth.h +++ b/include/haproxy/auth.h @@ -1,5 +1,6 @@ /* - * User authentication & authorization. + * include/haproxy/auth.h + * Functions for user authentication & authorization. * * Copyright 2010 Krzysztof Piotr Oledzki * @@ -10,11 +11,13 @@ * */ -#ifndef _PROTO_AUTH_H -#define _PROTO_AUTH_H +#ifndef _HAPROXY_AUTH_H +#define _HAPROXY_AUTH_H +#include #include -#include +#include +#include extern struct userlist *userlist; @@ -26,7 +29,7 @@ struct pattern *pat_match_auth(struct sample *smp, struct pattern_expr *expr, in int check_user(struct userlist *ul, const char *user, const char *pass); int check_group(struct userlist *ul, char *name); -#endif /* _PROTO_AUTH_H */ +#endif /* _HAPROXY_AUTH_H */ /* * Local variables: diff --git a/include/haproxy/defaults.h b/include/haproxy/defaults.h index dff5436d59..e359a3ea24 100644 --- a/include/haproxy/defaults.h +++ b/include/haproxy/defaults.h @@ -223,6 +223,20 @@ #define STATS_VERSION_STRING " version " HAPROXY_VERSION ", released " HAPROXY_DATE #endif +/* This is the default statistics URI */ +#ifdef CONFIG_STATS_DEFAULT_URI +#define STATS_DEFAULT_URI CONFIG_STATS_DEFAULT_URI +#else +#define STATS_DEFAULT_URI "/haproxy?stats" +#endif + +/* This is the default statistics realm */ +#ifdef CONFIG_STATS_DEFAULT_REALM +#define STATS_DEFAULT_REALM CONFIG_STATS_DEFAULT_REALM +#else +#define STATS_DEFAULT_REALM "HAProxy Statistics" +#endif + /* Maximum signal queue size, and also number of different signals we can * handle. */ diff --git a/include/types/acl.h b/include/types/acl.h index 89c3c93c8f..78b26125c7 100644 --- a/include/types/acl.h +++ b/include/types/acl.h @@ -22,11 +22,11 @@ #ifndef _TYPES_ACL_H #define _TYPES_ACL_H +#include #include #include #include -#include #include #include #include diff --git a/src/acl.c b/src/acl.c index 5b5fd1d3b9..1ecacb1d94 100644 --- a/src/acl.c +++ b/src/acl.c @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -23,7 +24,6 @@ #include #include -#include #include #include #include diff --git a/src/auth.c b/src/auth.c index 2058f1fe2f..30fec83f59 100644 --- a/src/auth.c +++ b/src/auth.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -33,7 +34,6 @@ #include #include -#include #include struct userlist *userlist = NULL; /* list of all existing userlists */ diff --git a/src/cfgparse.c b/src/cfgparse.c index 0505611537..23a290e3a9 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -55,7 +56,6 @@ #include #include -#include #include #include #include diff --git a/src/haproxy.c b/src/haproxy.c index 94a37c3f69..33b4abf279 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -78,6 +78,7 @@ #include #endif +#include #include #include @@ -109,7 +110,6 @@ #include #include #include -#include #include #include #include diff --git a/src/http_acl.c b/src/http_acl.c index 2fe7e85e1f..fdb5a0042e 100644 --- a/src/http_acl.c +++ b/src/http_acl.c @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -27,7 +28,6 @@ #include #include -#include #include diff --git a/src/http_fetch.c b/src/http_fetch.c index 31a69e7680..c14b95bd41 100644 --- a/src/http_fetch.c +++ b/src/http_fetch.c @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #include -#include #include #include #include diff --git a/src/sample.c b/src/sample.c index c1a4bb9bb6..c13a1ead12 100644 --- a/src/sample.c +++ b/src/sample.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -30,7 +31,6 @@ #include #include -#include #include #include #include