#include "peercon.h"
#include "util.h"
#include "peerdef.h"
#include <time.h>
#include <stdlib.h>
#include "spoof.h"
#include "sniff.h"
#include "debug.h"
Go to the source code of this file.
Functions | |
errorcode | wait_for_direct_conn (flag_t *check_flag) |
waits until the direct connection flag is set to FLAG_SUCCESS or FLAG_FAILED | |
errorcode | findDevice (char **dev) |
finds a network devide (requires root privledge) | |
errorcode | flood_syns (tcp_packet_info_t tcp_skeleton, char *device) |
function to do the SYN flooding to buddy | |
errorcode | start_find_synack (peer_conn_info_t *info) |
a function to spawn a thread to look for a SYN/ACK with | |
void * | run_find_synack (void *arg) |
the entry point for the thread that looks for the SYN/ACK in a bday flood | |
errorcode | wait_and_join_find_synack (peer_conn_info_t *info) |
waits for the find syn ack to finish, within a timeout, and then joins on the thread. | |
errorcode | synack_flood (peer_conn_info_t *info, seq_num_t seq_num) |
sends a bday flood of synacks to the peer |
Definition in file peercon.c.
|
finds a network devide (requires root privledge) this is basically a wrapper for pcap_lookupdev. I assume pcap_lookupdev uses malloc to allocate the memory for the returned pointer, but I am not sure. This needs to be checked.
Definition at line 48 of file peercon.c. References CHECK_NOT_NULL, ERROR_NULL_ARG_1, and errorcode. Referenced by natblaster_connect(). |
|
function to do the SYN flooding to buddy
Definition at line 65 of file peercon.c. References tcp_packet_info::ack_flag, tcp_packet_info::ack_num, CHECK_FAILED, CHECK_NOT_NULL, tcp_packet_info::d_port, DBG_BDAY, DBG_PORT, DEBUG, ERROR_CALLED_FUNCTION, ERROR_NULL_ARG_1, errorcode, tcp_packet_info::s_port, spoof(), tcp_packet_info::syn_flag, tcp_packet_info_t, TTL_TOO_LOW, and tcp_packet_info::window. Referenced by peer_fsm_start_bday(). |
|
the entry point for the thread that looks for the SYN/ACK in a bday flood
Definition at line 113 of file peercon.c. References peer_conn_info::bday, capture_flooded_synack(), CHECK_NOT_NULL, ERROR_NULL_ARG_1, errorcode, FAILED, bday_peer::find_synack_done, and peer_conn_info_t. Referenced by start_find_synack(). |
|
a function to spawn a thread to look for a SYN/ACK with
Definition at line 95 of file peercon.c. References peer_conn_info::bday, CHECK_NOT_NULL, ERROR_NULL_ARG_1, errorcode, bday_peer::find_synack_done, bday_peer::find_synack_tid, peer_conn_info_t, bday_peer::port_set, run_find_synack(), and bday_peer::stop_synack_find. Referenced by peer_fsm_start_bday(). |
|
sends a bday flood of synacks to the peer
Definition at line 166 of file peercon.c. References tcp_packet_info::ack_flag, tcp_packet_info::ack_num, peer_conn_info::buddy, CHECK_FAILED, CHECK_NOT_NULL, tcp_packet_info::d_addr, tcp_packet_info::d_port, peer_conn_info::device, ERROR_1, ERROR_NULL_ARG_1, errorcode, buddy_info::ext_ip, peer_info::ip, peer_conn_info::peer, peer_conn_info_t, peer_info::port, port_t, tcp_packet_info::s_addr, tcp_packet_info::s_port, tcp_packet_info::seq_num, SEQ_NUM_ADD, spoof(), tcp_packet_info::syn_flag, tcp_packet_info_t, TTL_OK, and tcp_packet_info::window. Referenced by peer_fsm_bday_synack_flood(). |
|
waits for the find syn ack to finish, within a timeout, and then joins on the thread.
Definition at line 134 of file peercon.c. References peer_conn_info::bday, CHECK_NOT_NULL, DBG_TIME, ERROR_NULL_ARG_1, errorcode, FAILED, FIND_SYN_ACK_TIMEOUT, bday_peer::find_synack_done, bday_peer::find_synack_tid, FLAG_SET, peer_conn_info_t, bday_peer::stop_synack_find, and wait_for_flag(). Referenced by peer_fsm_end_bday(). |
|
waits until the direct connection flag is set to FLAG_SUCCESS or FLAG_FAILED
Definition at line 34 of file peercon.c. References CHECK_FAILED, CHECK_NOT_NULL, DIRECT_CONNECTION_TIMEOUT, ERROR_1, ERROR_NULL_ARG_1, errorcode, FLAG_FAILED, FLAG_SUCCESS, and wait_for_flag(). Referenced by peer_fsm_forge_syn_ack(). |