14#ifndef ZEPHYR_INCLUDE_NET_NET_STATS_H_
15#define ZEPHYR_INCLUDE_NET_NET_STATS_H_
302#if NET_TC_TX_COUNT == 0
303#define NET_TC_TX_STATS_COUNT 1
305#define NET_TC_TX_STATS_COUNT NET_TC_TX_COUNT
308#if NET_TC_RX_COUNT == 0
309#define NET_TC_RX_STATS_COUNT 1
311#define NET_TC_RX_STATS_COUNT NET_TC_RX_COUNT
324#if defined(CONFIG_NET_PKT_TXTIME_STATS_DETAIL)
327 tx_time_detail[NET_PKT_DETAIL_STATS_COUNT];
343#if defined(CONFIG_NET_PKT_RXTIME_STATS_DETAIL)
346 rx_time_detail[NET_PKT_DETAIL_STATS_COUNT];
391#if defined(CONFIG_NET_STATISTICS_IPV6)
396#if defined(CONFIG_NET_STATISTICS_IPV4)
401#if defined(CONFIG_NET_STATISTICS_ICMP)
406#if defined(CONFIG_NET_STATISTICS_TCP)
411#if defined(CONFIG_NET_STATISTICS_UDP)
416#if defined(CONFIG_NET_STATISTICS_IPV6_ND)
421#if defined(CONFIG_NET_STATISTICS_IPV6_PMTU)
426#if defined(CONFIG_NET_STATISTICS_IPV4_PMTU)
431#if defined(CONFIG_NET_STATISTICS_MLD)
436#if defined(CONFIG_NET_STATISTICS_IGMP)
441#if defined(CONFIG_NET_STATISTICS_DNS)
451#if defined(CONFIG_NET_PKT_TXTIME_STATS)
456#if defined(CONFIG_NET_PKT_RXTIME_STATS)
461#if defined(CONFIG_NET_PKT_TXTIME_STATS_DETAIL)
465#if defined(CONFIG_NET_PKT_RXTIME_STATS_DETAIL)
470#if defined(CONFIG_NET_STATISTICS_POWER_MANAGEMENT)
580#ifdef CONFIG_NET_STATISTICS_ETHERNET_VENDOR
584struct net_stats_eth_vendor {
585 const char *
const key;
636#ifdef CONFIG_NET_STATISTICS_ETHERNET_VENDOR
638 struct net_stats_eth_vendor *vendor;
699#if defined(CONFIG_NET_STATISTICS_USER_API)
704#define _NET_STATS_LAYER NET_MGMT_LAYER_L3
705#define _NET_STATS_CODE 0x101
706#define _NET_STATS_BASE (NET_MGMT_LAYER(_NET_STATS_LAYER) | \
707 NET_MGMT_LAYER_CODE(_NET_STATS_CODE))
709enum net_request_stats_cmd {
710 NET_REQUEST_STATS_CMD_GET_ALL = 1,
711 NET_REQUEST_STATS_CMD_GET_PROCESSING_ERROR,
712 NET_REQUEST_STATS_CMD_GET_BYTES,
713 NET_REQUEST_STATS_CMD_GET_IP_ERRORS,
714 NET_REQUEST_STATS_CMD_GET_IPV4,
715 NET_REQUEST_STATS_CMD_GET_IPV6,
716 NET_REQUEST_STATS_CMD_GET_IPV6_ND,
717 NET_REQUEST_STATS_CMD_GET_IPV6_PMTU,
718 NET_REQUEST_STATS_CMD_GET_IPV4_PMTU,
719 NET_REQUEST_STATS_CMD_GET_ICMP,
720 NET_REQUEST_STATS_CMD_GET_UDP,
721 NET_REQUEST_STATS_CMD_GET_TCP,
722 NET_REQUEST_STATS_CMD_GET_ETHERNET,
723 NET_REQUEST_STATS_CMD_GET_PPP,
724 NET_REQUEST_STATS_CMD_GET_PM,
725 NET_REQUEST_STATS_CMD_GET_WIFI,
726 NET_REQUEST_STATS_CMD_RESET_WIFI,
727 NET_REQUEST_STATS_CMD_GET_VPN,
733#define NET_REQUEST_STATS_GET_ALL \
734 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_ALL)
737#define NET_REQUEST_STATS_GET_PROCESSING_ERROR \
738 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_PROCESSING_ERROR)
741#define NET_REQUEST_STATS_GET_BYTES \
742 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_BYTES)
745#define NET_REQUEST_STATS_GET_IP_ERRORS \
746 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_IP_ERRORS)
757#if defined(CONFIG_NET_STATISTICS_IPV4)
759#define NET_REQUEST_STATS_GET_IPV4 \
760 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_IPV4)
767#if defined(CONFIG_NET_STATISTICS_IPV6)
769#define NET_REQUEST_STATS_GET_IPV6 \
770 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_IPV6)
777#if defined(CONFIG_NET_STATISTICS_IPV6_ND)
779#define NET_REQUEST_STATS_GET_IPV6_ND \
780 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_IPV6_ND)
787#if defined(CONFIG_NET_STATISTICS_IPV6_PMTU)
789#define NET_REQUEST_STATS_GET_IPV6_PMTU \
790 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_IPV6_PMTU)
797#if defined(CONFIG_NET_STATISTICS_IPV4_PMTU)
799#define NET_REQUEST_STATS_GET_IPV4_PMTU \
800 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_IPV4_PMTU)
807#if defined(CONFIG_NET_STATISTICS_ICMP)
809#define NET_REQUEST_STATS_GET_ICMP \
810 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_ICMP)
817#if defined(CONFIG_NET_STATISTICS_UDP)
819#define NET_REQUEST_STATS_GET_UDP \
820 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_UDP)
827#if defined(CONFIG_NET_STATISTICS_TCP)
829#define NET_REQUEST_STATS_GET_TCP \
830 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_TCP)
837#if defined(CONFIG_NET_STATISTICS_ETHERNET)
839#define NET_REQUEST_STATS_GET_ETHERNET \
840 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_ETHERNET)
847#if defined(CONFIG_NET_STATISTICS_PPP)
849#define NET_REQUEST_STATS_GET_PPP \
850 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_PPP)
857#if defined(CONFIG_NET_STATISTICS_VPN)
859#define NET_REQUEST_STATS_GET_VPN \
860 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_VPN)
869#if defined(CONFIG_NET_STATISTICS_POWER_MANAGEMENT)
871#define NET_REQUEST_STATS_GET_PM \
872 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_PM)
879#if defined(CONFIG_NET_STATISTICS_WIFI)
881#define NET_REQUEST_STATS_GET_WIFI \
882 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_GET_WIFI)
889#define NET_REQUEST_STATS_RESET_WIFI \
890 (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_RESET_WIFI)
897#define NET_STATS_GET_METRIC_NAME(_name) _name
898#define NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx) net_stats_##dev_id##_##sfx##_collector
899#define NET_STATS_GET_VAR(dev_id, sfx, var) zephyr_net_##var
900#define NET_STATS_GET_INSTANCE(dev_id, sfx, _not_used) STRINGIFY(_##dev_id##_##sfx)
907#define NET_STATS_PROMETHEUS_COUNTER_DEFINE(_desc, _labelval, _not_used, \
908 _collector, _name, _stat_var_ptr) \
909 static PROMETHEUS_COUNTER_DEFINE( \
910 NET_STATS_GET_METRIC_NAME(_name), \
911 _desc, ({ .key = "nic", .value = &_labelval[1] }), \
912 &(_collector), _stat_var_ptr)
914#define NET_STATS_PROMETHEUS_GAUGE_DEFINE(_desc, _labelval, _not_used, \
915 _collector, _name, _stat_var_ptr) \
916 static PROMETHEUS_GAUGE_DEFINE( \
917 NET_STATS_GET_METRIC_NAME(_name), \
918 _desc, ({ .key = "nic", .value = &_labelval[1] }), \
919 &(_collector), _stat_var_ptr)
921#define NET_STATS_PROMETHEUS_SUMMARY_DEFINE(_desc, _labelval, _not_used, \
922 _collector, _name, _stat_var_ptr) \
923 static PROMETHEUS_SUMMARY_DEFINE( \
924 NET_STATS_GET_METRIC_NAME(_name), \
925 _desc, ({ .key = "nic", .value = &_labelval[1] }), \
926 &(_collector), _stat_var_ptr)
928#define NET_STATS_PROMETHEUS_HISTOGRAM_DEFINE(_desc, _labelval, _not_used, \
929 _collector, _name, _stat_var_ptr) \
930 static PROMETHEUS_HISTOGRAM_DEFINE( \
931 NET_STATS_GET_METRIC_NAME(_name), \
932 _desc, ({ .key = "nic", .value = &_labelval[1] }), \
933 &(_collector), _stat_var_ptr)
936#if defined(CONFIG_NET_STATISTICS_IPV6)
937#define NET_STATS_PROMETHEUS_IPV6(iface, dev_id, sfx) \
938 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
939 "IPv6 packets sent", \
940 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv6_sent), \
942 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
943 NET_STATS_GET_VAR(dev_id, sfx, ipv6_sent), \
944 &(iface)->stats.ipv6.sent); \
945 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
946 "IPv6 packets received", \
947 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv6_recv), \
949 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
950 NET_STATS_GET_VAR(dev_id, sfx, ipv6_recv), \
951 &(iface)->stats.ipv6.recv); \
952 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
953 "IPv6 packets dropped", \
954 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv6_drop), \
956 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
957 NET_STATS_GET_VAR(dev_id, sfx, ipv6_drop), \
958 &(iface)->stats.ipv6.drop); \
959 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
960 "IPv6 packets forwarded", \
961 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv6_forward), \
963 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
964 NET_STATS_GET_VAR(dev_id, sfx, ipv6_forwarded), \
965 &(iface)->stats.ipv6.forwarded)
967#define NET_STATS_PROMETHEUS_IPV6(iface, dev_id, sfx)
971#if defined(CONFIG_NET_STATISTICS_IPV4)
972#define NET_STATS_PROMETHEUS_IPV4(iface, dev_id, sfx) \
973 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
974 "IPv4 packets sent", \
975 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv4_sent), \
977 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
978 NET_STATS_GET_VAR(dev_id, sfx, ipv4_sent), \
979 &(iface)->stats.ipv4.sent); \
980 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
981 "IPv4 packets received", \
982 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv4_recv), \
984 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
985 NET_STATS_GET_VAR(dev_id, sfx, ipv4_recv), \
986 &(iface)->stats.ipv4.recv); \
987 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
988 "IPv4 packets dropped", \
989 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv4_drop), \
991 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
992 NET_STATS_GET_VAR(dev_id, sfx, ipv4_drop), \
993 &(iface)->stats.ipv4.drop); \
994 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
995 "IPv4 packets forwarded", \
996 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv4_forwarded), \
998 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
999 NET_STATS_GET_VAR(dev_id, sfx, ipv4_forwarded), \
1000 &(iface)->stats.ipv4.forwarded)
1002#define NET_STATS_PROMETHEUS_IPV4(iface, dev_id, sfx)
1006#if defined(CONFIG_NET_STATISTICS_ICMP)
1007#define NET_STATS_PROMETHEUS_ICMP(iface, dev_id, sfx) \
1008 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1009 "ICMP packets sent", \
1010 NET_STATS_GET_INSTANCE(dev_id, sfx, icmp_sent), \
1012 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1013 NET_STATS_GET_VAR(dev_id, sfx, icmp_sent), \
1014 &(iface)->stats.icmp.sent); \
1015 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1016 "ICMP packets received", \
1017 NET_STATS_GET_INSTANCE(dev_id, sfx, icmp_recv), \
1019 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1020 NET_STATS_GET_VAR(dev_id, sfx, icmp_recv), \
1021 &(iface)->stats.icmp.recv); \
1022 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1023 "ICMP packets dropped", \
1024 NET_STATS_GET_INSTANCE(dev_id, sfx, icmp_drop), \
1026 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1027 NET_STATS_GET_VAR(dev_id, sfx, icmp_drop), \
1028 &(iface)->stats.icmp.drop); \
1029 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1030 "ICMP packets checksum error", \
1031 NET_STATS_GET_INSTANCE(dev_id, sfx, icmp_chkerr), \
1033 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1034 NET_STATS_GET_VAR(dev_id, sfx, icmp_chkerr), \
1035 &(iface)->stats.icmp.chkerr); \
1036 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1037 "ICMP packets type error", \
1038 NET_STATS_GET_INSTANCE(dev_id, sfx, icmp_typeerr), \
1040 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1041 NET_STATS_GET_VAR(dev_id, sfx, icmp_typeerr), \
1042 &(iface)->stats.icmp.typeerr)
1044#define NET_STATS_PROMETHEUS_ICMP(iface, dev_id, sfx)
1048#if defined(CONFIG_NET_STATISTICS_UDP)
1049#define NET_STATS_PROMETHEUS_UDP(iface, dev_id, sfx) \
1050 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1051 "UDP packets sent", \
1052 NET_STATS_GET_INSTANCE(dev_id, sfx, udp_sent), \
1054 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1055 NET_STATS_GET_VAR(dev_id, sfx, udp_sent), \
1056 &(iface)->stats.udp.sent); \
1057 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1058 "UDP packets received", \
1059 NET_STATS_GET_INSTANCE(dev_id, sfx, udp_recv), \
1061 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1062 NET_STATS_GET_VAR(dev_id, sfx, udp_recv), \
1063 &(iface)->stats.udp.recv); \
1064 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1065 "UDP packets dropped", \
1066 NET_STATS_GET_INSTANCE(dev_id, sfx, udp_drop), \
1068 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1069 NET_STATS_GET_VAR(dev_id, sfx, udp_drop), \
1070 &(iface)->stats.udp.drop); \
1071 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1072 "UDP packets checksum error", \
1073 NET_STATS_GET_INSTANCE(dev_id, sfx, udp_chkerr), \
1075 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1076 NET_STATS_GET_VAR(dev_id, sfx, udp_chkerr), \
1077 &(iface)->stats.udp.chkerr)
1079#define NET_STATS_PROMETHEUS_UDP(iface, dev_id, sfx)
1083#if defined(CONFIG_NET_STATISTICS_TCP)
1084#define NET_STATS_PROMETHEUS_TCP(iface, dev_id, sfx) \
1085 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1087 NET_STATS_GET_INSTANCE(dev_id, sfx, tcp_bytes_sent), \
1089 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1090 NET_STATS_GET_VAR(dev_id, sfx, tcp_bytes_sent), \
1091 &(iface)->stats.tcp.bytes.sent); \
1092 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1093 "TCP bytes received", \
1094 NET_STATS_GET_INSTANCE(dev_id, sfx, tcp_bytes_recv), \
1096 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1097 NET_STATS_GET_VAR(dev_id, sfx, tcp_bytes_recv), \
1098 &(iface)->stats.tcp.bytes.received); \
1099 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1100 "TCP bytes resent", \
1101 NET_STATS_GET_INSTANCE(dev_id, sfx, tcp_bytes_resent), \
1103 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1104 NET_STATS_GET_VAR(dev_id, sfx, tcp_bytes_resent), \
1105 &(iface)->stats.tcp.resent); \
1106 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1107 "TCP packets sent", \
1108 NET_STATS_GET_INSTANCE(dev_id, sfx, tcp_sent), \
1110 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1111 NET_STATS_GET_VAR(dev_id, sfx, tcp_sent), \
1112 &(iface)->stats.tcp.sent); \
1113 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1114 "TCP packets received", \
1115 NET_STATS_GET_INSTANCE(dev_id, sfx, tcp_recv), \
1117 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1118 NET_STATS_GET_VAR(dev_id, sfx, tcp_recv), \
1119 &(iface)->stats.tcp.recv); \
1120 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1121 "TCP packets dropped", \
1122 NET_STATS_GET_INSTANCE(dev_id, sfx, tcp_drop), \
1124 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1125 NET_STATS_GET_VAR(dev_id, sfx, tcp_drop), \
1126 &(iface)->stats.tcp.drop); \
1127 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1128 "TCP packets checksum error", \
1129 NET_STATS_GET_INSTANCE(dev_id, sfx, tcp_chkerr), \
1131 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1132 NET_STATS_GET_VAR(dev_id, sfx, tcp_chkerr), \
1133 &(iface)->stats.tcp.chkerr); \
1134 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1135 "TCP packets ack error", \
1136 NET_STATS_GET_INSTANCE(dev_id, sfx, tcp_ackerr), \
1138 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1139 NET_STATS_GET_VAR(dev_id, sfx, tcp_ackerr), \
1140 &(iface)->stats.tcp.ackerr); \
1141 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1142 "TCP packets reset error", \
1143 NET_STATS_GET_INSTANCE(dev_id, sfx, tcp_rsterr), \
1145 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1146 NET_STATS_GET_VAR(dev_id, sfx, tcp_rsterr), \
1147 &(iface)->stats.tcp.rsterr); \
1148 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1149 "TCP packets retransmitted", \
1150 NET_STATS_GET_INSTANCE(dev_id, sfx, tcp_rexmit), \
1152 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1153 NET_STATS_GET_VAR(dev_id, sfx, tcp_rexmit), \
1154 &(iface)->stats.tcp.rexmit); \
1155 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1156 "TCP reset received", \
1157 NET_STATS_GET_INSTANCE(dev_id, sfx, tcp_rst_recv), \
1159 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1160 NET_STATS_GET_VAR(dev_id, sfx, tcp_rst), \
1161 &(iface)->stats.tcp.rst); \
1162 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1163 "TCP connection drop", \
1164 NET_STATS_GET_INSTANCE(dev_id, sfx, tcp_conndrop), \
1166 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1167 NET_STATS_GET_VAR(dev_id, sfx, tcp_conndrop), \
1168 &(iface)->stats.tcp.conndrop); \
1169 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1170 "TCP connection reset", \
1171 NET_STATS_GET_INSTANCE(dev_id, sfx, tcp_connrst), \
1173 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1174 NET_STATS_GET_VAR(dev_id, sfx, tcp_connrst), \
1175 &(iface)->stats.tcp.connrst)
1177#define NET_STATS_PROMETHEUS_TCP(iface, dev_id, sfx)
1181#if defined(CONFIG_NET_STATISTICS_IPV6_ND)
1182#define NET_STATS_PROMETHEUS_IPV6_ND(iface, dev_id, sfx) \
1183 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1184 "IPv6 ND packets sent", \
1185 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv6_nd_sent), \
1187 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1188 NET_STATS_GET_VAR(dev_id, sfx, ipv6_nd_sent), \
1189 &(iface)->stats.ipv6_nd.sent); \
1190 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1191 "IPv6 ND packets received", \
1192 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv6_nd_recv), \
1194 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1195 NET_STATS_GET_VAR(dev_id, sfx, ipv6_nd_recv), \
1196 &(iface)->stats.ipv6_nd.recv); \
1197 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1198 "IPv6 ND packets dropped", \
1199 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv6_nd_drop), \
1201 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1202 NET_STATS_GET_VAR(dev_id, sfx, ipv6_nd_drop), \
1203 &(iface)->stats.ipv6_nd.drop)
1205#define NET_STATS_PROMETHEUS_IPV6_ND(iface, dev_id, sfx)
1209#if defined(CONFIG_NET_STATISTICS_IPV6_PMTU)
1210#define NET_STATS_PROMETHEUS_IPV6_PMTU(iface, dev_id, sfx) \
1211 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1212 "IPv6 PMTU packets sent", \
1213 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv6_pmtu_sent), \
1215 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1216 NET_STATS_GET_VAR(dev_id, sfx, ipv6_pmtu_sent), \
1217 &(iface)->stats.ipv6_pmtu.sent); \
1218 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1219 "IPv6 PMTU packets received", \
1220 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv6_pmtu_recv), \
1222 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1223 NET_STATS_GET_VAR(dev_id, sfx, ipv6_pmtu_recv), \
1224 &(iface)->stats.ipv6_pmtu.recv); \
1225 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1226 "IPv6 PMTU packets dropped", \
1227 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv6_pmtu_drop), \
1229 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1230 NET_STATS_GET_VAR(dev_id, sfx, ipv6_pmtu_drop), \
1231 &(iface)->stats.ipv6_pmtu.drop)
1233#define NET_STATS_PROMETHEUS_IPV6_PMTU(iface, dev_id, sfx)
1237#if defined(CONFIG_NET_STATISTICS_IPV4_PMTU)
1238#define NET_STATS_PROMETHEUS_IPV4_PMTU(iface, dev_id, sfx) \
1239 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1240 "IPv4 PMTU packets sent", \
1241 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv4_pmtu_sent), \
1243 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1244 NET_STATS_GET_VAR(dev_id, sfx, ipv4_pmtu_sent), \
1245 &(iface)->stats.ipv4_pmtu.sent); \
1246 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1247 "IPv4 PMTU packets received", \
1248 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv4_pmtu_recv), \
1250 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1251 NET_STATS_GET_VAR(dev_id, sfx, ipv4_pmtu_recv), \
1252 &(iface)->stats.ipv4_pmtu.recv); \
1253 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1254 "IPv4 PMTU packets dropped", \
1255 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv4_pmtu_drop), \
1257 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1258 NET_STATS_GET_VAR(dev_id, sfx, ipv4_pmtu_drop), \
1259 &(iface)->stats.ipv4_pmtu.drop)
1261#define NET_STATS_PROMETHEUS_IPV4_PMTU(iface, dev_id, sfx)
1265#if defined(CONFIG_NET_STATISTICS_MLD)
1266#define NET_STATS_PROMETHEUS_MLD(iface, dev_id, sfx) \
1267 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1268 "IPv6 MLD packets sent", \
1269 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv6_mld_sent), \
1271 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1272 NET_STATS_GET_VAR(dev_id, sfx, ipv6_mld_sent), \
1273 &(iface)->stats.ipv6_mld.sent); \
1274 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1275 "IPv6 MLD packets received", \
1276 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv6_mld_recv), \
1278 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1279 NET_STATS_GET_VAR(dev_id, sfx, ipv6_mld_recv), \
1280 &(iface)->stats.ipv6_mld.recv); \
1281 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1282 "IPv6 MLD packets dropped", \
1283 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv6_mld_drop), \
1285 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1286 NET_STATS_GET_VAR(dev_id, sfx, ipv6_mld_drop), \
1287 &(iface)->stats.ipv6_mld.drop)
1289#define NET_STATS_PROMETHEUS_MLD(iface, dev_id, sfx)
1293#if defined(CONFIG_NET_STATISTICS_IGMP)
1294#define NET_STATS_PROMETHEUS_IGMP(iface, dev_id, sfx) \
1295 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1296 "IPv4 IGMP packets sent", \
1297 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv4_igmp_sent), \
1299 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1300 NET_STATS_GET_VAR(dev_id, sfx, ipv4_igmp_sent), \
1301 &(iface)->stats.ipv4_igmp.sent); \
1302 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1303 "IPv4 IGMP packets received", \
1304 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv4_igmp_recv), \
1306 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1307 NET_STATS_GET_VAR(dev_id, sfx, ipv4_igmp_recv), \
1308 &(iface)->stats.ipv4_igmp.recv); \
1309 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1310 "IPv4 IGMP packets dropped", \
1311 NET_STATS_GET_INSTANCE(dev_id, sfx, ipv4_igmp_drop), \
1313 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1314 NET_STATS_GET_VAR(dev_id, sfx, ipv4_igmp_drop), \
1315 &(iface)->stats.ipv4_igmp.drop)
1317#define NET_STATS_PROMETHEUS_IGMP(iface, dev_id, sfx)
1321#if defined(CONFIG_NET_STATISTICS_DNS)
1322#define NET_STATS_PROMETHEUS_DNS(iface, dev_id, sfx) \
1323 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1324 "DNS packets sent", \
1325 NET_STATS_GET_INSTANCE(dev_id, sfx, dns_sent), \
1327 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1328 NET_STATS_GET_VAR(dev_id, sfx, dns_sent), \
1329 &(iface)->stats.dns.sent); \
1330 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1331 "DNS packets received", \
1332 NET_STATS_GET_INSTANCE(dev_id, sfx, dns_recv), \
1334 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1335 NET_STATS_GET_VAR(dev_id, sfx, dns_recv), \
1336 &(iface)->stats.dns.recv); \
1337 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1338 "DNS packets dropped", \
1339 NET_STATS_GET_INSTANCE(dev_id, sfx, dns_drop), \
1341 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1342 NET_STATS_GET_VAR(dev_id, sfx, dns_drop), \
1343 &(iface)->stats.dns.drop)
1345#define NET_STATS_PROMETHEUS_DNS(iface, dev_id, sfx)
1349#if defined(CONFIG_NET_PKT_TXTIME_STATS)
1350#define NET_STATS_PROMETHEUS_TX_TIME(iface, dev_id, sfx) \
1351 NET_STATS_PROMETHEUS_SUMMARY_DEFINE( \
1352 "TX time in microseconds", \
1353 NET_STATS_GET_INSTANCE(dev_id, sfx, tx_time), \
1355 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1356 NET_STATS_GET_VAR(dev_id, sfx, tx_time), \
1357 &(iface)->stats.tx_time)
1359#define NET_STATS_PROMETHEUS_TX_TIME(iface, dev_id, sfx)
1363#if defined(CONFIG_NET_PKT_RXTIME_STATS)
1364#define NET_STATS_PROMETHEUS_RX_TIME(iface, dev_id, sfx) \
1365 NET_STATS_PROMETHEUS_SUMMARY_DEFINE( \
1366 "RX time in microseconds", \
1367 NET_STATS_GET_INSTANCE(dev_id, sfx, rx_time), \
1369 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1370 NET_STATS_GET_VAR(dev_id, sfx, rx_time), \
1371 &(iface)->stats.rx_time)
1373#define NET_STATS_PROMETHEUS_RX_TIME(iface, dev_id, sfx)
1377#define NET_STATS_PROMETHEUS(iface, dev_id, sfx) \
1378 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1379 "Processing error", \
1380 NET_STATS_GET_INSTANCE(dev_id, sfx, process_error), \
1382 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1383 NET_STATS_GET_VAR(dev_id, sfx, processing_error), \
1384 &(iface)->stats.processing_error); \
1386 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1388 NET_STATS_GET_INSTANCE(dev_id, sfx, ip_proto_error), \
1390 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1391 NET_STATS_GET_VAR(dev_id, sfx, ip_errors_protoerr), \
1392 &(iface)->stats.ip_errors.protoerr); \
1393 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1394 "IP version/header len error", \
1395 NET_STATS_GET_INSTANCE(dev_id, sfx, ip_vhl_error), \
1397 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1398 NET_STATS_GET_VAR(dev_id, sfx, ip_errors_vhlerr), \
1399 &(iface)->stats.ip_errors.vhlerr); \
1400 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1401 "IP header len error (high byte)", \
1402 NET_STATS_GET_INSTANCE(dev_id, sfx, ip_hblen_error), \
1404 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1405 NET_STATS_GET_VAR(dev_id, sfx, ip_errors_hblenerr), \
1406 &(iface)->stats.ip_errors.hblenerr); \
1407 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1408 "IP header len error (low byte)", \
1409 NET_STATS_GET_INSTANCE(dev_id, sfx, ip_lblen_error), \
1411 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1412 NET_STATS_GET_VAR(dev_id, sfx, ip_errors_lblenerr), \
1413 &(iface)->stats.ip_errors.lblenerr); \
1414 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1415 "IP fragment error", \
1416 NET_STATS_GET_INSTANCE(dev_id, sfx, ip_frag_error), \
1418 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1419 NET_STATS_GET_VAR(dev_id, sfx, ip_errors_fragerr), \
1420 &(iface)->stats.ip_errors.fragerr); \
1421 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1422 "IP checksum error", \
1423 NET_STATS_GET_INSTANCE(dev_id, sfx, ip_chk_error), \
1425 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1426 NET_STATS_GET_VAR(dev_id, sfx, ip_errors_chkerr), \
1427 &(iface)->stats.ip_errors.chkerr); \
1429 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1431 NET_STATS_GET_INSTANCE(dev_id, sfx, bytes_recv), \
1433 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1434 NET_STATS_GET_VAR(dev_id, sfx, bytes_recv), \
1435 &(iface)->stats.bytes.received); \
1436 NET_STATS_PROMETHEUS_COUNTER_DEFINE( \
1438 NET_STATS_GET_INSTANCE(dev_id, sfx, bytes_sent), \
1440 NET_STATS_GET_COLLECTOR_NAME(dev_id, sfx), \
1441 NET_STATS_GET_VAR(dev_id, sfx, bytes_sent), \
1442 &(iface)->stats.bytes.sent); \
1443 NET_STATS_PROMETHEUS_IPV6(iface, dev_id, sfx); \
1444 NET_STATS_PROMETHEUS_IPV4(iface, dev_id, sfx); \
1445 NET_STATS_PROMETHEUS_ICMP(iface, dev_id, sfx); \
1446 NET_STATS_PROMETHEUS_UDP(iface, dev_id, sfx); \
1447 NET_STATS_PROMETHEUS_TCP(iface, dev_id, sfx); \
1448 NET_STATS_PROMETHEUS_IPV6_ND(iface, dev_id, sfx); \
1449 NET_STATS_PROMETHEUS_IPV6_PMTU(iface, dev_id, sfx); \
1450 NET_STATS_PROMETHEUS_IPV4_PMTU(iface, dev_id, sfx); \
1451 NET_STATS_PROMETHEUS_MLD(iface, dev_id, sfx); \
1452 NET_STATS_PROMETHEUS_IGMP(iface, dev_id, sfx); \
1453 NET_STATS_PROMETHEUS_DNS(iface, dev_id, sfx); \
1454 NET_STATS_PROMETHEUS_TX_TIME(iface, dev_id, sfx); \
1455 NET_STATS_PROMETHEUS_RX_TIME(iface, dev_id, sfx)
1377#define NET_STATS_PROMETHEUS(iface, dev_id, sfx) \ …
Prometheus collector APIs.
#define NET_MGMT_DEFINE_REQUEST_HANDLER(_mgmt_request)
Declare a request handler function for the given network event.
Definition net_mgmt.h:111
uint32_t net_stats_t
Network statistics counter.
Definition net_stats.h:45
Prometheus histogram APIs.
Prometheus metric interface.
Network core definitions.
Network Management API public header.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Number of bytes sent and received.
Definition net_stats.h:50
net_stats_t sent
Number of bytes sent.
Definition net_stats.h:52
net_stats_t received
Number of bytes received.
Definition net_stats.h:54
DNS statistics.
Definition net_stats.h:267
net_stats_t drop
Number of dropped DNS packets.
Definition net_stats.h:275
net_stats_t recv
Number of received DNS queries.
Definition net_stats.h:269
net_stats_t sent
Number of sent DNS responses.
Definition net_stats.h:272
Ethernet checksum statistics.
Definition net_stats.h:558
net_stats_t rx_csum_offload_good
Number of good RX checksum offloading.
Definition net_stats.h:560
net_stats_t rx_csum_offload_errors
Number of failed RX checksum offloading.
Definition net_stats.h:563
Ethernet error statistics.
Definition net_stats.h:479
net_stats_t tx_carrier_errors
Number of TX carrier errors.
Definition net_stats.h:517
net_stats_t uncorr_ecc_errors
Number of uncorrected ECC errors.
Definition net_stats.h:532
net_stats_t rx_long_length_errors
Number of RX long length errors.
Definition net_stats.h:499
net_stats_t tx_window_errors
Number of TX window errors.
Definition net_stats.h:526
net_stats_t corr_ecc_errors
Number of corrected ECC errors.
Definition net_stats.h:535
net_stats_t rx_missed_errors
Number of RX missed errors.
Definition net_stats.h:496
net_stats_t rx_crc_errors
Number of RX CRC errors.
Definition net_stats.h:487
net_stats_t rx_short_length_errors
Number of RX short length errors.
Definition net_stats.h:502
net_stats_t rx_align_errors
Number of RX buffer align errors.
Definition net_stats.h:505
net_stats_t rx_dma_failed
Number of RX DMA failed errors.
Definition net_stats.h:508
net_stats_t rx_no_buffer_count
Number of RX net_pkt allocation errors.
Definition net_stats.h:493
net_stats_t tx_fifo_errors
Number of TX FIFO errors.
Definition net_stats.h:520
net_stats_t rx_frame_errors
Number of RX frame errors.
Definition net_stats.h:490
net_stats_t rx_over_errors
Number of RX overrun errors.
Definition net_stats.h:484
net_stats_t tx_dma_failed
Number of TX DMA failed errors.
Definition net_stats.h:529
net_stats_t rx_length_errors
Number of RX length errors.
Definition net_stats.h:481
net_stats_t rx_buf_alloc_failed
Number of RX net_buf allocation errors.
Definition net_stats.h:511
net_stats_t tx_heartbeat_errors
Number of TX heartbeat errors.
Definition net_stats.h:523
net_stats_t tx_aborted_errors
Number of TX aborted errors.
Definition net_stats.h:514
Ethernet flow control statistics.
Definition net_stats.h:541
net_stats_t rx_flow_control_xon
Number of RX XON flow control.
Definition net_stats.h:543
net_stats_t tx_flow_control_xon
Number of TX XON flow control.
Definition net_stats.h:549
net_stats_t rx_flow_control_xoff
Number of RX XOFF flow control.
Definition net_stats.h:546
net_stats_t tx_flow_control_xoff
Number of TX XOFF flow control.
Definition net_stats.h:552
Ethernet hardware timestamp statistics.
Definition net_stats.h:569
net_stats_t tx_hwtstamp_timeouts
Number of RX hardware timestamp timeout.
Definition net_stats.h:574
net_stats_t rx_hwtstamp_cleared
Number of RX hardware timestamp cleared.
Definition net_stats.h:571
net_stats_t tx_hwtstamp_skipped
Number of RX hardware timestamp skipped.
Definition net_stats.h:577
All Ethernet specific statistics.
Definition net_stats.h:593
struct net_stats_pkts broadcast
Total number of broadcast packets received and sent.
Definition net_stats.h:601
struct net_stats_eth_csum csum
Total number of checksum errors in RX and TX.
Definition net_stats.h:616
net_stats_t tx_dropped
Total number of dropped TX packets.
Definition net_stats.h:625
struct net_stats_eth_hw_timestamp hw_timestamp
Total number of hardware timestamp errors in RX and TX.
Definition net_stats.h:619
struct net_stats_pkts multicast
Total number of multicast packets received and sent.
Definition net_stats.h:604
struct net_stats_eth_flow flow_control
Total number of flow control errors in RX and TX.
Definition net_stats.h:613
net_stats_t tx_restart_queue
Total number of TX queue restarts.
Definition net_stats.h:631
net_stats_t collisions
Total number of collisions.
Definition net_stats.h:622
struct net_stats_bytes bytes
Total number of bytes received and sent.
Definition net_stats.h:595
struct net_stats_eth_errors error_details
Total number of errors in RX and TX.
Definition net_stats.h:610
struct net_stats_pkts pkts
Total number of packets received and sent.
Definition net_stats.h:598
struct net_stats_pkts errors
Total number of errors in RX and TX.
Definition net_stats.h:607
net_stats_t tx_timeout_count
Total number of TX timeout errors.
Definition net_stats.h:628
net_stats_t unknown_protocol
Total number of RX unknown protocol packets.
Definition net_stats.h:634
ICMP statistics.
Definition net_stats.h:114
net_stats_t sent
Number of sent ICMP packets.
Definition net_stats.h:119
net_stats_t chkerr
Number of ICMP packets with a bad checksum.
Definition net_stats.h:128
net_stats_t drop
Number of dropped ICMP packets.
Definition net_stats.h:122
net_stats_t typeerr
Number of ICMP packets with a wrong type.
Definition net_stats.h:125
net_stats_t recv
Number of received ICMP packets.
Definition net_stats.h:116
IP layer error statistics.
Definition net_stats.h:87
net_stats_t hblenerr
Number of packets dropped due to wrong IP length, high byte.
Definition net_stats.h:94
net_stats_t vhlerr
Number of packets dropped due to wrong IP version or header length.
Definition net_stats.h:91
net_stats_t chkerr
Number of packets dropped due to IP checksum errors.
Definition net_stats.h:103
net_stats_t protoerr
Number of packets dropped because they were neither ICMP, UDP nor TCP.
Definition net_stats.h:108
net_stats_t lblenerr
Number of packets dropped due to wrong IP length, low byte.
Definition net_stats.h:97
net_stats_t fragerr
Number of packets dropped because they were IP fragments.
Definition net_stats.h:100
IP layer statistics.
Definition net_stats.h:70
net_stats_t forwarded
Number of forwarded packets at the IP layer.
Definition net_stats.h:78
net_stats_t recv
Number of received packets at the IP layer.
Definition net_stats.h:72
net_stats_t sent
Number of sent packets at the IP layer.
Definition net_stats.h:75
net_stats_t drop
Number of dropped packets at the IP layer.
Definition net_stats.h:81
IPv4 IGMP daemon statistics.
Definition net_stats.h:253
net_stats_t drop
Number of dropped IPv4 IGMP packets.
Definition net_stats.h:261
net_stats_t recv
Number of received IPv4 IGMP queries.
Definition net_stats.h:255
net_stats_t sent
Number of sent IPv4 IGMP reports.
Definition net_stats.h:258
IPv4 Path MTU Discovery statistics.
Definition net_stats.h:225
net_stats_t sent
Number of sent IPv4 PMTU packets.
Definition net_stats.h:233
net_stats_t recv
Number of received IPv4 PMTU packets.
Definition net_stats.h:230
net_stats_t drop
Number of dropped IPv4 PMTU packets.
Definition net_stats.h:227
IPv6 multicast listener daemon statistics.
Definition net_stats.h:239
net_stats_t recv
Number of received IPv6 MLD queries.
Definition net_stats.h:241
net_stats_t sent
Number of sent IPv6 MLD reports.
Definition net_stats.h:244
net_stats_t drop
Number of dropped IPv6 MLD packets.
Definition net_stats.h:247
IPv6 neighbor discovery statistics.
Definition net_stats.h:197
net_stats_t sent
Number of sent IPv6 neighbor discovery packets.
Definition net_stats.h:205
net_stats_t recv
Number of received IPv6 neighbor discovery packets.
Definition net_stats.h:202
net_stats_t drop
Number of dropped IPv6 neighbor discovery packets.
Definition net_stats.h:199
IPv6 Path MTU Discovery statistics.
Definition net_stats.h:211
net_stats_t recv
Number of received IPv6 PMTU packets.
Definition net_stats.h:216
net_stats_t drop
Number of dropped IPv6 PMTU packets.
Definition net_stats.h:213
net_stats_t sent
Number of sent IPv6 PMTU packets.
Definition net_stats.h:219
Number of network packets sent and received.
Definition net_stats.h:60
net_stats_t rx
Number of packets received.
Definition net_stats.h:64
net_stats_t tx
Number of packets sent.
Definition net_stats.h:62
Power management statistics.
Definition net_stats.h:363
uint32_t last_suspend_time
How long the last suspend took.
Definition net_stats.h:369
uint32_t start_time
Network interface last suspend start time.
Definition net_stats.h:371
uint64_t overall_suspend_time
Total suspend time.
Definition net_stats.h:365
net_stats_t suspend_count
How many times we were suspended.
Definition net_stats.h:367
All PPP specific statistics.
Definition net_stats.h:645
net_stats_t chkerr
Number of received PPP frames with a bad checksum.
Definition net_stats.h:656
struct net_stats_pkts pkts
Total number of packets received and sent.
Definition net_stats.h:650
struct net_stats_bytes bytes
Total number of bytes received and sent.
Definition net_stats.h:647
net_stats_t drop
Number of received and dropped PPP frames.
Definition net_stats.h:653
Network packet receive times for calculating average RX time.
Definition net_stats.h:292
uint64_t sum
Sum of network packet receive times.
Definition net_stats.h:294
net_stats_t count
Number of network packets received.
Definition net_stats.h:297
All Wi-Fi management statistics.
Definition net_stats.h:662
net_stats_t beacons_miss
Number of missed beacons.
Definition net_stats.h:667
net_stats_t beacons_rx
Number of received beacons.
Definition net_stats.h:664
Traffic class statistics.
Definition net_stats.h:319
struct net_stats_tc::@410 recv[NET_TC_RX_STATS_COUNT]
RX statistics for each traffic class.
struct net_stats_tc::@409 sent[NET_TC_TX_STATS_COUNT]
TX statistics for each traffic class.
net_stats_t dropped
Number of packets dropped for this traffic class.
Definition net_stats.h:332
net_stats_t bytes
Number of bytes sent for this traffic class.
Definition net_stats.h:334
struct net_stats_tx_time tx_time
Helper for calculating average TX time statistics.
Definition net_stats.h:323
net_stats_t pkts
Number of packets sent for this traffic class.
Definition net_stats.h:330
uint8_t priority
Priority of this traffic class.
Definition net_stats.h:336
TCP statistics.
Definition net_stats.h:134
net_stats_t ackerr
Number of received TCP segments with a bad ACK number.
Definition net_stats.h:157
net_stats_t rsterr
Number of received bad TCP RST (reset) segments.
Definition net_stats.h:160
net_stats_t rexmit
Number of retransmitted TCP segments.
Definition net_stats.h:166
net_stats_t chkerr
Number of TCP segments with a bad checksum.
Definition net_stats.h:154
net_stats_t seg_drop
Number of dropped TCP segments.
Definition net_stats.h:151
net_stats_t connrst
Number of connection attempts for closed ports, triggering a RST.
Definition net_stats.h:174
net_stats_t drop
Number of dropped packets at the TCP layer.
Definition net_stats.h:142
net_stats_t rst
Number of received TCP RST (reset) segments.
Definition net_stats.h:163
net_stats_t sent
Number of sent TCP segments.
Definition net_stats.h:148
net_stats_t resent
Amount of retransmitted data.
Definition net_stats.h:139
net_stats_t conndrop
Number of dropped connection attempts because too few connections were available.
Definition net_stats.h:171
net_stats_t recv
Number of received TCP segments.
Definition net_stats.h:145
struct net_stats_bytes bytes
Amount of received and sent TCP application data.
Definition net_stats.h:136
Network packet transfer times for calculating average TX time.
Definition net_stats.h:281
net_stats_t count
Number of network packets transferred.
Definition net_stats.h:286
uint64_t sum
Sum of network packet transfer times.
Definition net_stats.h:283
UDP statistics.
Definition net_stats.h:180
net_stats_t recv
Number of received UDP segments.
Definition net_stats.h:185
net_stats_t drop
Number of dropped UDP segments.
Definition net_stats.h:182
net_stats_t chkerr
Number of UDP segments with a bad checksum.
Definition net_stats.h:191
net_stats_t sent
Number of sent UDP segments.
Definition net_stats.h:188
All Wi-Fi specific statistics.
Definition net_stats.h:673
struct net_stats_pkts broadcast
Total number of broadcast packets received and sent.
Definition net_stats.h:684
struct net_stats_pkts multicast
Total number of multicast packets received and sent.
Definition net_stats.h:687
struct net_stats_sta_mgmt sta_mgmt
Total number of beacon errors.
Definition net_stats.h:675
struct net_stats_bytes bytes
Total number of bytes received and sent.
Definition net_stats.h:678
net_stats_t overrun_count
Total number of dropped packets at received and sent.
Definition net_stats.h:696
struct net_stats_pkts pkts
Total number of packets received and sent.
Definition net_stats.h:681
struct net_stats_pkts errors
Total number of errors in RX and TX.
Definition net_stats.h:690
struct net_stats_pkts unicast
Total number of unicast packets received and sent.
Definition net_stats.h:693
All network statistics in one struct.
Definition net_stats.h:378
net_stats_t processing_error
Count of malformed packets or packets we do not have handler for.
Definition net_stats.h:380
struct net_stats_bytes bytes
This calculates amount of data transferred through all the network interfaces.
Definition net_stats.h:386
struct net_stats_ip_errors ip_errors
IP layer errors.
Definition net_stats.h:389