File: getifstats.h

package info (click to toggle)
miniupnpd 2.3.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,040 kB
  • sloc: ansic: 28,571; sh: 2,024; makefile: 164
file content (34 lines) | stat: -rw-r--r-- 1,099 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* $Id: getifstats.h,v 1.5 2025/04/03 21:11:35 nanard Exp $ */
/* MiniUPnP project
 * (c) 2006-2025 Thomas Bernard
 * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
 * This software is subject to the conditions detailed
 * in the LICENCE file provided within the distribution */

#ifndef GETIFSTATS_H_INCLUDED
#define GETIFSTATS_H_INCLUDED

/*! \file getifstats.h
 * \brief get network interface statistics
 *
 * Must be implemented for each supported system (BSD/Linux/etc.)
 */

struct ifdata {
	unsigned long opackets;	/*!< \brief output packets */
	unsigned long ipackets;	/*!< \brief input packets */
	unsigned long obytes;	/*!< \brief output bytes */
	unsigned long ibytes;	/*!< \brief input bytes */
	unsigned long baudrate;	/*!< \brief bits per seconds */
};

/*! \brief get interface statistics.
 *
 * Fill the ifdata structure with statistics for network interface ifname.
 * \param[in] ifname network interface name
 * \param[out] data statistics
 * \return 0 on success, -1 on bad arguments or any error */
int
getifstats(const char * ifname, struct ifdata * data);

#endif