Back to index

tor  0.2.3.18-rc
tor-fw-helper-upnp.h
Go to the documentation of this file.
00001 /* Copyright (c) 2010, Jacob Appelbaum, Steven J. Murdoch.
00002  * Copyright (c) 2010-2012, The Tor Project, Inc. */
00003 /* See LICENSE for licensing information */
00004 
00010 #ifdef MINIUPNPC
00011 #ifndef _TOR_FW_HELPER_UPNP_H
00012 #define _TOR_FW_HELPER_UPNP_H
00013 
00014 #include <miniupnpc/miniwget.h>
00015 #include <miniupnpc/miniupnpc.h>
00016 #include <miniupnpc/upnpcommands.h>
00017 #include <miniupnpc/upnperrors.h>
00018 
00020 #define UPNP_LANADDR_SZ 64
00021 
00024 typedef struct miniupnpc_state_t {
00025   struct UPNPUrls urls;
00026   struct IGDdatas data;
00027   char lanaddr[UPNP_LANADDR_SZ];
00028   int init;
00029 } miniupnpc_state_t;
00030 
00031 const tor_fw_backend_t *tor_fw_get_miniupnp_backend(void);
00032 
00033 int tor_upnp_init(tor_fw_options_t *options, void *backend_state);
00034 
00035 int tor_upnp_cleanup(tor_fw_options_t *options, void *backend_state);
00036 
00037 int tor_upnp_fetch_public_ip(tor_fw_options_t *options, void *backend_state);
00038 
00039 int tor_upnp_add_tcp_mapping(tor_fw_options_t *options, void *backend_state);
00040 
00041 #endif
00042 #endif
00043