Debian Codegraph @

madrisan-nagios-plugins-linux/nagios-plugins-linux/include/tcpinfo.h

raw symbols SCIP
1 // SPDX-License-Identifier: GPL-3.0-or-later
2 /* tcpinfo -- library for getting TCP network and socket informations
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
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 #ifndef _TCPINFO_H_
18 #define _TCPINFO_H_
19
20 #define TCP_UNSET 0
21 #define TCP_VERBOSE (1 << 1)
22 #define TCP_v4 (1 << 2)
23 #define TCP_v6 (1 << 3)
24
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #endif
29
30 struct proc_tcptable;
31
32 /* Allocates space for a new tcptable object.
33 * Returns 0 if all went ok. Errors are returned as negative values. */
34 int proc_tcptable_new (struct proc_tcptable **tcptable);
35
36 /* Fill the proc_tcptable structure pointed with the values found in the
37 * proc filesystem. */
38 void proc_tcptable_read (struct proc_tcptable *tcptable, int flags);
39
40 /* Drop a reference of the tcptable library context. If the refcount of
41 * reaches zero, the resources of the context will be released. */
42 struct proc_cputable *proc_tcptable_unref (struct proc_tcptable *tcptable);
43
44 /* Accessing the values from proc_tcptable */
45
46 unsigned long proc_tcp_get_tcp_established (struct proc_tcptable *tcptable);
47 unsigned long proc_tcp_get_tcp_syn_sent (struct proc_tcptable *tcptable);
48 unsigned long proc_tcp_get_tcp_syn_recv (struct proc_tcptable *tcptable);
49 unsigned long proc_tcp_get_tcp_fin_wait1 (struct proc_tcptable *tcptable);
50 unsigned long proc_tcp_get_tcp_fin_wait2 (struct proc_tcptable *tcptable);
51 unsigned long proc_tcp_get_tcp_time_wait (struct proc_tcptable *tcptable);
52 unsigned long proc_tcp_get_tcp_close (struct proc_tcptable *tcptable);
53 unsigned long proc_tcp_get_tcp_close_wait (struct proc_tcptable *tcptable);
54 unsigned long proc_tcp_get_tcp_last_ack (struct proc_tcptable *tcptable);
55 unsigned long proc_tcp_get_tcp_listen (struct proc_tcptable *tcptable);
56 unsigned long proc_tcp_get_tcp_closing (struct proc_tcptable *tcptable);
57
58 #ifdef __cplusplus
59 }
60 #endif
61
62 #endif /* _TCPINFO_H_ */