Merge pull request #2680 from masterwishx/work2471-eco_addon
[networkupstools.git] / server / nut_ctype.h
blob55ce73522061e6fc58a944dca564728043ed85c9
1 /* nut_ctype.h - client data definitions for upsd
3 Copyright (C)
4 2002 Russell Kroll <rkroll@exploits.org>
5 2008 Arjen de Korte <adkorte-guest@alioth.debian.org>
6 2011 Arnaud Quette <arnaud.quette@free.fr>
7 2013 Emilien Kia <kiae.dev@gmail.com>
8 2020 Jim Klimov <jimklimov@gmail.com>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #ifndef NUT_CTYPE_H_SEEN
26 #define NUT_CTYPE_H_SEEN 1
28 /* Mozilla NSS */
29 #ifdef WITH_NSS
30 # include <nss.h>
31 # include <ssl.h>
32 #endif
34 /* OpenSSL */
35 #ifdef WITH_OPENSSL
36 # include <openssl/err.h>
37 # include <openssl/ssl.h>
38 #endif
40 #include "parseconf.h"
42 #ifdef __cplusplus
43 /* *INDENT-OFF* */
44 extern "C" {
45 /* *INDENT-ON* */
46 #endif
48 /* client structure */
49 typedef struct nut_ctype_s {
50 char *addr;
51 TYPE_FD_SOCK sock_fd;
52 time_t last_heard;
53 char *loginups;
54 char *password;
55 char *username;
56 /* per client status info for commands and settings
57 * (disabled by default) */
58 int tracking;
60 #ifdef WITH_OPENSSL
61 SSL *ssl;
62 #elif defined(WITH_NSS)
63 PRFileDesc *ssl;
64 #else
65 void *ssl;
66 #endif
67 int ssl_connected;
69 PCONF_CTX_t ctx;
71 /* doubly linked list */
72 struct nut_ctype_s *prev;
73 struct nut_ctype_s *next;
74 #ifdef WIN32
75 HANDLE Event;
76 #endif
77 } nut_ctype_t;
79 #ifdef __cplusplus
80 /* *INDENT-OFF* */
82 /* *INDENT-ON* */
83 #endif
85 #endif /* NUT_CTYPE_H_SEEN */