From 86f8f6f781c5aca15241aa129fd6b28ee4b3714a Mon Sep 17 00:00:00 2001 From: Thierry Fournier Date: Sat, 28 Nov 2020 17:40:24 +0100 Subject: [PATCH] MINOR: actions: Export actions lookup functions These functions will be useful to check if a keyword is already registered. This will be needed by a next patch to fix a bug, and will need to be backported. (cherry picked from commit 7a71a6d9d262d7a0f7c3d208ab339d469958011d) Signed-off-by: Christopher Faulet (cherry picked from commit ab93f7c5d88bd43aa857043129f7997f5ad4f6c8) Signed-off-by: Christopher Faulet (cherry picked from commit 3f3b931f0c4cc012c56530caef7b0182a793c26b) Signed-off-by: Christopher Faulet --- include/proto/http_rules.h | 4 ++++ include/proto/tcp_rules.h | 5 +++++ src/http_rules.c | 4 ++-- src/tcp_rules.c | 8 ++++---- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/include/proto/http_rules.h b/include/proto/http_rules.h index 608ca57..e1b78d8 100644 --- a/include/proto/http_rules.h +++ b/include/proto/http_rules.h @@ -45,6 +45,10 @@ static inline void http_res_keywords_register(struct action_kw_list *kw_list) LIST_ADDQ(&http_res_keywords.list, &kw_list->list); } +struct action_kw *action_http_req_custom(const char *kw); +struct action_kw *action_http_res_custom(const char *kw); +struct action_kw *action_http_after_res_custom(const char *kw); + #endif /* _PROTO_HTTP_RULES_H */ /* diff --git a/include/proto/tcp_rules.h b/include/proto/tcp_rules.h index bf920a1..132d253 100644 --- a/include/proto/tcp_rules.h +++ b/include/proto/tcp_rules.h @@ -37,6 +37,11 @@ void tcp_req_sess_keywords_register(struct action_kw_list *kw_list); void tcp_req_cont_keywords_register(struct action_kw_list *kw_list); void tcp_res_cont_keywords_register(struct action_kw_list *kw_list); +struct action_kw *tcp_req_conn_action(const char *kw); +struct action_kw *tcp_req_sess_action(const char *kw); +struct action_kw *tcp_req_cont_action(const char *kw); +struct action_kw *tcp_res_cont_action(const char *kw); + #endif /* _PROTO_TCP_RULES_H */ /* diff --git a/src/http_rules.c b/src/http_rules.c index 95a8832..18bbc68 100644 --- a/src/http_rules.c +++ b/src/http_rules.c @@ -50,7 +50,7 @@ struct action_kw_list http_res_keywords = { /* * Return the struct http_req_action_kw associated to a keyword. */ -static struct action_kw *action_http_req_custom(const char *kw) +struct action_kw *action_http_req_custom(const char *kw) { return action_lookup(&http_req_keywords.list, kw); } @@ -58,7 +58,7 @@ static struct action_kw *action_http_req_custom(const char *kw) /* * Return the struct http_res_action_kw associated to a keyword. */ -static struct action_kw *action_http_res_custom(const char *kw) +struct action_kw *action_http_res_custom(const char *kw) { return action_lookup(&http_res_keywords.list, kw); } diff --git a/src/tcp_rules.c b/src/tcp_rules.c index 5d76c3b..e9ffa10 100644 --- a/src/tcp_rules.c +++ b/src/tcp_rules.c @@ -70,22 +70,22 @@ void tcp_res_cont_keywords_register(struct action_kw_list *kw_list) /* * Return the struct tcp_req_action_kw associated to a keyword. */ -static struct action_kw *tcp_req_conn_action(const char *kw) +struct action_kw *tcp_req_conn_action(const char *kw) { return action_lookup(&tcp_req_conn_keywords, kw); } -static struct action_kw *tcp_req_sess_action(const char *kw) +struct action_kw *tcp_req_sess_action(const char *kw) { return action_lookup(&tcp_req_sess_keywords, kw); } -static struct action_kw *tcp_req_cont_action(const char *kw) +struct action_kw *tcp_req_cont_action(const char *kw) { return action_lookup(&tcp_req_cont_keywords, kw); } -static struct action_kw *tcp_res_cont_action(const char *kw) +struct action_kw *tcp_res_cont_action(const char *kw) { return action_lookup(&tcp_res_cont_keywords, kw); } -- 1.7.10.4