Debian Codegraph @

madrisan-nagios-plugins-linux/nagios-plugins-linux/include/netinfo-private.h

raw symbols SCIP
1 // SPDX-License-Identifier: GPL-3.0-or-later
2 /* netinfo-private.h -- a library foe getting network interfaces statistics
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 _NETINFO_PRIVATE_H
18 #define _NETINFO_PRIVATE_H
19
20 #include <regex.h>
21 #include "netinfo.h"
22
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27
28 typedef struct ifstats
29 {
30 unsigned int tx_packets;
31 unsigned int rx_packets;
32 unsigned int tx_bytes;
33 unsigned int rx_bytes;
34 unsigned int tx_errors;
35 unsigned int rx_errors;
36 unsigned int tx_dropped;
37 unsigned int rx_dropped;
38 unsigned int collisions;
39 unsigned int multicast;
40 } ifstats_t;
41
42 typedef struct iflist
43 {
44 char *ifname;
45 uint8_t duplex; /* the duplex as defined in <linux/ethtool.h> */
46 uint32_t speed; /* the link speed in Mbps */
47 unsigned int flags;
48 struct ifstats *stats;
49 struct iflist *next;
50 } iflist_t;
51
52 struct iflist *get_netinfo_snapshot (unsigned int options,
53 const regex_t *iface_regex);
54
55 #ifdef __cplusplus
56 }
57 #endif
58
59 #endif /* _NETINFO_PRIVATE_H */