diff options
author | root <root@hestia.halldom.com> | 2010-07-28 01:04:21 +0100 |
---|---|---|
committer | root <root@hestia.halldom.com> | 2010-07-28 01:04:21 +0100 |
commit | 5992b25ebee1ef68a6f0c9aaa9c67f9f7e6d74e9 (patch) | |
tree | a519f97cadd30fbb8f9219e464a3be5c679f0356 /lib | |
parent | 0f1365093f448e9503b618a5097eb8d6433e7710 (diff) | |
download | quagga-5992b25ebee1ef68a6f0c9aaa9c67f9f7e6d74e9.tar.bz2 quagga-5992b25ebee1ef68a6f0c9aaa9c67f9f7e6d74e9.tar.xz |
Introduce "rs-in" route-map
All peers may be configured with an "rs-in" route-map, whether they
are rsclients, or not.
All routes from a given peer are passed through the "rs-in" route-map
before being considered for inclusion in any rsclients RIBs.
Routes pass through the "rs-in" route-map once, irrespective of the
number of rsclients.
An "rs-in" route-map is intended to be used to ensure that routes
from a given peer are kosher, before being passed to rsclients.
The "in" route-map and filters may do the same, but for the main RIB.
Any route-selection type actions that the "in" route-map may do for
the main RIB will probably be done in the "import" route-map for an
rsclient RIB.
Also:
* make zfree() work for NULL items, in lib/memory.c
* fix clear ip bgp .... so works when pEstablished
Version change to ex03.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/memory.c | 15 | ||||
-rw-r--r-- | lib/routemap.h | 12 |
2 files changed, 16 insertions, 11 deletions
diff --git a/lib/memory.c b/lib/memory.c index 2e295566..c13404d2 100644 --- a/lib/memory.c +++ b/lib/memory.c @@ -203,18 +203,21 @@ zrealloc (enum MTYPE mtype, void *ptr, size_t size MEMORY_TRACKER_NAME) void zfree (enum MTYPE mtype, void *ptr) { - LOCK ; + if (ptr != NULL) + { + LOCK ; - assert(mstat.mt[mtype].alloc > 0) ; + assert(mstat.mt[mtype].alloc > 0) ; - mstat.mt[mtype].alloc--; + mstat.mt[mtype].alloc--; #ifdef MEMORY_TRACKER - mem_md_free(mtype, ptr) ; + mem_md_free(mtype, ptr) ; #endif - free (ptr); + free (ptr); - UNLOCK ; + UNLOCK ; + } ; } ; /*------------------------------------------------------------------------------ diff --git a/lib/routemap.h b/lib/routemap.h index 1402f5c8..5ff8e334 100644 --- a/lib/routemap.h +++ b/lib/routemap.h @@ -16,7 +16,7 @@ * You should have received a copy of the GNU General Public License * along with GNU Zebra; see the file COPYING. If not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. + * 02111-1307, USA. */ #ifndef _ZEBRA_ROUTEMAP_H @@ -30,7 +30,9 @@ enum route_map_type RMAP_ANY }; -typedef enum +typedef enum route_map_type route_map_type_t ; + +typedef enum { RMAP_MATCH, RMAP_DENYMATCH, @@ -78,7 +80,7 @@ struct route_map_rule_cmd const char *str; /* Function for value set or match. */ - route_map_result_t (*func_apply)(void *, struct prefix *, + route_map_result_t (*func_apply)(void *, struct prefix *, route_map_object_t, void *); /* Compile argument and return result as void *. */ @@ -115,7 +117,7 @@ struct route_map_index int pref; /* Route map type permit or deny. */ - enum route_map_type type; + enum route_map_type type; /* Do we follow old rules, or hop forward? */ route_map_end_t exitpolicy; @@ -166,7 +168,7 @@ extern int route_map_delete_match (struct route_map_index *index, const char *match_arg); /* Add route-map set statement to the route map. */ -extern int route_map_add_set (struct route_map_index *index, +extern int route_map_add_set (struct route_map_index *index, const char *set_name, const char *set_arg); |