Changes to ecos sources, Starting the snmp agent – Comtrol eCos User Manual

Page 616

Advertising
background image

Chapter 47. SNMP for eCos

[ cmot { mib2 9 } is “historic”, just a placeholder ]

dot3

{ mib2 10 7 } == { transmission 7 } “EtherLike MIB”

snmp

{ mib2 11 }

On inclusion of SNMPv3 support packages, the following MIBs are added to the default set of MIBs enumerated
above :

snmpEngine

{ snmpFrameworkMIBObjects 1 }

SNMP-FRAMEWORK-MIB, as described in

RFC-2571 for support of SNMPv3

framework.

usmStats

{

usmMIBObjects 1 }

SNMP-USER-BASED-SM-MIB, as

usmUser

{

usmMIBObjects 2 }

specified in RFC-2574 for support

of user based security model in

SNMPv3 management domains.

Changes to eCos sources

Small changes have been made in three areas:

1. Various hardware-specific ethernet drivers.

2. The generic ethernet device driver.

3. The OpenBSD TCP/IP networking package.

These changes were made in order to export information about the driver and the network that the SNMP agent
must report. The changes were trivial in the case of the network stack, since it was already SNMP-friendly. The
generic ethernet device driver was re-organized to have an extensive header file and to add a couple of APIs to
extract statistics that the hardware-specific device drivers keep within themselves.

There may be a performance hit for recording that data; disabling a config option named something like

CYGDBG_DEVS_ETH_xxxx_xxxx_KEEP_STATISTICS

depending on the specific device driver will prevent that.

Not all platform ethernet device drivers export complete SNMP statistical information; if the exported information
is missing, SNMP will report zero values for such data (in the dot3 MIB).

The interface chipset has an ID which is an OID; not all the latest greatest devices are listed in the abailable
database, so new chipsets may need to be added to the client MIB, if not defined in those from UCD.

Starting the SNMP Agent

A routine to instantiate and start the SNMP agent thread in the default configuration is provided in

PACKAGES/net/snmp/agent/VERSION/src/snmptask.c

It starts the snmpd thread at priority

CYGPKG_NET_THREAD_PRIORITY+1

by default, ie. one step less important

than the TCP/IP stack service thread. It also statically creates and uses a very large stack of around 100 KiloBytes.
To use that convenience function, this code fragment may be copied (in plain C).

#ifdef CYGPKG_SNMPAGENT

{

extern void cyg_net_snmp_init(void);

512

Advertising