The code contains hard to debug bug where we periodically do some kind of error.
The problem is caused by weird values after the AgentX PDU header, exactly where
the first OID should lie. We expend value less than 15 but we found values like
0x00003b47. We found possible cause on assignment to socket's receive buffer
position in proto/snmp/subagent.c:snmp_rx at line 1569. An erroneous behavior
may have been caused by off-by-on error. More investigation is needed to gain
full picture.
To resolve this issue we use much more simpler approach. We will set max packet
size and wait until whole packet has arrived.
SNMP state changes are now handled by snmp_set_state() functions.
The registration structure and related variables are renamed to remove
confusion.
Manipulation of BGP peers, a reference to BGP protocol structures, is improved
by new functions that encapsulate raw hash table macros (moved from snmp.h).
IPv4 addresses now used by bgp_mib.c because BGP4-MIB does not support IPv6
addresses.
Configuration grammar rules are revised.
We now use DBG() and TRACE() macros to output information about SNMP state
chagnes and about received and transmitted packets.
Pieces of old code are removed, minor bugfixes are included. Large debug string
array are removed.
In the AgentX communication the subagent chooses the byte order used. To reduce
code complexity, we decide to use compile-time selected byte order in PDU sent.
Supported options are:
- SNMP_NATIVE: use native CPU byte order
- SNMP_NETWORK_BYTE_ORDER: use big endian in PDUs, i.e. network byte order
It is recommended not to used both options at the same time (even it is possible
on big endian platforms).