OpenVPN
manage.h
Go to the documentation of this file.
1 /*
2  * OpenVPN -- An application to securely tunnel IP networks
3  * over a single TCP/UDP port, with support for SSL/TLS-based
4  * session authentication and key exchange,
5  * packet encryption, packet authentication, and
6  * packet compression.
7  *
8  * Copyright (C) 2002-2021 OpenVPN Inc <sales@openvpn.net>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2
12  * as published by the Free Software Foundation.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 
24 #ifndef MANAGE_H
25 #define MANAGE_H
26 
27 #ifdef ENABLE_MANAGEMENT
28 
29 #include "misc.h"
30 #include "event.h"
31 #include "socket.h"
32 #include "mroute.h"
33 
34 #define MANAGEMENT_VERSION 3
35 #define MANAGEMENT_N_PASSWORD_RETRIES 3
36 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
37 #define MANAGEMENT_ECHO_BUFFER_SIZE 100
38 #define MANAGEMENT_STATE_BUFFER_SIZE 100
39 
40 /*
41  * Management-interface-based deferred authentication
42  */
44  unsigned long cid;
45 
46 #define DAF_CONNECTION_ESTABLISHED (1<<0)
47 #define DAF_CONNECTION_CLOSED (1<<1)
48 #define DAF_INITIAL_AUTH (1<<2)
49  unsigned int flags;
50 
51  unsigned int mda_key_id_counter;
52 
54 };
55 
56 /*
57  * Manage build-up of command line
58  */
60 {
61  struct buffer buf;
62  struct buffer residual;
63 };
64 
65 struct command_line *command_line_new(const int buf_len);
66 
67 void command_line_free(struct command_line *cl);
68 
69 void command_line_add(struct command_line *cl, const unsigned char *buf, const int len);
70 
71 const char *command_line_get(struct command_line *cl);
72 
73 void command_line_reset(struct command_line *cl);
74 
75 void command_line_next(struct command_line *cl);
76 
77 /*
78  * Manage log file history
79  */
80 
82  unsigned int msg_flags;
83  int state;
84  int intval;
85 };
86 
87 struct log_entry
88 {
89  time_t timestamp;
90  const char *string;
92  struct in6_addr local_ip6;
93  struct openvpn_sockaddr local_sock;
94  struct openvpn_sockaddr remote_sock;
95  union log_entry_union u;
96 };
97 
98 #define LOG_PRINT_LOG_PREFIX (1<<0)
99 #define LOG_PRINT_ECHO_PREFIX (1<<1)
100 #define LOG_PRINT_STATE_PREFIX (1<<2)
101 
102 #define LOG_PRINT_INT_DATE (1<<3)
103 #define LOG_PRINT_MSG_FLAGS (1<<4)
104 #define LOG_PRINT_STATE (1<<5)
105 #define LOG_PRINT_LOCAL_IP (1<<6)
106 
107 #define LOG_PRINT_CRLF (1<<7)
108 #define LOG_FATAL_NOTIFY (1<<8)
109 
110 #define LOG_PRINT_INTVAL (1<<9)
111 
112 #define LOG_PRINT_REMOTE_IP (1<<10)
113 
114 #define LOG_ECHO_TO_LOG (1<<11)
115 
116 const char *log_entry_print(const struct log_entry *e, unsigned int flags, struct gc_arena *gc);
117 
119 {
120  int base;
121  int size;
122  int capacity;
123  struct log_entry *array;
124 };
125 
126 struct log_history *log_history_init(const int capacity);
127 
128 void log_history_close(struct log_history *h);
129 
130 void log_history_add(struct log_history *h, const struct log_entry *le);
131 
132 void log_history_resize(struct log_history *h, const int capacity);
133 
134 const struct log_entry *log_history_ref(const struct log_history *h, const int index);
135 
136 static inline int
138 {
139  return h->size;
140 }
141 
142 static inline int
144 {
145  return h->capacity;
146 }
147 
148 /*
149  * Callbacks for 'status' and 'kill' commands.
150  * Also for management-based deferred authentication and packet filter.
151  */
153 {
154  void *arg;
155 
156 #define MCF_SERVER (1<<0) /* is OpenVPN being run as a server? */
157  unsigned int flags;
158 
159  void (*status) (void *arg, const int version, struct status_output *so);
160  void (*show_net) (void *arg, const int msglevel);
161  int (*kill_by_cn) (void *arg, const char *common_name);
162  int (*kill_by_addr) (void *arg, const in_addr_t addr, const int port);
163  void (*delete_event) (void *arg, event_t event);
164  int (*n_clients) (void *arg);
165  bool (*send_cc_message) (void *arg, const char *message, const char *parameter);
166  bool (*kill_by_cid)(void *arg, const unsigned long cid, const char *kill_msg);
167  bool (*client_auth) (void *arg,
168  const unsigned long cid,
169  const unsigned int mda_key_id,
170  const bool auth,
171  const char *reason,
172  const char *client_reason,
173  struct buffer_list *cc_config); /* ownership transferred */
174  bool (*client_pending_auth) (void *arg,
175  const unsigned long cid,
176  const char *extra,
177  unsigned int timeout);
178  char *(*get_peer_info) (void *arg, const unsigned long cid);
179  bool (*proxy_cmd)(void *arg, const char **p);
180  bool (*remote_cmd) (void *arg, const char **p);
181 #ifdef TARGET_ANDROID
182  int (*network_change)(void *arg, bool samenetwork);
183 #endif
184 };
185 
186 /*
187  * Management object, split into three components:
188  *
189  * struct man_persist : Data elements which are persistent across
190  * man_connection open and close.
191  *
192  * struct man_settings : management parameters.
193  *
194  * struct man_connection : created on socket binding and listen,
195  * deleted on socket unbind, may
196  * handle multiple sequential client
197  * connections.
198  */
199 
200 struct man_persist {
201  bool defined;
202 
203  struct log_history *log;
204  struct virtual_output vout;
205 
207  struct management_callback callback;
208 
209  struct log_history *echo; /* saved --echo strings */
211 
213 
214  const char *special_state_msg;
215 
218 };
219 
220 struct man_settings {
221  bool defined;
222  unsigned int flags; /* MF_x flags */
223  struct addrinfo *local;
224 #if UNIX_SOCK_SUPPORT
225  struct sockaddr_un local_unix;
226 #endif
228  struct user_pass up;
235 
236 /* flags for handling the management interface "signal" command */
237 #define MANSIG_IGNORE_USR1_HUP (1<<0)
238 #define MANSIG_MAP_USR1_TO_HUP (1<<1)
239 #define MANSIG_MAP_USR1_TO_TERM (1<<2)
240  unsigned int mansig;
241 };
242 
243 /* up_query modes */
244 #define UP_QUERY_DISABLED 0
245 #define UP_QUERY_USER_PASS 1
246 #define UP_QUERY_PASS 2
247 #define UP_QUERY_NEED_OK 3
248 #define UP_QUERY_NEED_STR 4
249 
250 /* states */
251 #define MS_INITIAL 0 /* all sockets are closed */
252 #define MS_LISTEN 1 /* no client is connected */
253 #define MS_CC_WAIT_READ 2 /* client is connected, waiting for read on socket */
254 #define MS_CC_WAIT_WRITE 3 /* client is connected, waiting for ability to write to socket */
255 
257  int state;
258 
261  struct openvpn_sockaddr remote;
262 
263 #ifdef _WIN32
264  struct net_event_win32 ne32;
265 #endif
266 
267  bool halt;
270 
271  struct command_line *in;
272  struct buffer_list *out;
273 
274 #define IEC_UNDEF 0
275 #define IEC_CLIENT_AUTH 1
276 /* #define IEC_CLIENT_PF 2 *REMOVED FEATURE* */
277 #define IEC_RSA_SIGN 3
278 #define IEC_CERTIFICATE 4
279 #define IEC_PK_SIGN 5
282  unsigned long in_extra_cid;
283  unsigned int in_extra_kid;
284 #define EKS_UNDEF 0
285 #define EKS_SOLICIT 1
286 #define EKS_INPUT 2
287 #define EKS_READY 3
292  struct event_set *es;
294 
300 
301  const char *up_query_type;
303  struct user_pass up_query;
304 
305 #ifdef TARGET_ANDROID
306  int fdtosend;
307  int lastfdreceived;
308 #endif
310 };
311 
313 {
314  struct man_persist persist;
316  struct man_connection connection;
317 };
318 
319 extern struct management *management;
320 
321 struct user_pass;
322 
323 struct management *management_init(void);
324 
325 /* management_open flags */
326 #define MF_SERVER (1<<0)
327 #define MF_QUERY_PASSWORDS (1<<1)
328 #define MF_HOLD (1<<2)
329 #define MF_SIGNAL (1<<3)
330 #define MF_FORGET_DISCONNECT (1<<4)
331 #define MF_CONNECT_AS_CLIENT (1<<5)
332 #define MF_CLIENT_AUTH (1<<6)
333 /* #define MF_CLIENT_PF (1<<7) *REMOVED FEATURE* */
334 #define MF_UNIX_SOCK (1<<8)
335 #define MF_EXTERNAL_KEY (1<<9)
336 #define MF_EXTERNAL_KEY_NOPADDING (1<<10)
337 #define MF_EXTERNAL_KEY_PKCS1PAD (1<<11)
338 #define MF_UP_DOWN (1<<12)
339 #define MF_QUERY_REMOTE (1<<13)
340 #define MF_QUERY_PROXY (1<<14)
341 #define MF_EXTERNAL_CERT (1<<15)
342 
343 bool management_open(struct management *man,
344  const char *addr,
345  const char *port,
346  const char *pass_file,
347  const char *client_user,
348  const char *client_group,
349  const int log_history_cache,
350  const int echo_buffer_size,
351  const int state_buffer_size,
352  const char *write_peer_info_file,
353  const int remap_sigusr1,
354  const unsigned int flags);
355 
356 void management_close(struct management *man);
357 
358 void management_post_tunnel_open(struct management *man, const in_addr_t tun_local_ip);
359 
360 void management_pre_tunnel_close(struct management *man);
361 
362 void management_socket_set(struct management *man,
363  struct event_set *es,
364  void *arg,
365  unsigned int *persistent);
366 
367 void management_io(struct management *man);
368 
369 void management_set_callback(struct management *man,
370  const struct management_callback *cb);
371 
372 void management_clear_callback(struct management *man);
373 
374 bool management_query_user_pass(struct management *man,
375  struct user_pass *up,
376  const char *type,
377  const unsigned int flags,
378  const char *static_challenge);
379 
380 #ifdef TARGET_ANDROID
381 bool management_android_control(struct management *man, const char *command, const char *msg);
382 
383 #define ANDROID_KEEP_OLD_TUN 1
384 #define ANDROID_OPEN_AFTER_CLOSE 2
385 #define ANDROID_OPEN_BEFORE_CLOSE 3
386 int managment_android_persisttun_action(struct management *man);
387 
388 #endif
389 
390 bool management_should_daemonize(struct management *man);
391 
392 bool management_would_hold(struct management *man);
393 
394 bool management_hold(struct management *man, int holdtime);
395 
396 void management_event_loop_n_seconds(struct management *man, int sec);
397 
398 void management_up_down(struct management *man, const char *updown, const struct env_set *es);
399 
400 void management_notify(struct management *man, const char *severity, const char *type, const char *text);
401 
402 void management_notify_generic(struct management *man, const char *str);
403 
404 void management_notify_client_needing_auth(struct management *management,
405  const unsigned int auth_id,
406  struct man_def_auth_context *mdac,
407  const struct env_set *es);
408 
409 void management_connection_established(struct management *management,
410  struct man_def_auth_context *mdac,
411  const struct env_set *es);
412 
413 void management_notify_client_close(struct management *management,
414  struct man_def_auth_context *mdac,
415  const struct env_set *es);
416 
417 void management_learn_addr(struct management *management,
418  struct man_def_auth_context *mdac,
419  const struct mroute_addr *addr,
420  const bool primary);
421 
422 void management_notify_client_cr_response(unsigned mda_key_id,
423  const struct man_def_auth_context *mdac,
424  const struct env_set *es,
425  const char *response);
426 
427 char *management_query_pk_sig(struct management *man, const char *b64_data,
428  const char *algorithm);
429 
430 char *management_query_cert(struct management *man, const char *cert_name);
431 
432 static inline bool
433 management_connected(const struct management *man)
434 {
436 }
437 
438 static inline bool
439 management_query_user_pass_enabled(const struct management *man)
440 {
442 }
443 
444 static inline bool
445 management_query_remote_enabled(const struct management *man)
446 {
447  return BOOL_CAST(man->settings.flags & MF_QUERY_REMOTE);
448 }
449 
450 static inline bool
451 management_query_proxy_enabled(const struct management *man)
452 {
453  return BOOL_CAST(man->settings.flags & MF_QUERY_PROXY);
454 }
455 
456 
457 static inline bool
458 management_enable_def_auth(const struct management *man)
459 {
460  return man && BOOL_CAST(man->settings.flags & MF_CLIENT_AUTH);
461 }
462 
463 /*
464  * OpenVPN tells the management layer what state it's in
465  */
466 
467 /* client/server states */
468 #define OPENVPN_STATE_INITIAL 0 /* Initial, undefined state */
469 #define OPENVPN_STATE_CONNECTING 1 /* Management interface has been initialized */
470 #define OPENVPN_STATE_ASSIGN_IP 2 /* Assigning IP address to virtual network interface */
471 #define OPENVPN_STATE_ADD_ROUTES 3 /* Adding routes to system */
472 #define OPENVPN_STATE_CONNECTED 4 /* Initialization sequence completed */
473 #define OPENVPN_STATE_RECONNECTING 5 /* Restart */
474 #define OPENVPN_STATE_EXITING 6 /* Exit */
475 
476 /* client-only states */
477 #define OPENVPN_STATE_WAIT 7 /* Waiting for initial response from server */
478 #define OPENVPN_STATE_AUTH 8 /* Authenticating with server */
479 #define OPENVPN_STATE_GET_CONFIG 9 /* Downloading configuration from server */
480 #define OPENVPN_STATE_RESOLVE 10 /* DNS lookup */
481 #define OPENVPN_STATE_TCP_CONNECT 11 /* Connecting to TCP server */
482 #define OPENVPN_STATE_AUTH_PENDING 12 /* Waiting in auth-pending mode
483  * technically variant of GET_CONFIG */
484 
485 #define OPENVPN_STATE_CLIENT_BASE 7 /* Base index of client-only states */
486 
487 void management_set_state(struct management *man,
488  const int state,
489  const char *detail,
490  const in_addr_t *tun_local_ip,
491  const struct in6_addr *tun_local_ip6,
492  const struct openvpn_sockaddr *local_addr,
493  const struct openvpn_sockaddr *remote_addr);
494 
495 /*
496  * The management object keeps track of OpenVPN --echo
497  * parameters.
498  */
499 void management_echo(struct management *man, const char *string, const bool pull);
500 
501 /*
502  * OpenVPN calls here to indicate a password failure
503  */
504 
505 void management_auth_failure(struct management *man, const char *type, const char *reason);
506 
507 /*
508  * Echo an authentication token to management interface
509  */
510 void management_auth_token(struct management *man, const char *token);
511 
512 /*
513  * These functions drive the bytecount in/out counters.
514  */
515 
516 void man_bytecount_output_client(struct management *man);
517 
518 static inline void
520 {
524  {
526  }
527 }
528 
529 static inline void
530 management_bytes_out_client(struct management *man, const int size)
531 {
532  man->persist.bytes_out += size;
534 }
535 
536 static inline void
537 management_bytes_in_client(struct management *man, const int size)
538 {
539  man->persist.bytes_in += size;
541 }
542 
543 static inline void
544 management_bytes_out(struct management *man, const int size)
545 {
546  if (!(man->persist.callback.flags & MCF_SERVER))
547  {
548  management_bytes_out_client(man, size);
549  }
550 }
551 
552 static inline void
553 management_bytes_in(struct management *man, const int size)
554 {
555  if (!(man->persist.callback.flags & MCF_SERVER))
556  {
557  management_bytes_in_client(man, size);
558  }
559 }
560 
561 void man_bytecount_output_server(struct management *man,
562  const counter_type *bytes_in_total,
563  const counter_type *bytes_out_total,
564  struct man_def_auth_context *mdac);
565 
566 static inline void
567 management_bytes_server(struct management *man,
568  const counter_type *bytes_in_total,
569  const counter_type *bytes_out_total,
570  struct man_def_auth_context *mdac)
571 {
575  {
576  man_bytecount_output_server(man, bytes_in_total, bytes_out_total, mdac);
577  }
578 }
579 
580 #endif /* ifdef ENABLE_MANAGEMENT */
581 
586 void management_sleep(const int n);
587 
588 #endif /* ifndef MANAGE_H */
void command_line_free(struct command_line *cl)
Definition: manage.c:3811
const char * log_entry_print(const struct log_entry *e, unsigned int flags, struct gc_arena *gc)
Definition: manage.c:3868
const char * string
Definition: manage.h:90
int client_uid
Definition: manage.h:233
void management_pre_tunnel_close(struct management *man)
Definition: manage.c:3000
static int buf_len(const struct buffer *buf)
Definition: buffer.h:240
bool management_over_tunnel
Definition: manage.h:227
int password_tries
Definition: manage.h:269
struct log_history * state
Definition: manage.h:210
void management_sleep(const int n)
A sleep function that services the management layer for n seconds rather than doing nothing...
Definition: manage.c:4043
bool management_query_user_pass(struct management *man, struct user_pass *up, const char *type, const unsigned int flags, const char *static_challenge)
Definition: manage.c:3411
int state
Definition: manage.h:83
static int log_history_size(const struct log_history *h)
Definition: manage.h:137
bool management_would_hold(struct management *man)
Definition: manage.c:3722
#define BOOL_CAST(x)
Definition: basic.h:27
struct man_persist persist
Definition: manage.h:314
unsigned int msg_flags
Definition: manage.h:82
void management_echo(struct management *man, const char *string, const bool pull)
Definition: manage.c:2946
const char * up_query_type
Definition: manage.h:301
struct man_connection connection
Definition: manage.h:316
bool management_open(struct management *man, const char *addr, const char *port, const char *pass_file, const char *client_user, const char *client_group, const int log_history_cache, const int echo_buffer_size, const int state_buffer_size, const char *write_peer_info_file, const int remap_sigusr1, const unsigned int flags)
Definition: manage.c:2581
struct management_callback callback
Definition: manage.h:207
int size
Definition: manage.h:121
void command_line_add(struct command_line *cl, const unsigned char *buf, const int len)
Definition: manage.c:3824
struct buffer_list * in_extra
Definition: manage.h:281
unsigned long in_extra_cid
Definition: manage.h:282
#define in_addr_t
Definition: config-msvc.h:103
struct buffer buf
Definition: manage.h:61
struct addrinfo * local
Definition: manage.h:223
counter_type bytes_in
Definition: manage.h:216
int echo_buffer_size
Definition: manage.h:230
#define MCF_SERVER
Definition: manage.h:156
#define MF_QUERY_PROXY
Definition: manage.h:340
int ext_key_state
Definition: manage.h:288
Definition: manage.h:81
void man_bytecount_output_server(struct management *man, const counter_type *bytes_in_total, const counter_type *bytes_out_total, struct man_def_auth_context *mdac)
Definition: manage.c:485
in_addr_t local_ip
Definition: manage.h:91
const struct log_entry * log_history_ref(const struct log_history *h, const int index)
Definition: manage.c:4030
void management_socket_set(struct management *man, struct event_set *es, void *arg, unsigned int *persistent)
Definition: manage.c:3044
#define MF_CLIENT_AUTH
Definition: manage.h:332
#define MF_QUERY_REMOTE
Definition: manage.h:339
void management_up_down(struct management *man, const char *updown, const struct env_set *es)
Definition: manage.c:2806
void management_learn_addr(struct management *management, struct man_def_auth_context *mdac, const struct mroute_addr *addr, const bool primary)
Definition: manage.c:2929
time_t bytecount_last_update
Definition: manage.h:299
static void management_bytes_out_client(struct management *man, const int size)
Definition: manage.h:530
void command_line_next(struct command_line *cl)
Definition: manage.c:3856
struct buffer_list * ext_key_input
Definition: manage.h:289
char * write_peer_info_file
Definition: manage.h:232
struct command_line * command_line_new(const int buf_len)
Definition: manage.c:3794
int up_query_mode
Definition: manage.h:302
time_t bytecount_last_update
Definition: manage.h:53
time_t timestamp
Definition: manage.h:89
time_t now
Definition: otime.c:36
bool standalone_disabled
Definition: manage.h:206
void management_auth_token(struct management *man, const char *token)
Definition: manage.c:3022
unsigned int flags
Definition: manage.h:49
void management_set_state(struct management *man, const int state, const char *detail, const in_addr_t *tun_local_ip, const struct in6_addr *tun_local_ip6, const struct openvpn_sockaddr *local_addr, const struct openvpn_sockaddr *remote_addr)
Definition: manage.c:2665
const char * command_line_get(struct command_line *cl)
Definition: manage.c:3840
struct event_set * es
Definition: manage.h:292
static void management_bytes_in(struct management *man, const int size)
Definition: manage.h:553
uint64_t counter_type
Definition: common.h:30
int in_extra_cmd
Definition: manage.h:280
int capacity
Definition: manage.h:122
void management_notify_generic(struct management *man, const char *str)
Definition: manage.c:2822
struct command_line * in
Definition: manage.h:271
void management_event_loop_n_seconds(struct management *man, int sec)
Definition: manage.c:3359
static void management_bytes_in_client(struct management *man, const int size)
Definition: manage.h:537
int state_buffer_size
Definition: manage.h:231
void management_set_callback(struct management *man, const struct management_callback *cb)
Definition: manage.c:2648
struct management * management
Definition: manage.c:63
void log_history_close(struct log_history *h)
Definition: manage.c:3981
socket_descriptor_t sd_cli
Definition: manage.h:260
char * management_query_pk_sig(struct management *man, const char *b64_data, const char *algorithm)
Definition: manage.c:3676
bool state_realtime
Definition: manage.h:295
static bool management_connected(const struct management *man)
Definition: manage.h:433
bool hold_release
Definition: manage.h:212
unsigned int mansig
Definition: manage.h:240
bool defined
Definition: manage.h:201
counter_type bytes_out
Definition: manage.h:217
void management_io(struct management *man)
Definition: manage.c:3084
#define msg(flags,...)
Definition: error.h:153
struct log_history * log_history_init(const int capacity)
Definition: manage.c:3960
void management_clear_callback(struct management *man)
Definition: manage.c:2656
static int log_history_capacity(const struct log_history *h)
Definition: manage.h:143
void management_post_tunnel_open(struct management *man, const in_addr_t tun_local_ip)
Definition: manage.c:2977
int base
Definition: manage.h:120
struct log_history * log
Definition: manage.h:203
void log_history_resize(struct log_history *h, const int capacity)
Definition: manage.c:4009
#define MF_QUERY_PASSWORDS
Definition: manage.h:327
const char * special_state_msg
Definition: manage.h:214
struct management * management_init(void)
Definition: manage.c:2565
int log_history_cache
Definition: manage.h:229
void log_history_add(struct log_history *h, const struct log_entry *le)
Definition: manage.c:3988
int client_version
Definition: manage.h:309
int env_filter_level
Definition: manage.h:293
void management_auth_failure(struct management *man, const char *type, const char *reason)
Definition: manage.c:3009
static bool management_query_user_pass_enabled(const struct management *man)
Definition: manage.h:439
int msglevel
Definition: status.h:56
SOCKET socket_descriptor_t
Definition: syshead.h:445
struct log_entry * array
Definition: manage.h:123
Definition: misc.h:56
Wrapper structure for dynamically allocated memory.
Definition: buffer.h:60
void management_connection_established(struct management *management, struct man_def_auth_context *mdac, const struct env_set *es)
Definition: manage.c:2905
struct buffer_list * ext_cert_input
Definition: manage.h:291
static settings_t settings
Definition: interactive.c:58
bool echo_realtime
Definition: manage.h:297
static void man_bytecount_possible_output_client(struct management *man)
Definition: manage.h:519
unsigned int flags
Definition: manage.h:222
static bool management_enable_def_auth(const struct management *man)
Definition: manage.h:458
socket_descriptor_t sd_top
Definition: manage.h:259
unsigned int mda_key_id_counter
Definition: manage.h:51
bool management_should_daemonize(struct management *man)
Definition: manage.c:3732
int intval
Definition: manage.h:84
static void management_bytes_out(struct management *man, const int size)
Definition: manage.h:544
Definition: manage.h:87
unsigned int flags
Definition: manage.h:157
struct buffer_list * out
Definition: manage.h:272
Garbage collection arena used to keep track of dynamically allocated memory.
Definition: buffer.h:116
#define DAF_CONNECTION_ESTABLISHED
Definition: manage.h:46
unsigned long cid
Definition: manage.h:44
bool management_hold(struct management *man, int holdtime)
Definition: manage.c:3742
void management_notify_client_cr_response(unsigned mda_key_id, const struct man_def_auth_context *mdac, const struct env_set *es, const char *response)
Definition: manage.c:2879
#define DAF_CONNECTION_CLOSED
Definition: manage.h:47
bool defined
Definition: manage.h:221
char * management_query_cert(struct management *man, const char *cert_name)
Definition: manage.c:3703
void management_close(struct management *man)
Definition: manage.c:2638
static void management_bytes_server(struct management *man, const counter_type *bytes_in_total, const counter_type *bytes_out_total, struct man_def_auth_context *mdac)
Definition: manage.h:567
#define MS_CC_WAIT_WRITE
Definition: manage.h:254
bool log_realtime
Definition: manage.h:296
bool password_verified
Definition: manage.h:268
unsigned int in_extra_kid
Definition: manage.h:283
static SERVICE_STATUS status
Definition: interactive.c:56
static bool management_query_remote_enabled(const struct management *man)
Definition: manage.h:445
int bytecount_update_seconds
Definition: manage.h:298
void management_notify(struct management *man, const char *severity, const char *type, const char *text)
Definition: manage.c:2816
static bool management_query_proxy_enabled(const struct management *man)
Definition: manage.h:451
int client_gid
Definition: manage.h:234
struct man_settings settings
Definition: manage.h:315
void command_line_reset(struct command_line *cl)
Definition: manage.c:3804
#define MS_CC_WAIT_READ
Definition: manage.h:253
struct log_history * echo
Definition: manage.h:209
void management_notify_client_needing_auth(struct management *management, const unsigned int auth_id, struct man_def_auth_context *mdac, const struct env_set *es)
Definition: manage.c:2855
void management_notify_client_close(struct management *management, struct man_def_auth_context *mdac, const struct env_set *es)
Definition: manage.c:2916
void man_bytecount_output_client(struct management *man)
Definition: manage.c:473
int ext_cert_state
Definition: manage.h:290