diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sibs/DirectConnection.hpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/sibs/DirectConnection.hpp b/include/sibs/DirectConnection.hpp index 70eaf4f..1ba8659 100644 --- a/include/sibs/DirectConnection.hpp +++ b/include/sibs/DirectConnection.hpp @@ -14,6 +14,7 @@ #include "Socket.hpp" #include "Message.hpp" #include <future> +#include <miniupnpc.h> namespace sibs { @@ -88,6 +89,10 @@ namespace sibs void removeDisconnectedPeers(); void receiveData(); int receiveDataFromPeer(const int socket, char *output, usize *receivedTotalSize); + + void openPortUpnpDevice(const Ipv4 &myAddress, UPNPDev *device); + void openPort(const Ipv4 &myAddress); + int closeOpenedPort(const Ipv4 &myAddress, UPNPUrls *upnpUrls, IGDdatas *igdDatas); private: u16 port; int eid; @@ -97,7 +102,17 @@ namespace sibs bool alive; PubSubOnRemoveDisconnectedPeerCallback removeDisconnectedPeerCallback; Ipv4Map<std::shared_future<PubSubConnectResult>> connectionResults; - std::mutex connectionResultsMutex; + std::mutex connectionResultsMutex; + + struct UPNPUrlData + { + UPNPUrls *upnpUrls; + IGDdatas *igdDatas; + bool portOpened; + }; + + UPNPDev *upnpDevList; + std::vector<UPNPUrlData> upnpData; }; struct DirectConnectionsUtils |