#include "helperdef.h"
#include "connlist.h"
#include "errorcodes.h"
#include "def.h"
Go to the source code of this file.
Data Structures | |
struct | helper_fsm_thread_arg |
structure to hold data passed into a helper_fsm thread More... | |
Typedefs | |
typedef helper_fsm_thread_arg | helper_fsm_thread_arg_t |
typedef for the helper_fsm_thread_arg structure | |
Functions | |
errorcode | create_new_handler (connlist_t *list, observed_data_t *data, sock_t sd) |
creates a new detached thread to handle a peer connection | |
void * | run_helper_fsm_thread (void *arg) |
a wrapper function for the helper fsm entry point | |
errorcode | get_buddy (connlist_t *list, connlist_item_t *item, connlist_item_t **found_buddy) |
finds and returns buddy info from the thread-shared list | |
errorcode | wait_for_buddy_port_alloc (helper_conn_info_t *buddy) |
returns success once the buddy's port allocation method has been set. timeouts out after WAIT_FOR_BUDDY_PORT_ALLOC_TIMEOUT | |
errorcode | wait_for_buddy_port_known (helper_conn_info_t *buddy) |
returns success once the buddy's external port has been set. timeouts out after WAIT_FOR_BUDDY_PORT_KNOWN_TIMEOUT | |
errorcode | wait_for_buddy_bday_port (helper_conn_info_t *buddy) |
returns success once the buddy's external port has been set through the birthday paradox. timeouts out after WAIT_FOR_BUDDY_BDAY_PORT_TIMEOUT | |
errorcode | wait_for_buddy_syn_seq_num (helper_conn_info_t *buddy) |
returns success once the buddy's SYN sequence number has been set. timeouts out after WAIT_FOR_BUDDY_SEQ_NUM_TIMEOUT | |
errorcode | wait_for_buddy_syn_flood (helper_conn_info_t *buddy) |
returns success once the buddy's SYN sequence number has been set. timeouts out after WAIT_FOR_BUDDY_SYN_FLOOD_TIMEOUT | |
errorcode | find_conn2 (connlist_t *list, observed_data_t *find_data, connlist_item_t **found_item) |
finds a second connection, timing out if it takes too long | |
Variables | |
helper_fsm_thread_arg | packed |
structure to hold data passed into a helper_fsm thread |
Definition in file helpercon.h.
|
creates a new detached thread to handle a peer connection
Definition at line 34 of file helpercon.c. References CHECK_NOT_NULL, connlist_item_t, connlist_t, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, errorcode, helper_fsm_thread_arg_t, connlist_item::info, helper_fsm_thread_arg::item, helper_fsm_thread_arg::list, connlist_item::obs_data, observed_data_t, helper_sock_desc::peer, run_helper_fsm_thread(), safe_free(), and helper_conn_info::socks. Referenced by natblaster_server(). |
|
finds a second connection, timing out if it takes too long timeout id FIND_CONN2_TIMEOUT
Definition at line 207 of file helpercon.c. References CHECK_NOT_NULL, connlist_find(), connlist_find_pred_port(), connlist_item_t, connlist_t, DEC_UNTIL_ZERO(), ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, errorcode, FAILED, and observed_data_t. Referenced by helper_fsm_conn2(). |
|
finds and returns buddy info from the thread-shared list This function looks for FIND_BUDDY_TIMEOUT seconds, and then gives up
Definition at line 97 of file helpercon.c. References helper_conn_info::buddy, CHECK_NOT_NULL, connlist_find(), connlist_find_buddy(), connlist_item_t, connlist_t, DBG_BUDDY, DEBUG, DEC_UNTIL_ZERO(), ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, ERROR_NULL_ARG_3, errorcode, FAILED, and connlist_item::info. Referenced by helper_fsm_buddy_alloc(). |
|
a wrapper function for the helper fsm entry point This pthread should be started detacted, but it returns errorcodes just in case.
Definition at line 77 of file helpercon.c. References CHECK_NOT_NULL, ERROR_NULL_ARG_1, FAILED, helper_fsm_start(), helper_fsm_thread_arg_t, helper_fsm_thread_arg::item, helper_fsm_thread_arg::list, and safe_free(). Referenced by create_new_handler(). |
|
returns success once the buddy's external port has been set through the birthday paradox. timeouts out after WAIT_FOR_BUDDY_BDAY_PORT_TIMEOUT
Definition at line 164 of file helpercon.c. References helper_conn_info::bday, CHECK_FAILED, CHECK_NOT_NULL, ERROR_CALLED_FUNCTION, ERROR_NULL_ARG_1, errorcode, FLAG_SET, helper_conn_info_t, bday_helper::port_set, WAIT_FOR_BUDDY_BDAY_PORT_TIMEOUT, and wait_for_flag(). Referenced by helper_fsm_end_buddy_bday(). |
|
returns success once the buddy's port allocation method has been set. timeouts out after WAIT_FOR_BUDDY_PORT_ALLOC_TIMEOUT
Definition at line 136 of file helpercon.c. References CHECK_FAILED, CHECK_NOT_NULL, ERROR_CALLED_FUNCTION, ERROR_NULL_ARG_1, errorcode, FLAG_SET, helper_conn_info_t, port_alloc::method_set, helper_conn_info::port_alloc, WAIT_FOR_BUDDY_PORT_ALLOC_TIMEOUT, and wait_for_flag(). Referenced by helper_fsm_buddy_alloc(). |
|
returns success once the buddy's external port has been set. timeouts out after WAIT_FOR_BUDDY_PORT_KNOWN_TIMEOUT
Definition at line 150 of file helpercon.c. References CHECK_FAILED, CHECK_NOT_NULL, ERROR_CALLED_FUNCTION, ERROR_NULL_ARG_1, errorcode, port_alloc::ext_port_set, FLAG_SET, helper_conn_info_t, helper_conn_info::port_alloc, WAIT_FOR_BUDDY_PORT_KNOWN_TIMEOUT, and wait_for_flag(). Referenced by helper_fsm_buddy_port(). |
|
returns success once the buddy's SYN sequence number has been set. timeouts out after WAIT_FOR_BUDDY_SYN_FLOOD_TIMEOUT
Definition at line 193 of file helpercon.c. References helper_conn_info::bday, CHECK_FAILED, CHECK_NOT_NULL, ERROR_CALLED_FUNCTION, ERROR_NULL_ARG_1, errorcode, FLAG_SET, helper_conn_info_t, bday_helper::seq_num_set, WAIT_FOR_BUDDY_SYN_FLOOD_TIMEOUT, and wait_for_flag(). Referenced by helper_fsm_start_buddy_bday(). |
|
returns success once the buddy's SYN sequence number has been set. timeouts out after WAIT_FOR_BUDDY_SEQ_NUM_TIMEOUT
Definition at line 178 of file helpercon.c. References helper_conn_info::buddy_syn, CHECK_FAILED, CHECK_NOT_NULL, ERROR_CALLED_FUNCTION, ERROR_NULL_ARG_1, errorcode, FLAG_SET, helper_conn_info_t, buddy_syn_seq_num::seq_num_set, WAIT_FOR_BUDDY_SEQ_NUM_TIMEOUT, and wait_for_flag(). Referenced by helper_fsm_start_direct_conn(). |