SNMP++ new major version 4.0.0 has been released 2026-08-12T22:00:00Z with a couple of USM/MPv3 security improvements and support for TCP and TLS transport mappings.
CHANGES
Summary
- Introducing a modular transport architecture with TCP and TLS support.
- Removed the obsolete
IpxAddressand added a fully functionalTcpAddressandTlsAddressclasses. - Implemented a
TransportMappingframework (UDP and TCP) to decouple low-level networking from the SNMP logic. - Fixed multiple
-Woverloaded-virtualwarnings where derived classes unintentionally hid virtual assignment
operators from their base classes. - Resolved inheritance-related member hiding in
OidandOctetStrsubclasses. - Fixed the USM statistics counter and the Report counter OID selected when incoming message authentication fails,
to conform to RFC 3414 §3.2 (6). - SECURITY: Verify the identity of the (D)TLS server, reject empty tmSecurityName
- SECURITY: Do not let unauthenticated messages poison the engine id cache
- SECURITY: Bind a received response to the request it claims to answer
- SECURITY: Bound the number of usmTimeTable entries engine discovery creates
- SECURITY: Validate a v3 response/report before consuming its cache entry
Detailed Changes
- Address Hierarchy: Refactored
Addressas an abstract base with a publicget_socket_addressmethod.
Port management was centralized inIpAddressto supportUdpAddress,TcpAddress, andTlsAddress. - Transport Mappings: Created
TransportMapping(base),UdpTransportMapping, andTcpTransportMapping.
These classes now handle socket creation, sending, and receiving. - Snmp Class: Updated
Snmpto manage a collection of transport mappings.snmp_engineandsend_raw_data
were refactored to dynamically select the appropriate transport based on the target address. - SNMPv3/USM: Refactored
v3MPandUSMclasses to use the abstractAddressclass,
enabling SNMPv3 over any supported transport (e.g., TCP, TLS). - Multi-homed Support: Updated receiving logic in
uxsnmp.cppto correctly associate incoming packets
with their specific transport mappings. - Project Configuration: Updated
CMakeLists.txtandconfig_snmp_pp.hto reflect version 4.0.0 and
include the new transport files. - OID Definitions: Added
using Oid::operator=;tosnmpTrapsOid,snmpTrapEnterpriseOid,
and their subclasses inoid_def.h. This ensures that the base class assignment operators remain accessible
and are not hidden by the implicitly generated copy assignment operators of the derived classes. - Opaque String: Added
using OctetStr::operator=;toOpaqueStrinoctet.hto maintain visibility of
OctetStrassignment operators. - Inheritance Consistency: Verified that other key classes in the
SnmpSyntaxhierarchy
(IpAddress,UdpAddress,TcpAddress,Counter32,Gauge32,TimeTicks) already have the necessary
usingdeclarations or explicit overloads to avoid similar warnings. - USM Statistics (RFC 3414 §3.2 (6)):
USM::process_msgnow incrementsusmStatsWrongDigestsfor any
failure reported by the authentication module, instead ofusmStatsUnsupportedSecLevels. The latter belongs
to step (5) of the same section, which checks the securityLevel the user supports and is already handled
before authentication is attempted. The return code is normalized toSNMPv3_USM_AUTHENTICATION_FAILURE
so that the generated Report carries the OID and value of the counter that was actually incremented.
Note that this code path is only reachable if anAuthimplementation reports a failure other than
SNMPv3_USM_AUTHENTICATION_FAILUREorSNMPv3_USM_UNSUPPORTED_AUTHPROTOCOL. - Report Counter OID:
v3MP::send_reportnow mapsSNMPv3_USM_UNSUPPORTED_AUTHPROTOCOLto
usmStatsUnsupportedSecLevels, which is the counter USM increments for it. Previously this code fell through
to the default branch and reportedsnmpInvalidMsgs, a counter that had not been incremented.