Dillo v3.1.1-99-gf3103cc4
Loading...
Searching...
No Matches
dpid.h
Go to the documentation of this file.
1
5#ifndef DPID_H
6#define DPID_H
7
8#include <sys/socket.h>
9#include <sys/select.h> /* for fd_set */
10#include <sys/un.h>
11#include <signal.h> /* for sig_atomic_t */
12#include <netinet/in.h> /* for ntohl, IPPORT_USERRESERVED and stuff */
13
14#include "d_size.h"
15
16/* FreeBSD 6.4 doesn't have it */
17#ifndef IPPORT_USERRESERVED
18 #define IPPORT_USERRESERVED 5000
19#endif
20
21#define PATH_LEN 50
22#define CMDLEN 20
23#define MSGLEN 50
24#define DPID_BASE_PORT (IPPORT_USERRESERVED + 20)
25
27#define SRS_NAME "dpid.srs"
28extern char *srs_name;
29
31extern int srs_fd;
32
35struct dp {
36 char *id;
37 char *path;
39 int port;
40 pid_t pid;
41 int filter;
42};
43
46struct service {
47 char *name;
49};
50
52extern int numdpis;
53
55extern int numsocks;
56
58extern struct dp *dpi_attr_list;
59
61extern Dlist *services_list;
62
64extern fd_set sock_set;
65
67extern volatile sig_atomic_t caught_sigchld;
68
70
71void cleanup(void);
72
73void free_dpi_attr(struct dp *dpi_attr);
74
75void free_plugin_list(struct dp **dpi_attr_list_ptr, int numdpis);
76
77void free_services_list(Dlist *s_list);
78
79enum file_type get_file_type(char *file_name);
80
81int get_dpi_attr(char *dpi_dir, char *service, struct dp *dpi_attr);
82
83int register_service(struct dp *dpi_attr, char *service);
84
85int register_all(struct dp **attlist);
86
87int fill_services_list(struct dp *attlist, int numdpis, Dlist **services_list);
88
89int init_ids_srs_socket(void);
90
91int init_dpi_socket(struct dp *dpi_attr);
92
94
95void dpi_sigchld(int sig);
96
97void handle_sigchld(void);
98
99void est_dpi_sigchld(void);
100
101void est_dpi_terminator(void);
102
103void stop_active_dpis(struct dp *dpi_attr_list, int numdpis);
104
105void ignore_dpi_sockets(struct dp *dpi_attr_list, int numdpis);
106
107int register_all_cmd(void);
108
109char *get_message(int sock, char *dpi_tag);
110
111int service_match(const struct service *A, const char *B);
112
113void send_sockport(int sock_fd, char * dpi_tag, struct dp *dpi_attr_list);
114
115#endif
void send_sockport(int sock_fd, char *dpi_tag, struct dp *dpi_attr_list)
Definition dpid.c:868
void free_services_list(Dlist *s_list)
Definition dpid.c:94
Dlist * services_list
Definition main.c:48
void free_dpi_attr(struct dp *dpi_attr)
Definition dpid.c:63
int init_all_dpi_sockets(struct dp *dpi_attr_list)
Definition dpid.c:671
volatile sig_atomic_t caught_sigchld
Definition downloads.cc:218
int register_all_cmd(void)
Definition dpid.c:811
int register_all(struct dp **attlist)
Definition dpid.c:347
int init_dpi_socket(struct dp *dpi_attr)
Definition dpid.c:647
char * srs_name
Definition main.c:44
void rm_dpi_sockets(struct dp *dpi_attr_list, int numdpis)
char * get_message(int sock, char *dpi_tag)
Definition dpid.c:832
int init_ids_srs_socket(void)
Definition dpid.c:623
void est_dpi_sigchld(void)
Definition dpid.c:717
void handle_sigchld(void)
Definition dpid.c:694
int get_dpi_attr(char *dpi_dir, char *service, struct dp *dpi_attr)
Definition dpid.c:233
int service_match(const struct service *A, const char *B)
Definition dpid.c:851
void stop_active_dpis(struct dp *dpi_attr_list, int numdpis)
Definition dpid.c:748
int register_service(struct dp *dpi_attr, char *service)
Definition dpid.c:293
int numdpis
Definition main.c:45
void est_dpi_terminator(void)
Definition dpid.c:117
int numsocks
Definition main.c:49
fd_set sock_set
Definition main.c:46
enum file_type get_file_type(char *file_name)
Definition dpid.c:162
int fill_services_list(struct dp *attlist, int numdpis, Dlist **services_list)
Definition dpid.c:437
void free_plugin_list(struct dp **dpi_attr_list_ptr, int numdpis)
Definition dpid.c:77
void dpi_sigchld(int sig)
Definition dpid.c:687
struct dp * dpi_attr_list
Definition main.c:47
void ignore_dpi_sockets(struct dp *dpi_attr_list, int numdpis)
Definition dpid.c:794
void cleanup(void)
Definition dpid.c:52
int srs_fd
Definition main.c:50
file_type
Definition dpid_common.h:43
Definition dlib.h:131
Definition dpid.h:35
int filter
Definition dpid.h:41
char * path
Definition dpid.h:37
int sock_fd
Definition dpid.h:38
char * id
Definition dpid.h:36
int port
Definition dpid.h:39
pid_t pid
Definition dpid.h:40
Definition dpid.h:46
int dp_index
Definition dpid.h:48
char * name
Definition dpid.h:47