summaryrefslogtreecommitdiff
path: root/lib/smux.h
AgeCommit message (Collapse)Author
2021-03-25lib, bgpd: add a specific oid_copy function for IPv6 addrsPat Ruddy
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>
2021-03-17*: require semicolon after DEFINE_HOOK & co.David Lamparter
See previous commit. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-14Merge pull request #7945 from volta-networks/feat_isis_snmpRenato Westphal
isisd: add support for read-only snmp mibs objects
2021-03-02isisd: support for snmplynne
Add support for read only mib objects from RFC4444. Signed-off-by: Lynne Morrison <lynne@voltanet.io> Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-02-24Merge pull request #8023 from volta-networks/feat_add_agentx_enabled_hookQuentin Young
lib: add agentx_enabled hook
2021-02-17bgpd, lib: add oid2in6_addr utility and use itPat Ruddy
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>
2021-02-16lib: add agentx_enabled hookKaren Schoener
Adding agentx_enabled hook. This permits the main LDP process to signal the lde and ldpe processes when agentx is enabled. Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-02-14lib, bgpd: smux_trap return code is never usedDonald Sharp
The return code from smux_trap is never used. If we have never used it after all this time. Remove the return from the function. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-02-02lib: allow traps with differently indexed objectsPat Ruddy
The function smux_trap only allows the paaasin of one index which is applied to all indexed objects. However there is a requirement for differently indexed objects within a singe trap. This commit introduces a new function smux_trap_multi_index which can be called with an array of indices. If this array is onf length 1 the original smux_trap behaviour is maintained. smux_trap now calls the new function with and index array length of 1 to avoid changes to existing callers. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-02-02bgpd: add SNMP support for mplsL3VpnRte TablePat Ruddy
Add MIB support for the route table in RFC4382 Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-02-02lib: add SNMP_OCTET macroPat Ruddy
Add SNMP macro to allow a singe octet to be returned Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-02-02lib: add IANA defines and IPv6 macroPat Ruddy
Add defines for IANA SNMP routing protocol values Add macro for returning an IPv6 address to the SNMP agent. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-02-02lib: add utilities to encode/decode an int in SNMP oidPat Ruddy
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>
2021-02-02bgpd, lib: add mplsL3VpnVrf tablePat Ruddy
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>
2020-03-26lib: make oid_copy_addr respect my constnessDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-11lib: add extern "C" {} blocks to all libfrr headersRenato Westphal
These are necessary to use functions defined in these headers from C++. Signed-off-by: David Lamparter <equinox@diac24.net> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
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>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
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>
2016-06-07*: add missing includesDavid Lamparter
Some places, particularly headers, were spewing warnings since they don't include neccessary other headers to get struct/enum definitions. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 388f8857eb81ef75014060976776523a58a99389)
2016-05-26snmp: fix warningsDavid Lamparter
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)
2012-06-25snmp: let handlers accept OID from a lesser prefixVincent Bernat
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.
2012-06-25agentx: handle SNMP trapsVincent Bernat
smux_trap() signature has been changed to provide appropriate level information to send SNMPv2 notifications. This includes the addition of the enterprise OID to use (from which is derived the SNMP trap OID) and the MIB registry to locate the appropriate function for variable bindings provided by the trap. The SMUX implementation has been updated but ignore the provided enterprise OID. Instead, it still uses the SMUX peer OID to keep compatibility with previous versions of Quagga. The SMUX implementation also ignores the provided MIB registry since it uses smux_get() function to grab the appropriate values. This is not possible with the AgentX implementation since there is no such function provided by NetSNMP.
2012-06-25smux: drop findVar element from trap object structVincent Bernat
This element was not unused.
2012-06-25smux: remove `tick` argument from smux_trap()Vincent Bernat
smux_trap() contains an argument whose use appears to be to set sysUpTime.0/timestamp field in SNMP trap. However, this value is not used in smux_trap(). Moreover, it is expected that this field is the value of sysUpTime.0 when the trap was sent and not any other time related to the trap. To avoid any confusion, we remove this field from the signature of the function.
2012-06-25smux: isolate SMUX implementation from SNMP implementationVincent Bernat
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.
2009-06-18[cleanup] Use const in smux interfaceStephen Hemminger
smux_trap and oid_copy should allow read-only source.
2009-06-02[smux] 64-bit fix for lib/smux.h SNMP_INTEGER() macroChris Caputo
Macro SNMP_INTEGER() prepares data which is eventually processed by asn_build_int(). SNMP_INTEGER() was using "int32_t" whereas asn_build_int() uses "long". On 32-bit systems these are the same, both 4 bytes, but on x86 64-bit systems "long" is 8 bytes. asn_build_int()'s reaction to an improperly sized value is to return a NULL pointer. Quagga's smux.c would eventually get this NULL pointer and use it in calculations to determine how much data to send over the smux connection, resulting in garbage being sent to the SNMP agent. Corrected SNMP_INTEGER() to use "long". Tested on 32-bit and 64-bit x86 Linux 2.6.27.10 systems running Quagga 0.99.11 with bgpd smux.
2005-09-292005-09-29 Alain Ritoux <alain.ritoux@6wind.com>vincent
* lib/smux.[ch]: allow to retreive global OID (identified by <0 namelen). * ospf_ism.c: generate SNMP traps on Interface state change * ospf_nsm.c: generate SNMP traps on Neighbour state change * ospf_snmp.[ch]: support for SNMP traps for interface and neighbours.
2005-05-062005-05-06 Paul Jakma <paul@dishone.st>paul
* (general) extern and static'ification of functions in code and header. Cleanup any definitions with unspecified arguments. Add casts for callback assignments where the callback is defined, typically, as passing void *, but the function being assigned has some other pointer type defined as its argument, as gcc complains about casts from void * to X* via function arguments. Fix some old K&R style function argument definitions. Add noreturn gcc attribute to some functions, as appropriate. Add unused gcc attribute to some functions (eg ones meant to help while debugging) Add guard defines to headers which were missing them. * command.c: (install_node) add const qualifier, still doesnt shut up the warning though, because of the double pointer. (cmp_node) ditto * keychain.c: (key_str2time) Add GET_LONG_RANGE() macro, derived fromn vty.h ones to fix some of the (long) < 0 warnings. * thread.c: (various) use thread_empty (cpu_record_hash_key) should cast to uintptr_t, a stdint.h type * vty.h: Add VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX so they removed from ospfd/ospf_vty.h * zebra.h: Move definition of ZEBRA_PORT to here, to remove dependence of lib on zebra/zserv.h
2004-10-13Make initializing smux connection configurable - "smux peer OID" commandhasso
initializes connection, and "no smux peer" command terminates it. Fixes bugzilla #47 and #112.
2004-10-112004-10-11 Paul Jakma <paul@dishone.st>paul
* if.h: mtu's should be unsigned. * routemap.{c,h}: const char updates * smux.{c,h}: ditto
2003-06-192003-06-19 Paul Jakma <paul@dishone.st>paul
* Fix lib/smux.c's reliance on daemons exporting struct thread_master *master.
2002-12-13Initial revisionpaul