int ipstats_stat_desc_show_xstats(struct ipstats_stat_show_attrs *attrs,
const struct ipstats_stat_desc *desc);
+#define IPSTATS_STAT_DESC_XSTATS_LEAF(NAME) { \
+ .name = (NAME), \
+ .kind = IPSTATS_STAT_DESC_KIND_LEAF, \
+ .show = &ipstats_stat_desc_show_xstats, \
+ .pack = &ipstats_stat_desc_pack_xstats, \
+ }
+
#ifndef INFINITY_LIFE_TIME
#define INFINITY_LIFE_TIME 0xFFFFFFFFU
#endif
.print_ifla_xstats = bond_print_xstats,
};
-static const struct ipstats_stat_desc ipstats_stat_desc_bond_tmpl_lacp = {
- .name = "802.3ad",
- .kind = IPSTATS_STAT_DESC_KIND_LEAF,
- .show = &ipstats_stat_desc_show_xstats,
- .pack = &ipstats_stat_desc_pack_xstats,
-};
-
static const struct ipstats_stat_desc_xstats
ipstats_stat_desc_xstats_bond_lacp = {
- .desc = ipstats_stat_desc_bond_tmpl_lacp,
+ .desc = IPSTATS_STAT_DESC_XSTATS_LEAF("802.3ad"),
.xstats_at = IFLA_STATS_LINK_XSTATS,
.link_type_at = LINK_XSTATS_TYPE_BOND,
.inner_max = BOND_XSTATS_MAX,
static const struct ipstats_stat_desc_xstats
ipstats_stat_desc_xstats_slave_bond_lacp = {
- .desc = ipstats_stat_desc_bond_tmpl_lacp,
+ .desc = IPSTATS_STAT_DESC_XSTATS_LEAF("802.3ad"),
.xstats_at = IFLA_STATS_LINK_XSTATS_SLAVE,
.link_type_at = LINK_XSTATS_TYPE_BOND,
.inner_max = BOND_XSTATS_MAX,
.print_ifla_xstats = bridge_print_xstats,
};
-static const struct ipstats_stat_desc ipstats_stat_desc_bridge_tmpl_stp = {
- .name = "stp",
- .kind = IPSTATS_STAT_DESC_KIND_LEAF,
- .show = &ipstats_stat_desc_show_xstats,
- .pack = &ipstats_stat_desc_pack_xstats,
-};
-
-static const struct ipstats_stat_desc ipstats_stat_desc_bridge_tmpl_mcast = {
- .name = "mcast",
- .kind = IPSTATS_STAT_DESC_KIND_LEAF,
- .show = &ipstats_stat_desc_show_xstats,
- .pack = &ipstats_stat_desc_pack_xstats,
-};
-
static const struct ipstats_stat_desc_xstats
ipstats_stat_desc_xstats_bridge_stp = {
- .desc = ipstats_stat_desc_bridge_tmpl_stp,
+ .desc = IPSTATS_STAT_DESC_XSTATS_LEAF("stp"),
.xstats_at = IFLA_STATS_LINK_XSTATS,
.link_type_at = LINK_XSTATS_TYPE_BRIDGE,
.inner_max = BRIDGE_XSTATS_MAX,
static const struct ipstats_stat_desc_xstats
ipstats_stat_desc_xstats_bridge_mcast = {
- .desc = ipstats_stat_desc_bridge_tmpl_mcast,
+ .desc = IPSTATS_STAT_DESC_XSTATS_LEAF("mcast"),
.xstats_at = IFLA_STATS_LINK_XSTATS,
.link_type_at = LINK_XSTATS_TYPE_BRIDGE,
.inner_max = BRIDGE_XSTATS_MAX,
static const struct ipstats_stat_desc_xstats
ipstats_stat_desc_xstats_slave_bridge_stp = {
- .desc = ipstats_stat_desc_bridge_tmpl_stp,
+ .desc = IPSTATS_STAT_DESC_XSTATS_LEAF("stp"),
.xstats_at = IFLA_STATS_LINK_XSTATS_SLAVE,
.link_type_at = LINK_XSTATS_TYPE_BRIDGE,
.inner_max = BRIDGE_XSTATS_MAX,
static const struct ipstats_stat_desc_xstats
ipstats_stat_desc_xstats_slave_bridge_mcast = {
- .desc = ipstats_stat_desc_bridge_tmpl_mcast,
+ .desc = IPSTATS_STAT_DESC_XSTATS_LEAF("mcast"),
.xstats_at = IFLA_STATS_LINK_XSTATS_SLAVE,
.link_type_at = LINK_XSTATS_TYPE_BRIDGE,
.inner_max = BRIDGE_XSTATS_MAX,