From: Thierry FOURNIER Date: Mon, 8 Dec 2014 18:50:43 +0000 (+0100) Subject: MINOR: global: export many symbols. X-Git-Tag: v1.6-dev1~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49f45af9aa02f099b0825de59b84ea17e9b795aa;p=thirdparty%2Fhaproxy.git MINOR: global: export many symbols. The functions "val_payload_lv" and "val_hdr" are useful with lua. The lua automatic binding for sample fetchs needs to compare check functions. The "arg_type_names" permit to display error messages. --- diff --git a/include/proto/arg.h b/include/proto/arg.h index e051de54d0..91c1acde70 100644 --- a/include/proto/arg.h +++ b/include/proto/arg.h @@ -48,6 +48,9 @@ #define ARG5(m, t1, t2, t3, t4, t5) \ (ARG4(m, t1, t2, t3, t4) + (ARGT_##t5 << (ARGM_BITS + ARGT_BITS * 4))) +/* Mapping between argument number and literal description. */ +extern const char *arg_type_names[]; + /* This dummy arg list may be used by default when no arg is found, it helps * parsers by removing pointer checks. */ diff --git a/include/proto/payload.h b/include/proto/payload.h index 4b658d41b0..fd89c88cb0 100644 --- a/include/proto/payload.h +++ b/include/proto/payload.h @@ -27,6 +27,7 @@ #include int fetch_rdp_cookie_name(struct session *s, struct sample *smp, const char *cname, int clen); +int val_payload_lv(struct arg *arg, char **err_msg); #endif /* _PROTO_PROTO_PAYLOAD_H */ diff --git a/include/proto/proto_http.h b/include/proto/proto_http.h index 579a6cb4ec..9e99ba17e5 100644 --- a/include/proto/proto_http.h +++ b/include/proto/proto_http.h @@ -131,6 +131,7 @@ enum http_meth_t find_http_meth(const char *str, const int len); struct http_req_action_kw *action_http_req_custom(const char *kw); struct http_res_action_kw *action_http_res_custom(const char *kw); +int val_hdr(struct arg *arg, char **err_msg); static inline void http_req_keywords_register(struct http_req_action_kw_list *kw_list) { diff --git a/src/arg.c b/src/arg.c index e609ac5f57..e212f6ba9c 100644 --- a/src/arg.c +++ b/src/arg.c @@ -17,7 +17,7 @@ #include #include -static const char *arg_type_names[ARGT_NBTYPES] = { +const char *arg_type_names[ARGT_NBTYPES] = { [ARGT_STOP] = "end of arguments", [ARGT_UINT] = "unsigned integer", [ARGT_SINT] = "signed integer", diff --git a/src/payload.c b/src/payload.c index 2654170835..53c9972850 100644 --- a/src/payload.c +++ b/src/payload.c @@ -631,7 +631,7 @@ smp_fetch_payload(struct proxy *px, struct session *s, void *l7, unsigned int op * error, that the caller is responsible for freeing. The initial location must * either be freeable or NULL. */ -static int val_payload_lv(struct arg *arg, char **err_msg) +int val_payload_lv(struct arg *arg, char **err_msg) { if (!arg[1].data.uint) { memprintf(err_msg, "payload length must be > 0"); diff --git a/src/proto_http.c b/src/proto_http.c index f87583f719..de219e3bb7 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -11364,7 +11364,7 @@ smp_fetch_url32_src(struct proxy *px, struct session *l4, void *l7, unsigned int * error message in case of error, that the caller is responsible for freeing. * The initial location must either be freeable or NULL. */ -static int val_hdr(struct arg *arg, char **err_msg) +int val_hdr(struct arg *arg, char **err_msg) { if (arg && arg[1].type == ARGT_SINT && arg[1].data.sint < -MAX_HDR_HISTORY) { memprintf(err_msg, "header occurrence must be >= %d", -MAX_HDR_HISTORY);