diff options
| author | 2008-08-13 07:58:38 +0000 | |
|---|---|---|
| committer | 2008-08-13 07:58:38 +0000 | |
| commit | b6fe6f708acd33f4d8761f6b67ab0461933f8c26 (patch) | |
| tree | b5faaa18bc9dce7372c3bb9dfd71388c5a8d702f /src/modules/upnp/igdcontrolpoint.cpp | |
| parent | renamed class members, according to KVIrc code conventions (diff) | |
| download | KVIrc-b6fe6f708acd33f4d8761f6b67ab0461933f8c26.tar.gz KVIrc-b6fe6f708acd33f4d8761f6b67ab0461933f8c26.tar.bz2 KVIrc-b6fe6f708acd33f4d8761f6b67ab0461933f8c26.zip | |
more work on upnp; should be able to get external ip address now (please test)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2234 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/upnp/igdcontrolpoint.cpp')
| -rw-r--r-- | src/modules/upnp/igdcontrolpoint.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/modules/upnp/igdcontrolpoint.cpp b/src/modules/upnp/igdcontrolpoint.cpp index eb3eb5346..c4d808a10 100644 --- a/src/modules/upnp/igdcontrolpoint.cpp +++ b/src/modules/upnp/igdcontrolpoint.cpp @@ -42,8 +42,10 @@ namespace UPnP { #define InternetGatewayDeviceType "urn:schemas-upnp-org:device:InternetGatewayDevice:1" -#define Layer3ForwardingType "urn:schemas-upnp-org:service:Layer3Forwarding:1" +//#define Layer3ForwardingType "urn:schemas-upnp-org:service:Layer3Forwarding:1" +#define WanIpConnectionType "urn:schemas-upnp-org:service:WANIPConnection:1" +#define WanPPPConnectionType "urn:schemas-upnp-org:service:WANPPPConnection:1" // The constructor IgdControlPoint::IgdControlPoint(const QString &hostname, int port, const QString &rootUrl) @@ -116,26 +118,28 @@ void IgdControlPoint::slotDeviceQueried(bool error) { if(! error) { - // Get the Layer3ForwardingService from the retrieved service list - ServiceParameters params = m_pRootService->getServiceByType(Layer3ForwardingType); + ServiceParameters params = m_pRootService->getServiceByType(WanIpConnectionType); + + if(params.controlUrl.isNull()) + params = m_pRootService->getServiceByType(WanPPPConnectionType); if(! params.controlUrl.isNull()) { - qDebug() << "UPnP::IgdControlPoint: Services found, " - << "querying service '" << params.serviceId << "' for port mapping service..." << endl; + qDebug() << "UPnP::IgdControlPoint: wan/ipconnection service found, " + << "querying service '" << params.serviceId << "' for external ip address..." << endl; // Call the service - m_pForwardingService = new Layer3ForwardingService(params); - connect(m_pForwardingService, SIGNAL(queryFinished(bool)), this, SLOT(slotWanConnectionFound(bool))); - m_pForwardingService->queryDefaultConnectionService(); + m_pWanConnectionService = new WanConnectionService(params); + connect(m_pWanConnectionService, SIGNAL(queryFinished(bool)), this, SLOT(slotWanQueryFinished(bool))); + m_pWanConnectionService->queryExternalIpAddress(); } else { - qDebug() << "UPnP::IgdControlPoint: No Layer3Forwarding service found on device" << endl; + qDebug() << "UPnP::IgdControlPoint: no ppp/ipconnection service found :(" << endl; } } } - +/* // A WAN connection service was found void IgdControlPoint::slotWanConnectionFound(bool error) { @@ -162,7 +166,7 @@ void IgdControlPoint::slotWanConnectionFound(bool error) m_pForwardingService->deleteLater(); m_pForwardingService = 0; } - +*/ // A WAN connection query was finished |
