Permalink
Fetching contributors…
Cannot retrieve contributors at this time
71 lines (61 sloc) 1.33 KB
/**
* configuration.h
*
* Author: Brane F. Gracnar
*
*/
#include <sys/types.h>
#include <limits.h>
#ifdef USE_SHARED_CACHE
#include "shctx.h"
#ifndef MAX_SHCUPD_PEERS
#define MAX_SHCUPD_PEERS 15
#endif
typedef struct shcupd_peer_opt {
char *ip;
char *port;
} shcupd_peer_opt;
#endif
typedef enum {
ENC_TLS,
ENC_SSL
} ENC_TYPE;
/* configuration structure */
struct __stud_config {
ENC_TYPE ETYPE;
int WRITE_IP_OCTET;
int WRITE_PROXY_LINE;
char *CHROOT;
uid_t UID;
gid_t GID;
char *FRONT_IP;
char *FRONT_PORT;
char *BACK_IP;
char *BACK_PORT;
long NCORES;
char *CERT_FILE;
char *CIPHER_SUITE;
char *ENGINE;
int BACKLOG;
#ifdef USE_SHARED_CACHE
int SHARED_CACHE;
char *SHCUPD_IP;
char *SHCUPD_PORT;
shcupd_peer_opt SHCUPD_PEERS[MAX_SHCUPD_PEERS+1];
char *SHCUPD_MCASTIF;
char *SHCUPD_MCASTTTL;
#endif
int SYSLOG;
int SYSLOG_FACILITY;
int LOG_LEVEL;
int TCP_KEEPALIVE_TIME;
int DAEMONIZE;
int PREFER_SERVER_CIPHERS;
char PID_FILE[PATH_MAX];
};
typedef struct __stud_config stud_config;
char * config_error_get (void);
stud_config * config_new (void);
void config_destroy (stud_config *cfg);
int config_file_parse (char *file, stud_config *cfg);
void config_parse_cli(int argc, char **argv, stud_config *cfg);