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