Version usage (v1, v2 or v3), Traps, Snmpd.conf file – Comtrol eCos User Manual
Page 618: Snmpd.conf, File

Chapter 47. SNMP for eCos
Version usage (v1, v2 or v3)
The default build supports all three versions of the SNMP protocol, but without any dispatcher functionality (rfc
2571, section 3.1.1.2). This has the following implications :
1. There is no community authentication for v1 and v2c.
2. Security provided by v3 can be bypassed by using v1/v2c protocol.
To provide the dispatcher with rfc 2571 type functionality, it is required to set up security models and access
profiles. This can be provided in the normal Unix style by writing the required configurations in
snmpd.conf
file.
Application code may setup profiles in
snmpd.conf
and optionally set the environment variable
SNMPCONFPATH
to point to the file if it is not in the usual location. The whole concept works in the usual way as with the standard
UCD-SNMP distribution.
Traps
The support of the
trapsink
command in the
file is not tested and there may be problems for it
working as expected. Moreover, in systems that do not have filesystem support, there is no way to configure a
trap-session in the conventional way.
For reasons mentioned above, applications need to initialize their own trap sessions and pass it the details of trap-
sink. The following is a small sample for initializing a v1 trap session :
typedef struct trap {
unsigned char ip [4];
unsigned int
port;
unsigned char community [256];
}
trap
trapsink;
unsinged char
sink [16];
...
...
if (trapsink.ip != 0) {
sprintf (sink, "%d.%d.%d.%d",
trapsink[0], trapsink[1], trapsink[2], trapsink[3]);
if (create_trap_session (sink,
trapsink.port,
(char *)trapsink.community,
SNMP_VERSION_1,
SNMP_MSG_TRAP) == 0) {
log_error ("Creation of trap session failed \n");
}
}
snmpd.conf
file
Using snmpd.conf requires the inclusion of one of the file-system packages (eg. CYGPKG_RAMFS) and CYG-
PKG_FILEIO. With these two packages included, the SNMP sub-system will read the snmpd.conf file from the
514