@@ -172,13 +172,13 @@ struct TORRENT_EXTRA_EXPORT upnp final
172
172
// portmap_alert_ respectively. If The mapping fails immediately, the return value
173
173
// is -1, which means failure. There will not be any error alert notification for
174
174
// mappings that fail with a -1 return value.
175
- int add_mapping (portmap_protocol p, int external_port, tcp::endpoint local_ep);
175
+ port_mapping_t add_mapping (portmap_protocol p, int external_port, tcp::endpoint local_ep);
176
176
177
177
// This function removes a port mapping. ``mapping_index`` is the index that refers
178
178
// to the mapping you want to remove, which was returned from add_mapping().
179
- void delete_mapping (int mapping_index);
179
+ void delete_mapping (port_mapping_t mapping_index);
180
180
181
- bool get_mapping (int mapping_index, tcp::endpoint& local_ep, int & external_port
181
+ bool get_mapping (port_mapping_t mapping_index, tcp::endpoint& local_ep, int & external_port
182
182
, portmap_protocol& protocol) const ;
183
183
184
184
void discover_device ();
@@ -207,8 +207,8 @@ struct TORRENT_EXTRA_EXPORT upnp final
207
207
, std::size_t bytes_transferred);
208
208
209
209
struct rootdevice ;
210
- void next (rootdevice& d, int i);
211
- void update_map (rootdevice& d, int i);
210
+ void next (rootdevice& d, port_mapping_t i);
211
+ void update_map (rootdevice& d, port_mapping_t i);
212
212
213
213
void on_upnp_xml (error_code const & e
214
214
, libtorrent::http_parser const & p, rootdevice& d
@@ -218,22 +218,22 @@ struct TORRENT_EXTRA_EXPORT upnp final
218
218
, http_connection& c);
219
219
void on_upnp_map_response (error_code const & e
220
220
, libtorrent::http_parser const & p, rootdevice& d
221
- , int mapping, http_connection& c);
221
+ , port_mapping_t mapping, http_connection& c);
222
222
void on_upnp_unmap_response (error_code const & e
223
223
, libtorrent::http_parser const & p, rootdevice& d
224
- , int mapping, http_connection& c);
224
+ , port_mapping_t mapping, http_connection& c);
225
225
void on_expire (error_code const & e);
226
226
227
227
void disable (error_code const & ec);
228
- void return_error (int mapping, int code);
228
+ void return_error (port_mapping_t mapping, int code);
229
229
#ifndef TORRENT_DISABLE_LOGGING
230
230
bool should_log () const ;
231
231
void log (char const * msg, ...) const TORRENT_FORMAT(2 ,3 );
232
232
#endif
233
233
234
234
void get_ip_address (rootdevice& d);
235
- void delete_port_mapping (rootdevice& d, int i);
236
- void create_port_mapping (http_connection& c, rootdevice& d, int i);
235
+ void delete_port_mapping (rootdevice& d, port_mapping_t i);
236
+ void create_port_mapping (http_connection& c, rootdevice& d, port_mapping_t i);
237
237
void post (upnp::rootdevice const & d, char const * soap
238
238
, char const * soap_action);
239
239
@@ -278,7 +278,7 @@ struct TORRENT_EXTRA_EXPORT upnp final
278
278
// either the WANIP namespace or the WANPPP namespace
279
279
std::string service_namespace;
280
280
281
- aux::vector<mapping_t > mapping;
281
+ aux::vector<mapping_t , port_mapping_t > mapping;
282
282
283
283
// this is the hostname, port and path
284
284
// component of the url or the control_url
@@ -326,11 +326,11 @@ struct TORRENT_EXTRA_EXPORT upnp final
326
326
327
327
struct upnp_state_t
328
328
{
329
- std ::vector<global_mapping_t > mappings;
329
+ aux ::vector<global_mapping_t , port_mapping_t > mappings;
330
330
std::set<rootdevice> devices;
331
331
};
332
332
333
- aux::vector<global_mapping_t > m_mappings;
333
+ aux::vector<global_mapping_t , port_mapping_t > m_mappings;
334
334
335
335
std::string m_user_agent;
336
336
0 commit comments