diff options
author | Feng Lu <lu.feng@6wind.com> | 2015-05-22 11:39:56 +0200 |
---|---|---|
committer | Vipin Kumar <vipin@cumulusnetworks.com> | 2015-10-30 00:45:10 +0100 |
commit | b72ede27fd39c2e97dbf31715464573c30de557f (patch) | |
tree | 11eed2f547406c62434d9097bd2331940eac6b67 /zebra/zebra_snmp.c | |
parent | Deactivate BGP peer via "no neighbor x.x.x.x activate" removes other config (diff) | |
download | frr-b72ede27fd39c2e97dbf31715464573c30de557f.tar.xz frr-b72ede27fd39c2e97dbf31715464573c30de557f.zip |
lib, zebra: move "struct vrf" to be a lib module
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
Diffstat (limited to 'zebra/zebra_snmp.c')
-rw-r--r-- | zebra/zebra_snmp.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/zebra/zebra_snmp.c b/zebra/zebra_snmp.c index f0d3e7e58..3d005aa55 100644 --- a/zebra/zebra_snmp.c +++ b/zebra/zebra_snmp.c @@ -19,6 +19,10 @@ * 02111-1307, USA. */ +/* + * Currently SNMP is only running properly for MIBs in the default VRF. + */ + #include <zebra.h> #ifdef HAVE_SNMP @@ -31,6 +35,7 @@ #include "command.h" #include "smux.h" #include "table.h" +#include "vrf.h" #include "zebra/rib.h" #include "zebra/zserv.h" @@ -143,7 +148,7 @@ ipFwNumber (struct variable *v, oid objid[], size_t *objid_len, if (smux_header_generic(v, objid, objid_len, exact, val_len, write_method) == MATCH_FAILED) return NULL; - table = vrf_table (AFI_IP, SAFI_UNICAST, 0); + table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, VRF_DEFAULT); if (! table) return NULL; @@ -168,7 +173,7 @@ ipCidrNumber (struct variable *v, oid objid[], size_t *objid_len, if (smux_header_generic(v, objid, objid_len, exact, val_len, write_method) == MATCH_FAILED) return NULL; - table = vrf_table (AFI_IP, SAFI_UNICAST, 0); + table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, VRF_DEFAULT); if (! table) return 0; @@ -330,7 +335,7 @@ get_fwtable_route_node(struct variable *v, oid objid[], size_t *objid_len, if (exact && (*objid_len != (unsigned) v->namelen + 10)) return; - table = vrf_table (AFI_IP, SAFI_UNICAST, 0); + table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, VRF_DEFAULT); if (! table) return; |