MCPcopy Create free account
hub / github.com/defold/defold / BuildProbeRecord

Function BuildProbeRecord

engine/dlib/src/dlib/mdns.cpp:808–829  ·  view source on GitHub ↗

Materializes one tentative unique record owned by a service. These records are the RFC 6762 "claims" used in the authority section.

Source from the content-addressed store, hash-verified

806 // Materializes one tentative unique record owned by a service. These
807 // records are the RFC 6762 "claims" used in the authority section.
808 static bool BuildProbeRecord(const RegisteredService& service, const char* name, uint16_t type, ProbeRecord* record)
809 {
810 memset(record, 0, sizeof(*record));
811 record->m_Type = type;
812 record->m_Class = DNS_CLASS_IN;
813
814 if (NameEquals(name, service.m_FullServiceName))
815 {
816 if (type == DNS_TYPE_TXT)
817 return BuildTxtRData(service, record->m_RData, sizeof(record->m_RData), &record->m_RDataLength);
818 if (type == DNS_TYPE_SRV)
819 return BuildSrvRData(service, record->m_RData, sizeof(record->m_RData), &record->m_RDataLength);
820 return false;
821 }
822
823 if (service.m_ProbeHost && NameEquals(name, service.m_HostLocal) && type == DNS_TYPE_A)
824 {
825 return BuildARData(service.m_HostAddress, record->m_RData, sizeof(record->m_RData), &record->m_RDataLength);
826 }
827
828 return false;
829 }
830
831 // DNS-SD service-instance ownership is defined by the TXT and SRV records
832 // at the full instance name. Build and return that sortable record set.

Callers 3

BuildHostProbeRecordSetFunction · 0.85

Calls 4

NameEqualsFunction · 0.85
BuildTxtRDataFunction · 0.85
BuildSrvRDataFunction · 0.85
BuildARDataFunction · 0.85

Tested by

no test coverage detected