tools/mesh-cfgclient: Excluded addresses property
authorInga Stotland <inga.stotland@intel.com>
Thu, 23 Sep 2021 03:26:02 +0000 (20:26 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:37 +0000 (19:08 +0530)
The correct name for a property that contains a list of addresses
not allowed in circulation is "networkExclusions"
The "excluded" property in "nodes" array entry is used to indicated that
this node has been removed from a mesh network and it's address should not
be re-used.

Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
tools/mesh/mesh-db.c

index b1e292c..b2c0ae6 100644 (file)
@@ -2167,7 +2167,7 @@ static bool load_rejected_addresses(json_object *jobj)
        json_object *jarray;
        int i, cnt;
 
-       json_object_object_get_ex(jobj, "blacklistedAddresses", &jarray);
+       json_object_object_get_ex(jobj, "networkExclusions", &jarray);
        if (!jarray || json_object_get_type(jarray) != json_type_array)
                return true;
 
@@ -2214,11 +2214,10 @@ bool mesh_db_add_rejected_addr(uint16_t unicast, uint32_t iv_index)
        if (!cfg || !cfg->jcfg)
                return false;
 
-       json_object_object_get_ex(cfg->jcfg, "blacklistedAddresses", &jarray);
+       json_object_object_get_ex(cfg->jcfg, "networkExclusions", &jarray);
        if (!jarray) {
                jarray = json_object_new_array();
-               json_object_object_add(cfg->jcfg, "blacklistedAddresses",
-                                                                       jarray);
+               json_object_object_add(cfg->jcfg, "networkExclusions", jarray);
        }
 
        idx = get_rejected_by_iv_index(jarray, iv_index);
@@ -2263,7 +2262,7 @@ bool mesh_db_clear_rejected(uint32_t iv_index)
        if (!cfg || !cfg->jcfg)
                return false;
 
-       json_object_object_get_ex(cfg->jcfg, "blacklistedAddresses", &jarray);
+       json_object_object_get_ex(cfg->jcfg, "networkExclusions", &jarray);
        if (!jarray || json_object_get_type(jarray) != json_type_array)
                return false;
 
@@ -2340,7 +2339,7 @@ bool mesh_db_create(const char *fname, const uint8_t token[8],
        if (!jarray)
                goto fail;
 
-       json_object_object_add(jcfg, "blacklistedAddresses", jarray);
+       json_object_object_add(jcfg, "networkExclusions", jarray);
 
        write_int(jcfg, "ivIndex", 0);