diff options
author | Jacob Appelbaum <jacob@appelbaum.net> | 2010-09-24 12:52:07 -0700 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-09-30 11:39:34 -0400 |
commit | 3eaa9a376c756b0b8f836c4a78c3cf4012d6ffd7 (patch) | |
tree | ebc4d8429ebe5354490f45cbd5cf3199bb1bd7c4 /src/tools/tor-fw-helper/tor-fw-helper.h | |
parent | 9cc76cf0053cad90d2ff55d24993d9a0ac4c0cdb (diff) | |
download | tor-3eaa9a376c756b0b8f836c4a78c3cf4012d6ffd7.tar.gz tor-3eaa9a376c756b0b8f836c4a78c3cf4012d6ffd7.zip |
Changes to tor-fw-helper, some based on Nick's review
* MINIUPNPC rather than the generic UPNP
* Nick suggested a better abstraction model for tor-fw-helper
* Fix autoconf to build with either natpmp or miniupnpc
* Add AM_PROG_CC_C_O to fix automake complaint
* update spec to address nickm's concern
* refactor nat-pmp to match upnp state
* we prefer tor_snprintf to snprintf
* link properlty for tor_snprintf
* rename test_commandline_options to log_commandline_options
* cast this uint as an int
* detect possible FD_SETSIZE errors
* make note about future enhancements for natpmp
* add upnp enhancement note
* ChangeLog entry
* doxygen and check-spaces cleanup
* create tor-fw-helper.1.txt
Diffstat (limited to 'src/tools/tor-fw-helper/tor-fw-helper.h')
-rw-r--r-- | src/tools/tor-fw-helper/tor-fw-helper.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tools/tor-fw-helper/tor-fw-helper.h b/src/tools/tor-fw-helper/tor-fw-helper.h index 03501459cb..1af9c0c7aa 100644 --- a/src/tools/tor-fw-helper/tor-fw-helper.h +++ b/src/tools/tor-fw-helper/tor-fw-helper.h @@ -2,6 +2,11 @@ * Copyright (c) 2010, The Tor Project, Inc. */ /* See LICENSE for licensing information */ +/** + * \file tor-fw-helper.h + * \brief The main header for our firewall helper. + **/ + #ifndef _TOR_FW_HELPER_H #define _TOR_FW_HELPER_H @@ -11,8 +16,15 @@ #include <getopt.h> #include <time.h> +/** The current version of tor-fw-helper. */ #define tor_fw_version "0.1" +/** This is an arbitrary hard limit - We currently have two (NAT-PMP and UPnP). + We're likely going to add the Intel UPnP library but nothing else comes to + mind at the moment. */ +#define MAX_BACKENDS 23 + +/** This is where we store parsed commandline options. */ typedef struct { int verbose; int help; @@ -29,5 +41,17 @@ typedef struct { int public_ip_status; } tor_fw_options_t; +/** This is our main structure that defines our backend helper API; each helper + * must conform to these public methods if it expects to be handled in a + * non-special way. */ +typedef struct tor_fw_backend_t { + const char *name; + size_t state_len; + int (*init)(tor_fw_options_t *options, void *backend_state); + int (*cleanup)(tor_fw_options_t *options, void *backend_state); + int (*fetch_public_ip)(tor_fw_options_t *options, void *backend_state); + int (*add_tcp_mapping)(tor_fw_options_t *options, void *backend_state); +} tor_fw_backend_t; + #endif |