/src/pdns/pdns/dnsdistdist/build/dnsdist-lua-selectors-generated-body.hh
Line | Count | Source |
1 | | // !! This file has been generated by dnsdist-rules-generator.py, do not edit by hand!! |
2 | 0 | luaCtx.writeFunction("AllRule", []() { |
3 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getAllSelector()); |
4 | 0 | }); |
5 | 0 | luaCtx.writeFunction("DNSSECRule", []() { |
6 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getDNSSECSelector()); |
7 | 0 | }); |
8 | 0 | luaCtx.writeFunction("DSTPortRule", [](uint16_t port) { |
9 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getDSTPortSelector(port)); |
10 | 0 | }); |
11 | 0 | luaCtx.writeFunction("EDNSOptionRule", [](uint16_t option_code) { |
12 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getEDNSOptionSelector(option_code)); |
13 | 0 | }); |
14 | 0 | luaCtx.writeFunction("EDNSVersionRule", [](uint8_t version) { |
15 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getEDNSVersionSelector(version)); |
16 | 0 | }); |
17 | 0 | luaCtx.writeFunction("ERCodeRule", [](uint8_t rcode) { |
18 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getERCodeSelector(rcode)); |
19 | 0 | }); |
20 | 0 | luaCtx.writeFunction("HTTPHeaderRule", [](std::string header, std::string expression) { |
21 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getHTTPHeaderSelector(header, expression)); |
22 | 0 | }); |
23 | 0 | luaCtx.writeFunction("HTTPPathRule", [](std::string path) { |
24 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getHTTPPathSelector(path)); |
25 | 0 | }); |
26 | 0 | luaCtx.writeFunction("HTTPPathRegexRule", [](std::string expression) { |
27 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getHTTPPathRegexSelector(expression)); |
28 | 0 | }); |
29 | 0 | luaCtx.writeFunction("IncomingProtocolRule", [](std::string protocol) { |
30 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getIncomingProtocolSelector(protocol)); |
31 | 0 | }); |
32 | 0 | luaCtx.writeFunction("LuaFFIPerThreadRule", [](std::string code) { |
33 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getLuaFFIPerThreadSelector(code)); |
34 | 0 | }); |
35 | 0 | luaCtx.writeFunction("MaxQPSRule", [](uint32_t qps, std::optional<uint32_t> burst) { |
36 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getMaxQPSSelector(qps, burst)); |
37 | 0 | }); |
38 | 0 | luaCtx.writeFunction("MaxQPSIPRule", [](uint32_t qps, std::optional<uint8_t> ipv4_mask, std::optional<uint8_t> ipv6_mask, std::optional<uint32_t> burst, std::optional<uint32_t> expiration, std::optional<uint32_t> cleanup_delay, std::optional<uint32_t> scan_fraction, std::optional<uint32_t> shards) { |
39 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getMaxQPSIPSelector(qps, ipv4_mask, ipv6_mask, burst, expiration, cleanup_delay, scan_fraction, shards)); |
40 | 0 | }); |
41 | 0 | luaCtx.writeFunction("OpcodeRule", [](uint8_t code) { |
42 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getOpcodeSelector(code)); |
43 | 0 | }); |
44 | 0 | luaCtx.writeFunction("PayloadSizeRule", [](std::string comparison, uint16_t size) { |
45 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getPayloadSizeSelector(comparison, size)); |
46 | 0 | }); |
47 | 0 | luaCtx.writeFunction("PoolAvailableRule", [](std::string pool) { |
48 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getPoolAvailableSelector(pool)); |
49 | 0 | }); |
50 | 0 | luaCtx.writeFunction("PoolOutstandingRule", [](std::string pool, uint64_t max_outstanding) { |
51 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getPoolOutstandingSelector(pool, max_outstanding)); |
52 | 0 | }); |
53 | 0 | luaCtx.writeFunction("ProbaRule", [](double probability) { |
54 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getProbaSelector(probability)); |
55 | 0 | }); |
56 | 0 | luaCtx.writeFunction("ProxyProtocolValueRule", [](uint8_t option_type, std::optional<std::string> option_value) { |
57 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getProxyProtocolValueSelector(option_type, option_value)); |
58 | 0 | }); |
59 | 0 | luaCtx.writeFunction("QNameLabelsCountRule", [](uint16_t min_labels_count, uint16_t max_labels_count) { |
60 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getQNameLabelsCountSelector(min_labels_count, max_labels_count)); |
61 | 0 | }); |
62 | 0 | luaCtx.writeFunction("QNameWireLengthRule", [](uint16_t min, uint16_t max) { |
63 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getQNameWireLengthSelector(min, max)); |
64 | 0 | }); |
65 | 0 | luaCtx.writeFunction("RCodeRule", [](uint8_t rcode) { |
66 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getRCodeSelector(rcode)); |
67 | 0 | }); |
68 | 0 | luaCtx.writeFunction("RDRule", []() { |
69 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getRDSelector()); |
70 | 0 | }); |
71 | 0 | luaCtx.writeFunction("RE2Rule", [](std::string expression) { |
72 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getRE2Selector(expression)); |
73 | 0 | }); |
74 | 0 | luaCtx.writeFunction("RecordsCountRule", [](uint8_t section, uint16_t minimum, uint16_t maximum) { |
75 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getRecordsCountSelector(section, minimum, maximum)); |
76 | 0 | }); |
77 | 0 | luaCtx.writeFunction("RecordsTypeCountRule", [](uint8_t section, uint16_t record_type, uint16_t minimum, uint16_t maximum) { |
78 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getRecordsTypeCountSelector(section, record_type, minimum, maximum)); |
79 | 0 | }); |
80 | 0 | luaCtx.writeFunction("RegexRule", [](std::string expression) { |
81 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getRegexSelector(expression)); |
82 | 0 | }); |
83 | 0 | luaCtx.writeFunction("SNIRule", [](std::string server_name) { |
84 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getSNISelector(server_name)); |
85 | 0 | }); |
86 | 0 | luaCtx.writeFunction("TCPRule", [](bool tcp) { |
87 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getTCPSelector(tcp)); |
88 | 0 | }); |
89 | 0 | luaCtx.writeFunction("TrailingDataRule", []() { |
90 | 0 | return std::shared_ptr<DNSRule>(dnsdist::selectors::getTrailingDataSelector()); |
91 | 0 | }); |