struct EDNSOptionCode
{
// Temporary code assigned for OpenTelemetry TraceID and SpanID
- enum EDNSOptionCodeEnum : uint16_t {NSID=3, DAU=5, DHU=6, N3U=7, ECS=8, EXPIRE=9, COOKIE=10, TCPKEEPALIVE=11, PADDING=12, CHAIN=13, KEYTAG=14, EXTENDEDERROR=15, OTTRACEIDS=65500};
+ enum EDNSOptionCodeEnum : uint16_t {NSID=3, DAU=5, DHU=6, N3U=7, ECS=8, EXPIRE=9, COOKIE=10, TCPKEEPALIVE=11, PADDING=12, CHAIN=13, KEYTAG=14, EXTENDEDERROR=15, TRACEPARENT=65500};
};
/* extract the position (relative to the optRR pointer!) and size of a specific EDNS0 option from a pointer on the beginning rdLen of the OPT RR */
{
EDNSOptionCode::EDNSOptionCodeEnum realEOC = eoc;
if (realEOC == 0) {
- realEOC = EDNSOptionCode::OTTRACEIDS;
+ realEOC = EDNSOptionCode::TRACEPARENT;
}
bool traceidset = false;
if (const auto& option = map.find(realEOC); option != map.end()) {
ecsParsed = true;
if (SyncRes::eventTraceEnabled(SyncRes::event_trace_to_ot)) {
- bool ednsFound = pdns::trace::extractOTraceIDs(ednsOptions, EDNSOptionCode::OTTRACEIDS, otTrace);
+ bool ednsFound = pdns::trace::extractOTraceIDs(ednsOptions, EDNSOptionCode::TRACEPARENT, otTrace);
if (!matchOTConditions(eventTrace, t_OTConditions, mappedSource, qname, qtype, ntohs(headerdata->id), ednsFound) && SyncRes::eventTraceEnabledOnly(SyncRes::event_trace_to_ot)) {
eventTrace.setEnabled(false);
}
qnameParsed = true;
if (SyncRes::eventTraceEnabled(SyncRes::event_trace_to_ot)) {
- bool ednsFound = pdns::trace::extractOTraceIDs(ednsOptions, EDNSOptionCode::OTTRACEIDS, comboWriter->d_otTrace);
+ bool ednsFound = pdns::trace::extractOTraceIDs(ednsOptions, EDNSOptionCode::TRACEPARENT, comboWriter->d_otTrace);
if (SyncRes::eventTraceEnabledOnly(SyncRes::event_trace_to_ot) && !matchOTConditions(comboWriter->d_eventTrace, t_OTConditions, comboWriter->d_mappedSource, qname, qtype, ntohs(comboWriter->d_mdp.d_header.id), ednsFound)) {
comboWriter->d_eventTrace.setEnabled(false);
}
return count;
}
-static const std::unordered_set<uint16_t> s_skipOptions = {EDNSOptionCode::ECS, EDNSOptionCode::COOKIE, EDNSOptionCode::OTTRACEIDS};
+static const std::unordered_set<uint16_t> s_skipOptions = {EDNSOptionCode::ECS, EDNSOptionCode::COOKIE, EDNSOptionCode::TRACEPARENT};
bool RecursorPacketCache::qrMatch(const packetCache_t::index<HashTag>::type::iterator& iter, const std::string& queryPacket, const DNSName& qname, uint16_t qtype, uint16_t qclass)
{
record.setTraceID(traceid);
record.setSpanID(spanid);
record.setFlags(flags);
- opts.emplace_back(EDNSOptionCode::OTTRACEIDS, std::string_view(reinterpret_cast<const char*>(data.data()), data.size())); // NOLINT
+ opts.emplace_back(EDNSOptionCode::TRACEPARENT, std::string_view(reinterpret_cast<const char*>(data.data()), data.size())); // NOLINT
}
pw.addOpt(bufsize, 0, dnssec ? EDNSOpts::DNSSECOK : 0, opts);
pw.commit();