]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: define PR_CAP_LB
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 7 May 2021 13:12:20 +0000 (15:12 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 7 May 2021 13:12:20 +0000 (15:12 +0200)
Add a new proxy capability for proxy with load-balancing capabilities.
This help to differentiate listen/frontend/backend with special proxies
such as peer proxies.

include/haproxy/proxy-t.h
src/cfgparse-listen.c

index 02d1391df2acd808515f18165d84eac003e551c9..95d3bc978f15538536e7b06d635d641636186cc4 100644 (file)
@@ -69,6 +69,7 @@ enum PR_SRV_STATE_FILE {
 #define PR_CAP_LISTEN  (PR_CAP_FE|PR_CAP_BE)
 #define PR_CAP_DEF     0x0004           /* defaults section */
 #define PR_CAP_LUA     0x0008           /* internal proxy used by lua engine */
+#define PR_CAP_LB      0x0010           /* load-balancing capabilities, i.e. listen/frontend/backend proxies */
 
 /* bits for proxy->options */
 #define PR_O_REDISP     0x00000001      /* allow reconnection to dispatch in case of errors */
index 525da589096ac2047a009ffe14056b361f580423..d5df78c516ea87a568d09f2531b80da11863bbd5 100644 (file)
@@ -223,11 +223,11 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
        }
 
        if (strcmp(args[0], "listen") == 0)
-               rc = PR_CAP_LISTEN;
+               rc = PR_CAP_LISTEN | PR_CAP_LB;
        else if (strcmp(args[0], "frontend") == 0)
-               rc = PR_CAP_FE;
+               rc = PR_CAP_FE | PR_CAP_LB;
        else if (strcmp(args[0], "backend") == 0)
-               rc = PR_CAP_BE;
+               rc = PR_CAP_BE | PR_CAP_LB;
        else if (strcmp(args[0], "defaults") == 0) {
                /* "defaults" must first delete the last no-name defaults if any */
                proxy_destroy_defaults(proxy_find_by_name("", PR_CAP_DEF, 0));