1 /*
2  *  Copyright (C) 2016 Christos Tsantilas
3  *
4  *  This program is free software; you can redistribute it and/or
5  *  modify it under the terms of the GNU Lesser General Public
6  *  License as published by the Free Software Foundation; either
7  *  version 2.1 of the License, or (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  *  Lesser General Public License for more details.
13  *
14  *  You should have received a copy of the GNU Lesser General Public
15  *  License along with this library; if not, write to the Free Software
16  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  *  MA  02110-1301  USA.
18  */
19 
20 
21 #ifndef __C_ICAP_PORT_H
22 #define __C_ICAP_PORT_H
23 
24 #include "c-icap.h"
25 #include "net_io.h"
26 #ifdef USE_OPENSSL
27 #include <openssl/ssl.h>
28 #endif
29 
30 /**
31  * Basic configurations for a listening port
32  \ingroup CONFIG
33  */
34 typedef struct ci_port {
35     int port;
36     int protocol_family;
37     char *address;
38     int secs_to_linger;
39 #ifdef USE_OPENSSL
40     int tls_enabled;
41     char *tls_server_cert;
42     char *tls_server_key;
43     char *tls_client_ca_certs;
44     char *tls_cafile;
45     char *tls_capath;
46     char *tls_method;
47     char *tls_ciphers;
48     long tls_options;
49 #endif
50     int configured;
51     ci_socket_t fd;
52 #ifdef USE_OPENSSL
53     SSL_CTX *tls_context;
54     BIO* bio;
55 #endif
56 } ci_port_t;
57 
58 /*For internal c-icap use*/
59 struct ci_vector;
60 void ci_port_handle_reconfigure(struct ci_vector *new_ports, struct ci_vector *old_ports);
61 void ci_port_close(ci_port_t *port);
62 void ci_port_list_release(struct ci_vector *ports);
63 #endif
64