main: use two sockets to communicate with sec-mod

That allows to have a reliable synchronous socket, and
a socket where messages are sent and received asynchronously.
This commit is contained in:
Nikos Mavrogiannopoulos
2015-05-13 14:04:20 +02:00
parent accf63a9e3
commit 33bcfb178e
7 changed files with 65 additions and 40 deletions

View File

@@ -38,6 +38,7 @@ typedef struct sec_mod_st {
unsigned key_size;
struct htable *client_db;
int cmd_fd;
int cmd_fd_sync;
struct config_mod_st *config_module;
} sec_mod_st;
@@ -127,11 +128,11 @@ void sec_auth_init(sec_mod_st *sec, struct perm_cfg_st *config);
void handle_sec_auth_ban_ip_reply(sec_mod_st *sec, const BanIpReplyMsg *msg);
int handle_sec_auth_init(int cfd, sec_mod_st *sec, const SecAuthInitMsg * req, pid_t pid);
int handle_sec_auth_cont(int cfd, sec_mod_st *sec, const SecAuthContMsg * req);
int handle_sec_auth_session_cmd(sec_mod_st *sec, const SecAuthSessionMsg *req, unsigned cmd);
int handle_sec_auth_session_cmd(sec_mod_st *sec, int fd, const SecAuthSessionMsg *req, unsigned cmd);
int handle_sec_auth_stats_cmd(sec_mod_st * sec, const CliStatsMsg * req);
void sec_auth_user_deinit(sec_mod_st * sec, client_entry_st * e);
void sec_mod_server(void *main_pool, struct perm_cfg_st *config, const char *socket_file,
uint8_t cookie_key[COOKIE_KEY_SIZE], int cmd_fd);
uint8_t cookie_key[COOKIE_KEY_SIZE], int cmd_fd, int cmd_fd_sync);
#endif