#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <assert.h>
#include <string.h>
#include <libgen.h>
#include <linux/netfilter.h>
#include "libipq.h"
#include <linux/ip.h>
#include <arpa/inet.h>
#include <signal.h>
#include <pthread.h>
#include "misc.h"
#include "tcp.h"
#include "scheduler.h"
#include "tcptimer.h"
#include "tcpproxy.h"
Go to the source code of this file.
Defines | |
#define | IPQ_BUF_SIZE 10240 |
Functions | |
Tpacket_data * | alloc_packet_data (ipq_packet_msg_t *p) |
void | dealloc_packet_data (Tpacket_data *pd) |
unsigned short | ip_chksum (ipq_packet_msg_t *p, unsigned int words) |
int | handle_icmp (Tpacket_data *pd) |
int | handle_other (Tpacket_data *pd) |
int | handle_packet (ipq_packet_msg_t *p) |
void | cleanup () |
void | signal_handler (int signum) |
int | main (int argc, const char *argv[]) |
Variables | |
static struct ipq_handle * | qh |
static __u32 | mob_ip |
static pthread_t | sched_thread |
static pthread_t | timer_thread |
volatile sig_atomic_t | request_exit = 0 |
pthread_t | main_thread |
|
Definition at line 24 of file tcpproxy.c. Referenced by main(). |
|
Definition at line 42 of file tcpproxy.c. References packet_data::ip, packet_data::ipq_pm, packet_data::payload, packet_data::trans, and xmalloc(). Referenced by handle_packet(). |
|
Definition at line 212 of file tcpproxy.c. References EPRINT, EXIT_ERR_IPQ_DESTROY_HANDLE, ipq_destroy_handle(), ipq_perror(), IPRINT, request_exit, sched_thread, and timer_thread. Referenced by main(). |
|
Definition at line 61 of file tcpproxy.c. References packet_data::payload, and xfree(). Referenced by clear_tcp_queue(), handle_packet(), handle_tcp(), queue_packet(), and send_packet(). |
|
Definition at line 95 of file tcpproxy.c. References queue_hipri(). Referenced by handle_packet(). |
|
Definition at line 105 of file tcpproxy.c. References queue_lowpri(). Referenced by handle_packet(). |
|
Definition at line 116 of file tcpproxy.c. References alloc_packet_data(), dealloc_packet_data(), DEBUG, packet_data::dir, DPRINT, EPRINT, EXIT_ERR_WRONG_IP_VER, handle_icmp(), handle_other(), handle_tcp(), packet_data::ip, ip_chksum(), ipq_perror(), ipq_set_verdict(), IPRINT, mob_ip, PACKET_DIR_IN, and PACKET_DIR_OUT. Referenced by main(). |
|
Definition at line 75 of file tcpproxy.c. Referenced by handle_packet(). |
|
|
Definition at line 233 of file tcpproxy.c. References DPRINT, EPRINT, and request_exit. Referenced by main(). |
|
Definition at line 36 of file tcpproxy.c. Referenced by main(), and safe_exit(). |
|
Definition at line 31 of file tcpproxy.c. Referenced by handle_packet(), and main(). |
|
Definition at line 30 of file tcpproxy.c. |
|
Definition at line 35 of file tcpproxy.c. Referenced by cleanup(), main(), safe_exit(), scheduler(), signal_handler(), and tcp_timer(). |
|
Definition at line 32 of file tcpproxy.c. |
|
Definition at line 33 of file tcpproxy.c. |