8 #include <QSocketNotifier> 15 #define TORC_BONJOUR_HOST QStringLiteral("host") 16 #define TORC_BONJOUR_ADDRESSES QStringLiteral("addresses") 17 #define TORC_BONJOUR_TXT QStringLiteral("txtrecords") 18 #define TORC_BONJOUR_NAME QStringLiteral("name") 19 #define TORC_BONJOUR_TYPE QStringLiteral("type") 20 #define TORC_BONJOUR_PORT QStringLiteral("port") 40 TorcBonjourService(
ServiceType BonjourType,
const QByteArray &Name,
const QByteArray &Type,
const QByteArray &Domain, uint32_t InterfaceIndex);
71 static void Suspend (
bool Suspend);
72 static void TearDown (
void);
73 static QByteArray MapToTxtRecord (
const QMap<QByteArray,QByteArray> &Map);
74 static QMap<QByteArray,QByteArray> TxtRecordToMap(
const QByteArray &TxtRecord);
76 quint32 Register (quint16 Port,
const QByteArray &Type,
77 const QByteArray &Name,
const QMap<QByteArray,QByteArray> &TxtRecords, quint32 Reference = 0);
78 quint32 Register (quint16 Port,
const QByteArray &Type,
79 const QByteArray &Name,
const QByteArray &Txt, quint32 Reference = 0);
80 quint32
Browse (
const QByteArray &Type, quint32 Reference = 0);
87 void Resolve(DNSServiceRef Reference, DNSServiceErrorType ErrorType,
const char *Fullname,
88 const char *HostTarget, uint16_t Port, uint16_t TxtLen,
89 const unsigned char *TxtRecord);
92 void socketReadyRead (
int Socket);
95 void SuspendPriv (
bool Suspend);
96 void HostLookup (
const QHostInfo &HostInfo);
105 QMutex m_serviceLock;
106 QMap<quint32,TorcBonjourService> m_services;
107 QMutex m_discoveredLock;
108 QMap<quint32,TorcBonjourService> m_discoveredServices;
QList< QHostAddress > m_ipAddresses
Address resolution for a discovered service.
uint32_t m_interfaceIndex
~TorcBonjourService()=default
QSocketNotifier * m_socketNotifier
bool IsResolved(void)
Returns true when the service has been fully resolved to an IP address and port.
void Deregister(void)
Release all resources associated with this service.
Wrapper around a DNS service reference, either advertised or discovered.
A service being advertised by this application.
TorcBonjourService & operator=(const TorcBonjourService &Other)
Advertises and searches for services via Bonjour (aka Zero Configuration Networking/Avahi) ...
An external service which we are actively trying to discover.
void SetFileDescriptor(int FileDescriptor, TorcBonjour *Object)
Sets the file descriptor and creates a QSocketNotifier to listen for socket events.
ServiceType m_serviceType