std::string d_data;
};
+class SetEDNSOptionResponseAction : public DNSResponseAction
+{
+public:
+ // this action does not stop the processing
+ SetEDNSOptionResponseAction(uint16_t code, std::string data) :
+ d_code(code), d_data(std::move(data))
+ {
+ }
+
+ DNSResponseAction::Action operator()(DNSResponse* response, std::string* ruleresult) const override
+ {
+ setEDNSOption(*response, d_code, d_data);
+ return Action::None;
+ }
+
+ [[nodiscard]] std::string toString() const override
+ {
+ return "add EDNS Option to response (code=" + std::to_string(d_code) + ")";
+ }
+
+private:
+ uint16_t d_code;
+ std::string d_data;
+};
+
class SetNoRecurseAction : public DNSAction
{
public:
{"SetECSPrefixLengthAction", true, "v4, v6", "Set the ECS prefix length. Subsequent rules are processed after this action"},
{"SetMacAddrAction", true, "option", "Add the source MAC address to the query as EDNS0 option option. This action is currently only supported on Linux. Subsequent rules are processed after this action"},
{"SetEDNSOptionAction", true, "option, data", "Add arbitrary EDNS option and data to the query. Subsequent rules are processed after this action"},
+ {"SetEDNSOptionResponseAction", true, "option, data", "Add arbitrary EDNS option and data to the response. Subsequent rules are processed after this action"},
{"SetExtendedDNSErrorAction", true, "infoCode [, extraText]", "Set an Extended DNS Error status that will be added to the response corresponding to the current query. Subsequent rules are processed after this action"},
{"SetExtendedDNSErrorResponseAction", true, "infoCode [, extraText]", "Set an Extended DNS Error status that will be added to this response. Subsequent rules are processed after this action"},
{"SetNoRecurseAction", true, "", "strip RD bit from the question, let it go through"},
type: "Vec<ProtoBufMetaConfiguration>"
default: true
description: "A list of ``name``=``key`` pairs, for meta-data to be added to Protocol Buffer message"
+- name: "SetEDNSOption"
+ description: "Add arbitrary EDNS option and data to the response. Any existing EDNS content with the same option code will be overwritten. Subsequent rules are processed after this action"
+ skip-rust: true
+ parameters:
+ - name: "code"
+ type: "u32"
+ description: "The EDNS option number"
+ - name: "data"
+ type: "String"
+ description: "The EDNS0 option raw content"
- name: "SetExtendedDNSError"
description: "Set an Extended DNS Error status that will be added to the response. Subsequent rules are processed after this action"
parameters:
:param int option: The EDNS option number
:param string data: The EDNS0 option raw content
+.. function:: SetEDNSOptionResponseAction(option)
+
+ .. versionadded:: 1.9.11
+
+ Add arbitrary EDNS option and data to the response. Any existing EDNS content with the same option code will be overwritten.
+ Subsequent rules are processed after this action.
+
+ :param int option: The EDNS option number
+ :param string data: The EDNS0 option raw content
+
.. function:: SetExtendedDNSErrorAction(infoCode [, extraText])
.. versionadded:: 1.9.0