updated
[crywrap.git] / src / crywrap.h
blob1c245a9af152536e390f0c4d7c25ec57d94d4e28
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>
5 * This file is part of CryWrap.
7 * CryWrap is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * CryWrap is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 * License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 /** @file crywrap.h
23 * Global variables and declarations for CryWrap.
25 * All of the global types, structures and whatnot are declared in
26 * this file. Not variables, though. Those are in crywrap.c.
29 #ifndef _CRYWRAP_H
30 #define _CRYWRAP_H 1 /**< crywrap.h multi-inclusion guard. */
32 /** @defgroup defaults Built-in defaults.
33 * @{
35 #define __CRYWRAP__ "crywrap" /**< Software name. */
36 /** Software version.
38 #define _CRYWRAP_VERSION "0.2." PATCHLEVEL EXTRAVERSION
39 /** Configuration directory.
41 #define _CRYWRAP_CONFDIR SYSCONFDIR "/crywrap"
42 #define _CRYWRAP_UID 65534 /**< Default UID to run as. */
43 /** Default PID file.
45 #define _CRYWRAP_PIDFILE "/var/run/crywrap.pid"
46 /** Maximum number of clients supported.
48 #define _CRYWRAP_MAXCONN 1024
49 /** Maximum I/O buffer size.
51 #define _CRYWRAP_MAXBUF 64 * 1024
52 /** Default server certificate and key.
54 #define _CRYWRAP_PEMFILE _CRYWRAP_CONFDIR "/server.pem"
55 /** @} */
57 /** Configuration structure.
58 * Most of the CryWrap configuration - those options that are settable
59 * via the command-line are stored in a variable of this type.
61 typedef struct
63 /** Properties of the listening socket.
65 struct
67 in_port_t port;
68 struct sockaddr_storage *addr;
69 } listen;
71 /** Properties of the destination socket.
73 struct
75 in_port_t port;
76 char *host;
77 struct sockaddr_storage *addr;
78 } dest;
80 char *pidfile; /**< File to store our PID in. */
81 uid_t uid; /**< User ID to run as. */
82 int inetd; /**< InetD-mode toggle. */
83 int anon; /**< Anon-DH toggle. */
84 int verify; /**< Client certificate verify level. */
85 int debug;
86 } crywrap_config_t;
88 /** @defgroup options Options.
89 * These are the compile-time options.
90 * @{
92 /** If this option is set, CryWrap will fork into the background.
94 #ifndef CRYWRAP_OPTION_FORK
95 #define CRYWRAP_OPTION_FORK 1
96 #endif
98 #if CRYWRAP_OPTION_NOFORK
99 #undef CRYWRAP_OPTION_FORK
100 #endif
102 /** @} *//* End of the Options group */
104 #endif /* !_CRYWRAP_H */
106 /* arch-tag: ebfe1550-0fec-4c0d-8833-23e48292e75d */