summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_snmp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-53/+55
| | | | | | | | | | | | | | | | | | | | | | 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>
* lib: Isolate nexthop_group functions to nexthop_group.cDonald Sharp2018-03-091-10/+11
| | | | | | | Also modify `struct route_entry` to use nexthop_groups. Move ALL_NEXTHOPS loop to nexthop_group.h Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use clang's 'ForEachMacros' format style optionRenato Westphal2017-09-151-7/+5
| | | | | | | | | | | | | This fixes the broken indentation of several foreach loops throughout the code. From clang's documentation[1]: ForEachMacros: A vector of macros that should be interpreted as foreach loops instead of as function calls. [1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zebra: Fixup indentationDonald Sharp2017-09-111-6/+9
| | | | | | | | RNODE_FOREACH_RE... function calls were not properly being indented when we switched over to the new format. Let's fix this issue. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-446/+433
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: Refactor 'struct rib' to be 'struct route_entry'Donald Sharp2017-06-011-34/+34
| | | | | | | | | | The 'struct rib' data structure is missnamed. It really is a 'struct route_entry' as part of the 'struct route_node'. We have 1 'struct route_entry' per route src. As such 1 route node can have multiple route entries if multiple protocols attempt to install the same route. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: 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-5/+21
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: fix sign warning in SNMP codeDavid Lamparter2016-11-151-2/+2
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: snmp: add a load of "static" specifiersDavid Lamparter2016-07-281-2/+2
| | | | | | | Make it easier to see which bits in *_snmp.c are actually referenced from non-SNMP parts of the code. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: fix include for SNMPDavid Lamparter2016-07-281-0/+1
| | | | | | no idea where this disappeared. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: Refactor struct zebra_tDonald Sharp2016-04-151-2/+0
| | | | | | | | | | | We were including 'extern struct zebra_t zebrad;' all over the place. This made no sense. Refactor into zserv.h where the definition was and remove resulting unnecessary code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
* ZEBRA: Remove NEXTHOP_TYPE_XXX_IFNAMEDonald Sharp2015-12-041-2/+1
| | | | | | | The NEXTHOP_TYPE_XXX_IFNAME types were never being used. Remove them and the code associated with them. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib, zebra: move "struct vrf" to be a lib moduleFeng Lu2015-10-301-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously "struct vrf" is defined locally in zebra. Now it is moved to be a lib module. This is the first step to support multi-VRF in quagga. The implementation is splitted into small patches for the purpose of easy review. * lib: "struct vrf" with basic members is defined in vrf.c. The member "void *info" is for user data. Some basic functions are defined in vrf.c for adding/deleting/ looking up a VRF, scanning the VRF table and initializing the VRF module. The type "vrf_id_t" is defined specificly for VRF ID. * zebra: The previous "struct vrf" is re-defined as "struct zebra_vrf"; and previous "vrf" variables are renamed to "zvrf". The previous "struct vrf" related functions are removed from zbera_rib.c. New functions are defined to maintain the new "struct zebra_vrf". The names vrf_xxx are reserved for the functions in VRF module. So: - the previous vrf_table() are renamed to zebra_vrf_table(); - the previous vrf_static_table() are renamed to zebra_vrf_static_table(). The main logic is not changed. BTW: Add a statement to zebra_snmp.c telling that the SNMP is running only for the MIBs in the default VRF. Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Conflicts: lib/Makefile.am zebra/zebra_rib.c zebra/zebra_vty.c Conflicts: lib/Makefile.am lib/memtypes.c zebra/rib.h zebra/zebra_rib.c zebra/zebra_rnh.c zebra/zebra_rnh.h zebra/zebra_vty.c
* *: nuke ^L (page feed)David Lamparter2014-06-041-3/+3
| | | | | | | | | | | | | | Quagga sources have inherited a slew of Page Feed (^L, \xC) characters from ancient history. Among other things, these break patchwork's XML-RPC API because \xC is not a valid character in XML documents. Nuke them from high orbit. Patches can be adapted simply by: sed -e 's%^L%%' -i filename.patch (you can type page feeds in some environments with Ctrl-V Ctrl-L) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: add structure to hold per-prefix state in RIBAvneesh Sachdev2012-11-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the rib_dest_t structure to hold per-prefix state in the routing information base. This gives us an appropriate place to maintain the queueing state of a route_node. Queuing state was previously being stored on the first rib in the list of ribs hanging off the route_node. * zebra/rib.h - Add new structure rib_dest_t. - Remove the rn_status field from 'struct rib', it is no longer required. - Add macros (RNODE_FOREACH_RIB, RNODE_FOREACH_RIB_SAFE) for walking all 'struct ribs' corresponding to a route_node. These hide the fact that there is an intermediate rib_dest_t structure. - Add a few utility inlines to go between a rib_dest_t and associated structures. * zebra/zebra_rib.c - rib_link()/rib_unlink() Tweak for new behavior, where the 'info' pointer of a route_node points to a rib_dest_t. The list of ribs for a prefix now hangs off of the dest. Change the way we ref count route_nodes. We now hold a single ref count on a route_node if there is a corresponding rib_dest_t. - Maintain the queuing state of a route_node on the flags field of the rib_dest_t. - Add the rib_gc_dest() function, which deletes a rib_dest_t if it is no longer required. A rib_dest_t can be deleted iff there are no struct ribs hanging off of it. - Call rib_gc_dest() any time we unlink a rib from the rib_dest_t. Currently we only need to call it once, just before we return from rib_process(). * zebra/{redistribute,zebra_rib,zebra_snmp,zebra_vty}.c Use new macros to walk over route_node ribs. * lib/memtypes.c Add memory type for rib_dest_t. Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* snmp: let handlers accept OID from a lesser prefixVincent Bernat2012-06-251-0/+8
| | | | | | | | | 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.
* build: only define HAVE_SNMPVincent Bernat2012-06-251-6/+0
| | | | | NetSNMP is the only SNMP implementation for Quagga. We don't need two different symbols.
* [snmp] Compiler warning fixes for when "--enable-snmp" is configured.Chris Caputo2009-06-021-14/+19
| | | | | Compiled on 32-bit and 64-bit linux gcc 4.1.2 platforms. No run-time testing on 32-bit and limited run-time testing on 64-bit.
* Make --enable-snmp cross compile and make libcrypto optional with ↵Joakim Tjernlund2008-08-251-1/+3
| | | | | | | --without-crypto Autoconfig work by me, the rest was done by "Kirill K. Smirnov" <lich@math.spbu.ru>
* Make initializing smux connection configurable - "smux peer OID" commandhasso2004-10-131-4/+1
| | | | | initializes connection, and "no smux peer" command terminates it. Fixes bugzilla #47 and #112.
* Some compiler warnings fixes and fix for bugzilla #119.hasso2004-10-121-5/+5
|
* 2003-06-19 Paul Jakma <paul@dishone.st>paul2003-06-191-1/+4
| | | | | * Fix lib/smux.c's reliance on daemons exporting struct thread_master *master.
* Fix build for net-snmppaul2003-03-181-81/+99
|
* Initial revisionpaul2002-12-131-0/+550