Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

helperfsm_private.h File Reference

prototypes for private helperfsm functions More...

Go to the source code of this file.

Functions

errorcode helper_fsm_hello (connlist_t *list, connlist_item_t *item)
 the state to deal with a hello message
errorcode helper_fsm_conn2 (connlist_t *list, connlist_item_t *item)
 handles the second connection state
errorcode helper_fsm_buddy_alloc (connlist_t *list, connlist_item_t *item)
 handles sending a message with buddy info to peers
errorcode helper_fsm_buddy_port (connlist_t *list, connlist_item_t *peer, connlist_item_t *buddy)
 handles sending a message with buddy port to peers, or determing port through birthday paradox
errorcode helper_fsm_start_direct_conn (connlist_t *list, connlist_item_t *peer, connlist_item_t *buddy)
 handles starting direct connection
errorcode helper_fsm_goodbye (connlist_t *list, connlist_item_t *peer, connlist_item_t *buddy)
 final state to recieve the peer's goodbye message
errorcode helper_fsm_start_peer_bday (connlist_t *list, connlist_item_t *peer, connlist_item_t *buddy)
 optional state that handles starting birthday paradox when the peer is the random one.
errorcode helper_fsm_end_peer_bday (connlist_t *list, connlist_item_t *peer, connlist_item_t *buddy)
 optional state that handles ending birthday paradox when the peer is the random one.
errorcode helper_fsm_start_buddy_bday (connlist_t *list, connlist_item_t *peer, connlist_item_t *buddy)
 optional state that handles starting birthday paradox when the buddy is the random one.
errorcode helper_fsm_end_buddy_bday (connlist_t *list, connlist_item_t *peer, connlist_item_t *buddy)
 optional state that handles ending birthday paradox when the buddy is the random one.


Detailed Description

prototypes for private helperfsm functions

Author:
Daniel Ferullo (ferullo@cmu.edu)

Definition in file helperfsm_private.h.


Function Documentation

errorcode helper_fsm_buddy_alloc connlist_t list,
connlist_item_t item
 

handles sending a message with buddy info to peers

Parameters:
list a pointer to the connection list
item a pointer to the item for this connection
Returns:
SUCCESS, errorcode on failure

Definition at line 224 of file helperfsm.c.

References comm_msg_buddy_alloc::buddy_port_alloc, CHECK_FAILED, CHECK_NOT_NULL, COMM_MSG_BUDDY_ALLOC, comm_msg_buddy_alloc_t, COMM_MSG_WAITING_FOR_BUDDY_ALLOC, connlist_forget(), connlist_item_match(), connlist_item_t, connlist_t, DBG_BUDDY, DBG_LIST, DBG_PROTOCOL, DBG_VERBOSE, DEBUG, ERROR_3, ERROR_NETWORK_READ, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, errorcode, FAILED, get_buddy(), helper_fsm_buddy_port(), connlist_item::info, port_alloc::method, helper_sock_desc::peer, helper_conn_info::port_alloc, readMsg(), sendMsg(), helper_conn_info::socks, comm_msg_buddy_alloc::support, and wait_for_buddy_port_alloc().

Referenced by helper_fsm_conn2().

errorcode helper_fsm_buddy_port connlist_t list,
connlist_item_t peer,
connlist_item_t buddy
 

handles sending a message with buddy port to peers, or determing port through birthday paradox

there is no check to make sure both peers aren't random, it is assumed that this case is handled in an earlier state (since it is unsupported).

Definition at line 297 of file helperfsm.c.

References comm_msg_buddy_info::bday, CHECK_FAILED, CHECK_NOT_NULL, COMM_BDAY_NEEDED, COMM_BDAY_NOT_NEEDED, COMM_MSG_BUDDY_PORT, comm_msg_buddy_port_t, COMM_MSG_WAITING_FOR_BUDDY_PORT, connlist_item_t, connlist_t, DBG_PROTOCOL, DEBUG, ERROR_1, ERROR_CALLED_FUNCTION_1, ERROR_CALLED_FUNCTION_2, ERROR_CALLED_FUNCTION_3, ERROR_NETWORK_READ, ERROR_NETWORK_SEND, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, ERROR_NULL_ARG_3, errorcode, port_alloc::ext_port, comm_msg_buddy_info::ext_port, helper_fsm_start_buddy_bday(), helper_fsm_start_direct_conn(), helper_fsm_start_peer_bday(), connlist_item::info, port_alloc::method, helper_sock_desc::peer, helper_conn_info::port_alloc, readMsg(), sendMsg(), helper_conn_info::socks, and wait_for_buddy_port_known().

Referenced by helper_fsm_buddy_alloc().

errorcode helper_fsm_conn2 connlist_t list,
connlist_item_t item
 

handles the second connection state

Parameters:
list a pointer to the connection list
item a pointer to the item for this connection
Returns:
SUCCESS, errorcode on failure

