SNMP Updates – NET+OS 7.0

 

 

 

Last Updated: 11/28/06         Fix Count: 2

 

 

Title

SNMP trap changes

 

Case:  1218183

 

Date fixed: 11/28/06

 

Description

There have been changes required due to the differences between NET+OS 6.3 and NET+OS 7.0.  One of these differences is there is no support for authenticated or encrypted traps.

 

Changes

 

  1. The naSnmpSetColdStartTrap function has been removed.
  2. The naSnmpDisableColdStartTrap function has been added.
  3. There is a new header file snmpv1v2capi.h. It has declaration and function prototypes that are used only with the v1v2c library.
  4. The NaSnmpTrap_t structure and naSnmpSendTrap prototype have changed.
  5. NaSnmpTrap_t structure and naSnmpGetTrap, naSnmpAddTrap, naSnmpDeleteTrap, and naSnmpSendTrap are only used with the v1v2c library.
  6. NaSnmpTargetParamsMPModel_t and NaSnmpNotificationTarget_t types have been added. They are used with the v3 library only.
  7. naSnmpSetNotificationTargets, naSetNotificationUserName, naSetNotificationContextName, and naSnmpSendNotifications have been added for the use with the v3 library only.
  8. naSnmpSetDefaultEngineId prototype has changed.

 

The way traps work on v1/v2:

 

Traps that are generated by TreckcoldStart and authenticationFailure traps, and traps added to the MIB, sent by the function, or generated by the MIB compiler, are sent using trap sinks. Trap sinks define destination and source addresses (source address can be defaulted, community, enterprise), and trap versions sent – V1, V2, or both.

 

For traps that are sent with naSnmpSendTrap, trap sinks are not used. Instead the same NaSnmpTrap_t structure is used as the argument in a function call.

 

NOTE; Even if you don’t send a coldStart trap, or don’t expect an authenticationFailure trap, naSnmpAddTrap must be called before the agent is started, otherwise expect unpredicted behavior.  Just set the enterprise number, enterprise length to 8, community to “public” and destination address to something.

 

The nasnmpapp example adds a Trap sink and sends traps using naSnmpSendTrap.

 

The way traps work with v3 library:

 

Initialization

 

  1. The enterprise number must be set, otherwise it is 29999.
  2. The engine ID must be set, or set to default, specifying agent source address, or using NULL for default address.
  3. The trap user name and trap context name must be initialized by calling naSetNotificationUserName and naSetNotificationContextName, otherwise they will be “ELMIC” and “ELMIC CONTEXT”.
  4. Notification Targets must be initialized with naSnmpSetNotificationTargets. The function accepts an array of targets. The security names are limited to “public” and “private”. If this function is not called all traps will be send to “10.52.35.103” IP address. All fields of Notification and Target Address MIBs that are not in NaSnmpNotificationTarget_t structure are initialized to defaults. The initialization of Notification and Target Address MIBs is limited, but the MIBS, of course, can be modified remotely by an SNMP manager.

 

coldStart and authenticationFailure traps are generated by the agent. Other traps can be added to MIBs and sent, using a function, generated by the MIB compiler, or sent by calling naSnmpSendNotifications.

 

All traps are sent to the targets from the Target Address MIB following the rules of Notification and Target Address MIBs. Those MIBS also control the versions of traps sent. The naSnmpSetNotificationTargets function allows the control of trap SNMP versions. The naSnmpSendNotifications function uses the enterprise number from the argument, rather than the one set with naSnmpSetEnterpriseNumber. 

 

 

This applies to both v1/v2 and v3:

 

coldStart traps are always sent unless disabled by naSnmpDisableColdStartTrap. V2 requires all trap variables to be in a MIB. The MIB compiler does not add sysUpTime and trapOID variables, you need to add them manually to MIB definitions.

 

The trap code, generated by the MIB compiler, has bugs. The trap code, generated by the MIB compiler, uses the constant for the Enterprise number; the constant is defined in a Treck header. This needs to be changed in the generated code.

 

 

Title

SNMP files missing from 7.0 CD

 

Case:  1218183

 

Date fixed: 09/21/06

 

Description

