:class:`ComboAddress` where this query was received on.
If the proxy protocol is used, this will contain the destination address from the proxy protocol header.
- .. attribute:: DNSQuestion.phys_remoteaddr
+ .. attribute:: DNSQuestion.interface_remoteaddr
- :class:`ComboAddress` of the physical requestor, that is, the physical network source address of the request.
+ :class:`ComboAddress` of the interface the requestor used, that is, the network source address of the request.
- .. attribute:: DNSQuestion.phys_localaddr
+ .. attribute:: DNSQuestion.interface_localaddr
- The physical :class:`ComboAddress` where this query was received on, which is one of the listening addresses of the recursor.
+ The :class:`ComboAddress` of the interface where this query was received on, which is one of the listening addresses of the recursor.
.. attribute:: DNSQuestion.variable
void pdns_ffi_param_get_local_raw(pdns_ffi_param_t* ref, const void** addr, size_t* addrSize) __attribute__((visibility("default")));
uint16_t pdns_ffi_param_get_local_port(const pdns_ffi_param_t* ref) __attribute__((visibility("default")));
- const char* pdns_ffi_param_get_phys_remote(pdns_ffi_param_t* ref) __attribute__((visibility("default")));
- void pdns_ffi_param_get_phys_remote_raw(pdns_ffi_param_t* ref, const void** addr, size_t* addrSize) __attribute__((visibility("default")));
- uint16_t pdns_ffi_param_get_phys_remote_port(const pdns_ffi_param_t* ref) __attribute__((visibility("default")));
- const char* pdns_ffi_param_get_phys_local(pdns_ffi_param_t* ref) __attribute__((visibility("default")));
- void pdns_ffi_param_get_phys_local_raw(pdns_ffi_param_t* ref, const void** addr, size_t* addrSize) __attribute__((visibility("default")));
- uint16_t pdns_ffi_param_get_phys_local_port(const pdns_ffi_param_t* ref) __attribute__((visibility("default")));
+ const char* pdns_ffi_param_get_interface_remote(pdns_ffi_param_t* ref) __attribute__((visibility("default")));
+ void pdns_ffi_param_get_interface_remote_raw(pdns_ffi_param_t* ref, const void** addr, size_t* addrSize) __attribute__((visibility("default")));
+ uint16_t pdns_ffi_param_get_interface_remote_port(const pdns_ffi_param_t* ref) __attribute__((visibility("default")));
+ const char* pdns_ffi_param_get_interface_local(pdns_ffi_param_t* ref) __attribute__((visibility("default")));
+ void pdns_ffi_param_get_interface_local_raw(pdns_ffi_param_t* ref, const void** addr, size_t* addrSize) __attribute__((visibility("default")));
+ uint16_t pdns_ffi_param_get_interface_local_port(const pdns_ffi_param_t* ref) __attribute__((visibility("default")));
const char* pdns_ffi_param_get_edns_cs(pdns_ffi_param_t* ref) __attribute__((visibility("default")));
void pdns_ffi_param_get_edns_cs_raw(pdns_ffi_param_t* ref, const void** net, size_t* netSize) __attribute__((visibility("default")));
d_lw->registerMember<bool (DNSQuestion::*)>("isTcp", [](const DNSQuestion& dnsQuestion) -> bool { return dnsQuestion.isTcp; }, [](DNSQuestion& /* dnsQuestion */, bool newTcp) { (void) newTcp; });
d_lw->registerMember<const ComboAddress (DNSQuestion::*)>("localaddr", [](const DNSQuestion& dnsQuestion) -> const ComboAddress& { return dnsQuestion.local; }, [](DNSQuestion& /* dnsQuestion */, const ComboAddress& newLocal) { (void) newLocal; });
d_lw->registerMember<const ComboAddress (DNSQuestion::*)>("remoteaddr", [](const DNSQuestion& dnsQuestion) -> const ComboAddress& { return dnsQuestion.remote; }, [](DNSQuestion& /* dnsQuestion */, const ComboAddress& newRemote) { (void) newRemote; });
- d_lw->registerMember<const ComboAddress (DNSQuestion::*)>("phys_localaddr", [](const DNSQuestion& dnsQuestion) -> const ComboAddress& { return dnsQuestion.phys_local; }, [](DNSQuestion& /* dnsQuestion */, const ComboAddress& newLocal) { (void) newLocal; });
- d_lw->registerMember<const ComboAddress (DNSQuestion::*)>("phys_remoteaddr", [](const DNSQuestion& dnsQuestion) -> const ComboAddress& { return dnsQuestion.phys_remote; }, [](DNSQuestion& /* dnsQuestion */, const ComboAddress& newRemote) { (void) newRemote; });
+ d_lw->registerMember<const ComboAddress (DNSQuestion::*)>("interface_localaddr", [](const DNSQuestion& dnsQuestion) -> const ComboAddress& { return dnsQuestion.interface_local; }, [](DNSQuestion& /* dnsQuestion */, const ComboAddress& newLocal) { (void) newLocal; });
+ d_lw->registerMember<const ComboAddress (DNSQuestion::*)>("interface_remoteaddr", [](const DNSQuestion& dnsQuestion) -> const ComboAddress& { return dnsQuestion.interface_remote; }, [](DNSQuestion& /* dnsQuestion */, const ComboAddress& newRemote) { (void) newRemote; });
d_lw->registerMember<uint8_t (DNSQuestion::*)>("validationState", [](const DNSQuestion& dnsQuestion) -> uint8_t { return (vStateIsBogus(dnsQuestion.validationState) ? /* in order not to break older scripts */ static_cast<uint8_t>(255) : static_cast<uint8_t>(dnsQuestion.validationState)); }, [](DNSQuestion& /* dnsQuestion */, uint8_t newState) { (void) newState; });
d_lw->registerMember<vState (DNSQuestion::*)>("detailedValidationState", [](const DNSQuestion& dnsQuestion) -> vState { return dnsQuestion.validationState; }, [](DNSQuestion& /* dnsQuestion */, vState newState) { (void) newState; });
std::unique_ptr<std::string> qnameStr{nullptr};
std::unique_ptr<std::string> localStr{nullptr};
std::unique_ptr<std::string> remoteStr{nullptr};
- std::unique_ptr<std::string> physLocalStr{nullptr};
- std::unique_ptr<std::string> physRemoteStr{nullptr};
+ std::unique_ptr<std::string> interfaceLocalStr{nullptr};
+ std::unique_ptr<std::string> interfaceRemoteStr{nullptr};
std::unique_ptr<std::string> ednssubnetStr{nullptr};
std::vector<pdns_ednsoption_t> ednsOptionsVect;
std::vector<pdns_proxyprotocol_value_t> proxyProtocolValuesVect;
return ref->params.local.getPort();
}
-const char* pdns_ffi_param_get_phys_remote(pdns_ffi_param_t* ref)
+const char* pdns_ffi_param_get_interface_remote(pdns_ffi_param_t* ref)
{
- if (!ref->physRemoteStr) {
- ref->physRemoteStr = std::make_unique<std::string>(ref->params.phys_remote.toString());
+ if (!ref->interfaceRemoteStr) {
+ ref->interfaceRemoteStr = std::make_unique<std::string>(ref->params.interface_remote.toString());
}
- return ref->physRemoteStr->c_str();
+ return ref->interfaceRemoteStr->c_str();
}
-void pdns_ffi_param_get_phys_remote_raw(pdns_ffi_param_t* ref, const void** addr, size_t* addrSize)
+void pdns_ffi_param_get_interface_remote_raw(pdns_ffi_param_t* ref, const void** addr, size_t* addrSize)
{
- pdns_ffi_comboaddress_to_raw(ref->params.phys_remote, addr, addrSize);
+ pdns_ffi_comboaddress_to_raw(ref->params.interface_remote, addr, addrSize);
}
-uint16_t pdns_ffi_param_get_phys_remote_port(const pdns_ffi_param_t* ref)
+uint16_t pdns_ffi_param_get_interface_remote_port(const pdns_ffi_param_t* ref)
{
- return ref->params.phys_remote.getPort();
+ return ref->params.interface_remote.getPort();
}
-const char* pdns_ffi_param_get_phys_local(pdns_ffi_param_t* ref)
+const char* pdns_ffi_param_get_interface_local(pdns_ffi_param_t* ref)
{
- if (!ref->physLocalStr) {
- ref->physLocalStr = std::make_unique<std::string>(ref->params.phys_local.toString());
+ if (!ref->interfaceLocalStr) {
+ ref->interfaceLocalStr = std::make_unique<std::string>(ref->params.interface_local.toString());
}
- return ref->physLocalStr->c_str();
+ return ref->interfaceLocalStr->c_str();
}
-void pdns_ffi_param_get_phys_local_raw(pdns_ffi_param_t* ref, const void** addr, size_t* addrSize)
+void pdns_ffi_param_get_interface_local_raw(pdns_ffi_param_t* ref, const void** addr, size_t* addrSize)
{
- pdns_ffi_comboaddress_to_raw(ref->params.phys_local, addr, addrSize);
+ pdns_ffi_comboaddress_to_raw(ref->params.interface_local, addr, addrSize);
}
-uint16_t pdns_ffi_param_get_phys_local_port(const pdns_ffi_param_t* ref)
+uint16_t pdns_ffi_param_get_interface_local_port(const pdns_ffi_param_t* ref)
{
- return ref->params.phys_local.getPort();
+ return ref->params.interface_local.getPort();
}
const char* pdns_ffi_param_get_edns_cs(pdns_ffi_param_t* ref)
{
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
DNSQuestion(const ComboAddress& prem, const ComboAddress& ploc, const ComboAddress& rem, const ComboAddress& loc, const DNSName& query, uint16_t type, bool tcp, bool& variable_, bool& wantsRPZ_, bool& logResponse_, bool& addPaddingToResponse_, const struct timeval& queryTime_) :
- qname(query), phys_local(ploc), phys_remote(prem), local(loc), remote(rem), variable(variable_), wantsRPZ(wantsRPZ_), logResponse(logResponse_), addPaddingToResponse(addPaddingToResponse_), queryTime(queryTime_), qtype(type), isTcp(tcp)
+ qname(query), interface_local(ploc), interface_remote(prem), local(loc), remote(rem), variable(variable_), wantsRPZ(wantsRPZ_), logResponse(logResponse_), addPaddingToResponse(addPaddingToResponse_), queryTime(queryTime_), qtype(type), isTcp(tcp)
{
}
const DNSName& qname;
- const ComboAddress& phys_local;
- const ComboAddress& phys_remote;
+ const ComboAddress& interface_local;
+ const ComboAddress& interface_remote;
const ComboAddress& local;
const ComboAddress& remote;
const ComboAddress* fromAuthIP{nullptr};
public:
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
FFIParams(const DNSName& qname_, uint16_t qtype_, const ComboAddress& plocal_, const ComboAddress& premote_, const ComboAddress& local_, const ComboAddress& remote_, const Netmask& ednssubnet_, LuaContext::LuaObject& data_, std::unordered_set<std::string>& policyTags_, std::vector<DNSRecord>& records_, const EDNSOptionViewMap& ednsOptions_, const std::vector<ProxyProtocolValue>& proxyProtocolValues_, std::string& requestorId_, std::string& deviceId_, std::string& deviceName_, std::string& routingTag_, boost::optional<int>& rcode_, uint32_t& ttlCap_, bool& variable_, bool tcp_, bool& logQuery_, bool& logResponse_, bool& followCNAMERecords_, boost::optional<uint16_t>& extendedErrorCode_, std::string& extendedErrorExtra_, bool& disablePadding_, std::map<std::string, MetaValue>& meta_) :
- data(data_), qname(qname_), phys_local(plocal_), phys_remote(premote_), local(local_), remote(remote_), ednssubnet(ednssubnet_), policyTags(policyTags_), records(records_), ednsOptions(ednsOptions_), proxyProtocolValues(proxyProtocolValues_), requestorId(requestorId_), deviceId(deviceId_), deviceName(deviceName_), routingTag(routingTag_), extendedErrorExtra(extendedErrorExtra_), rcode(rcode_), extendedErrorCode(extendedErrorCode_), ttlCap(ttlCap_), variable(variable_), logQuery(logQuery_), logResponse(logResponse_), followCNAMERecords(followCNAMERecords_), disablePadding(disablePadding_), qtype(qtype_), tcp(tcp_), meta(meta_)
+ data(data_), qname(qname_), interface_local(plocal_), interface_remote(premote_), local(local_), remote(remote_), ednssubnet(ednssubnet_), policyTags(policyTags_), records(records_), ednsOptions(ednsOptions_), proxyProtocolValues(proxyProtocolValues_), requestorId(requestorId_), deviceId(deviceId_), deviceName(deviceName_), routingTag(routingTag_), extendedErrorExtra(extendedErrorExtra_), rcode(rcode_), extendedErrorCode(extendedErrorCode_), ttlCap(ttlCap_), variable(variable_), logQuery(logQuery_), logResponse(logResponse_), followCNAMERecords(followCNAMERecords_), disablePadding(disablePadding_), qtype(qtype_), tcp(tcp_), meta(meta_)
{
}
LuaContext::LuaObject& data;
const DNSName& qname;
- const ComboAddress& phys_local;
- const ComboAddress& phys_remote;
+ const ComboAddress& interface_local;
+ const ComboAddress& interface_remote;
const ComboAddress& local;
const ComboAddress& remote;
const Netmask& ednssubnet;
return true
end
- local physremoteaddr = dq.phys_remoteaddr:toString()
- local physlocaladdr = dq.phys_localaddr:toStringWithPort()
+ local interfaceremoteaddr = dq.interface_remoteaddr:toString()
+ local interfacelocaladdr = dq.interface_localaddr:toStringWithPort()
- if physremoteaddr ~= '127.0.0.1' and physremoteaddr ~= '[::]' then
- pdnslog('invalid phys source '..physremoteaddr)
+ if interfaceremoteaddr ~= '127.0.0.1' and interfaceremoteaddr ~= '[::]' then
+ pdnslog('invalid interface source '..interfaceremoteaddr)
dq:addAnswer(pdns.A, '192.0.2.131', 60)
return true
end
- if physlocaladdr ~= '127.0.0.1:%d' and physlocaladdr ~= '[::1]:%d' then
- pdnslog('invalid physdest '..physlocaladdr)
+ if interfacelocaladdr ~= '127.0.0.1:%d' and interfacelocaladdr ~= '[::1]:%d' then
+ pdnslog('invalid interfacedest '..interfacelocaladdr)
dq:addAnswer(pdns.A, '192.0.2.132', 60)
return true
end
uint16_t pdns_ffi_param_get_remote_port(const pdns_ffi_param_t* ref);
uint16_t pdns_ffi_param_get_local_port(const pdns_ffi_param_t* ref);
- const char* pdns_ffi_param_get_phys_remote(pdns_ffi_param_t* ref);
- const char* pdns_ffi_param_get_phys_local(pdns_ffi_param_t* ref);
- uint16_t pdns_ffi_param_get_phys_remote_port(const pdns_ffi_param_t* ref);
- uint16_t pdns_ffi_param_get_phys_local_port(const pdns_ffi_param_t* ref);
+ const char* pdns_ffi_param_get_interface_remote(pdns_ffi_param_t* ref);
+ const char* pdns_ffi_param_get_interface_local(pdns_ffi_param_t* ref);
+ uint16_t pdns_ffi_param_get_interface_remote_port(const pdns_ffi_param_t* ref);
+ uint16_t pdns_ffi_param_get_interface_local_port(const pdns_ffi_param_t* ref);
void pdns_ffi_param_set_tag(pdns_ffi_param_t* ref, unsigned int tag);
]]
return
end
- local physremoteaddr = ffi.string(ffi.C.pdns_ffi_param_get_phys_remote(obj))
- local physlocaladdr = ffi.string(ffi.C.pdns_ffi_param_get_phys_local(obj))
+ local interfaceremoteaddr = ffi.string(ffi.C.pdns_ffi_param_get_interface_remote(obj))
+ local interfacelocaladdr = ffi.string(ffi.C.pdns_ffi_param_get_interface_local(obj))
- if physremoteaddr ~= '127.0.0.1' and remoteaddr ~= '::1' then
- pdnslog('gettag-ffi: invalid phys source '..physremoteaddr)
+ if interfaceremoteaddr ~= '127.0.0.1' and remoteaddr ~= '::1' then
+ pdnslog('gettag-ffi: invalid interface source '..interfaceremoteaddr)
ffi.C.pdns_ffi_param_set_tag(obj, 1)
return
end
- if physlocaladdr ~= '127.0.0.1' and physlocaladdr ~= '::1' then
- pdnslog('gettag-ffi: invalid phys dest '..physlocaladdr)
+ if interfacelocaladdr ~= '127.0.0.1' and interfacelocaladdr ~= '::1' then
+ pdnslog('gettag-ffi: invalid interface dest '..interfacelocaladdr)
ffi.C.pdns_ffi_param_set_tag(obj, 2)
return
end
- if ffi.C.pdns_ffi_param_get_phys_local_port(obj) ~= %d then
- pdnslog('gettag-ffi: invalid phys source port '..ffi.C.pdns_ffi_param_get_phys_local_port(obj))
+ if ffi.C.pdns_ffi_param_get_interface_local_port(obj) ~= %d then
+ pdnslog('gettag-ffi: invalid interface source port '..ffi.C.pdns_ffi_param_get_interface_local_port(obj))
ffi.C.pdns_ffi_param_set_tag(obj, 2)
return
end