The complete source code of IdealIRC http://www.idealirc.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
idealirc/NATUtils/PortMapping.h

31 lines
801 B

/*
* IdealIRC - Internet Relay Chat client
* Copyright (c) 2022 Tom-Andre Barstad.
* This software is licensed under the Software Attribution License.
* See LICENSE for more information.
*/
#ifndef NATPORTMAPPING_H
#define NATPORTMAPPING_H
#include <cstdint>
#include <string>
namespace NATPortMapping {
/**
* Add a port forwarding onto local network router using libnatpmp.
* The reservation is set to expire after one week to accommodate for clients on slow connections doing for example a file transfer taking a few days (it is theoretically possible.)
* Returns true on success.
*/
bool add(uint16_t intPort, uint16_t extPort);
/**
* Remove a port forward using libnatpmp.
* Returns true on success.
*/
bool remove(uint16_t intPort, uint16_t extPort);
}
#endif //NATPORTMAPPING_H