aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Fabio Bas2008-08-13 09:46:12 +0000
committerGravatar Fabio Bas2008-08-13 09:46:12 +0000
commit900c8771c9c08fb7861489ab2a5e14b12e27ab07 (patch)
tree07bd7f185352b2e389192322769e7b0dade2a53f /src/modules
parentwiped out layer3forwardingservice check from upnp module (incompatible betwee... (diff)
downloadKVIrc-900c8771c9c08fb7861489ab2a5e14b12e27ab07.tar.gz
KVIrc-900c8771c9c08fb7861489ab2a5e14b12e27ab07.tar.bz2
KVIrc-900c8771c9c08fb7861489ab2a5e14b12e27ab07.zip
more work on upnp
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2236 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/upnp/igdcontrolpoint.cpp6
-rw-r--r--src/modules/upnp/rootservice.cpp21
-rw-r--r--src/modules/upnp/rootservice.h2
-rw-r--r--src/modules/upnp/ssdpconnection.cpp2
4 files changed, 27 insertions, 4 deletions
diff --git a/src/modules/upnp/igdcontrolpoint.cpp b/src/modules/upnp/igdcontrolpoint.cpp
index 3ae288f22..e782f1370 100644
--- a/src/modules/upnp/igdcontrolpoint.cpp
+++ b/src/modules/upnp/igdcontrolpoint.cpp
@@ -40,8 +40,6 @@
namespace UPnP
{
-#define InternetGatewayDeviceType "urn:schemas-upnp-org:device:InternetGatewayDevice:1"
-
#define WanIpConnectionType "urn:schemas-upnp-org:service:WANIPConnection:1"
#define WanPPPConnectionType "urn:schemas-upnp-org:service:WANPPPConnection:1"
@@ -121,6 +119,9 @@ void IgdControlPoint::slotDeviceQueried(bool error)
if(! params.controlUrl.isNull())
{
+
+ m_bGatewayAvailable = true;
+
qDebug() << "UPnP::IgdControlPoint: wan/ipconnection service found, "
<< "querying service '" << params.serviceId << "' for external ip address..." << endl;
@@ -141,7 +142,6 @@ void IgdControlPoint::slotWanQueryFinished(bool error)
if(! error)
{
qDebug() << "IgdControlPoint: UPnP Gateway Device found." << endl;
- m_bGatewayAvailable = true;
} else {
// Just started, the request for the external IP failed. This should succeed, abort portation
qDebug() << "Requesting external IP address failed, leaving UPnP Gateway Device untouched." << endl;
diff --git a/src/modules/upnp/rootservice.cpp b/src/modules/upnp/rootservice.cpp
index f87af52ac..b04662b42 100644
--- a/src/modules/upnp/rootservice.cpp
+++ b/src/modules/upnp/rootservice.cpp
@@ -32,6 +32,10 @@
#include "rootservice.h"
#include "xmlfunctions.h"
+#include "kvi_locale.h"
+#include "kvi_out.h"
+#include "kvi_app.h"
+#include "kvi_console.h"
#include <QDebug>
@@ -155,6 +159,23 @@ void RootService::addDeviceServices(const QDomNode &device)
{
qDebug() << "UPnP Discovered device " << XmlFunctions::getNodeValue(device, "/UDN") << endl;
+ if(XmlFunctions::getNodeValue(device, "/deviceType") == InternetGatewayDeviceType)
+ {
+ QString description;
+ description = XmlFunctions::getNodeValue(device, "/friendlyName");
+ if(description.isNull())
+ description = XmlFunctions::getNodeValue(device, "/modelDescription");
+ if(description.isNull())
+ description = XmlFunctions::getNodeValue(device, "/modelName") + " " + XmlFunctions::getNodeValue(device, "/modelNumber");
+ if(description.isNull())
+ description = __tr2qs("Unknown");
+
+ qDebug() << "Model: " << description << endl;
+
+ g_pApp->activeConsole()->output(KVI_OUT_GENERICSTATUS,__tr2qs_ctx("[UPNP]: Found gateway device: %s","upnp"), description.toUtf8().data());
+
+
+ }
// Insert the given device node
// The "key" is the device/UDN tag, the value is a list of device/serviceList/service nodes
m_deviceServices.insert(XmlFunctions::getNodeValue(device, "/UDN"),
diff --git a/src/modules/upnp/rootservice.h b/src/modules/upnp/rootservice.h
index b4d98c47c..7ff4120b8 100644
--- a/src/modules/upnp/rootservice.h
+++ b/src/modules/upnp/rootservice.h
@@ -39,6 +39,8 @@
namespace UPnP
{
+#define InternetGatewayDeviceType "urn:schemas-upnp-org:device:InternetGatewayDevice:1"
+
/**
* The services of a device can be retrieved using the device root service.
* The URL of the root service is returned by an SSDP broadcast.
diff --git a/src/modules/upnp/ssdpconnection.cpp b/src/modules/upnp/ssdpconnection.cpp
index 7297453e6..79f63323f 100644
--- a/src/modules/upnp/ssdpconnection.cpp
+++ b/src/modules/upnp/ssdpconnection.cpp
@@ -103,7 +103,7 @@ void SsdpConnection::slotDataReceived()
QString location = sspdResponse.mid(locationStart, locationEnd - locationStart);
// Parse the URL syntax using KURL
- QUrl url(location);
+ QUrl url(location.trimmed());
qDebug("Found internet gateway: %s\n", location.toUtf8().data());
// Emit success