]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_area.c
eigrpd: eigrp usage of uint32_t to struct in_addr for router_id data
[mirror_frr.git] / ospf6d / ospf6_area.c
index bd5e2bd1d35740e1d6ff6ce0bdcaaa5f29907df1..30f0e9e77421daaf10c682c71a0ab3d422a78989 100644 (file)
@@ -61,7 +61,8 @@ static void ospf6_area_lsdb_hook_add(struct ospf6_lsa *lsa)
        case OSPF6_LSTYPE_ROUTER:
        case OSPF6_LSTYPE_NETWORK:
                if (IS_OSPF6_DEBUG_EXAMIN_TYPE(lsa->header->type)) {
-                       zlog_debug("%s Examin LSA %s", __PRETTY_FUNCTION__, lsa->name);
+                       zlog_debug("%s Examin LSA %s", __PRETTY_FUNCTION__,
+                                  lsa->name);
                        zlog_debug(" Schedule SPF Calculation for %s",
                                   OSPF6_AREA(lsa->lsdb->data)->name);
                }
@@ -117,7 +118,9 @@ static void ospf6_area_lsdb_hook_remove(struct ospf6_lsa *lsa)
 
 static void ospf6_area_route_hook_add(struct ospf6_route *route)
 {
-       struct ospf6_route *copy = ospf6_route_copy(route);
+       struct ospf6_route *copy;
+
+       copy = ospf6_route_copy(route);
        ospf6_route_add(copy, ospf6->route_table);
 }
 
