Changeset View
Changeset View
Standalone View
Standalone View
src/mapport.h
// Copyright (c) 2011-2020 The Bitcoin Core developers | // Copyright (c) 2011-2020 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_MAPPORT_H | #ifndef BITCOIN_MAPPORT_H | ||||
#define BITCOIN_MAPPORT_H | #define BITCOIN_MAPPORT_H | ||||
/** -upnp default */ | |||||
#ifdef USE_UPNP | #ifdef USE_UPNP | ||||
static const bool DEFAULT_UPNP = USE_UPNP; | static constexpr bool DEFAULT_UPNP = USE_UPNP; | ||||
#else | #else | ||||
static const bool DEFAULT_UPNP = false; | static constexpr bool DEFAULT_UPNP = false; | ||||
#endif | #endif // USE_UPNP | ||||
#ifdef USE_NATPMP | |||||
static constexpr bool DEFAULT_NATPMP = USE_NATPMP; | |||||
#else | |||||
static constexpr bool DEFAULT_NATPMP = false; | |||||
#endif // USE_NATPMP | |||||
enum MapPortProtoFlag : unsigned int { | enum MapPortProtoFlag : unsigned int { | ||||
NONE = 0x00, | NONE = 0x00, | ||||
UPNP = 0x01, | UPNP = 0x01, | ||||
NAT_PMP = 0x02, | NAT_PMP = 0x02, | ||||
}; | }; | ||||
void StartMapPort(bool use_upnp); | void StartMapPort(bool use_upnp, bool use_natpmp); | ||||
void InterruptMapPort(); | void InterruptMapPort(); | ||||
void StopMapPort(); | void StopMapPort(); | ||||
#endif // BITCOIN_MAPPORT_H | #endif // BITCOIN_MAPPORT_H |