diff options
author | Alberto Gonzalez Iniesta <agi@inittab.org> | 2016-12-27 18:25:47 +0100 |
---|---|---|
committer | Alberto Gonzalez Iniesta <agi@inittab.org> | 2016-12-27 18:25:47 +0100 |
commit | 3a2bbdb05ca6a6996e424c9fb225cb0d53804125 (patch) | |
tree | f29063da5bec4caf3853d49a22a09c8619eebd21 /src/openvpn/status.h | |
parent | d53dba59e78da865c4fe820386ff2f4f76925f3b (diff) |
New upstream version 2.4.0upstream/2.4.0
Diffstat (limited to 'src/openvpn/status.h')
-rw-r--r-- | src/openvpn/status.h | 85 |
1 files changed, 47 insertions, 38 deletions
diff --git a/src/openvpn/status.h b/src/openvpn/status.h index af16fd2..590ae41 100644 --- a/src/openvpn/status.h +++ b/src/openvpn/status.h @@ -5,7 +5,7 @@ * packet encryption, packet authentication, and * packet compression. * - * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net> + * Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -31,15 +31,15 @@ * virtual function interface for status output */ struct virtual_output { - void *arg; - unsigned int flags_default; - void (*func) (void *arg, const unsigned int flags, const char *str); + void *arg; + unsigned int flags_default; + void (*func) (void *arg, const unsigned int flags, const char *str); }; static inline void -virtual_output_print (const struct virtual_output *vo, const unsigned int flags, const char *str) +virtual_output_print(const struct virtual_output *vo, const unsigned int flags, const char *str) { - (*vo->func) (vo->arg, flags, str); + (*vo->func)(vo->arg, flags, str); } /* @@ -48,52 +48,61 @@ virtual_output_print (const struct virtual_output *vo, const unsigned int flags, struct status_output { -# define STATUS_OUTPUT_READ (1<<0) -# define STATUS_OUTPUT_WRITE (1<<1) - unsigned int flags; +#define STATUS_OUTPUT_READ (1<<0) +#define STATUS_OUTPUT_WRITE (1<<1) + unsigned int flags; - char *filename; - int fd; - int msglevel; - const struct virtual_output *vout; + char *filename; + int fd; + int msglevel; + const struct virtual_output *vout; - struct buffer read_buf; + struct buffer read_buf; - struct event_timeout et; + struct event_timeout et; - bool errors; + bool errors; }; -struct status_output *status_open (const char *filename, - const int refresh_freq, - const int msglevel, - const struct virtual_output *vout, - const unsigned int flags); - -bool status_trigger_tv (struct status_output *so, struct timeval *tv); -bool status_trigger (struct status_output *so); -void status_reset (struct status_output *so); -void status_flush (struct status_output *so); -bool status_close (struct status_output *so); -void status_printf (struct status_output *so, const char *format, ...) +struct status_output *status_open(const char *filename, + const int refresh_freq, + const int msglevel, + const struct virtual_output *vout, + const unsigned int flags); + +bool status_trigger_tv(struct status_output *so, struct timeval *tv); + +bool status_trigger(struct status_output *so); + +void status_reset(struct status_output *so); + +void status_flush(struct status_output *so); + +bool status_close(struct status_output *so); + +void status_printf(struct status_output *so, const char *format, ...) #ifdef __GNUC__ #if __USE_MINGW_ANSI_STDIO - __attribute__ ((format (gnu_printf, 2, 3))) +__attribute__ ((format(gnu_printf, 2, 3))) #else - __attribute__ ((format (__printf__, 2, 3))) +__attribute__ ((format(__printf__, 2, 3))) #endif #endif - ; +; -bool status_read (struct status_output *so, struct buffer *buf); +bool status_read(struct status_output *so, struct buffer *buf); static inline unsigned int -status_rw_flags (const struct status_output *so) +status_rw_flags(const struct status_output *so) { - if (so) - return so->flags; - else - return 0; + if (so) + { + return so->flags; + } + else + { + return 0; + } } -#endif +#endif /* ifndef STATUS_H */ |