]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: add proxy->options3
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 7 Mar 2025 09:55:31 +0000 (10:55 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Wed, 12 Mar 2025 09:49:36 +0000 (10:49 +0100)
proxy->options2 is almost full, yet we will add new log-forward options
in upcoming patches so we anticipate that by adding a new {no_}options3
and cfg_opts3[] to further extend proxy options

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

index 79b6499dc737a6c4292f058a8465ae76d278b958..3da19da69a3509b9e5cd73603bc90c88b581d625 100644 (file)
@@ -170,6 +170,10 @@ enum PR_SRV_STATE_FILE {
 #define PR_O2_CHK_ANY   0xF0000000      /* Mask to cover any check */
 /* end of proxy->options2 */
 
+/* bits for proxy->options3 */
+/* unused: 0x00000000 to  0x80000000 */
+/* end of proxy->options3 */
+
 /* Cookie settings for pr->ck_opts */
 #define PR_CK_RW        0x00000001      /* rewrite all direct cookies with the right serverid */
 #define PR_CK_IND       0x00000002      /* keep only indirect cookies */
@@ -294,6 +298,7 @@ struct proxy {
 
        int options;                            /* PR_O_REDISP, PR_O_TRANSP, ... */
        int options2;                           /* PR_O2_* */
+       int options3;                           /* PR_O3_* */
        unsigned int ck_opts;                   /* PR_CK_* (cookie options) */
        unsigned int fe_req_ana, be_req_ana;    /* bitmap of common request protocol analysers for the frontend and backend */
        unsigned int fe_rsp_ana, be_rsp_ana;    /* bitmap of common response protocol analysers for the frontend and backend */
@@ -429,6 +434,7 @@ struct proxy {
        /* used only during configuration parsing */
        int no_options;                         /* PR_O_REDISP, PR_O_TRANSP, ... */
        int no_options2;                        /* PR_O2_* */
+       int no_options3;                        /* PR_O3_* */
 
        struct {
                const char *file;               /* file where the section appears */
index 3de1aa9eef59a8c68166134483a41dcb5e22324e..5abbeb5f3e5b41f8cbc165c57cd5928102fdd840 100644 (file)
@@ -39,6 +39,7 @@ extern struct eb_root proxy_by_name;    /* tree of proxies sorted by name */
 
 extern const struct cfg_opt cfg_opts[];
 extern const struct cfg_opt cfg_opts2[];
+extern const struct cfg_opt cfg_opts3[];
 
 struct task *manage_proxy(struct task *t, void *context, unsigned int state);
 void proxy_cond_pause(struct proxy *p);
index de89740dd13d05b38c902d3cf5a56a14be595c99..2dd2a489735bcc3acefe3882dd27f15d74e7ea79 100644 (file)
@@ -2066,6 +2066,14 @@ stats_error_parsing:
                if (err_code & ERR_CODE)
                        goto out;
 
+               /* try to match option within cfg_opts3 */
+               if (cfg_parse_listen_match_option(file, linenum, kwm, cfg_opts3, &err_code, args,
+                                                 PR_MODES, PR_CAP_NONE,
+                                                 &curproxy->options3, &curproxy->no_options3))
+                       goto out;
+               if (err_code & ERR_CODE)
+                       goto out;
+
                /* HTTP options override each other. They can be cancelled using
                 * "no option xxx" which only switches to default mode if the mode
                 * was this one (useful for cancelling options set in defaults
index c3b3467be47a6eda34dbaad53a59fc32903b19d8..fa270ab9d8d47a7937154e8c88c3f5321c982421 100644 (file)
@@ -136,6 +136,12 @@ const struct cfg_opt cfg_opts2[] =
        { NULL, 0, 0, 0 }
 };
 
+/* proxy->options3 */
+const struct cfg_opt cfg_opts3[] =
+{
+       { NULL, 0, 0, 0 }
+};
+
 /* Helper function to resolve a single sticking rule after config parsing.
  * Returns 1 for success and 0 for failure
  */