From: Archie Pusaka <apusaka@google.com>
To: linux-bluetooth <linux-bluetooth@vger.kernel.org>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: CrosBT Upstreaming <chromeos-bluetooth-upstreaming@chromium.org>,
Archie Pusaka <apusaka@chromium.org>
Subject: [Bluez PATCH 54/62] mesh: Inclusive language changes
Date: Fri, 13 Aug 2021 20:18:39 +0800 [thread overview]
Message-ID: <20210813201256.Bluez.54.I9802817b065e02b0060e91cf8ce11a8f5fec973a@changeid> (raw)
In-Reply-To: <20210813121848.3686029-1-apusaka@google.com>
From: Archie Pusaka <apusaka@chromium.org>
"flooding", "accept list", and "reject list" are the preferred terms,
as reflected in
https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf
---
mesh/net-keys.c | 38 +++++++++++++++++++-------------------
mesh/net-keys.h | 8 ++++----
mesh/net.h | 4 ++--
3 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/mesh/net-keys.c b/mesh/net-keys.c
index e0060df746..ee7bbf0c05 100644
--- a/mesh/net-keys.c
+++ b/mesh/net-keys.c
@@ -45,7 +45,7 @@ struct net_key {
uint16_t beacon_enables;
uint8_t friend_key;
uint8_t nid;
- uint8_t master[16];
+ uint8_t flooding[16];
uint8_t encrypt[16];
uint8_t privacy[16];
uint8_t beacon[16];
@@ -53,7 +53,7 @@ struct net_key {
};
static struct l_queue *keys = NULL;
-static uint32_t last_master_id = 0;
+static uint32_t last_flooding_id = 0;
/* To avoid re-decrypting same packet for multiple nodes, cache and check */
static uint8_t cache_pkt[29];
@@ -63,11 +63,11 @@ static size_t cache_plainlen;
static uint32_t cache_id;
static uint32_t cache_iv_index;
-static bool match_master(const void *a, const void *b)
+static bool match_flooding(const void *a, const void *b)
{
const struct net_key *key = a;
- return (memcmp(key->master, b, sizeof(key->master)) == 0);
+ return (memcmp(key->flooding, b, sizeof(key->flooding)) == 0);
}
static bool match_id(const void *a, const void *b)
@@ -87,9 +87,9 @@ static bool match_network(const void *a, const void *b)
}
/* Key added from Provisioning, NetKey Add or NetKey update */
-uint32_t net_key_add(const uint8_t master[16])
+uint32_t net_key_add(const uint8_t flooding[16])
{
- struct net_key *key = l_queue_find(keys, match_master, master);
+ struct net_key *key = l_queue_find(keys, match_flooding, flooding);
uint8_t p[] = {0};
bool result;
@@ -102,22 +102,22 @@ uint32_t net_key_add(const uint8_t master[16])
keys = l_queue_new();
key = l_new(struct net_key, 1);
- memcpy(key->master, master, 16);
+ memcpy(key->flooding, flooding, 16);
key->ref_cnt++;
- result = mesh_crypto_k2(master, p, sizeof(p), &key->nid, key->encrypt,
+ result = mesh_crypto_k2(flooding, p, sizeof(p), &key->nid, key->encrypt,
key->privacy);
if (!result)
goto fail;
- result = mesh_crypto_k3(master, key->network);
+ result = mesh_crypto_k3(flooding, key->network);
if (!result)
goto fail;
- result = mesh_crypto_nkbk(master, key->beacon);
+ result = mesh_crypto_nkbk(flooding, key->beacon);
if (!result)
goto fail;
- key->id = ++last_master_id;
+ key->id = ++last_flooding_id;
l_queue_push_tail(keys, key);
return key->id;
@@ -126,11 +126,11 @@ fail:
return 0;
}
-uint32_t net_key_frnd_add(uint32_t master_id, uint16_t lpn, uint16_t frnd,
+uint32_t net_key_frnd_add(uint32_t flooding_id, uint16_t lpn, uint16_t frnd,
uint16_t lp_cnt, uint16_t fn_cnt)
{
const struct net_key *key = l_queue_find(keys, match_id,
- L_UINT_TO_PTR(master_id));
+ L_UINT_TO_PTR(flooding_id));
struct net_key *frnd_key;
uint8_t p[9] = {0x01};
bool result;
@@ -145,7 +145,7 @@ uint32_t net_key_frnd_add(uint32_t master_id, uint16_t lpn, uint16_t frnd,
l_put_be16(lp_cnt, p + 5);
l_put_be16(fn_cnt, p + 7);
- result = mesh_crypto_k2(key->master, p, sizeof(p), &frnd_key->nid,
+ result = mesh_crypto_k2(key->flooding, p, sizeof(p), &frnd_key->nid,
frnd_key->encrypt, frnd_key->privacy);
if (!result) {
@@ -155,7 +155,7 @@ uint32_t net_key_frnd_add(uint32_t master_id, uint16_t lpn, uint16_t frnd,
frnd_key->friend_key = true;
frnd_key->ref_cnt++;
- frnd_key->id = ++last_master_id;
+ frnd_key->id = ++last_flooding_id;
l_queue_push_head(keys, frnd_key);
return frnd_key->id;
@@ -174,22 +174,22 @@ void net_key_unref(uint32_t id)
}
}
-bool net_key_confirm(uint32_t id, const uint8_t master[16])
+bool net_key_confirm(uint32_t id, const uint8_t flooding[16])
{
struct net_key *key = l_queue_find(keys, match_id, L_UINT_TO_PTR(id));
if (key)
- return memcmp(key->master, master, sizeof(key->master)) == 0;
+ return !memcmp(key->flooding, flooding, sizeof(key->flooding));
return false;
}
-bool net_key_retrieve(uint32_t id, uint8_t *master)
+bool net_key_retrieve(uint32_t id, uint8_t *flooding)
{
struct net_key *key = l_queue_find(keys, match_id, L_UINT_TO_PTR(id));
if (key) {
- memcpy(master, key->master, sizeof(key->master));
+ memcpy(flooding, key->flooding, sizeof(key->flooding));
return true;
}
diff --git a/mesh/net-keys.h b/mesh/net-keys.h
index 70b3d22c3a..420618f710 100644
--- a/mesh/net-keys.h
+++ b/mesh/net-keys.h
@@ -13,10 +13,10 @@
#define IV_INDEX_UPDATE 0x02
void net_key_cleanup(void);
-bool net_key_confirm(uint32_t id, const uint8_t master[16]);
-bool net_key_retrieve(uint32_t id, uint8_t *master);
-uint32_t net_key_add(const uint8_t master[16]);
-uint32_t net_key_frnd_add(uint32_t master_id, uint16_t lpn, uint16_t frnd,
+bool net_key_confirm(uint32_t id, const uint8_t flooding[16]);
+bool net_key_retrieve(uint32_t id, uint8_t *flooding);
+uint32_t net_key_add(const uint8_t flooding[16]);
+uint32_t net_key_frnd_add(uint32_t flooding_id, uint16_t lpn, uint16_t frnd,
uint16_t lp_cnt, uint16_t fn_cnt);
void net_key_unref(uint32_t id);
uint32_t net_key_decrypt(uint32_t iv_index, const uint8_t *pkt, size_t len,
diff --git a/mesh/net.h b/mesh/net.h
index 4dbc94b8b3..465d889090 100644
--- a/mesh/net.h
+++ b/mesh/net.h
@@ -86,8 +86,8 @@ struct mesh_node;
#define PROXY_OP_FILTER_STATUS 0x03
/* Proxy Filter Defines */
-#define PROXY_FILTER_WHITELIST 0x00
-#define PROXY_FILTER_BLACKLIST 0x01
+#define PROXY_FILTER_ACCEPT_LIST 0x00
+#define PROXY_FILTER_REJECT_LIST 0x01
/* Network Tranport Opcodes */
#define NET_OP_SEG_ACKNOWLEDGE 0x00
--
2.33.0.rc1.237.g0d66db33f3-goog
next prev parent reply other threads:[~2021-08-13 12:22 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 12:17 [Bluez PATCH 00/62] Inclusive language changes Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 01/62] lib: Inclusive language in HCI commands and events Archie Pusaka
2021-08-13 12:49 ` Inclusive language changes bluez.test.bot
2021-08-13 19:26 ` [Bluez PATCH 01/62] lib: Inclusive language in HCI commands and events Marcel Holtmann
2021-08-13 21:47 ` Luiz Augusto von Dentz
2021-08-16 15:59 ` Marcel Holtmann
2021-08-13 12:17 ` [Bluez PATCH 02/62] lib: Inclusive language in consts and strings Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 03/62] tools/hciconfig: Inclusive language update Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 04/62] core: Inclusive language for l2cap Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 05/62] core: Inclusive language for rfcomm Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 06/62] lib: Inclusive language for filtering devices Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 07/62] lib/mgmt: Inclusive language for LTK Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 08/62] doc/mgmt: Inclusive language update Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 09/62] btio: Inclusive language changes Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 10/62] shared/ad: " Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 11/62] shared/hfp: " Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 12/62] monitor: Inclusive language in struct member Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 13/62] monitor: Inclusive language in SMP related things Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 14/62] monitor: Inclusive language in LE states Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 15/62] monitor: Inclusive language in LL feature Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 16/62] monitor: Inclusive language in link key transaction Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 17/62] monitor: Inclusive language in peripheral broadcast Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 18/62] monitor: Inclusive language in peripheral page response timeout Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 19/62] monitor: Inclusive language in consts and strings Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 20/62] monitor: Inclusive language in filtering devices Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 21/62] emulator: Inclusive language in naming Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 22/62] emulator: Inclusive language in strings Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 23/62] emulator: Inclusive language in filtering device Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 24/62] tools: Inclusive language in referring the central address Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 25/62] tools/parser/hci: Inclusive language changes Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 26/62] tools/parser/smp: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 27/62] tools/3dsp: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 28/62] tools/mgmt-tester: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 29/62] tools/bdaddr: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 30/62] tools/hciconfig: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 31/62] tools/meshctl: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 32/62] tools/mgmt-tester: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 33/62] tools/parser: Inclusive language in struct member Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 34/62] tools/parser/lmp: Inclusive language changes Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 35/62] tools/parser/avdtp: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 36/62] tools/parser/csr: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 37/62] tools/btpclientctl: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 38/62] tools/l2cap-tester: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 39/62] tools/hci-tester: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 40/62] tools/btiotest: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 41/62] tools/hcitool: Inclusive language changes, central peripheral Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 42/62] tools/hcitool: Inclusive language changes, accept list Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 43/62] tools/l2test: Inclusive language changes Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 44/62] tools/rctest: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 45/62] tools/rfcomm: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 46/62] plugins/sixaxis: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 47/62] profiles/audio: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 48/62] profiles/health: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 49/62] sdp: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 50/62] adapter: Inclusive language for central and peripheral Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 51/62] adapter: Inclusive language for storing LTK Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 52/62] adapter: Inclusive language for device filtering Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 53/62] client: Inclusive language changes Archie Pusaka
2021-08-13 12:18 ` Archie Pusaka [this message]
2021-08-13 12:18 ` [Bluez PATCH 55/62] tools/mesh: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 56/62] tools/mesh-gatt: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 57/62] unit/mesh: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 58/62] doc/mesh: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 59/62] android: Inclusive language for volume control Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 60/62] android: Inclusive language for describing relation Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 61/62] android: Inclusive language for filtering devices Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 62/62] android: Inclusive language in storing LTK Archie Pusaka
2021-08-13 21:42 ` [Bluez PATCH 00/62] Inclusive language changes Luiz Augusto von Dentz
2021-08-14 5:22 ` Archie Pusaka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210813201256.Bluez.54.I9802817b065e02b0060e91cf8ce11a8f5fec973a@changeid \
--to=apusaka@google.com \
--cc=apusaka@chromium.org \
--cc=chromeos-bluetooth-upstreaming@chromium.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).