Bugfix: memory and thread-deleting problems
[monky] / src / tcp-portmon.h
1 /* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
2  *
3  * tcp-portmon.h - libtcp-portmon hooks protoypes
4  *
5  * Copyright (C) 2008 Phil Sutter <Phil@nwl.cc>
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  *
19  * $Id$
20  *
21  */
22 #ifndef _TCP_PORTMON_H
23 #define _TCP_PORTMON_H
24
25 #include "libtcp-portmon.h"
26
27 struct tcp_port_monitor_data {
28         /* starting port to monitor */
29         in_port_t port_range_begin;
30         /* ending port to monitor */
31         in_port_t port_range_end;
32         /* enum from libtcp-portmon.h, e.g. COUNT, etc. */
33         int item;
34         /* 0 to n-1 connections. */
35         int connection_index;
36 };
37
38 /* forward declare to make gcc happy */
39 struct text_object;
40
41 int tcp_portmon_init(struct text_object *, const char *);
42 int tcp_portmon_action(struct text_object *, char *, int);
43 int tcp_portmon_update(void);
44 int tcp_portmon_clear(void);
45 int tcp_portmon_set_max_connections(int);
46 void tcp_portmon_free(struct text_object *);
47
48 #endif /* _TCP_PORTMON_H */