Definition at line 31 of file C4Network2UPnPLinux.cpp.
◆ C4Network2UPnPP() [1/2]
C4Network2UPnPP::C4Network2UPnPP |
( |
| ) |
|
◆ ~C4Network2UPnPP()
C4Network2UPnPP::~C4Network2UPnPP |
( |
| ) |
|
|
virtual |
◆ C4Network2UPnPP() [2/2]
C4Network2UPnPP::C4Network2UPnPP |
( |
| ) |
|
|
default |
◆ AddMapping() [1/2]
void C4Network2UPnPP::AddMapping |
( |
C4Network2IOProtocol |
protocol, |
|
|
uint16_t |
intport, |
|
|
uint16_t |
extport |
|
) |
| |
Definition at line 115 of file C4Network2UPnPLinux.cpp.
118 mapping.external_port = extport;
119 mapping.internal_port = intport;
120 mapping.protocol = (protocol ==
P_TCP ?
"TCP" :
"UDP");
122 added_mappings.push_back(mapping);
124 action = std::async([
this, action = std::move(action), mapping]() {
126 AddPortMapping(mapping);
References P_TCP.
◆ AddMapping() [2/2]
void C4Network2UPnPP::AddMapping |
( |
C4Network2IOProtocol |
protocol, |
|
|
uint16_t |
intport, |
|
|
uint16_t |
extport |
|
) |
| |
◆ ClearMappings()
void C4Network2UPnPP::ClearMappings |
( |
| ) |
|
Definition at line 130 of file C4Network2UPnPLinux.cpp.
132 action = std::async([
this, action = std::move(action)]() {
135 for (
auto mapping : added_mappings)
136 RemovePortMapping(mapping);
138 added_mappings.clear();
Referenced by ~C4Network2UPnPP().
◆ ClearNatMappings()
void C4Network2UPnPP::ClearNatMappings |
( |
| ) |
|
Definition at line 127 of file C4Network2UPnPWin32.cpp.
131 for(IStaticPortMapping *mapping: added_mappings)
134 long intport, extport;
135 mapping->get_ExternalPort(&extport);
136 mapping->get_InternalPort(&intport);
137 mapping->get_InternalClient(&client);
138 mapping->get_Protocol(&proto);
139 if (SUCCEEDED(
mappings->Remove(extport, proto)))
140 LogF(
"UPnP: Closed port %d->%s:%d (%s)", (
int)extport,
StdStrBuf(client).getData(), (
int)intport,
StdStrBuf(proto).getData());
141 ::SysFreeString(proto);
142 ::SysFreeString(client);
143 SafeRelease(mapping);
bool LogF(const char *strMessage,...)
IStaticPortMappingCollection * mappings
References LogF(), and mappings.
◆ RemoveMapping()
◆ added_mappings
std::set<IStaticPortMapping*> C4Network2UPnPP::added_mappings |
◆ mappings
IStaticPortMappingCollection* C4Network2UPnPP::mappings {nullptr} |
◆ MustReleaseCOM
bool C4Network2UPnPP::MustReleaseCOM {false} |
The documentation for this class was generated from the following files: