Lines Matching +full:data +full:- +full:role

4  * SPDX-License-Identifier: Apache-2.0
36 struct bt_mesh_proxy_role *role; member
40 [0 ... (CONFIG_BT_MAX_CONN - 1)] = {
51 if (!servers[i].role) { in find_proxy_srv()
70 if (!servers[i].role || in find_proxy_srv_by_conn()
71 servers[i].role->conn != conn) { in find_proxy_srv_by_conn()
89 if (!server->link_opened) { in bt_mesh_proxy_cli_relay()
93 if (bt_mesh_proxy_relay_send(server->role->conn, adv)) { in bt_mesh_proxy_cli_relay()
103 static void proxy_msg_recv(struct bt_mesh_proxy_role *role) in proxy_msg_recv() argument
105 switch (role->msg_type) { in proxy_msg_recv()
108 bt_mesh_net_recv(&role->buf, 0, BT_MESH_NET_IF_PROXY); in proxy_msg_recv()
112 bt_mesh_beacon_recv(&role->buf); in proxy_msg_recv()
119 LOG_WRN("Unhandled Message Type 0x%02x", role->msg_type); in proxy_msg_recv()
128 srv->role = bt_mesh_proxy_role_setup(conn, bt_mesh_gatt_send, in proxy_connected()
136 srv->link_opened = true; in proxy_link_open()
143 bt_mesh_proxy_role_cleanup(srv->role); in proxy_disconnected()
145 srv->role = NULL; in proxy_disconnected()
146 srv->link_opened = false; in proxy_disconnected()
165 srv = find_proxy_srv(sub->net_idx, true, true); in proxy_srv_check_and_get()
167 if (srv->role) { in proxy_srv_check_and_get()
182 if (!net_id || !memcmp(sub->keys[0].net_id, net_id, 8) || in proxy_srv_check_and_get()
183 (bt_mesh_subnet_has_new_key(sub) && !memcmp(sub->keys[1].net_id, net_id, 8))) { in proxy_srv_check_and_get()
201 } data; member
211 memcpy(&in[0], sub->keys[idx].net_id, 8); in is_hash_equal()
212 memcpy(&in[8], res->data.priv.rand, 8); in is_hash_equal()
213 err = bt_mesh_encrypt(&sub->keys[idx].identity, in, out); in is_hash_equal()
219 if (memcmp(&out[8], res->data.priv.hash, 8)) { in is_hash_equal()
231 if (res->type == BT_MESH_ID_TYPE_NET) { in has_net_id()
232 net_id = (uint8_t *)res->data.net_id; in has_net_id()
242 return proxy_srv_check_and_get(sub, net_id, &res->srv); in has_net_id()
256 if (buf->len != 8) { in handle_net_id()
259 res.data.net_id = net_buf_simple_pull_mem(buf, 8); in handle_net_id()
262 if (buf->len != 16) { in handle_net_id()
266 res.data.priv.hash = net_buf_simple_pull_mem(buf, 8); in handle_net_id()
267 res.data.priv.rand = net_buf_simple_pull_mem(buf, 8); in handle_net_id()
272 err = bt_mesh_gatt_cli_connect(info->addr, &proxy, res.srv); in handle_net_id()
311 return -EALREADY; in bt_mesh_proxy_connect()
321 return -EALREADY; in bt_mesh_proxy_connect()
326 return -ENOMEM; in bt_mesh_proxy_connect()
329 srv->net_idx = net_idx; in bt_mesh_proxy_connect()
342 return -EALREADY; in bt_mesh_proxy_disconnect()
345 srv->net_idx = BT_MESH_KEY_UNUSED; in bt_mesh_proxy_disconnect()
347 if (!srv->role) { in bt_mesh_proxy_disconnect()
351 return bt_conn_disconnect(srv->role->conn, in bt_mesh_proxy_disconnect()
356 return -EALREADY; in bt_mesh_proxy_disconnect()
364 if (!servers[i].role) { in bt_mesh_proxy_disconnect()
368 err = bt_conn_disconnect(servers[i].role->conn, in bt_mesh_proxy_disconnect()
382 (void)bt_mesh_proxy_disconnect(sub->net_idx); in subnet_evt()