2
* Copyright (c) 2009,2010 Mij <mij@sshguard.net>
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.
18
* SSHGuard. See http://www.sshguard.net
21
#ifndef SSHGUARD_LOGSUCK_H
22
#define SSHGUARD_LOGSUCK_H
28
typedef uint32_t sourceid_t;
31
* Initialize the logsuck subsystem.
33
* @return 0 on success, -1 on error
38
* Add a log file to be polled.
40
* @return 0 on success, -1 on error
42
int logsuck_add_logsource(const char *restrict filename);
45
* Get the first whole log line coming from any log file configured.
47
* @param from_previous_source read from the same source of previous message
49
* @return 0 on success, -1 on error
51
int logsuck_getline(char *restrict buf, size_t buflen, bool from_previous_source, sourceid_t *restrict whichsource);
54
* Finalize the logsuck subsystem.
56
* @return 0 on success, -1 on error