summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2014-06-13 16:17:14 +0200
committerWilly Tarreau <w@1wt.eu>2014-06-13 16:32:48 +0200
commit3a4ac422cecbaf828d14562705e256cd31e9fd75 (patch)
treed586b614feb9f03a20d0789c4a71438d383ccfcf
parent54da8db40be730f272173941a494f7d5ec3bbb3e (diff)
downloadhaproxy-3a4ac422cecbaf828d14562705e256cd31e9fd75.tar.gz
MINOR: tcp: prepare support for the "capture" action
A few minor entries will be needed to capture sample fetches in requests or responses. This patch just prepares the code for this.
-rw-r--r--include/types/arg.h1
-rw-r--r--include/types/proto_tcp.h7
-rw-r--r--src/sample.c1
3 files changed, 9 insertions, 0 deletions
diff --git a/include/types/arg.h b/include/types/arg.h
index 566f17410..809f367d4 100644
--- a/include/types/arg.h
+++ b/include/types/arg.h
@@ -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 */
diff --git a/include/types/proto_tcp.h b/include/types/proto_tcp.h
index 7f65244a0..e8f2d74b4 100644
--- a/include/types/proto_tcp.h
+++ b/include/types/proto_tcp.h
@@ -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;
};
diff --git a/src/sample.c b/src/sample.c
index 66c9a9c99..9f22ef971 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -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;
}