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-2018 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 2
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  */
43 #ifdef MANAGEMENT_DEF_AUTH
44 struct man_def_auth_context {
45  unsigned long cid;
46 
47 #define DAF_CONNECTION_ESTABLISHED (1<<0)
48 #define DAF_CONNECTION_CLOSED (1<<1)
49 #define DAF_INITIAL_AUTH (1<<2)
50  unsigned int flags;
51 
52  unsigned int mda_key_id_counter;
53 
54  time_t bytecount_last_update;
55 };
56 #endif
57 
58 /*
59  * Manage build-up of command line
60  */
62 {
63  struct buffer buf;
64  struct buffer residual;
65 };
66 
67 struct command_line *command_line_new(const int buf_len);
68 
69 void command_line_free(struct command_line *cl);
70 
71 void command_line_add(struct command_line *cl, const unsigned char *buf, const int len);
72 
73 const char *command_line_get(struct command_line *cl);
74 
75 void command_line_reset(struct command_line *cl);
76 
77 void command_line_next(struct command_line *cl);
78 
79 /*
80  * Manage log file history
81  */
82 
84  unsigned int msg_flags;
85  int state;
86  int intval;
87 };
88 
89 struct log_entry
90 {
91  time_t timestamp;
92  const char *string;
94  struct in6_addr local_ip6;
95  struct openvpn_sockaddr local_sock;
96  struct openvpn_sockaddr remote_sock;
97  union log_entry_union u;
98 };
99 
100 #define LOG_PRINT_LOG_PREFIX (1<<0)
101 #define LOG_PRINT_ECHO_PREFIX (1<<1)
102 #define LOG_PRINT_STATE_PREFIX (1<<2)
103 
104 #define LOG_PRINT_INT_DATE (1<<3)
105 #define LOG_PRINT_MSG_FLAGS (1<<4)
106 #define LOG_PRINT_STATE (1<<5)
107 #define LOG_PRINT_LOCAL_IP (1<<6)
108 
109 #define LOG_PRINT_CRLF (1<<7)
110 #define LOG_FATAL_NOTIFY (1<<8)
111 
112 #define LOG_PRINT_INTVAL (1<<9)
113 
114 #define LOG_PRINT_REMOTE_IP (1<<10)
115 
116 #define LOG_ECHO_TO_LOG (1<<11)
117 
118 const char *log_entry_print(const struct log_entry *e, unsigned int flags, struct gc_arena *gc);
119 
121 {
122  int base;
123  int size;
124  int capacity;
125  struct log_entry *array;
126 };
127 
128 struct log_history *log_history_init(const int capacity);
129 
130 void log_history_close(struct log_history *h);
131 
132 void log_history_add(struct log_history *h, const struct log_entry *le);
133 
134 void log_history_resize(struct log_history *h, const int capacity);
135 
136 const struct log_entry *log_history_ref(const struct log_history *h, const int index);
137 
138 static inline int
140 {
141  return h->size;
142 }
143 
144 static inline int
146 {
147  return h->capacity;
148 }
149 
150 /*
151  * Callbacks for 'status' and 'kill' commands.
152  * Also for management-based deferred authentication and packet filter.
153  */
155 {
156  void *arg;
157 
158 #define MCF_SERVER (1<<0) /* is OpenVPN being run as a server? */
159  unsigned int flags;
160 
161  void (*status) (void *arg, const int version, struct status_output *so);
162  void (*show_net) (void *arg, const int msglevel);
163  int (*kill_by_cn) (void *arg, const char *common_name);
164  int (*kill_by_addr) (void *arg, const in_addr_t addr, const int port);
165  void (*delete_event) (void *arg, event_t event);
166  int (*n_clients) (void *arg);
167 #ifdef MANAGEMENT_DEF_AUTH
168  bool (*kill_by_cid)(void *arg, const unsigned long cid, const char *kill_msg);
169  bool (*client_auth) (void *arg,
170  const unsigned long cid,
171  const unsigned int mda_key_id,
172  const bool auth,
173  const char *reason,
174  const char *client_reason,
175  struct buffer_list *cc_config); /* ownership transferred */
176  char *(*get_peer_info) (void *arg, const unsigned long cid);
177 #endif
178 #ifdef MANAGEMENT_PF
179  bool (*client_pf)(void *arg,
180  const unsigned long cid,
181  struct buffer_list *pf_config); /* ownership transferred */
182 #endif
183  bool (*proxy_cmd)(void *arg, const char **p);
184  bool (*remote_cmd) (void *arg, const char **p);
185 #ifdef TARGET_ANDROID
186  int (*network_change)(void *arg, bool samenetwork);
187 #endif
188 };
189 
190 /*
191  * Management object, split into three components:
192  *
193  * struct man_persist : Data elements which are persistent across
194  * man_connection open and close.
195  *
196  * struct man_settings : management parameters.
197  *
198  * struct man_connection : created on socket binding and listen,
199  * deleted on socket unbind, may
200  * handle multiple sequential client
201  * connections.
202  */
203 
204 struct man_persist {
205  bool defined;
206 
207  struct log_history *log;
208  struct virtual_output vout;
209 
211  struct management_callback callback;
212 
213  struct log_history *echo; /* saved --echo strings */
215 
217 
218  const char *special_state_msg;
219 
222 };
223 
224 struct man_settings {
225  bool defined;
226  unsigned int flags; /* MF_x flags */
227  struct addrinfo *local;
228 #if UNIX_SOCK_SUPPORT
229  struct sockaddr_un local_unix;
230 #endif
232  struct user_pass up;
239 
240 /* flags for handling the management interface "signal" command */
241 #define MANSIG_IGNORE_USR1_HUP (1<<0)
242 #define MANSIG_MAP_USR1_TO_HUP (1<<1)
243 #define MANSIG_MAP_USR1_TO_TERM (1<<2)
244  unsigned int mansig;
245 };
246 
247 /* up_query modes */
248 #define UP_QUERY_DISABLED 0
249 #define UP_QUERY_USER_PASS 1
250 #define UP_QUERY_PASS 2
251 #define UP_QUERY_NEED_OK 3
252 #define UP_QUERY_NEED_STR 4
253 
254 /* states */
255 #define MS_INITIAL 0 /* all sockets are closed */
256 #define MS_LISTEN 1 /* no client is connected */
257 #define MS_CC_WAIT_READ 2 /* client is connected, waiting for read on socket */
258 #define MS_CC_WAIT_WRITE 3 /* client is connected, waiting for ability to write to socket */
259 
261  int state;
262 
265  struct openvpn_sockaddr remote;
266 
267 #ifdef _WIN32
268  struct net_event_win32 ne32;
269 #endif
270 
271  bool halt;
274 
275  struct command_line *in;
276  struct buffer_list *out;
277 
278 #ifdef MANAGEMENT_IN_EXTRA
279 #define IEC_UNDEF 0
280 #define IEC_CLIENT_AUTH 1
281 #define IEC_CLIENT_PF 2
282 #define IEC_RSA_SIGN 3
283 #define IEC_CERTIFICATE 4
284 #define IEC_PK_SIGN 5
285  int in_extra_cmd;
286  struct buffer_list *in_extra;
287 #ifdef MANAGEMENT_DEF_AUTH
288  unsigned long in_extra_cid;
289  unsigned int in_extra_kid;
290 #endif
291 #ifdef MANAGMENT_EXTERNAL_KEY
292 #define EKS_UNDEF 0
293 #define EKS_SOLICIT 1
294 #define EKS_INPUT 2
295 #define EKS_READY 3
296  int ext_key_state;
297  struct buffer_list *ext_key_input;
298  int ext_cert_state;
299  struct buffer_list *ext_cert_input;
300 #endif
301 #endif /* ifdef MANAGEMENT_IN_EXTRA */
302  struct event_set *es;
304 
310 
311  const char *up_query_type;
313  struct user_pass up_query;
314 
315 #ifdef TARGET_ANDROID
316  int fdtosend;
317  int lastfdreceived;
318 #endif
320 };
321 
323 {
324  struct man_persist persist;
326  struct man_connection connection;
327 };
328 
329 extern struct management *management;
330 
331 struct user_pass;
332 
333 struct management *management_init(void);
334 
335 /* management_open flags */
336 #define MF_SERVER (1<<0)
337 #define MF_QUERY_PASSWORDS (1<<1)
338 #define MF_HOLD (1<<2)
339 #define MF_SIGNAL (1<<3)
340 #define MF_FORGET_DISCONNECT (1<<4)
341 #define MF_CONNECT_AS_CLIENT (1<<5)
342 #ifdef MANAGEMENT_DEF_AUTH
343 #define MF_CLIENT_AUTH (1<<6)
344 #endif
345 #ifdef MANAGEMENT_PF
346 #define MF_CLIENT_PF (1<<7)
347 #endif
348 #define MF_UNIX_SOCK (1<<8)
349 #ifdef MANAGMENT_EXTERNAL_KEY
350 #define MF_EXTERNAL_KEY (1<<9)
351 #endif
352 #define MF_UP_DOWN (1<<10)
353 #define MF_QUERY_REMOTE (1<<11)
354 #define MF_QUERY_PROXY (1<<12)
355 #define MF_EXTERNAL_CERT (1<<13)
356 
357 bool management_open(struct management *man,
358  const char *addr,
359  const char *port,
360  const char *pass_file,
361  const char *client_user,
362  const char *client_group,
363  const int log_history_cache,
364  const int echo_buffer_size,
365  const int state_buffer_size,
366  const char *write_peer_info_file,
367  const int remap_sigusr1,
368  const unsigned int flags);
369 
370 void management_close(struct management *man);
371 
372 void management_post_tunnel_open(struct management *man, const in_addr_t tun_local_ip);
373 
374 void management_pre_tunnel_close(struct management *man);
375 
376 void management_socket_set(struct management *man,
377  struct event_set *es,
378  void *arg,
379  unsigned int *persistent);
380 
381 void management_io(struct management *man);
382 
383 void management_set_callback(struct management *man,
384  const struct management_callback *cb);
385 
386 void management_clear_callback(struct management *man);
387 
388 bool management_query_user_pass(struct management *man,
389  struct user_pass *up,
390  const char *type,
391  const unsigned int flags,
392  const char *static_challenge);
393 
394 #ifdef TARGET_ANDROID
395 bool management_android_control(struct management *man, const char *command, const char *msg);
396 
397 #define ANDROID_KEEP_OLD_TUN 1
398 #define ANDROID_OPEN_AFTER_CLOSE 2
399 #define ANDROID_OPEN_BEFORE_CLOSE 3
400 int managment_android_persisttun_action(struct management *man);
401 
402 #endif
403 
404 bool management_should_daemonize(struct management *man);
405 
406 bool management_would_hold(struct management *man);
407 
408 bool management_hold(struct management *man, int holdtime);
409 
410 void management_event_loop_n_seconds(struct management *man, int sec);
411 
412 void management_up_down(struct management *man, const char *updown, const struct env_set *es);
413 
414 void management_notify(struct management *man, const char *severity, const char *type, const char *text);
415 
416 void management_notify_generic(struct management *man, const char *str);
417 
418 #ifdef MANAGEMENT_DEF_AUTH
419 void management_notify_client_needing_auth(struct management *management,
420  const unsigned int auth_id,
421  struct man_def_auth_context *mdac,
422  const struct env_set *es);
423 
424 void management_connection_established(struct management *management,
425  struct man_def_auth_context *mdac,
426  const struct env_set *es);
427 
428 void management_notify_client_close(struct management *management,
429  struct man_def_auth_context *mdac,
430  const struct env_set *es);
431 
432 void management_learn_addr(struct management *management,
433  struct man_def_auth_context *mdac,
434  const struct mroute_addr *addr,
435  const bool primary);
436 
437 #endif
438 
439 #ifdef MANAGMENT_EXTERNAL_KEY
440 
441 char *management_query_pk_sig(struct management *man, const char *b64_data);
442 
443 char *management_query_cert(struct management *man, const char *cert_name);
444 
445 #endif
446 
447 static inline bool
448 management_connected(const struct management *man)
449 {
451 }
452 
453 static inline bool
454 management_query_user_pass_enabled(const struct management *man)
455 {
457 }
458 
459 static inline bool
460 management_query_remote_enabled(const struct management *man)
461 {
462  return BOOL_CAST(man->settings.flags & MF_QUERY_REMOTE);
463 }
464 
465 static inline bool
466 management_query_proxy_enabled(const struct management *man)
467 {
468  return BOOL_CAST(man->settings.flags & MF_QUERY_PROXY);
469 }
470 
471 #ifdef MANAGEMENT_PF
472 static inline bool
473 management_enable_pf(const struct management *man)
474 {
475  return man && BOOL_CAST(man->settings.flags & MF_CLIENT_PF);
476 }
477 #endif
478 
479 #ifdef MANAGEMENT_DEF_AUTH
480 static inline bool
481 management_enable_def_auth(const struct management *man)
482 {
483  return man && BOOL_CAST(man->settings.flags & MF_CLIENT_AUTH);
484 }
485 #endif
486 
487 /*
488  * OpenVPN tells the management layer what state it's in
489  */
490 
491 /* client/server states */
492 #define OPENVPN_STATE_INITIAL 0 /* Initial, undefined state */
493 #define OPENVPN_STATE_CONNECTING 1 /* Management interface has been initialized */
494 #define OPENVPN_STATE_ASSIGN_IP 2 /* Assigning IP address to virtual network interface */
495 #define OPENVPN_STATE_ADD_ROUTES 3 /* Adding routes to system */
496 #define OPENVPN_STATE_CONNECTED 4 /* Initialization sequence completed */
497 #define OPENVPN_STATE_RECONNECTING 5 /* Restart */
498 #define OPENVPN_STATE_EXITING 6 /* Exit */
499 
500 /* client-only states */
501 #define OPENVPN_STATE_WAIT 7 /* Waiting for initial response from server */
502 #define OPENVPN_STATE_AUTH 8 /* Authenticating with server */
503 #define OPENVPN_STATE_GET_CONFIG 9 /* Downloading configuration from server */
504 #define OPENVPN_STATE_RESOLVE 10 /* DNS lookup */
505 #define OPENVPN_STATE_TCP_CONNECT 11 /* Connecting to TCP server */
506 
507 #define OPENVPN_STATE_CLIENT_BASE 7 /* Base index of client-only states */
508 
509 void management_set_state(struct management *man,
510  const int state,
511  const char *detail,
512  const in_addr_t *tun_local_ip,
513  const struct in6_addr *tun_local_ip6,
514  const struct openvpn_sockaddr *local_addr,
515  const struct openvpn_sockaddr *remote_addr);
516 
517 /*
518  * The management object keeps track of OpenVPN --echo
519  * parameters.
520  */
521 void management_echo(struct management *man, const char *string, const bool pull);
522 
523 /*
524  * OpenVPN calls here to indicate a password failure
525  */
526 
527 void management_auth_failure(struct management *man, const char *type, const char *reason);
528 
529 /*
530  * Echo an authentication token to management interface
531  */
532 void management_auth_token(struct management *man, const char *token);
533 
534 /*
535  * These functions drive the bytecount in/out counters.
536  */
537 
538 void man_bytecount_output_client(struct management *man);
539 
540 static inline void
542 {
546  {
548  }
549 }
550 
551 static inline void
552 management_bytes_out_client(struct management *man, const int size)
553 {
554  man->persist.bytes_out += size;
556 }
557 
558 static inline void
559 management_bytes_in_client(struct management *man, const int size)
560 {
561  man->persist.bytes_in += size;
563 }
564 
565 static inline void
566 management_bytes_out(struct management *man, const int size)
567 {
568  if (!(man->persist.callback.flags & MCF_SERVER))
569  {
570  management_bytes_out_client(man, size);
571  }
572 }
573 
574 static inline void
575 management_bytes_in(struct management *man, const int size)
576 {
577  if (!(man->persist.callback.flags & MCF_SERVER))
578  {
579  management_bytes_in_client(man, size);
580  }
581 }
582 
583 #ifdef MANAGEMENT_DEF_AUTH
584 
585 static inline void
586 management_bytes_server(struct management *man,
587  const counter_type *bytes_in_total,
588  const counter_type *bytes_out_total,
589  struct man_def_auth_context *mdac)
590 {
591  void man_bytecount_output_server(struct management *man,
592  const counter_type *bytes_in_total,
593  const counter_type *bytes_out_total,
594  struct man_def_auth_context *mdac);
595 
597  && now >= mdac->bytecount_last_update + man->connection.bytecount_update_seconds
598  && (mdac->flags & (DAF_CONNECTION_ESTABLISHED|DAF_CONNECTION_CLOSED)) == DAF_CONNECTION_ESTABLISHED)
599  {
600  man_bytecount_output_server(man, bytes_in_total, bytes_out_total, mdac);
601  }
602 }
603 
604 #endif /* MANAGEMENT_DEF_AUTH */
605 
606 #endif /* ifdef ENABLE_MANAGEMENT */
607 
612 void management_sleep(const int n);
613 
614 #endif /* ifndef MANAGE_H */
char * management_query_cert(struct management *man, const char *cert_name)
Definition: manage.c:3687
void command_line_free(struct command_line *cl)
Definition: manage.c:3797
const char * log_entry_print(const struct log_entry *e, unsigned int flags, struct gc_arena *gc)
Definition: manage.c:3850
const char * string
Definition: manage.h:92
int client_uid
Definition: manage.h:237
void management_pre_tunnel_close(struct management *man)
Definition: manage.c:2996
static int buf_len(const struct buffer *buf)
Definition: buffer.h:240
bool management_over_tunnel
Definition: manage.h:231
int password_tries
Definition: manage.h:273
struct log_history * state
Definition: manage.h:214
void management_sleep(const int n)
A sleep function that services the management layer for n seconds rather than doing nothing...
Definition: manage.c:4027
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:3398
int state
Definition: manage.h:85
static int log_history_size(const struct log_history *h)
Definition: manage.h:139
bool management_would_hold(struct management *man)
Definition: manage.c:3708
struct man_persist persist
Definition: manage.h:324
unsigned int msg_flags
Definition: manage.h:84
void management_echo(struct management *man, const char *string, const bool pull)
Definition: manage.c:2942
const char * up_query_type
Definition: manage.h:311
struct man_connection connection
Definition: manage.h:326
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:2601
struct management_callback callback
Definition: manage.h:211
int size
Definition: manage.h:123
void command_line_add(struct command_line *cl, const unsigned char *buf, const int len)
Definition: manage.c:3806
#define in_addr_t
Definition: config-msvc.h:103
struct buffer buf
Definition: manage.h:63
struct addrinfo * local
Definition: manage.h:227
counter_type bytes_in
Definition: manage.h:220
int echo_buffer_size
Definition: manage.h:234
#define MCF_SERVER
Definition: manage.h:158
#define MF_QUERY_PROXY
Definition: manage.h:354
Definition: manage.h:83
in_addr_t local_ip
Definition: manage.h:93
const struct log_entry * log_history_ref(const struct log_history *h, const int index)
Definition: manage.c:4014
char * management_query_pk_sig(struct management *man, const char *b64_data)
Definition: manage.c:3672
void management_socket_set(struct management *man, struct event_set *es, void *arg, unsigned int *persistent)
Definition: manage.c:3040
list flags
#define MF_QUERY_REMOTE
Definition: manage.h:353
void management_up_down(struct management *man, const char *updown, const struct env_set *es)
Definition: manage.c:2824
time_t bytecount_last_update
Definition: manage.h:309
static void management_bytes_out_client(struct management *man, const int size)
Definition: manage.h:552
void command_line_next(struct command_line *cl)
Definition: manage.c:3838
char * write_peer_info_file
Definition: manage.h:236
struct command_line * command_line_new(const int buf_len)
Definition: manage.c:3780
int up_query_mode
Definition: manage.h:312
time_t timestamp
Definition: manage.h:91
time_t now
Definition: otime.c:36
bool standalone_disabled
Definition: manage.h:210
void management_auth_token(struct management *man, const char *token)
Definition: manage.c:3018
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:2685
const char * command_line_get(struct command_line *cl)
Definition: manage.c:3822
struct event_set * es
Definition: manage.h:302
static void management_bytes_in(struct management *man, const int size)
Definition: manage.h:575
int capacity
Definition: manage.h:124
void management_notify_generic(struct management *man, const char *str)
Definition: manage.c:2840
struct command_line * in
Definition: manage.h:275
void management_event_loop_n_seconds(struct management *man, int sec)
Definition: manage.c:3346
static SERVICE_STATUS status
Definition: automatic.c:47
static void management_bytes_in_client(struct management *man, const int size)
Definition: manage.h:559
int state_buffer_size
Definition: manage.h:235
void management_set_callback(struct management *man, const struct management_callback *cb)
Definition: manage.c:2668
struct management * management
Definition: manage.c:63
unsigned int counter_type
Definition: common.h:38
void log_history_close(struct log_history *h)
Definition: manage.c:3965
socket_descriptor_t sd_cli
Definition: manage.h:264
bool state_realtime
Definition: manage.h:305
static bool management_connected(const struct management *man)
Definition: manage.h:448
bool hold_release
Definition: manage.h:216
unsigned int mansig
Definition: manage.h:244
bool defined
Definition: manage.h:205
counter_type bytes_out
Definition: manage.h:221
void management_io(struct management *man)
Definition: manage.c:3080
struct log_history * log_history_init(const int capacity)
Definition: manage.c:3944
void management_clear_callback(struct management *man)
Definition: manage.c:2676
static int log_history_capacity(const struct log_history *h)
Definition: manage.h:145
void management_post_tunnel_open(struct management *man, const in_addr_t tun_local_ip)
Definition: manage.c:2973
int base
Definition: manage.h:122
struct log_history * log
Definition: manage.h:207
void log_history_resize(struct log_history *h, const int capacity)
Definition: manage.c:3993
#define MF_QUERY_PASSWORDS
Definition: manage.h:337
const char * special_state_msg
Definition: manage.h:218
struct management * management_init(void)
Definition: manage.c:2585
int log_history_cache
Definition: manage.h:233
void log_history_add(struct log_history *h, const struct log_entry *le)
Definition: manage.c:3972
int client_version
Definition: manage.h:319
int env_filter_level
Definition: manage.h:303
void management_auth_failure(struct management *man, const char *type, const char *reason)
Definition: manage.c:3005
static bool management_query_user_pass_enabled(const struct management *man)
Definition: manage.h:454
int msglevel
Definition: status.h:56
SOCKET socket_descriptor_t
Definition: syshead.h:487
#define msg
Definition: error.h:173
struct log_entry * array
Definition: manage.h:125
Definition: misc.h:65
Wrapper structure for dynamically allocated memory.
Definition: buffer.h:60
static settings_t settings
Definition: interactive.c:58
bool echo_realtime
Definition: manage.h:307
static void man_bytecount_possible_output_client(struct management *man)
Definition: manage.h:541
unsigned int flags
Definition: manage.h:226
socket_descriptor_t sd_top
Definition: manage.h:263
bool management_should_daemonize(struct management *man)
Definition: manage.c:3718
int intval
Definition: manage.h:86
static void management_bytes_out(struct management *man, const int size)
Definition: manage.h:566
Definition: manage.h:89
#define bool
Definition: simple.c:61
unsigned int flags
Definition: manage.h:159
struct buffer_list * out
Definition: manage.h:276
Garbage collection arena used to keep track of dynamically allocated memory.
Definition: buffer.h:116
bool management_hold(struct management *man, int holdtime)
Definition: manage.c:3728
bool defined
Definition: manage.h:225
void management_close(struct management *man)
Definition: manage.c:2658
#define MS_CC_WAIT_WRITE
Definition: manage.h:258
bool log_realtime
Definition: manage.h:306
bool password_verified
Definition: manage.h:272
static bool management_query_remote_enabled(const struct management *man)
Definition: manage.h:460
int bytecount_update_seconds
Definition: manage.h:308
void management_notify(struct management *man, const char *severity, const char *type, const char *text)
Definition: manage.c:2834
#define BOOL_CAST(x)
Definition: basic.h:27
static bool management_query_proxy_enabled(const struct management *man)
Definition: manage.h:466
int client_gid
Definition: manage.h:238
struct man_settings settings
Definition: manage.h:325
void command_line_reset(struct command_line *cl)
Definition: manage.c:3790
#define MS_CC_WAIT_READ
Definition: manage.h:257
struct log_history * echo
Definition: manage.h:213
void man_bytecount_output_client(struct management *man)
Definition: manage.c:474