]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tcp: prepare support for the "capture" action
authorWilly Tarreau <w@1wt.eu>
Fri, 13 Jun 2014 14:17:14 +0000 (16:17 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 13 Jun 2014 14:32:48 +0000 (16:32 +0200)
A few minor entries will be needed to capture sample fetches in requests
or responses. This patch just prepares the code for this.

include/types/arg.h
include/types/proto_tcp.h
src/sample.c

index 566f174102c49d37c4ebc92382d6126da396118f..809f367d4fb5e77a57c77984184fe8087c428fc7 100644 (file)
@@ -58,6 +58,7 @@ enum {
        ARGC_HRS,      /* http-response */
        ARGC_UIF,      /* unique-id-format */
        ARGC_RDR,      /* redirect */
+       ARGC_CAP,      /* capture rule */
 };
 
 /* some types that are externally defined */
index 7f65244a06fdd2785b3d7ad2b866f47cc7364df7..e8f2d74b42019ebd21b1293821932f726694b5ad 100644 (file)
@@ -38,6 +38,12 @@ enum {
        TCP_ACT_TRK_SC2 = 6,
        TCP_ACT_TRK_SCMAX = TCP_ACT_TRK_SC0 + MAX_SESS_STKCTR - 1,
        TCP_ACT_CLOSE, /* close at the sender's */
+       TCP_ACT_CAPTURE, /* capture a fetched sample */
+};
+
+struct capture_prm {
+       struct sample_expr *expr;               /* expression used as the key */
+       struct cap_hdr *hdr;                    /* the capture storage */
 };
 
 struct tcp_rule {
@@ -46,6 +52,7 @@ struct tcp_rule {
        int action;
        union {
                struct track_ctr_prm trk_ctr;
+               struct capture_prm cap;
        } act_prm;
 };
 
index 66c9a9c99631fba297c116810fd95876347c274f..9f22ef97156f9e55923f0311fe9011d8eb3ecedf 100644 (file)
@@ -971,6 +971,7 @@ int smp_resolve_args(struct proxy *p)
                case ARGC_HRS: where = "in http-response header format string in"; break;
                case ARGC_UIF: where = "in unique-id-format string in"; break;
                case ARGC_RDR: where = "in redirect format string in"; break;
+               case ARGC_CAP: where = "in capture rule in"; break;
                case ARGC_ACL: ctx = "ACL keyword"; break;
                }