#include "sniff.h"
#include "sniff_private.h"
#include "debug.h"
#include "util.h"
#include <string.h>
#include "nethelp.h"
Go to the source code of this file.
Functions | |
errorcode | capture_peer_to_buddy_syn (peer_conn_info_t *info) |
finds a syn sent from the peer to the buddy, and puts it into the correct location in the peer_conn_info_t structure | |
errorcode | capture_flooded_synack (peer_conn_info_t *info) |
finds a synack that was a part of a bday flood by the buddy | |
errorcode | init_packet_capture (pcap_t **pcap_desc, char *device, int timeout, char *errbuf, long errbuf_len) |
initializes the pcap functions | |
errorcode | find_tcp_packet (pcap_t *pcap_desc, tcp_packet_info_t *tcp_skeleton, flag_t *break_flag, unsigned char **payload, unsigned long *payload_len) |
finds a tcp packet, looping over all captured packets until the correct one is found | |
errorcode | process_packet (unsigned char *packet, tcp_packet_info_t *tcp_skeleton, unsigned char **payload, unsigned long *payload_len) |
Definition in file sniff.c.
|
finds a synack that was a part of a bday flood by the buddy
Definition at line 62 of file sniff.c. References tcp_packet_info::ack_flag, peer_conn_info::bday, bindSocket(), peer_conn_info::buddy, peer_sock_desc::buddy, CHECK_FAILED, CHECK_NOT_NULL, tcp_packet_info::d_addr, tcp_packet_info::d_port, DBG_BDAY, DEBUG, peer_conn_info::device, ERROR_1, ERROR_CALLED_FUNCTION, ERROR_NULL_ARG_1, errorcode, buddy_info::ext_ip, buddy_info::ext_port, find_tcp_packet(), init_packet_capture(), peer_info::ip, peer_conn_info::peer, peer_conn_info_t, bday_peer::port, bday_peer::port_set, tcp_packet_info::s_addr, tcp_packet_info::s_port, peer_conn_info::socks, bday_peer::stop_synack_find, tcp_packet_info::syn_flag, and tcp_packet_info_t. Referenced by run_find_synack(). |
|
finds a syn sent from the peer to the buddy, and puts it into the correct location in the peer_conn_info_t structure
Definition at line 32 of file sniff.c. References tcp_packet_info::ack_flag, peer_conn_info::buddy, peer_conn_info::buddy_syn, CHECK_FAILED, CHECK_NOT_NULL, tcp_packet_info::d_addr, tcp_packet_info::d_port, peer_conn_info::device, peer_conn_info::direct_conn_status, ERROR_1, ERROR_NULL_ARG_1, errorcode, buddy_info::ext_ip, buddy_info::ext_port, find_tcp_packet(), init_packet_capture(), peer_info::ip, peer_conn_info::peer, peer_conn_info_t, peer_info::port, tcp_packet_info::s_addr, tcp_packet_info::s_port, and tcp_packet_info::syn_flag. Referenced by peer_fsm_start_direct_conn(). |
|
finds a tcp packet, looping over all captured packets until the correct one is found If the passed in flag takes on any value other than FLAG_UNSET then this function will return early
Definition at line 156 of file sniff.c. References CHECK_NOT_NULL, DBG_SNIFF, DEBUG, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, ERROR_NULL_ARG_3, errorcode, FAILED, process_packet(), and tcp_packet_info_t. Referenced by capture_flooded_synack(), and capture_peer_to_buddy_syn(). |
|
initializes the pcap functions
Definition at line 110 of file sniff.c. References CHECK_GREATER_THAN, CHECK_NOT_NULL, DBG_SNIFF, DEBUG, ERROR_ARG_5, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, ERROR_NULL_ARG_4, and errorcode. Referenced by capture_flooded_synack(), and capture_peer_to_buddy_syn(). |
|
Definition at line 190 of file sniff.c. References tcp_packet_info::ack_flag, tcp_packet_info::ack_num, BOOL_MATCH, CHECK_NOT_NULL, tcp_packet_info::d_addr, tcp_packet_info::d_port, DBG_IP, DBG_PORT, DBG_SNIFF, DEBUG, ERROR_NULL_ARG_1, ERROR_NULL_ARG_2, errorcode, FLAG_SET, tcp_packet_info::s_addr, tcp_packet_info::s_port, tcp_packet_info::seq_num, tcp_packet_info::syn_flag, tcp_packet_info_t, and tcp_packet_info::window. Referenced by find_tcp_packet(). |