enum act_parse_ret resolv_parse_do_resolve(const char **args, int *orig_arg, struct proxy *px, struct act_rule *rule, char **err);
int check_action_do_resolve(struct act_rule *rule, struct proxy *px, char **err);
-int stats_dump_dns(struct stream_interface *si,
- struct field *stats, size_t stats_count,
- struct list *stat_modules);
-void dns_stats_clear_counters(int clrall, struct list *stat_modules);
-int dns_allocate_counters(struct list *stat_modules);
+int stats_dump_resolvers(struct stream_interface *si,
+ struct field *stats, size_t stats_count,
+ struct list *stat_modules);
+void resolv_stats_clear_counters(int clrall, struct list *stat_modules);
+int resolv_allocate_counters(struct list *stat_modules);
#endif // _HAPROXY_DNS_H
}
-static int stats_dump_dns_to_buffer(struct stream_interface *si,
+static int stats_dump_resolv_to_buffer(struct stream_interface *si,
struct dns_nameserver *ns,
struct field *stats, size_t stats_count,
struct list *stat_modules)
/* Uses <appctx.ctx.stats.obj1> as a pointer to the current resolver and <obj2>
* as a pointer to the current nameserver.
*/
-int stats_dump_dns(struct stream_interface *si,
- struct field *stats, size_t stats_count,
- struct list *stat_modules)
+int stats_dump_resolvers(struct stream_interface *si,
+ struct field *stats, size_t stats_count,
+ struct list *stat_modules)
{
struct appctx *appctx = __objt_appctx(si->end);
struct channel *rep = si_ic(si);
if (buffer_almost_full(&rep->buf))
goto full;
- if (!stats_dump_dns_to_buffer(si, ns,
- stats, stats_count,
- stat_modules)) {
+ if (!stats_dump_resolv_to_buffer(si, ns,
+ stats, stats_count,
+ stat_modules)) {
return 0;
}
}
return 0;
}
-void dns_stats_clear_counters(int clrall, struct list *stat_modules)
+void resolv_stats_clear_counters(int clrall, struct list *stat_modules)
{
struct resolvers *resolvers;
struct dns_nameserver *ns;
}
-int dns_allocate_counters(struct list *stat_modules)
+int resolv_allocate_counters(struct list *stat_modules)
{
struct stats_module *mod;
struct resolvers *resolvers;
case STAT_ST_LIST:
switch (domain) {
case STATS_DOMAIN_DNS:
- if (!stats_dump_dns(si, stat_l[domain],
- stat_count[domain],
- &stats_module_list[domain])) {
+ if (!stats_dump_resolvers(si, stat_l[domain],
+ stat_count[domain],
+ &stats_module_list[domain])) {
return 0;
}
break;
}
}
- dns_stats_clear_counters(clrall, &stats_module_list[STATS_DOMAIN_DNS]);
+ resolv_stats_clear_counters(clrall, &stats_module_list[STATS_DOMAIN_DNS]);
memset(activity, 0, sizeof(activity));
return 1;
i += mod->stats_count;
}
- if (!dns_allocate_counters(&stats_module_list[STATS_DOMAIN_DNS])) {
+ if (!resolv_allocate_counters(&stats_module_list[STATS_DOMAIN_DNS])) {
ha_alert("stats: cannot allocate all counters for dns statistics\n");
err_code |= ERR_ALERT | ERR_FATAL;
return err_code;