Fix CVE-2017-6891 in minitasn1 code
[platform/upstream/gnutls.git] / src / crywrap / crywrap.h
1 /* -*- mode: c; c-file-style: "gnu" -*-
2  * crywrap.h -- Global definitions for CryWrap
3  * Copyright (C) 2003, 2004 Gergely Nagy <algernon@bonehunter.rulez.org>
4  *
5  * This file is part of CryWrap.
6  *
7  * CryWrap is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * CryWrap is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19  */
20
21 /** @file crywrap.h
22  * Global variables and declarations for CryWrap.
23  *
24  * All of the global types, structures and whatnot are declared in
25  * this file. Not variables, though. Those are in crywrap.c.
26  */
27
28 #ifndef _CRYWRAP_H
29 #define _CRYWRAP_H 1 /**< crywrap.h multi-inclusion guard. */
30
31 /** @defgroup defaults Built-in defaults.
32  * @{
33  */
34 #define __CRYWRAP__ "crywrap" /**< Software name. */
35 /** Software version.
36  */
37 #define _CRYWRAP_VERSION "0.2." CRYWRAP_PATCHLEVEL
38 /** Configuration directory.
39  */
40 #define _CRYWRAP_CONFDIR SYSCONFDIR "/crywrap"
41 #define _CRYWRAP_UID 65534 /**< Default UID to run as. */
42 /** Default PID file.
43  */
44 #define _CRYWRAP_PIDFILE "/var/run/crywrap.pid"
45 /** Maximum number of clients supported.
46  */
47 #define _CRYWRAP_MAXCONN 1024
48 /** Maximum I/O buffer size.
49  */
50 #define _CRYWRAP_MAXBUF 64 * 1024
51 /** Default server certificate and key.
52  */
53 #define _CRYWRAP_PEMFILE _CRYWRAP_CONFDIR "/server.pem"
54 /** @} */
55
56 /** Configuration structure.
57  * Most of the CryWrap configuration - those options that are settable
58  * via the command-line are stored in a variable of this type.
59  */
60 typedef struct {
61   /** Properties of the listening socket.
62    */
63         struct {
64                 in_port_t port;
65                 struct sockaddr_storage *addr;
66         } listen;
67
68   /** Properties of the destination socket.
69    */
70         struct {
71                 in_port_t port;
72                 char *host;
73                 struct sockaddr_storage *addr;
74         } dest;
75
76         gnutls_priority_t priority;
77                               /**< GnuTLS priority string. */
78         const char *pidfile;
79                        /**< File to store our PID in. */
80         uid_t uid;
81              /**< User ID to run as. */
82         int inetd;
83              /**< InetD-mode toggle. */
84         int anon;
85             /**< Anon-DH toggle. */
86         int verify;
87               /**< Client certificate verify level. */
88         int debug;
89 } crywrap_config_t;
90
91          /** @} *//* End of the Options group */
92
93 #endif                          /* !_CRYWRAP_H */