2020-08-16 07:58:53 +08:00
|
|
|
#ifndef MAIN_H
|
|
|
|
#define MAIN_H
|
2020-01-21 19:48:05 +08:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2020-03-24 11:46:32 +08:00
|
|
|
#include <strings.h>
|
2020-01-21 19:48:05 +08:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netdb.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/epoll.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <pwd.h>
|
|
|
|
#include <dirent.h>
|
2020-08-16 07:58:53 +08:00
|
|
|
#include <sched.h>
|
2020-03-24 11:46:32 +08:00
|
|
|
#include <getopt.h>
|
|
|
|
#include <netinet/in.h>
|
2020-01-21 19:48:05 +08:00
|
|
|
|
|
|
|
#define MAX_CONNECTION 1020
|
2020-07-30 18:10:31 +08:00
|
|
|
#define BUFFER_SIZE 8192
|
2020-01-21 19:48:05 +08:00
|
|
|
#define PATH_SIZE 270
|
2020-08-16 07:58:53 +08:00
|
|
|
#define CACHE_SIZE 270
|
2020-01-21 19:48:05 +08:00
|
|
|
|
|
|
|
int local_port;
|
|
|
|
char local_host[128];
|
2020-06-20 16:59:51 +08:00
|
|
|
int process;
|
2020-01-21 19:48:05 +08:00
|
|
|
|
|
|
|
extern int epollfd;
|
|
|
|
extern struct epoll_event ev, events[MAX_CONNECTION + 1];
|
|
|
|
int create_connection(char *remote_host, int remote_port);
|
|
|
|
|
|
|
|
#endif
|