CProxy/conf.h

56 lines
1.3 KiB
C
Raw Normal View History

#ifndef CONF_H
#define CONF_H
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <error.h>
#include <unistd.h>
2019-06-20 09:39:31 +08:00
2020-01-21 19:48:05 +08:00
// 配置文件结构
typedef struct CONF {
// server module
int uid;
int process;
int timer;
int sslencoding;
//int server_port;
int local_port;
2020-01-21 19:48:05 +08:00
char *server_pid_file;
int server_pid_file_len; // length
// http module
int http_port;
char *http_ip, *http_del, *http_first;
int http_ip_len, http_del_len, http_first_len;
char *http_strrep, *http_regrep;
int http_strrep_len, http_regrep_len;
2020-06-08 20:28:15 +08:00
2020-01-21 19:48:05 +08:00
char *http_strrep_aim, *http_strrep_obj;
int http_strrep_aim_len, http_strrep_obj_len;
2020-06-08 20:28:15 +08:00
2020-01-21 19:48:05 +08:00
char *http_regrep_aim, *http_regrep_obj;
int http_regrep_aim_len, http_regrep_obj_len;
// https module
int https_port;
char *https_ip, *https_del, *https_first;
int https_ip_len, https_del_len, https_first_len;
char *https_strrep, *https_regrep;
int https_strrep_len, https_regrep_len;
2020-06-08 20:28:15 +08:00
2020-01-21 19:48:05 +08:00
char *https_strrep_aim, *https_strrep_obj;
int https_strrep_aim_len, https_strrep_obj_len;
2020-06-08 20:28:15 +08:00
2020-01-21 19:48:05 +08:00
char *https_regrep_aim, *https_regrep_obj;
int https_regrep_aim_len, https_regrep_obj_len;
} conf;
char *strncpy_(char *dest, const char *src, size_t n);
2020-06-08 20:28:15 +08:00
void read_conf(char *file, conf * p);
void free_conf(conf * p);
2020-06-20 16:59:51 +08:00
void printfconf(conf * configure);
#endif