diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2004-01-04 08:28:50 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2004-01-04 08:28:50 +0000 |
commit | c1606a8b4a93bb266cfcf1699e631fd5a316aaa6 (patch) | |
tree | 21dd93ca259055fc14af3b1fbfdc2066a803de1b /usr.sbin/syslogd/syslogd.h | |
parent | f2546e76535bf0bf40a4b51c451e6354435df578 (diff) |
Buffered logging for syslogd. Logs may be stored in memory buffers and
extracted using a small client. Useful for diskless systems.
much feedback from deraadt@, canacar@, jmc@, jakob@ ; ok deraadt@
Diffstat (limited to 'usr.sbin/syslogd/syslogd.h')
-rw-r--r-- | usr.sbin/syslogd/syslogd.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.sbin/syslogd/syslogd.h b/usr.sbin/syslogd/syslogd.h index 49b9aa4ee12..ed58afbb981 100644 --- a/usr.sbin/syslogd/syslogd.h +++ b/usr.sbin/syslogd/syslogd.h @@ -36,6 +36,8 @@ int receive_fd(int); #define MAXFUNIX 21 extern int nfunix; extern char *funixn[MAXFUNIX]; +extern char *ctlsock_path; + #define dprintf if (Debug) printf extern int Debug; extern int Startup; @@ -43,6 +45,19 @@ extern int Startup; /* fds to poll */ #define PFD_KLOG 0 /* Offset of /dev/klog entry */ #define PFD_INET 1 /* Offset of inet socket entry */ -#define PFD_UNIX_0 2 /* Start of Unix socket entries */ +#define PFD_CTLSOCK 2 /* Offset of control socket entry */ +#define PFD_CTLCONN 3 /* Offset of control connection entry */ +#define PFD_UNIX_0 4 /* Start of Unix socket entries */ #define N_PFD (PFD_UNIX_0 + MAXFUNIX) /* # of pollfd entries */ extern struct pollfd pfd[N_PFD]; + +struct ringbuf { + char *buf; + size_t len, start, end; +}; + +struct ringbuf *ringbuf_init(size_t); +void ringbuf_clear(struct ringbuf *); +size_t ringbuf_used(struct ringbuf *); +int ringbuf_append_line(struct ringbuf *, char *); +ssize_t ringbuf_to_string(char *, size_t, struct ringbuf *); |