Back to index

tor  0.2.3.18-rc
tor-fw-helper.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 #ifndef _TOR_FW_HELPER_H
00011 #define _TOR_FW_HELPER_H
00012 
00013 #include <stdint.h>
00014 #include <stdio.h>
00015 #include <stdlib.h>
00016 #include <getopt.h>
00017 #include <time.h>
00018 
00020 #define tor_fw_version "0.1"
00021 
00025 #define MAX_BACKENDS 23
00026 
00028 typedef struct {
00029   int verbose;
00030   int help;
00031   int test_commandline;
00032   uint16_t private_dir_port;
00033   uint16_t private_or_port;
00034   uint16_t public_dir_port;
00035   uint16_t public_or_port;
00036   uint16_t internal_port;
00037   uint16_t external_port;
00038   int fetch_public_ip;
00039   int nat_pmp_status;
00040   int upnp_status;
00041   int public_ip_status;
00042 } tor_fw_options_t;
00043 
00047 typedef struct tor_fw_backend_t {
00048   const char *name;
00049   size_t state_len;
00050   int (*init)(tor_fw_options_t *options, void *backend_state);
00051   int (*cleanup)(tor_fw_options_t *options, void *backend_state);
00052   int (*fetch_public_ip)(tor_fw_options_t *options, void *backend_state);
00053   int (*add_tcp_mapping)(tor_fw_options_t *options, void *backend_state);
00054 } tor_fw_backend_t;
00055 
00056 #endif
00057