/* Hook function for updating route_map assignment. */ static void ospf_route_map_update (const char *name) { struct ospf *ospf; int type; /* If OSPF instatnce does not exist, return right now. */ ospf = ospf_lookup (); if (ospf == NULL) return; /* Update route-map */ for (type = 0; type <= ZEBRA_ROUTE_MAX; type++) { if (ROUTEMAP_NAME (ospf, type) && strcmp (ROUTEMAP_NAME (ospf, type), name) == 0) { /* Keep old route-map. */ struct route_map *old = ROUTEMAP (ospf, type); /* Update route-map. */ ROUTEMAP (ospf, type) = route_map_lookup_by_name (ROUTEMAP_NAME (ospf, type)); /* No update for this distribute type. */ if (old == NULL && ROUTEMAP (ospf, type) == NULL) continue; ospf_distribute_list_update (ospf, type); } } }
static void ospf6_asbr_routemap_set (int type, const char *mapname) { if (ospf6->rmap[type].name) free (ospf6->rmap[type].name); ospf6->rmap[type].name = strdup (mapname); ospf6->rmap[type].map = route_map_lookup_by_name (mapname); }
static void ripng_redistribute_routemap_set (int type, const char *name) { if (ripng->route_map[type].name) free (ripng->route_map[type].name); ripng->route_map[type].name = strdup (name); ripng->route_map[type].map = route_map_lookup_by_name (name); }
/* RIP route-map set for redistribution */ void rip_routemap_set (int type, char *name) { if (rip->route_map[type].name) free(rip->route_map[type].name); rip->route_map[type].name = strdup (name); rip->route_map[type].map = route_map_lookup_by_name (name); }
/* redistribute function */ void ospf6_asbr_routemap_set (int type, char *mapname) { if (rmap[type].name) free (rmap[type].name); rmap[type].name = strdup (mapname); rmap[type].map = route_map_lookup_by_name (mapname); }
void ospf6_asbr_routemap_update () { int i; for (i = 0; i < ZEBRA_ROUTE_MAX; i++) { if (rmap[i].name) rmap[i].map = route_map_lookup_by_name (rmap[i].name); else rmap[i].map = NULL; } }
void eigrp_if_rmap_update(struct if_rmap *if_rmap) { struct interface *ifp; struct eigrp_interface *ei, *ei2; struct listnode *node, *nnode; struct route_map *rmap; struct eigrp *e; ifp = if_lookup_by_name(if_rmap->ifname); if (ifp == NULL) return; ei = NULL; e = eigrp_lookup(); for (ALL_LIST_ELEMENTS(e->eiflist, node, nnode, ei2)) { if (strcmp(ei2->ifp->name, ifp->name) == 0) { ei = ei2; break; } } if (if_rmap->routemap[IF_RMAP_IN]) { rmap = route_map_lookup_by_name(if_rmap->routemap[IF_RMAP_IN]); if (rmap) ei->routemap[IF_RMAP_IN] = rmap; else ei->routemap[IF_RMAP_IN] = NULL; } else ei->routemap[EIGRP_FILTER_IN] = NULL; if (if_rmap->routemap[IF_RMAP_OUT]) { rmap = route_map_lookup_by_name(if_rmap->routemap[IF_RMAP_OUT]); if (rmap) ei->routemap[IF_RMAP_OUT] = rmap; else ei->routemap[IF_RMAP_OUT] = NULL; } else ei->routemap[EIGRP_FILTER_OUT] = NULL; }
static void isis_redist_routemap_set(struct isis_redist *redist, const char *routemap) { if (redist->map_name) { XFREE(MTYPE_ISIS, redist->map_name); redist->map = NULL; } if (routemap && strlen(routemap)) { redist->map_name = XSTRDUP(MTYPE_ISIS, routemap); redist->map = route_map_lookup_by_name(routemap); } }
/* ARGSUSED */ void eigrp_route_map_update(const char *notused) { int i; struct eigrp *e; e = eigrp_lookup(); if (e) { for (i = 0; i < ZEBRA_ROUTE_MAX; i++) { if (e->route_map[i].name) e->route_map[i].map = route_map_lookup_by_name( e->route_map[i].name); } } }
/* Hook function for updating route_map assignment. */ void rip_route_map_update () { int i; if (rip) { for (i = 0; i < ZEBRA_ROUTE_MAX; i++) { if (rip->route_map[i].name) rip->route_map[i].map = route_map_lookup_by_name (rip->route_map[i].name); } } }
void eigrp_routemap_update_redistribute(void) { int i; struct eigrp *e; e = eigrp_lookup(); if (e) { for (i = 0; i < ZEBRA_ROUTE_MAX; i++) { if (e->route_map[i].name) e->route_map[i].map = route_map_lookup_by_name( e->route_map[i].name); } } }
/* Redistribute with route-map specification. */ int bgp_redistribute_rmap_set (struct bgp *bgp, afi_t afi, int type, const char *name) { if (bgp->rmap[afi][type].name && (strcmp (bgp->rmap[afi][type].name, name) == 0)) return 0; if (bgp->rmap[afi][type].name) free (bgp->rmap[afi][type].name); bgp->rmap[afi][type].name = strdup (name); bgp->rmap[afi][type].map = route_map_lookup_by_name (name); return 1; }
/* ARGSUSED */ static void rip_route_map_update (const char *notused) { int i; if (rip) { for (i = 0; i < ZEBRA_ROUTE_MAX; i++) { if (rip->route_map[i].name) rip->route_map[i].map = route_map_lookup_by_name (rip->route_map[i].name); } } }
static void ospf6_asbr_routemap_update (const char *mapname) { int type; if (ospf6 == NULL) return; for (type = 0; type < ZEBRA_ROUTE_MAX; type++) { if (ospf6->rmap[type].name) ospf6->rmap[type].map = route_map_lookup_by_name (ospf6->rmap[type].name); else ospf6->rmap[type].map = NULL; } }