Definition at line 149 of file helperfsm.c.

References CHECK_FAILED, CHECK_NOT_NULL, COMM_MSG_CONNECTED_AGAIN, COMM_MSG_PORT_PRED, comm_msg_pred_port_t, COMM_PORT_ALLOC_SEQ, connlist_forget(), connlist_item_match(), connlist_item_t, connlist_t, DBG_LIST, DBG_PORT_PRED, DBG_PROTOCOL, DEBUG, ERROR_1, ERROR_CALLED_FUNCTION, ERROR_NETWORK_READ, ERROR_NETWORK_SEND, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, errorcode, port_alloc::ext_port, port_alloc::ext_port_set, FAILED, find_conn2(), helper_fsm_buddy_alloc(), connlist_item::info, port_alloc::method, port_alloc::method_set, connlist_item::obs_data, observed_data_t, helper_sock_desc::peer, observed_data::port, PORT_ADD, helper_conn_info::port_alloc, comm_msg_pred_port::port_alloc, readMsg(), sendMsg(), and helper_conn_info::socks.

Referenced by helper_fsm_hello().

errorcode helper_fsm_end_buddy_bday connlist_t list,
connlist_item_t peer,
connlist_item_t buddy
 

optional state that handles ending birthday paradox when the buddy is the random one.

Parameters:
list a pointer to the connection list
peer a pointer to the peer item for this connection
buddy a pointer to the buddy item for this connection
Returns:
SUCCESS, errorcode on failure

Definition at line 550 of file helperfsm.c.

References comm_msg_buddy_info::bday, helper_conn_info::bday, CHECK_FAILED, CHECK_NOT_NULL, COMM_MSG_BUDDY_PORT, comm_msg_buddy_port_t, COMM_MSG_SYN_ACK_FLOOD_DONE, connlist_item_t, connlist_t, DBG_PROTOCOL, DEBUG, ERROR_1, ERROR_CALLED_FUNCTION, ERROR_NETWORK_READ, ERROR_NETWORK_SEND, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, ERROR_NULL_ARG_3, errorcode, comm_msg_buddy_info::ext_port, helper_fsm_start_direct_conn(), connlist_item::info, helper_sock_desc::peer, bday_helper::port, readMsg(), sendMsg(), helper_conn_info::socks, and wait_for_buddy_bday_port().

Referenced by helper_fsm_start_buddy_bday().

errorcode helper_fsm_end_peer_bday connlist_t list,
connlist_item_t peer,
connlist_item_t buddy
 

optional state that handles ending birthday paradox when the peer is the random one.

Parameters:
list a pointer to the connection list
peer a pointer to the peer item for this connection
buddy a pointer to the buddy item for this connection
Returns:
SUCCESS, errorcode on failure

Definition at line 465 of file helperfsm.c.

References comm_msg_buddy_info::bday, helper_conn_info::bday, CHECK_FAILED, CHECK_NOT_NULL, COMM_MSG_BDAY_SUCCESS_PORT, comm_msg_bday_success_port_t, COMM_MSG_BUDDY_PORT, comm_msg_buddy_port_t, connlist_item_t, connlist_t, DBG_PROTOCOL, DEBUG, ERROR_CALLED_FUNCTION, ERROR_NETWORK_SEND, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, ERROR_NULL_ARG_3, errorcode, comm_msg_buddy_info::ext_port, port_alloc::ext_port, port_alloc::ext_port_set, FAILED, helper_fsm_start_direct_conn(), connlist_item::info, helper_sock_desc::peer, bday_helper::port, helper_conn_info::port_alloc, bday_helper::port_set, readMsg(), sendMsg(), helper_conn_info::socks, and bday_helper::status.

Referenced by helper_fsm_start_peer_bday().

errorcode helper_fsm_goodbye connlist_t list,
connlist_item_t peer,
connlist_item_t buddy
 

final state to recieve the peer's goodbye message

Parameters:
list a pointer to the connection list
peer a pointer to the peer item for this connection
buddy a pointer to the buddy item for this connection
Returns:
SUCCESS, errorcode on failure

Definition at line 406 of file helperfsm.c.

References CHECK_FAILED, CHECK_NOT_NULL, COMM_MSG_GOODBYE, comm_msg_goodbye_t, connlist_item_t, connlist_t, DBG_PROTOCOL, DBG_VERBOSE, DEBUG, ERROR_NETWORK_READ, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, errorcode, FLAG_FAILED, connlist_item::info, helper_sock_desc::peer, readMsg(), and helper_conn_info::socks.

Referenced by helper_fsm_start_direct_conn().

errorcode helper_fsm_hello connlist_t list,
connlist_item_t item
 

the state to deal with a hello message

Parameters:
list a pointer to the connection info list
item a pointer to the connection info item for this connection
Returns:
SUCCESS, errorcode on failure

Definition at line 99 of file helperfsm.c.

