diff --git a/include/proto/sample.h b/include/proto/sample.h index d363e4ecb..b8a10400f 100644 --- a/include/proto/sample.h +++ b/include/proto/sample.h @@ -26,6 +26,8 @@ #include #include +extern const char *smp_to_type[SMP_TYPES]; + struct sample_expr *sample_parse_expr(char **str, int *idx, char **err, struct arg_list *al); struct sample_conv *find_sample_conv(const char *kw, int len); struct sample *sample_process(struct proxy *px, struct session *l4, diff --git a/src/dumpstats.c b/src/dumpstats.c index 3835f2c8d..ba0a7a502 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -4836,19 +4837,6 @@ static int stats_maps_list(struct stream_interface *si) } } -static const char *smp_to_type[SMP_TYPES] = { - [SMP_T_BOOL] = "bool", - [SMP_T_UINT] = "uint", - [SMP_T_SINT] = "sint", - [SMP_T_ADDR] = "addr", - [SMP_T_IPV4] = "ipv4", - [SMP_T_IPV6] = "ipv6", - [SMP_T_STR] = "str", - [SMP_T_BIN] = "bin", - [SMP_T_CSTR] = "cstr", - [SMP_T_CBIN] = "cbin", -}; - static int stats_map_lookup(struct stream_interface *si) { struct appctx *appctx = __objt_appctx(si->end); diff --git a/src/sample.c b/src/sample.c index 8584dbe8e..f57811e5a 100644 --- a/src/sample.c +++ b/src/sample.c @@ -28,6 +28,20 @@ #include #include +/* sample type names */ +const char *smp_to_type[SMP_TYPES] = { + [SMP_T_BOOL] = "bool", + [SMP_T_UINT] = "uint", + [SMP_T_SINT] = "sint", + [SMP_T_ADDR] = "addr", + [SMP_T_IPV4] = "ipv4", + [SMP_T_IPV6] = "ipv6", + [SMP_T_STR] = "str", + [SMP_T_BIN] = "bin", + [SMP_T_CSTR] = "cstr", + [SMP_T_CBIN] = "cbin", +}; + /* static sample used in sample_process() when

is NULL */ static struct sample temp_smp;