enum http_meth_t find_http_meth(const char *str, const int len);
int http_get_status_idx(unsigned int status);
const char *http_get_reason(unsigned int status);
+void dump_http_hardening_kws();
struct http_hdng_prf *http_hardening_lookup(const char *name);
struct http_hdng_prf *http_hardening_resolve(const char *name, char **err);
void http_status_add_range(long *array, uint low, uint high);
#include <haproxy/global.h>
#include <haproxy/http_ana.h>
#include <haproxy/http_rules.h>
+#include <haproxy/http.h>
#include <haproxy/http_htx.h>
#include <haproxy/lb_chash.h>
#include <haproxy/lb_fas.h>
}
}
+
+ /* this section's keywords are not registered via cfg_kw_list */
+ printf("http-hardening\n");
+ dump_http_hardening_kws();
}
/* these are the config sections handled by default */
{ NULL, 0 }
};
+/* Dumps the list of known HTTP hardening keywords on stdout, one per line. */
+void dump_http_hardening_kws()
+{
+ const struct http_hardening_kw *kw;
+
+ for (kw = http_hardening_kws; kw->name; kw++)
+ if (kw->mask & (kw->mask - 1)) // more than one bit set
+ printf("\t%s\n", kw->name);
+ else // single bit, report its position starting at 1
+ printf("\t%s (%d)\n", kw->name, my_flsl(kw->mask));
+}
+
/* Declared profiles are indexed by name in <http_hardening_by_name>. They must
* be declared before being referenced, like for "defaults" sections. The
* implicit "untrusted" and "trusted" profiles are static, so that they may