References helper_conn_info::buddy, CHECK_FAILED, CHECK_NOT_NULL, COMM_MSG_CONNECT_AGAIN, COMM_MSG_HELLO, comm_msg_hello_t, connlist_item_t, connlist_t, DBG_IP, DBG_PORT, DBG_PROTOCOL, DBG_VERBOSE, DEBUG, ERROR_CALLED_FUNCTION, ERROR_NETWORK_READ, ERROR_NETWORK_SEND, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, errorcode, buddy_info::ext_ip, helper_fsm_conn2(), buddy_info::identifier, connlist_item::info, buddy_info::int_ip, buddy_info::int_port, peer_info::ip, helper_conn_info::peer, helper_sock_desc::peer, peer_info::port, readMsg(), sendMsg(), peer_info::set, and helper_conn_info::socks.

Referenced by helper_fsm_start().

errorcode helper_fsm_start_buddy_bday connlist_t list,
connlist_item_t peer,
connlist_item_t buddy
 

optional state that handles starting birthday paradox when the buddy is the random one.

Parameters:
list a pointer to the connection list
peer a pointer to the peer item for this connection
buddy a pointer to the buddy item for this connection
Returns:
SUCCESS, errorcode on failure

Definition at line 514 of file helperfsm.c.

References helper_conn_info::bday, CHECK_FAILED, CHECK_NOT_NULL, COMM_MSG_SYN_ACK_FLOOD_SEQ_NUM, comm_msg_syn_ack_flood_seq_num_t, COMM_MSG_WAITING_TO_SYN_ACK_FLOOD, connlist_item_t, connlist_t, DBG_PROTOCOL, DEBUG, ERROR_1, ERROR_CALLED_FUNCTION, ERROR_NETWORK_READ, ERROR_NETWORK_SEND, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, ERROR_NULL_ARG_3, errorcode, helper_fsm_end_buddy_bday(), connlist_item::info, helper_sock_desc::peer, readMsg(), sendMsg(), bday_helper::seq_num, comm_msg_syn_ack_flood_seq_num::seq_num, helper_conn_info::socks, and wait_for_buddy_syn_flood().

Referenced by helper_fsm_buddy_port().

errorcode helper_fsm_start_direct_conn connlist_t list,
connlist_item_t peer,
connlist_item_t buddy
 

handles starting direct connection

Parameters:
list a pointer to the connection list
peer a pointer to the peer item for this connection
buddy a pointer to the buddy item for this connection
Returns:
SUCCESS, errorcode on failure

Definition at line 364 of file helperfsm.c.

References helper_conn_info::buddy_syn, CHECK_FAILED, CHECK_NOT_NULL, COMM_MSG_BUDDY_SYN_SEQ, comm_msg_buddy_syn_seq_t, COMM_MSG_PEER_SYN_SEQ, comm_msg_peer_syn_seq_t, connlist_item_t, connlist_t, DBG_PROTOCOL, DBG_SEQ_NUM, DBG_VERBOSE, DEBUG, ERROR_1, ERROR_CALLED_FUNCTION, ERROR_NETWORK_READ, ERROR_NETWORK_SEND, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, ERROR_NULL_ARG_3, errorcode, helper_fsm_goodbye(), connlist_item::info, helper_sock_desc::peer, readMsg(), sendMsg(), comm_msg_peer_syn_seq::seq_num, buddy_syn_seq_num::seq_num, buddy_syn_seq_num::seq_num_set, helper_conn_info::socks, and wait_for_buddy_syn_seq_num().

Referenced by helper_fsm_buddy_port(), helper_fsm_end_buddy_bday(), and helper_fsm_end_peer_bday().

errorcode helper_fsm_start_peer_bday connlist_t list,
connlist_item_t peer,
connlist_item_t buddy
 

optional state that handles starting birthday paradox when the peer is the random one.

Parameters:
list a pointer to the connection list
peer a pointer to the peer item for this connection
buddy a pointer to the buddy item for this connection
Returns:
SUCCESS, errorcode on failure

Definition at line 431 of file helperfsm.c.

References helper_conn_info::bday, CHECK_FAILED, CHECK_NOT_NULL, COMM_MSG_BUDDY_SYN_ACK_FLOODED, COMM_MSG_SYN_FLOODED, comm_msg_syn_flooded_t, connlist_item_t, connlist_t, DBG_PROTOCOL, DEBUG, ERROR_CALLED_FUNCTION, ERROR_NETWORK_READ, ERROR_NETWORK_SEND, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, ERROR_NULL_ARG_3, errorcode, helper_fsm_end_peer_bday(), connlist_item::info, helper_sock_desc::peer, readMsg(), sendMsg(), bday_helper::seq_num, bday_helper::seq_num_set, and helper_conn_info::socks.

Referenced by helper_fsm_buddy_port().


Generated on Wed Mar 30 23:20:48 2005 for NATBLASTER by  doxygen 1.3.9.1