libktorrent  2.2.0
Classes | Signals | Public Member Functions | List of all members
bt::UPnPRouter Class Reference

#include <upnprouter.h>

Inheritance diagram for bt::UPnPRouter:
Inheritance graph
[legend]

Classes

class  Visitor
 

Signals

void stateChanged ()
 
void xmlFileDownloaded (UPnPRouter *r, bool success)
 

Public Member Functions

 UPnPRouter (const QString &server, const QUrl &location, bool verbose=false)
 
void addService (const UPnPService &s)
 
void downloadXMLFile ()
 
void forward (const net::Port &port)
 
UPnPDeviceDescriptiongetDescription ()
 Get the device description.
 
const UPnPDeviceDescriptiongetDescription () const
 Get the device description (const version)
 
QString getError () const
 Get the current error (null string if there is none)
 
QString getExternalIP () const
 Get the router's external IP.
 
QUrl getLocation () const
 Get the location of it's xml description.
 
QString getServer () const
 Get the name of the server.
 
void setVerbose (bool v)
 Disable or enable verbose logging.
 
void undoForward (const net::Port &port, bt::WaitJob *waitjob=0)
 
void visit (Visitor *visitor) const
 

Detailed Description

Author
Joris Guisson

Class representing a UPnP enabled router. This class is also used to communicate with the router.

Definition at line 96 of file upnprouter.h.

Constructor & Destructor Documentation

◆ UPnPRouter()

bt::UPnPRouter::UPnPRouter ( const QString &  server,
const QUrl &  location,
bool  verbose = false 
)

Construct a router.

Parameters
serverThe name of the router
locationThe location of it's xml description file
verbosePrint lots of debug info

Member Function Documentation

◆ addService()

void bt::UPnPRouter::addService ( const UPnPService s)

Add a service to the router.

Parameters
sThe service

◆ downloadXMLFile()

void bt::UPnPRouter::downloadXMLFile ( )

Download the XML File of the router.

◆ forward()

void bt::UPnPRouter::forward ( const net::Port port)

Forward a local port

Parameters
portThe local port to forward

◆ stateChanged

void bt::UPnPRouter::stateChanged ( )
signal

Internal state has changed, a forwarding succeeded or failed, or an undo forwarding succeeded or failed.

◆ undoForward()

void bt::UPnPRouter::undoForward ( const net::Port port,
bt::WaitJob waitjob = 0 
)

Undo forwarding

Parameters
portThe port
waitjobWhen this is set the jobs needs to be added to the waitjob, so we can wait for their completeion at exit

◆ visit()

void bt::UPnPRouter::visit ( Visitor visitor) const

Visit all forwardings

Parameters
visitorThe Visitor

◆ xmlFileDownloaded

void bt::UPnPRouter::xmlFileDownloaded ( UPnPRouter r,
bool  success 
)
signal

Signal which indicates that the XML was downloaded successfully or not.

Parameters
rThe router which emitted the signal
successWhether or not it succeeded

The documentation for this class was generated from the following file: