~ubuntu-branches/ubuntu/wily/sshguard/wily

« back to all changes in this revision

Viewing changes to src/sshguard_logsuck.h

  • Committer: Bazaar Package Importer
  • Author(s): Julián Moreno Patiño
  • Date: 2011-02-13 17:24:58 UTC
  • mfrom: (1.2.1 upstream) (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110213172458-0pr057n7ja5gfvz9
Tags: 1.5-1
* New upstream release
  + Removed README.source, it's not used.
  + Moved svn to git
  + Added support for whitelisting
  + Released to unstable, it's a stable release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2009,2010 Mij <mij@sshguard.net>
 
3
 *
 
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.
 
7
 *
 
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.
 
15
 */
 
16
 
 
17
/*
 
18
 * SSHGuard. See http://www.sshguard.net
 
19
 */
 
20
 
 
21
#ifndef SSHGUARD_LOGSUCK_H
 
22
#define SSHGUARD_LOGSUCK_H
 
23
 
 
24
#include <stdint.h>
 
25
#include <stdbool.h>
 
26
 
 
27
 
 
28
typedef uint32_t sourceid_t;
 
29
 
 
30
/**
 
31
 * Initialize the logsuck subsystem.
 
32
 *
 
33
 * @return 0 on success, -1 on error
 
34
 */
 
35
int logsuck_init();
 
36
 
 
37
/**
 
38
 * Add a log file to be polled.
 
39
 *
 
40
 * @return 0 on success, -1 on error
 
41
 */
 
42
int logsuck_add_logsource(const char *restrict filename);
 
43
 
 
44
/**
 
45
 * Get the first whole log line coming from any log file configured.
 
46
 *
 
47
 * @param from_previous_source  read from the same source of previous message
 
48
 *
 
49
 * @return 0 on success, -1 on error
 
50
 */
 
51
int logsuck_getline(char *restrict buf, size_t buflen, bool from_previous_source, sourceid_t *restrict whichsource);
 
52
 
 
53
/**
 
54
 * Finalize the logsuck subsystem.
 
55
 *
 
56
 * @return 0 on success, -1 on error
 
57
 */
 
58
int logsuck_fin();
 
59
 
 
60
#endif
 
61