summaryrefslogtreecommitdiffstats
path: root/lib/snmp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: use compiler.h MIN/MAX macros instead of everyone having oneDonald Sharp2021-11-111-3/+1
| | | | | | | | We had various forms of min/max macros across multiple daemons all of which duplicated what we have in compiler.h. Convert everyone to use the `correct` ones Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* lib, bgpd: add a specific oid_copy function for IPv6 addrsPat Ruddy2021-03-251-3/+14
| | | | | | | Do not overload the v4 oid_copy_addr function for ipv6 coverity does not like this kind of thing. Signed-off-by: Pat Ruddy <pat@voltanet.io>
* bgpd, lib: add oid2in6_addr utility and use itPat Ruddy2021-02-171-0/+11
| | | | | | | | The existing code was using the oid2in_addr API to copy IPv6 addresses passing an IPv6 length. Create a utility to do this properly and avoid annoying coverity with type checking. Signed-off-by: Pat Ruddy <pat@voltanet.io>
* lib: add utilities to encode/decode an int in SNMP oidPat Ruddy2021-02-021-1/+27
| | | | | | | Add 2 functions to encode/decode intergers to/from SNMP OIDs. Make sure oid is in network format. Signed-off-by: Pat Ruddy <pat@voltanet.io>
* bgpd, lib: add mplsL3VpnVrf tablePat Ruddy2021-02-021-0/+28
| | | | | | | Add SNMP support for L3vpn Vrf table as defined in [RFC4382] Keep track of vrf status for the table and for future traps. Signed-off-by: Pat Ruddy <pat@voltanet.io>
* lib: make oid_copy_addr respect my constnessDonald Sharp2020-03-261-2/+2
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-75/+67
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: snmp: convert into modulesDavid Lamparter2017-03-251-2/+0
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* snmp: fix warningsDavid Lamparter2016-05-261-1/+1
| | | | | | | batch-fix all warnings that come up when enabling AgentX SNMP support. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit dfee58f1d41a2e36c7f5f38a3ef5712224131824)
* snmp: let handlers accept OID from a lesser prefixVincent Bernat2012-06-251-0/+20
| | | | | | | | | Most table handlers do not expect to be given an OID whose prefix is outside what they can handle. This is not a problem with the SMUX implementation since it always correct the OID such that the prefix matches. However, this is not the case for the AgentX implementation. A new function, smux_header_table() is used to do this normalization.
* smux: isolate SMUX implementation from SNMP implementationVincent Bernat2012-06-251-0/+113
lib/snmp.c gets OID related helper functions that can be used with another SNMP interface. smux.h is cleaned of SMUX specific bits to only expose functions that may be used by an alternative implementation. We also do not redefine functions already present in NetSNMP. Just use the appropriate headers.