KVIrc 5.2.0
Developer APIs
igdcontrolpoint.h
Go to the documentation of this file.
1//=============================================================================
2//
3// File : igdcontrolpoint.h
4// Creation date : Fri Aug 08 18:00:00 2008 GMT by Fabio Bas
5//
6// This file is part of the KVIrc IRC client distribution
7// Copyright (C) 2008 Fabio Bas (ctrlaltca at gmail dot com)
8//
9// This program is FREE software. You can redistribute it and/or
10// modify it under the terms of the GNU General Public License
11// as published by the Free Software Foundation; either version 2
12// of the License, or (at your option) any later version.
13//
14// This program is distributed in the HOPE that it will be USEFUL,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17// See the GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with this program. If not, write to the Free Software Foundation,
21// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22//
23// Original Copyright follows:
24//=============================================================================
25
26/***************************************************************************
27 igdcontrolpoint.cpp - description
28 -------------------
29 begin : Mon Jul 25 2005
30 copyright : (C) 2005 by Diederik van der Boor
31 email : vdboor --at-- codingdomain.com
32 ***************************************************************************/
33
34#ifndef UPNP_IGDCONTROLPOINT_H
35#define UPNP_IGDCONTROLPOINT_H
36
37#include <QObject>
38
39namespace UPnP
40{
41
42 class SsdpConnection;
43 class RootService;
44 class WanConnectionService;
45
56 class IgdControlPoint : public QObject
57 {
58 Q_OBJECT
59
60 public: // public methods
61 // The constructor
62 IgdControlPoint(const QString & hostname, int port, const QString & rootUrl);
63 // The destructor
65
66 // Return the external IP address
67 QString getExternalIpAddress() const;
68 // Initialize the control point
69 void initialize();
70 // Return true if a controlable gateway is available
71 bool isGatewayAvailable();
72
73 // Add a port mapping
74 void addPortMapping(const QString & protocol, const QString & remoteHost, int externalPort, const QString & internalClient, int internalPort, const QString & description, bool enabled = true, int leaseDuration = 0);
75 // Delete a port mapping
76 void deletePortMapping(const QString & protocol, const QString & remoteHost, int externalPort);
77
78 private slots:
79 // The IGD was queried for it's services
80 void slotDeviceQueried(bool error);
81 // A WAN connection query was finished
82 void slotWanQueryFinished(bool error);
83
84 private: // private attributes
85 // Is a gateway available?
87 // The host of the gateway
89 // The port of the gateway
91 // The root service
93 // The wan connection service
95 };
96}
97
98#endif
Definition igdcontrolpoint.h:57
bool isGatewayAvailable()
Definition igdcontrolpoint.cpp:95
void initialize()
Definition igdcontrolpoint.cpp:89
RootService * m_pRootService
Definition igdcontrolpoint.h:92
void slotWanQueryFinished(bool error)
Definition igdcontrolpoint.cpp:131
int m_iIgdPort
Definition igdcontrolpoint.h:90
bool m_bGatewayAvailable
Definition igdcontrolpoint.h:86
void deletePortMapping(const QString &protocol, const QString &remoteHost, int externalPort)
Definition igdcontrolpoint.cpp:155
void slotDeviceQueried(bool error)
Definition igdcontrolpoint.cpp:101
QString m_szIgdHostname
Definition igdcontrolpoint.h:88
WanConnectionService * m_pWanConnectionService
Definition igdcontrolpoint.h:94
QString getExternalIpAddress() const
Definition igdcontrolpoint.cpp:75
void addPortMapping(const QString &protocol, const QString &remoteHost, int externalPort, const QString &internalClient, int internalPort, const QString &description, bool enabled=true, int leaseDuration=0)
Definition igdcontrolpoint.cpp:145
~IgdControlPoint()
Definition igdcontrolpoint.cpp:66
Definition RootService.h:53
Definition WanConnectionService.h:66
Definition igdcontrolpoint.cpp:42