2 * Copyright (c) 2009-2018 Todd C. Miller <Todd.Miller@sudo.ws>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #ifndef SUDOERS_IOLOG_H
18 #define SUDOERS_IOLOG_H
21 # include <zlib.h> /* for gzFile */
25 * I/O log event types as stored as the first field in the timing file.
26 * Changing existing values will result in incompatible I/O log files.
28 #define IO_EVENT_STDIN 0
29 #define IO_EVENT_STDOUT 1
30 #define IO_EVENT_STDERR 2
31 #define IO_EVENT_TTYIN 3
32 #define IO_EVENT_TTYOUT 4
33 #define IO_EVENT_WINSIZE 5
34 #define IO_EVENT_TTYOUT_1_8_7 6
35 #define IO_EVENT_SUSPEND 7
36 #define IO_EVENT_COUNT 8
38 /* Default maximum session ID */
39 #define SESSID_MAX 2176782336U
50 * Info present in the I/O log file
64 struct timing_closure {
66 struct timespec *max_delay;
80 bool parse_timing(const char *buf, struct timespec *delay, struct timing_closure *timing);
81 char *parse_delay(const char *cp, struct timespec *delay, const char *decimal_point);
82 struct log_info *parse_logfile(const char *logfile);
83 void free_log_info(struct log_info *li);
84 void adjust_delay(struct timespec *delay, struct timespec *max_delay, double scale_factor);
86 #endif /* SUDOERS_IOLOG_H */