summaryrefslogtreecommitdiff
path: root/mesh/prov.h
diff options
context:
space:
mode:
authorBrian Gix <brian.gix@intel.com>2019-07-11 15:59:51 -0700
committerBrian Gix <brian.gix@intel.com>2019-07-14 08:32:18 -0700
commit2e46771050e6f302e4b7a8a1760ab19e68ea2385 (patch)
tree0a72f16bbe06de217dc2d7fc8eb991834e81238e /mesh/prov.h
parent20585d786bd6c52f84182621cb7299e00d01b2dc (diff)
downloadbluez-2e46771050e6f302e4b7a8a1760ab19e68ea2385.tar.gz
mesh: Convert provisioning pkts to packed structs
Provisioning packets are defined in the specification as packed big endian structures. Instead of specifying an octet array, we now use struct matching the spec.
Diffstat (limited to 'mesh/prov.h')
-rw-r--r--mesh/prov.h51
1 files changed, 50 insertions, 1 deletions
diff --git a/mesh/prov.h b/mesh/prov.h
index 61ec08e10..11b20b31f 100644
--- a/mesh/prov.h
+++ b/mesh/prov.h
@@ -48,7 +48,7 @@ enum mesh_prov_mode {
struct mesh_prov;
-typedef void (*prov_trans_tx_t)(void *trans_data, uint8_t *data, uint16_t len);
+typedef void (*prov_trans_tx_t)(void *trans_data, void *data, uint16_t len);
typedef void (*mesh_prov_open_func_t)(void *user_data, prov_trans_tx_t trans_tx,
void *trans_data, uint8_t trans_type);
@@ -63,6 +63,11 @@ struct prov_invite {
uint8_t attention;
} __packed;
+struct prov_invite_msg {
+ uint8_t opcode;
+ struct prov_invite invite;
+} __packed;
+
struct prov_start {
uint8_t algorithm;
uint8_t pub_key;
@@ -71,6 +76,50 @@ struct prov_start {
uint8_t auth_size;
} __packed;
+struct prov_caps_msg {
+ uint8_t opcode;
+ struct mesh_net_prov_caps caps;
+} __packed;
+
+struct prov_start_msg {
+ uint8_t opcode;
+ struct prov_start start;
+} __packed;
+
+struct prov_pub_key_msg {
+ uint8_t opcode;
+ uint8_t pub_key[64];
+} __packed;
+
+struct prov_conf_msg {
+ uint8_t opcode;
+ uint8_t conf[16];
+} __packed;
+
+struct prov_rand_msg {
+ uint8_t opcode;
+ uint8_t rand[16];
+} __packed;
+
+struct prov_data {
+ uint8_t net_key[16];
+ uint16_t net_idx;
+ uint8_t flags;
+ uint32_t iv_index;
+ uint16_t primary;
+} __packed;
+
+struct prov_data_msg {
+ uint8_t opcode;
+ struct prov_data data;
+ uint64_t mic;
+} __packed;
+
+struct prov_fail_msg {
+ uint8_t opcode;
+ uint8_t reason;
+} __packed;
+
struct conf_input {
struct prov_invite invite;
struct mesh_net_prov_caps caps;