Several files were missing from the 7.0 CD.  There was also a bug in the namib example application that would result in an error being generated even though the task completed successfully.

 

Solution

This patch contains the missing makefiles, the namib readme was cleaned up, and a missing break was added to the namib example application to clear up the error.

 

 

Files:  netos\src\snmpcust\Makefile.fv

netos\src\snmpcust\Makefile.fv3

netos\src\snmpcust\Makefile.no_ipsec

netos\src\snmpcust\Makefile.src

netos\src\snmpcust\Makefile.v3no_ipsec

netos\src\examples\namib\example_local.c

netos\src\examples\namib\readme

netos\src\treck\snmpd\trapi.h

netos\src\treck\snmpd\trconcpt.h

netos\src\treck\snmpd\trintapi.h

netos\src\treck\snmpd\trmib2.h

netos\h\snmp\snmpimpl.h

netos\h\snmp\snmpv1v2capi.h

netos\h\snmp\snmpv3api.h

netos\h\snmpapi.h

netos\src\examples\nasnmpd\readme

netos\src\examples\nasnmpd\root.c

netos\src\examples\nasnmpv3\root.c

netos\src\examples\nasnmpv3\cli.c

netos\src\examples\nasnmpv3\readme

netos\src\treck\snmpd\trsnmpv3.h

netos\src\treck\snmpd\trconsts.h

netos\src\treck\snmpd\trregstr.h

netos\lib\arm7\32b\ghs\libsnmp.a

netos\lib\arm7\32b\ghs\libsnmpd.a

netos\lib\arm7\32b\ghs\libsnmpdv3.a

netos\lib\arm7\32b\ghs\libsnmpdv3_no_ipsec.a

netos\lib\arm7\32b\ghs\libsnmpd_no_ipsec.a

netos\lib\arm7\32b\ghs\libsnmpv3.a

netos\lib\arm7\32b\ghs\libsnmpv3_no_ipsec.a

netos\lib\arm7\32b\ghs\libsnmp_no_ipsec.a

netos\lib\arm7\32b\gnu\libsnmp.a

netos\lib\arm7\32b\gnu\libsnmpd.a

netos\lib\arm7\32b\gnu\libsnmpdv3.a

netos\lib\arm7\32b\gnu\libsnmpdv3_no_ipsec.a

netos\lib\arm7\32b\gnu\libsnmpd_no_ipsec.a

netos\lib\arm7\32b\gnu\libsnmpv3.a

netos\lib\arm7\32b\gnu\libsnmpv3_no_ipsec.a

netos\lib\arm7\32b\gnu\libsnmp_no_ipsec.a

netos\lib\arm9\32b\ghs\libsnmp.a

netos\lib\arm9\32b\ghs\libsnmpd.a

netos\lib\arm9\32b\ghs\libsnmpdv3.a

netos\lib\arm9\32b\ghs\libsnmpdv3_no_ipsec.a

netos\lib\arm9\32b\ghs\libsnmpd_no_ipsec.a

netos\lib\arm9\32b\ghs\libsnmpv3.a

netos\lib\arm9\32b\ghs\libsnmpv3_no_ipsec.a

netos\lib\arm9\32b\ghs\libsnmp_no_ipsec.a

netos\lib\arm9\32b\gnu\libsnmp.a

netos\lib\arm9\32b\gnu\libsnmpd.a

netos\lib\arm9\32b\gnu\libsnmpdv3.a

netos\lib\arm9\32b\gnu\libsnmpdv3_no_ipsec.a

netos\lib\arm9\32b\gnu\libsnmpd_no_ipsec.a

netos\lib\arm9\32b\gnu\libsnmpv3.a

netos\lib\arm9\32b\gnu\libsnmpv3_no_ipsec.a

netos\lib\arm9\32b\gnu\libsnmp_no_ipsec.a

netos\Documentation\ApiReference.chm

 

Special Instructions

 

  • Unzip the patch(es) to the root of your NET+OS installation, for example C:\netos70\.
  • Be sure to install any patches listed under Dependencies below
  • Rebuild your application.

 

Patch Link:  SNMPUpdates_70

 

Dependencies

This patch also requires the installation of the following patch(es):

 

ApiReference_70