summaryrefslogtreecommitdiff
path: root/types
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2020-01-19 23:32:15 +0000
committerDmitry V. Levin <ldv@altlinux.org>2020-01-21 18:02:38 +0000
commit6fd4ec93404c18bb5593a0fd50cb1ca262f8043d (patch)
tree821d3474f3ec6203e7b8dc4bbd1756d129f87128 /types
parent6519a53dc55cb38d1f3bc5ebbd6500f32a6a524d (diff)
downloadstrace-6fd4ec93404c18bb5593a0fd50cb1ca262f8043d.tar.gz
rtnl_link: check all struct rtnl_link_stats* and struct ifla_port_vsi types automatically
Move definitions of struct_rtnl_link_stats* and struct_ifla_port_vsi types to a separate types/ header file. * configure.ac (AC_CHECK_TYPES): Remove struct ifla_bridge_id, struct ifla_port_vsi and struct rtnl_link_stats64. (AC_CHECK_MEMBERS): Remove struct rtnl_link_stats.rx_nohandler and struct rtnl_link_stats64.rx_nohandler. * rtnl_link.c: Include "types/rtnl_link.h". [HAVE_LINUX_IF_LINK_H]: Remove. [HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER, HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER, HAVE_STRUCT_IFLA_PORT_VSI]: Remove static_assert checks. (struct_rtnl_link_stats, struct_rtnl_link_stats64, struct_ifla_port_vsi): Move to ... * types/rtnl_link.h: ... new file. (struct_ifla_bridge_id): New typedef.
Diffstat (limited to 'types')
-rw-r--r--types/rtnl_link.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/types/rtnl_link.h b/types/rtnl_link.h
new file mode 100644
index 000000000..923df0882
--- /dev/null
+++ b/types/rtnl_link.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2019-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_IF_LINK_H
+# define STRACE_TYPES_IF_LINK_H
+
+/*
+ * <linux/rtnetlink.h> used to require other headers be included beforehand,
+ * include "netlink.h" that pulls in all necessary headers.
+ */
+# include "netlink.h"
+
+/*
+ * These types are defined in <linux/if_link.h> nowadays, but that was not
+ * always the case in the past. Fortunately, when these types were moved
+ * out of <linux/rtnetlink.h>, it was changed to include necessary headers
+ * for backwards compatibility.
+ */
+# include <linux/rtnetlink.h>
+
+typedef struct {
+ uint32_t rx_packets;
+ uint32_t tx_packets;
+ uint32_t rx_bytes;
+ uint32_t tx_bytes;
+ uint32_t rx_errors;
+ uint32_t tx_errors;
+ uint32_t rx_dropped;
+ uint32_t tx_dropped;
+ uint32_t multicast;
+ uint32_t collisions;
+ uint32_t rx_length_errors;
+ uint32_t rx_over_errors;
+ uint32_t rx_crc_errors;
+ uint32_t rx_frame_errors;
+ uint32_t rx_fifo_errors;
+ uint32_t rx_missed_errors;
+ uint32_t tx_aborted_errors;
+ uint32_t tx_carrier_errors;
+ uint32_t tx_fifo_errors;
+ uint32_t tx_heartbeat_errors;
+ uint32_t tx_window_errors;
+ uint32_t rx_compressed;
+ uint32_t tx_compressed;
+ uint32_t rx_nohandler; /**< Added by v4.6-rc1~91^2~329^2~2 */
+} struct_rtnl_link_stats;
+
+/** Added by Linux commit v2.6.35-rc1~473^2~759 */
+typedef struct {
+ uint64_t rx_packets;
+ uint64_t tx_packets;
+ uint64_t rx_bytes;
+ uint64_t tx_bytes;
+ uint64_t rx_errors;
+ uint64_t tx_errors;
+ uint64_t rx_dropped;
+ uint64_t tx_dropped;
+ uint64_t multicast;
+ uint64_t collisions;
+ uint64_t rx_length_errors;
+ uint64_t rx_over_errors;
+ uint64_t rx_crc_errors;
+ uint64_t rx_frame_errors;
+ uint64_t rx_fifo_errors;
+ uint64_t rx_missed_errors;
+ uint64_t tx_aborted_errors;
+ uint64_t tx_carrier_errors;
+ uint64_t tx_fifo_errors;
+ uint64_t tx_heartbeat_errors;
+ uint64_t tx_window_errors;
+ uint64_t rx_compressed;
+ uint64_t tx_compressed;
+ uint64_t rx_nohandler; /**< Added by v4.6-rc1~91^2~329^2~2 */
+} struct_rtnl_link_stats64;
+
+/** Added by Linux commit v4.4-rc1~141^2~231^2~18 */
+typedef struct {
+ uint8_t prio[2];
+ uint8_t addr[6];
+} struct_ifla_bridge_id;
+
+/** Added by Linux commit v2.6.35-rc1~473^2~33 */
+typedef struct {
+ uint8_t vsi_mgr_id;
+ uint8_t vsi_type_id[3];
+ uint8_t vsi_type_version;
+ uint8_t pad[3];
+} struct_ifla_port_vsi;
+
+#endif /* !STRACE_TYPES_IF_LINK_H */