56 #ifndef LWIP_HDR_SNMP_H 57 #define LWIP_HDR_SNMP_H 82 snmp_ifType_regular1822,
85 snmp_ifType_rfc877_x25,
86 snmp_ifType_ethernet_csmacd,
87 snmp_ifType_iso88023_csmacd,
88 snmp_ifType_iso88024_tokenBus,
89 snmp_ifType_iso88025_tokenRing,
90 snmp_ifType_iso88026_man,
92 snmp_ifType_proteon_10Mbit,
93 snmp_ifType_proteon_80Mbit,
94 snmp_ifType_hyperchannel,
100 snmp_ifType_basicISDN,
101 snmp_ifType_primaryISDN,
102 snmp_ifType_propPointToPointSerial,
104 snmp_ifType_softwareLoopback,
106 snmp_ifType_ethernet_3Mbit,
112 snmp_ifType_frame_relay
116 #ifndef MIB2_COPY_SYSUPTIME_TO 117 #define MIB2_COPY_SYSUPTIME_TO(ptrToVal) (*(ptrToVal) = (sys_now() / 10)) 124 #define MIB2_STATS_NETIF_INC(n, x) do { ++(n)->mib2_counters.x; } while(0) 129 #define MIB2_STATS_NETIF_ADD(n, x, val) do { (n)->mib2_counters.x += (val); } while(0) 138 #define MIB2_INIT_NETIF(netif, type, speed) do { \ 139 (netif)->link_type = (type); \ 140 (netif)->link_speed = (speed);\ 142 (netif)->mib2_counters.ifinoctets = 0; \ 143 (netif)->mib2_counters.ifinucastpkts = 0; \ 144 (netif)->mib2_counters.ifinnucastpkts = 0; \ 145 (netif)->mib2_counters.ifindiscards = 0; \ 146 (netif)->mib2_counters.ifinerrors = 0; \ 147 (netif)->mib2_counters.ifinunknownprotos = 0; \ 148 (netif)->mib2_counters.ifoutoctets = 0; \ 149 (netif)->mib2_counters.ifoutucastpkts = 0; \ 150 (netif)->mib2_counters.ifoutnucastpkts = 0; \ 151 (netif)->mib2_counters.ifoutdiscards = 0; \ 152 (netif)->mib2_counters.ifouterrors = 0; } while(0) 154 #ifndef MIB2_COPY_SYSUPTIME_TO 155 #define MIB2_COPY_SYSUPTIME_TO(ptrToVal) 157 #define MIB2_INIT_NETIF(netif, type, speed) 158 #define MIB2_STATS_NETIF_INC(n, x) 159 #define MIB2_STATS_NETIF_ADD(n, x, val) 163 #if LWIP_MIB2_CALLBACKS 165 void mib2_netif_added(
struct netif *ni);
166 void mib2_netif_removed(
struct netif *ni);
168 #if LWIP_IPV4 && LWIP_ARP 170 void mib2_add_arp_entry(
struct netif *ni, ip4_addr_t *ip);
171 void mib2_remove_arp_entry(
struct netif *ni, ip4_addr_t *ip);
173 #define mib2_add_arp_entry(ni,ip) 174 #define mib2_remove_arp_entry(ni,ip) 179 void mib2_add_ip4(
struct netif *ni);
180 void mib2_remove_ip4(
struct netif *ni);
181 void mib2_add_route_ip4(u8_t dflt,
struct netif *ni);
182 void mib2_remove_route_ip4(u8_t dflt,
struct netif *ni);
187 void mib2_udp_bind(
struct udp_pcb *pcb);
188 void mib2_udp_unbind(
struct udp_pcb *pcb);
196 #define mib2_netif_added(ni) 197 #define mib2_netif_removed(ni) 200 #define mib2_add_arp_entry(ni,ip) 201 #define mib2_remove_arp_entry(ni,ip) 204 #define mib2_add_ip4(ni) 205 #define mib2_remove_ip4(ni) 206 #define mib2_add_route_ip4(dflt, ni) 207 #define mib2_remove_route_ip4(dflt, ni) 210 #define mib2_udp_bind(pcb) 211 #define mib2_udp_unbind(pcb) 215 #define NETIF_INIT_SNMP MIB2_INIT_NETIF 216 #define snmp_add_ifinoctets(ni,value) MIB2_STATS_NETIF_ADD(ni, ifinoctets, value) 217 #define snmp_inc_ifinucastpkts(ni) MIB2_STATS_NETIF_INC(ni, ifinucastpkts) 218 #define snmp_inc_ifinnucastpkts(ni) MIB2_STATS_NETIF_INC(ni, ifinnucastpkts) 219 #define snmp_inc_ifindiscards(ni) MIB2_STATS_NETIF_INC(ni, ifindiscards) 220 #define snmp_inc_ifinerrors(ni) MIB2_STATS_NETIF_INC(ni, ifinerrors) 221 #define snmp_inc_ifinunknownprotos(ni) MIB2_STATS_NETIF_INC(ni, ifinunknownprotos) 222 #define snmp_add_ifoutoctets(ni,value) MIB2_STATS_NETIF_ADD(ni, ifoutoctets, value) 223 #define snmp_inc_ifoutucastpkts(ni) MIB2_STATS_NETIF_INC(ni, ifoutucastpkts) 224 #define snmp_inc_ifoutnucastpkts(ni) MIB2_STATS_NETIF_INC(ni, ifoutnucastpkts) 225 #define snmp_inc_ifoutdiscards(ni) MIB2_STATS_NETIF_INC(ni, ifoutdiscards) 226 #define snmp_inc_ifouterrors(ni) MIB2_STATS_NETIF_INC(ni, ifouterrors)