Dillo v3.1.1-119-g140d9ebd
|
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/stat.h>
#include "dpid_common.h"
#include "dpid.h"
#include "dpi.h"
#include "dpi_socket_dir.h"
#include "misc_new.h"
#include "../dlib/dlib.h"
#include "../dpip/dpip.h"
Go to the source code of this file.
Enumerations | |
enum | { no_errors , dpid_srs_addrinuse } |
Functions | |
static int | start_filter_plugin (struct dp dpi_attr) |
Start a dpi filter plugin after accepting the pending connection \Return. | |
static void | start_server_plugin (struct dp dpi_attr) |
static char * | get_request (Dsh *sh) |
static int | get_command (Dsh *sh, char *dpi_tag) |
static int | server_is_running (char *server_id) |
Check whether a dpi server is running. | |
static int | get_open_max (void) |
Get MAX open FD limit (yes, it's tricky –Jcid). | |
int | main (void) |
Variables | |
sigset_t | mask_sigchld |
enum { ... } | dpi_errno |
char * | srs_name |
int | numdpis |
fd_set | sock_set |
struct dp * | dpi_attr_list |
Dlist * | services_list |
int | numsocks |
int | srs_fd |
|
static |
Get value of cmd field in dpi_tag \Return command code on success, -1 on failure
Definition at line 152 of file main.c.
References _ERRMSG, a_Dpip_build_cmd(), a_Dpip_dsh_write_str(), a_Dpip_get_attr(), AUTH_CMD, BYE_CMD, CHECK_SERVER_CMD, dFree(), ERRMSG, MSG_ERR, REGISTER_ALL_CMD, REGISTER_SERVICE_CMD, sh, and UNKNOWN_CMD.
Referenced by main().
|
static |
|
static |
Read service request from sock \Return pointer to dynamically allocated request tag
Definition at line 136 of file main.c.
References a_Dpip_dsh_read_token(), mask_sigchld, and sh.
Referenced by main().
int main | ( | void | ) |
Definition at line 226 of file main.c.
References _ERRMSG, a_Dpi_sockdir_file(), a_Dpip_build_cmd(), a_Dpip_check_auth(), a_Dpip_dsh_close(), a_Dpip_dsh_free(), a_Dpip_dsh_new(), AUTH_CMD, BYE_CMD, caught_sigchld, CHECK_SERVER_CMD, CKD_WRITE, dClose(), dFree(), dpi_attr_list, dpi_errno, dpid_srs_addrinuse, ERRMSG, est_dpi_sigchld(), est_dpi_terminator(), fill_services_list(), get_command(), get_open_max(), get_request(), handle_sigchld(), init_all_dpi_sockets(), init_ids_srs_socket(), init_sockdir(), mask_sigchld, MSG_ERR, no_errors, numdpis, numsocks, register_all(), REGISTER_ALL_CMD, register_all_cmd(), send_sockport(), server_is_running(), services_list, sh, sock_set, srs_fd, start_filter_plugin(), start_server_plugin(), stop_active_dpis(), and UNKNOWN_CMD.
|
static |
Check whether a dpi server is running.
Definition at line 193 of file main.c.
References dpi_attr_list, and numdpis.
Referenced by main().
|
static |
|
static |
struct dp* dpi_attr_list |
State information for each plugin.
Definition at line 47 of file main.c.
Referenced by free_plugin_list(), handle_sigchld(), ignore_dpi_sockets(), init_all_dpi_sockets(), main(), register_all_cmd(), send_sockport(), server_is_running(), and stop_active_dpis().
enum { ... } dpi_errno |
Referenced by main().
sigset_t mask_sigchld |
Definition at line 35 of file main.c.
Referenced by get_request(), and main().
int numdpis |
Number of available plugins
Definition at line 45 of file main.c.
Referenced by fill_services_list(), free_plugin_list(), handle_sigchld(), ignore_dpi_sockets(), init_all_dpi_sockets(), main(), register_all_cmd(), send_sockport(), server_is_running(), and stop_active_dpis().
int numsocks |
Number of sockets being watched
Definition at line 49 of file main.c.
Referenced by handle_sigchld(), init_all_dpi_sockets(), main(), and register_all_cmd().
Dlist* services_list |
service served for each plugin
Definition at line 48 of file main.c.
Referenced by fill_services_list(), main(), register_all_cmd(), and send_sockport().
fd_set sock_set |
Set of sockets watched for connections
Definition at line 46 of file main.c.
Referenced by handle_sigchld(), ignore_dpi_sockets(), init_dpi_socket(), init_ids_srs_socket(), main(), and register_all_cmd().
int srs_fd |
dpid's service request socket file descriptor
Definition at line 50 of file main.c.
Referenced by init_ids_srs_socket(), main(), and register_all_cmd().
char* srs_name |
Definition at line 44 of file main.c.
Referenced by a_Dpi_srs().