16 #define TORC_SSDP_UDP_MULTICAST_PORT 1900 17 #define TORC_IPV4_UDP_MULTICAST_ADDR QStringLiteral("239.255.255.250") 18 #define TORC_IPV4_UDP_MULTICAST_URL QStringLiteral("%1:%2").arg(TORC_IPV4_UDP_MULTICAST_ADDR).arg(TORC_SSDP_UDP_MULTICAST_PORT) 19 #define TORC_IPV6_UDP_MULTICAST_ADDR QStringLiteral("[FF05::C]") 20 #define TORC_IPV6_UDP_MULTICAST_ADDR2 QStringLiteral("FF05::C") 21 #define TORC_IPV6_UDP_MULTICAST_URL QStringLiteral("%1:%2").arg(TORC_IPV6_UDP_MULTICAST_ADDR).arg(TORC_SSDP_UDP_MULTICAST_PORT) 53 static void CancelSearch (
void);
55 static void CancelAnnounce (
void);
68 static TorcSSDP* Create (
bool Destroy =
false);
71 void SearchPriv (
void);
72 void CancelSearchPriv (
void);
73 void AnnouncePriv (
void);
74 void CancelAnnouncePriv (
void);
76 void SendSearch (
void);
77 void SendAnnounce (
bool IsIPv6,
bool Alive);
79 bool event (QEvent *Event)
override;
81 void ProcessResponses (
void);
85 static QUdpSocket* CreateSearchSocket (const QHostAddress &HostAddress,
TorcSSDP *Owner);
86 static QUdpSocket* CreateMulticastSocket (const QHostAddress &HostAddress,
TorcSSDP *Owner, const QNetworkInterface &Interface);
91 void ProcessDevice (const QMap<QString,QString> &Headers, qint64 Expires,
bool Add);
92 qint64 GetExpiryTime (const QString &Expires);
93 void StartSearch (
void);
94 void StopSearch (
void);
95 void StartAnnounce (
void);
96 void StopAnnounce (
void);
102 QString m_serverString;
104 bool m_searchDebugged;
105 int m_firstSearchTimer;
106 int m_secondSearchTimer;
107 int m_firstAnnounceTimer;
108 int m_secondAnnounceTimer;
111 QString m_ipv4Address;
112 QString m_ipv6Address;
113 QList<QHostAddress> m_addressess;
114 QHostAddress m_ipv4GroupAddress;
115 QUdpSocket *m_ipv4MulticastSocket;
116 QHostAddress m_ipv6LinkGroupBaseAddress;
117 QUdpSocket *m_ipv6LinkMulticastSocket;
119 QUdpSocket *m_ipv4UnicastSocket;
120 QUdpSocket *m_ipv6UnicastSocket;
121 QTimer m_responseTimer;
132 void Start(
void)
override;
133 void Finish(
void)
override;
static QMutex * gSSDPLock
QHostAddress m_responseAddress
ResponseTypes m_responseTypes
The public class for handling Simple Service Discovery Protocol searches and announcements.
static TorcHTTPServer::Status gAnnounceOptions
static bool gAnnounceEnabled
void Finish(void) override
static bool gSearchEnabled
static TorcHTTPServer::Status gSearchOptions
void Start(void) override
A Torc specific wrapper around QThread.