Add enum snmp_ifType in snmp.h, and use it in network interfaces for NETIF_INIT_SNMP

This commit is contained in:
fbernon
2007-08-31 10:14:09 +00:00
parent fca25479ad
commit 85fef90c94
5 changed files with 46 additions and 9 deletions

View File

@@ -140,7 +140,7 @@ struct netif {
/** number of this interface */
u8_t num;
#if LWIP_SNMP
/** link type (ifType values per RFC1213) */
/** link type (from "snmp_ifType" enum from snmp.h) */
u8_t link_type;
/** (estimate) link speed */
u32_t link_speed;
@@ -167,7 +167,7 @@ struct netif {
#if LWIP_SNMP
#define NETIF_INIT_SNMP(netif, type, speed) \
/* ifType ethernetCsmacd(6) @see RFC1213 */ \
/* use "snmp_ifType" enum from snmp.h for "type", snmp_ifType_ethernet_csmacd by example */ \
netif->link_type = type; \
/* your link speed here */ \
netif->link_speed = speed; \

View File

@@ -41,6 +41,44 @@
extern "C" {
#endif
/**
* @see RFC1213, "MIB-II, 6. Definitions"
*/
enum snmp_ifType {
snmp_ifType_other=1, /* none of the following */
snmp_ifType_regular1822,
snmp_ifType_hdh1822,
snmp_ifType_ddn_x25,
snmp_ifType_rfc877_x25,
snmp_ifType_ethernet_csmacd,
snmp_ifType_iso88023_csmacd,
snmp_ifType_iso88024_tokenBus,
snmp_ifType_iso88025_tokenRing,
snmp_ifType_iso88026_man,
snmp_ifType_starLan,
snmp_ifType_proteon_10Mbit,
snmp_ifType_proteon_80Mbit,
snmp_ifType_hyperchannel,
snmp_ifType_fddi,
snmp_ifType_lapb,
snmp_ifType_sdlc,
snmp_ifType_ds1, /* T-1 */
snmp_ifType_e1, /* european equiv. of T-1 */
snmp_ifType_basicISDN,
snmp_ifType_primaryISDN, /* proprietary serial */
snmp_ifType_propPointToPointSerial,
snmp_ifType_ppp,
snmp_ifType_softwareLoopback,
snmp_ifType_eon, /* CLNP over IP [11] */
snmp_ifType_ethernet_3Mbit,
snmp_ifType_nsip, /* XNS over IP */
snmp_ifType_slip, /* generic SLIP */
snmp_ifType_ultra, /* ULTRA technologies */
snmp_ifType_ds3, /* T-3 */
snmp_ifType_sip, /* SMDS */
snmp_ifType_frame_relay
};
/* SNMP support available? */
#if defined(LWIP_SNMP) && (LWIP_SNMP > 0)