@@ -196,7 +199,7 @@ static void ospf6_area_no_summary_unset(struct ospf6 *ospf6,
  * @param o - ospf6 instance
  * @param df - display format for area ID
  */
-struct ospf6_area *ospf6_area_create(u_int32_t area_id, struct ospf6 *o, int df)
+struct ospf6_area *ospf6_area_create(uint32_t area_id, struct ospf6 *o, int df)
 {
        struct ospf6_area *oa;
 
@@ -219,6 +222,7 @@ struct ospf6_area *ospf6_area_create(u_int32_t area_id, struct ospf6 *o, int df)
        oa->lsdb->hook_add = ospf6_area_lsdb_hook_add;
        oa->lsdb->hook_remove = ospf6_area_lsdb_hook_remove;
        oa->lsdb_self = ospf6_lsdb_create(oa);
+       oa->temp_router_lsa_lsdb = ospf6_lsdb_create(oa);
 
        oa->spf_table = OSPF6_ROUTE_TABLE_CREATE(AREA, SPF_RESULTS);
        oa->spf_table->scope = oa;
@@ -273,10 +277,11 @@ void ospf6_area_delete(struct ospf6_area *oa)
        for (ALL_LIST_ELEMENTS_RO(oa->if_list, n, oi))
                oi->area = NULL;
 
-       list_delete_and_null(&oa->if_list);
+       list_delete(&oa->if_list);
 
        ospf6_lsdb_delete(oa->lsdb);
        ospf6_lsdb_delete(oa->lsdb_self);
+       ospf6_lsdb_delete(oa->temp_router_lsa_lsdb);
 
        ospf6_spf_table_finish(oa->spf_table);
        ospf6_route_table_delete(oa->spf_table);
@@ -293,7 +298,7 @@ void ospf6_area_delete(struct ospf6_area *oa)
        XFREE(MTYPE_OSPF6_AREA, oa);
 }
 
-struct ospf6_area *ospf6_area_lookup(u_int32_t area_id, struct ospf6 *ospf6)
+struct ospf6_area *ospf6_area_lookup(uint32_t area_id, struct ospf6 *ospf6)
 {
        struct ospf6_area *oa;
        struct listnode *n;
@@ -379,7 +384,7 @@ void ospf6_area_show(struct vty *vty, struct ospf6_area *oa)
 #define OSPF6_CMD_AREA_GET(str, oa)                                            \
        {                                                                      \
                char *ep;                                                      \
-               u_int32_t area_id = htonl(strtoul(str, &ep, 10));              \
+               uint32_t area_id = htonl(strtoul(str, &ep, 10));               \
                if (*ep && inet_pton(AF_INET, str, &area_id) != 1) {           \
                        vty_out(vty, "Malformed Area-ID: %s\n", str);          \
                        return CMD_SUCCESS;                                    \
@@ -411,7 +416,7 @@ DEFUN (area_range,
        struct ospf6_area *oa;
        struct prefix prefix;
        struct ospf6_route *range;
-       u_int32_t cost = OSPF_AREA_RANGE_COST_UNSPEC;
+       uint32_t cost = OSPF_AREA_RANGE_COST_UNSPEC;
 
        OSPF6_CMD_AREA_GET(argv[idx_ipv4]->arg, oa);
 
@@ -436,6 +441,7 @@ DEFUN (area_range,
                        SET_FLAG(range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE);
                } else if (strmatch(argv[idx_type]->text, "advertise")) {
                        UNSET_FLAG(range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE);
+                       cost = range->path.u.cost_config;
                } else {
                        cost = strtoul(argv[5]->arg, NULL, 10);
                        UNSET_FLAG(range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE);
@@ -561,9 +567,10 @@ void ospf6_area_config_write(struct vty *vty)
 
 DEFUN (area_filter_list,
        area_filter_list_cmd,
-       "area A.B.C.D filter-list prefix WORD <in|out>",
+       "area <A.B.C.D|(0-4294967295)> filter-list prefix WORD <in|out>",
        "OSPF6 area parameters\n"
        "OSPF6 area ID in IP address format\n"
+       "OSPF6 area ID as a decimal value\n"
        "Filter networks between OSPF6 areas\n"
        "Filter prefixes between OSPF6 areas\n"
        "Name of an IPv6 prefix-list\n"
@@ -583,14 +590,14 @@ DEFUN (area_filter_list,
        if (strmatch(inout, "in")) {
                PREFIX_LIST_IN(area) = plist;
                XFREE(MTYPE_OSPF6_PLISTNAME, PREFIX_NAME_IN(area));
-               PREFIX_NAME_IN(area) = XSTRDUP(MTYPE_OSPF6_PLISTNAME,
-                                              plistname);
+               PREFIX_NAME_IN(area) =
+                       XSTRDUP(MTYPE_OSPF6_PLISTNAME, plistname);
                ospf6_abr_reimport(area);
        } else {
                PREFIX_LIST_OUT(area) = plist;
                XFREE(MTYPE_OSPF6_PLISTNAME, PREFIX_NAME_OUT(area));
-               PREFIX_NAME_OUT(area) = XSTRDUP(MTYPE_OSPF6_PLISTNAME,
-                                               plistname);
+               PREFIX_NAME_OUT(area) =
+                       XSTRDUP(MTYPE_OSPF6_PLISTNAME, plistname);
                ospf6_abr_enable_area(area);
        }
 
@@ -599,10 +606,11 @@ DEFUN (area_filter_list,
 
 DEFUN (no_area_filter_list,
        no_area_filter_list_cmd,
-       "no area A.B.C.D filter-list prefix WORD <in|out>",
+       "no area <A.B.C.D|(0-4294967295)> filter-list prefix WORD <in|out>",
        NO_STR
        "OSPF6 area parameters\n"
        "OSPF6 area ID in IP address format\n"
+       "OSPF6 area ID as a decimal value\n"
        "Filter networks between OSPF6 areas\n"
        "Filter prefixes between OSPF6 areas\n"
        "Name of an IPv6 prefix-list\n"
@@ -656,9 +664,10 @@ void ospf6_area_plist_update(struct prefix_list *plist, int add)
 
 DEFUN (area_import_list,
        area_import_list_cmd,
-       "area A.B.C.D import-list NAME",
+       "area <A.B.C.D|(0-4294967295)> import-list NAME",
        "OSPF6 area parameters\n"
        "OSPF6 area ID in IP address format\n"
+       "OSPF6 area ID as a decimal value\n"
        "Set the filter for networks from other areas announced to the specified one\n"
        "Name of the acess-list\n")
 {
@@ -684,10 +693,11 @@ DEFUN (area_import_list,
 
 DEFUN (no_area_import_list,
        no_area_import_list_cmd,
-       "no area A.B.C.D import-list NAME",
+       "no area <A.B.C.D|(0-4294967295)> import-list NAME",
        NO_STR
        "OSPF6 area parameters\n"
        "OSPF6 area ID in IP address format\n"
+       "OSPF6 area ID as a decimal value\n"
        "Unset the filter for networks announced to other areas\n"
        "Name of the access-list\n")
 {
@@ -709,9 +719,10 @@ DEFUN (no_area_import_list,
 
 DEFUN (area_export_list,
        area_export_list_cmd,
-       "area A.B.C.D export-list NAME",
+       "area <A.B.C.D|(0-4294967295)> export-list NAME",
        "OSPF6 area parameters\n"
        "OSPF6 area ID in IP address format\n"
+       "OSPF6 area ID as a decimal value\n"
        "Set the filter for networks announced to other areas\n"
        "Name of the acess-list\n")
 {
@@ -737,10 +748,11 @@ DEFUN (area_export_list,
 
 DEFUN (no_area_export_list,
        no_area_export_list_cmd,
-       "no area A.B.C.D export-list NAME",
+       "no area <A.B.C.D|(0-4294967295)> export-list NAME",
        NO_STR
        "OSPF6 area parameters\n"
        "OSPF6 area ID in IP address format\n"
+       "OSPF6 area ID as a decimal value\n"
        "Unset the filter for networks announced to other areas\n"
        "Name of the access-list\n")
 {
@@ -766,7 +778,7 @@ DEFUN (show_ipv6_ospf6_spf_tree,
        SHOW_STR
        IP6_STR
        OSPF6_STR
-       "Shortest Path First caculation\n"
+       "Shortest Path First calculation\n"
        "Show SPF tree\n")
 {
        struct listnode *node;
@@ -801,11 +813,11 @@ DEFUN (show_ipv6_ospf6_area_spf_tree,
        OSPF6_STR
        OSPF6_AREA_STR
        OSPF6_AREA_ID_STR
-       "Shortest Path First caculation\n"
+       "Shortest Path First calculation\n"
        "Show SPF tree\n")
 {
        int idx_ipv4 = 4;
-       u_int32_t area_id;
+       uint32_t area_id;
        struct ospf6_area *oa;
        struct ospf6_vertex *root;
        struct ospf6_route *route;
@@ -851,12 +863,12 @@ DEFUN (show_ipv6_ospf6_simulate_spf_tree_root,
 {
        int idx_ipv4 = 5;
        int idx_ipv4_2 = 7;
-       u_int32_t area_id;
+       uint32_t area_id;
        struct ospf6_area *oa;
        struct ospf6_vertex *root;
        struct ospf6_route *route;
        struct prefix prefix;
-       u_int32_t router_id;
+       uint32_t router_id;
        struct ospf6_route_table *spf_table;
        unsigned char tmp_debug_ospf6_spf = 0;