aboutsummaryrefslogtreecommitdiff
path: root/src/tools/tor-fw-helper/tor-fw-helper-upnp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/tor-fw-helper/tor-fw-helper-upnp.h')
-rw-r--r--src/tools/tor-fw-helper/tor-fw-helper-upnp.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/tools/tor-fw-helper/tor-fw-helper-upnp.h b/src/tools/tor-fw-helper/tor-fw-helper-upnp.h
index aac745231..fdbd2dd18 100644
--- a/src/tools/tor-fw-helper/tor-fw-helper-upnp.h
+++ b/src/tools/tor-fw-helper/tor-fw-helper-upnp.h
@@ -2,6 +2,12 @@
* Copyright (c) 2010, The Tor Project, Inc. */
/* See LICENSE for licensing information */
+/**
+ * \file tor-fw-helper-upnp.h
+ * \brief The main header for our firewall helper.
+ **/
+
+#ifdef MINIUPNPC
#ifndef _TOR_FW_HELPER_UPNP_H
#define _TOR_FW_HELPER_UPNP_H
@@ -10,8 +16,11 @@
#include <miniupnpc/upnpcommands.h>
#include <miniupnpc/upnperrors.h>
+/** This is a magic number for miniupnpc lan address size. */
#define UPNP_LANADDR_SZ 64
+/** This is our miniupnpc meta structure - it holds our request data,
+ * responses, and various miniupnpc parameters. */
typedef struct miniupnpc_state_t {
struct UPNPUrls urls;
struct IGDdatas data;
@@ -19,14 +28,16 @@ typedef struct miniupnpc_state_t {
int init;
} miniupnpc_state_t;
-int tor_upnp_init(miniupnpc_state_t *state);
+const tor_fw_backend_t *tor_fw_get_miniupnp_backend(void);
+
+int tor_upnp_init(tor_fw_options_t *options, void *backend_state);
-int tor_upnp_cleanup(miniupnpc_state_t *state);
+int tor_upnp_cleanup(tor_fw_options_t *options, void *backend_state);
-int tor_upnp_fetch_public_ip(miniupnpc_state_t *state);
+int tor_upnp_fetch_public_ip(tor_fw_options_t *options, void *backend_state);
-int tor_upnp_add_tcp_mapping(miniupnpc_state_t *state,
- uint16_t internal_port, uint16_t external_port);
+int tor_upnp_add_tcp_mapping(tor_fw_options_t *options, void *backend_state);
#endif
+#endif