 +ServerSettings::init_upnp()
 +{
 +  struct UPNPDev * devlist;
-+  char lanaddr[256];
 +  int retval;
 +
 +  printf("TB : init_upnp()\n");

+  memset(&data, 0, sizeof(struct IGDdatas));
+
+  devlist = upnpDiscover(2000, NULL, NULL);
+  retval = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, 256);
+  printf("UPNP: %d", retval);
+
+  freeUPNPDevlist(devlist);

 
 class ServerSettings : public AbstractTorSettings
 {
@@ -89,9 +93,21 @@
   virtual QVariant torValue(const QString &key) const;
 
 private:
+  /** Used by miniupnpc library */
+  struct UPNPUrls urls;
+  struct IGDdatas data;
+  char lanaddr[16];
+  void init_upnp();
+  void upnp_add_redir (const char * addr, int port);
+  void upnp_rem_redir(int port);
