From 73ffb25bec41d729b0dac34d17b6ccd4aa25803b Mon Sep 17 00:00:00 2001 From: paul Date: Sat, 19 Apr 2003 15:49:49 +0000 Subject: Hasso Tepper http://hasso.linux.ee/zebra/ht-routemap-18042003_5.patch Trivial fixes to sync daemon's route-map commands to have same syntax. Fixes a lot of errors with "match ..." and "set ..." commands when using vtysh. --- ospfd/ospf_routemap.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'ospfd/ospf_routemap.c') diff --git a/ospfd/ospf_routemap.c b/ospfd/ospf_routemap.c index a2b257fa..64822d61 100644 --- a/ospfd/ospf_routemap.c +++ b/ospfd/ospf_routemap.c @@ -43,28 +43,32 @@ void ospf_route_map_update (char *name) { + struct ospf *ospf; int type; /* If OSPF instatnce does not exist, return right now. */ - if (!ospf_top) + ospf = ospf_lookup (); + if (ospf == NULL) return; /* Update route-map */ for (type = 0; type <= ZEBRA_ROUTE_MAX; type++) { - if (ROUTEMAP_NAME (type) && strcmp (ROUTEMAP_NAME (type), name) == 0) + if (ROUTEMAP_NAME (ospf, type) + && strcmp (ROUTEMAP_NAME (ospf, type), name) == 0) { /* Keep old route-map. */ - struct route_map *old = ROUTEMAP (type); + struct route_map *old = ROUTEMAP (ospf, type); /* Update route-map. */ - ROUTEMAP (type) = route_map_lookup_by_name (ROUTEMAP_NAME (type)); + ROUTEMAP (ospf, type) = + route_map_lookup_by_name (ROUTEMAP_NAME (ospf, type)); /* No update for this distribute type. */ - if (old == NULL && ROUTEMAP (type) == NULL) + if (old == NULL && ROUTEMAP (ospf, type) == NULL) continue; - ospf_distribute_list_update (type); + ospf_distribute_list_update (ospf, type); } } } @@ -72,19 +76,21 @@ ospf_route_map_update (char *name) void ospf_route_map_event (route_map_event_t event, char *name) { + struct ospf *ospf; int type; /* If OSPF instatnce does not exist, return right now. */ - if (!ospf_top) + ospf = ospf_lookup (); + if (ospf == NULL) return; /* Update route-map. */ for (type = 0; type <= ZEBRA_ROUTE_MAX; type++) { - if (ROUTEMAP_NAME (type) && ROUTEMAP (type) && - !strcmp (ROUTEMAP_NAME (type), name)) + if (ROUTEMAP_NAME (ospf, type) && ROUTEMAP (ospf, type) + && !strcmp (ROUTEMAP_NAME (ospf, type), name)) { - ospf_distribute_list_update (type); + ospf_distribute_list_update (ospf, type); } } } @@ -750,8 +756,8 @@ DEFUN (set_metric_type, "set metric-type (type-1|type-2)", SET_STR "Type of metric for destination routing protocol\n" - "OSPF external type 1 metric\n" - "OSPF external type 2 metric\n") + "OSPF[6] external type 1 metric\n" + "OSPF[6] external type 2 metric\n") { if (strcmp (argv[0], "1") == 0) return ospf_route_set_add (vty, vty->index, "metric-type", "type-1"); @@ -780,8 +786,8 @@ ALIAS (no_set_metric_type, NO_STR SET_STR "Type of metric for destination routing protocol\n" - "OSPF external type 1 metric\n" - "OSPF external type 2 metric\n") + "OSPF[6] external type 1 metric\n" + "OSPF[6] external type 2 metric\n") /* Route-map init */ void -- cgit v1.2.1