Snmp clients and package use, Unimplemented features – Comtrol eCos User Manual

Page 620

Advertising
background image

Chapter 47. SNMP for eCos

snmp[cmd] -v3 $IP -u root -L noAuthNoPriv $OID

snmp[cmd] -v3 $IP -u root -L authNoPriv -A MD5 -a md5passwd $OID

The following commands would however fail since they violate the access model :

snmp[cmd] $IP public $OID

snmp[cmd] -v1 $IP public $OID

snmp[cmd] -v2c $IP public $OID

snmp[cmd] -v3 $IP -u no_user -L noAuthNoPriv $OID

snmp[cmd] -v3 $IP -u root -L authNoPriv -A MD5 -a badpasswd $OID

SNMP clients and package use

SNMP clients may use these packages, but this usage is currently untested: the reason why this port to eCos exists
is to acquire the SNMP agent. The fact that that the SNMP API (for clients) exists is a side-effect. See the standard
man page SNMP_API(3) for details. There are further caveats below about client-side use of the SNMP library.

All of the SNMP header files are installed beneath .../include/ucd-snmp in the install tree. The SNMP code it-
self assumes that directory is on its include path, so we recommend that client code does the same. Further,
like the TCP/IP stack, compiling SNMP code requires definition of _KERNEL and __ECOS, and additionally
IN_UCD_SNMP_SOURCE.

Therefore, add all of these to your compile lines if you wish to include SNMP header files:

-D_KERNEL

-D__ECOS

-DIN_UCD_SNMP_SOURCE=1

-I$(PREFIX)/include/ucd-snmp

Unimplemented features

Currently, the filesystem and persistent storage areas are left undone, to be implemented by the application.

The SNMP library package is intended to support client and agent code alike. It therefore contains lots of assump-
tions about the presence of persistent storage ie. a filesystem. Currently, by default, eCos has no such thing, so
those areas have been simply commented out and made to return empty lists or say “no data here.”

Specifically the following files have omitted/unimplemented code :

PACKAGES/net/snmp/lib/VERSION/src/parse.c

contains code to enumerate MIB files discovered in the system MIB directories (“

/usr/share/snmp/mibs

”),

and read them all in, building data structures that are used by client programs to interrogate an agent. This is not
required in an agent, so the routine which enumerates the directories returns an empty list.

PACKAGES/net/snmp/lib/VERSION/src/read_config.c

contains two systems:

The first tries to read the configuration file as described in the

snmpd.conf file

section and the second system

contains code to record persistent data as files in a directory (typically

/var/ucd-snmp

) thus preserving the state

permanently.

The first part is partially implemented to support multiple profiles and enables dispatcher functionality as discussed
in

the Section called Version usage (v1, v2 or v3)

. The second part is not supported at all in the default implemen-

516

Advertising