summaryrefslogtreecommitdiff
path: root/mesh/net-keys.h
diff options
context:
space:
mode:
authorBrian Gix <brian.gix@intel.com>2020-10-08 10:44:59 -0700
committerBrian Gix <brian.gix@gmail.com>2023-01-30 16:14:41 -0800
commit5ba57cf85140e2087fef0e617608ee33a04c5449 (patch)
treeb454824891adf1a0cc9fbbba03c4d13468dc2369 /mesh/net-keys.h
parent6619b24cc23710c3074fe90c6510cb3688bee701 (diff)
downloadbluez-5ba57cf85140e2087fef0e617608ee33a04c5449.tar.gz
mesh: Add Tx/Rx support of Mesh Private Beacons
With this change, we start evaluating received Mesh Private Beacons in addition to the legacy Secure Network Beacons. We also add the ability to request Tx of Mesh Private Beacons, which are regenerated with new Random Nonce a minimum of every 0 - 2550 seconds.
Diffstat (limited to 'mesh/net-keys.h')
-rw-r--r--mesh/net-keys.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/mesh/net-keys.h b/mesh/net-keys.h
index 420618f71..a3909448c 100644
--- a/mesh/net-keys.h
+++ b/mesh/net-keys.h
@@ -9,6 +9,7 @@
*/
#define BEACON_TYPE_SNB 0x01
+#define BEACON_TYPE_MPB 0x02
#define KEY_REFRESH 0x01
#define IV_INDEX_UPDATE 0x02
@@ -23,12 +24,15 @@ uint32_t net_key_decrypt(uint32_t iv_index, const uint8_t *pkt, size_t len,
uint8_t **plain, size_t *plain_len);
bool net_key_encrypt(uint32_t id, uint32_t iv_index, uint8_t *pkt, size_t len);
uint32_t net_key_network_id(const uint8_t network[8]);
+uint32_t net_key_beacon(const uint8_t *data, uint16_t len, uint32_t *ivi,
+ bool *ivu, bool *kr);
bool net_key_snb_check(uint32_t id, uint32_t iv_index, bool kr, bool ivu,
uint64_t cmac);
bool net_key_snb_compose(uint32_t id, uint32_t iv_index, bool kr, bool ivu,
uint8_t *snb);
void net_key_beacon_seen(uint32_t id);
-void net_key_beacon_enable(uint32_t id);
-bool net_key_beacon_refresh(uint32_t id, uint32_t iv_index, bool kr, bool ivu);
-void net_key_beacon_disable(uint32_t id);
+bool net_key_beacon_refresh(uint32_t id, uint32_t iv_index, bool kr, bool ivu,
+ bool force);
+void net_key_beacon_enable(uint32_t id, bool mpb, uint8_t refresh_count);
+void net_key_beacon_disable(uint32_t id, bool mpb);
uint32_t net_key_beacon_last_seen(uint32_t id);