2 * collectd - src/ethstat.h
3 * Copyright (C) 2011 Cyril Feraudet
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * Cyril Feraudet <cyril at feraudet.com>
23 #define ETHTOOL_BUSINFO_LEN 32
24 #define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
25 #define ETH_GSTRING_LEN 32
26 #define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
27 #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
29 enum ethtool_stringset {
34 typedef unsigned long long u64;
35 typedef unsigned char __u8;
36 typedef unsigned short __u16;
37 typedef unsigned int __u32;
38 typedef unsigned long long __u64;
41 static const char *config_keys[] =
45 static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
47 static char **ifacelist;
48 static int ifacenumber = 0;
49 struct ethtool_drvinfo {
51 char driver[32]; /* driver short name, "tulip", "eepro100" */
52 char version[32]; /* driver version string */
53 char fw_version[32]; /* firmware version string, if applicable */
54 char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
55 /* For PCI devices, use pci_name(pci_dev). */
58 __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
60 __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
61 __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
64 struct ethtool_gstrings {
65 __u32 cmd; /* ETHTOOL_GSTRINGS */
66 __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
67 __u32 len; /* number of strings in the string set */
71 struct ethtool_stats {
72 __u32 cmd; /* ETHTOOL_GSTATS */
73 __u32 n_stats; /* number of u64's being returned */