Back to index

tor  0.2.3.18-rc
tor-fw-helper-natpmp.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 
00009 #ifdef NAT_PMP
00010 #ifndef _TOR_FW_HELPER_NATPMP_H
00011 #define _TOR_FW_HELPER_NATPMP_H
00012 
00013 #include <natpmp.h>
00014 
00016 #define NATPMP_DEFAULT_LEASE 3600
00017 
00018 #define NATPMP_SUCCESS 0
00019 
00023 typedef struct natpmp_state_t {
00024   natpmp_t natpmp;
00025   natpmpresp_t response;
00026   int fetch_public_ip;
00027   int status;
00028   int init; 
00029   int protocol; 
00030   int lease;
00031 } natpmp_state_t;
00032 
00033 const tor_fw_backend_t *tor_fw_get_natpmp_backend(void);
00034 
00035 int tor_natpmp_init(tor_fw_options_t *tor_fw_options, void *backend_state);
00036 
00037 int tor_natpmp_cleanup(tor_fw_options_t *tor_fw_options, void *backend_state);
00038 
00039 int tor_natpmp_add_tcp_mapping(tor_fw_options_t *tor_fw_options,
00040                                void *backend_state);
00041 
00042 int tor_natpmp_fetch_public_ip(tor_fw_options_t *tor_fw_options,
00043                                void *backend_state);
00044 
00045 #endif
00046 #endif
00047