Lines Matching refs:sub
160 static bool proxy_srv_check_and_get(struct bt_mesh_subnet *sub, const uint8_t *net_id, in proxy_srv_check_and_get() argument
165 srv = find_proxy_srv(sub->net_idx, true, true); 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()
206 static bool is_hash_equal(struct bt_mesh_subnet *sub, struct find_net_id *res, uint8_t idx) in is_hash_equal() argument
211 memcpy(&in[0], sub->keys[idx].net_id, 8); in is_hash_equal()
213 err = bt_mesh_encrypt(&sub->keys[idx].identity, in, out); in is_hash_equal()
226 static bool has_net_id(struct bt_mesh_subnet *sub, void *user_data) in has_net_id() argument
237 if (!(is_hash_equal(sub, res, 0) || in has_net_id()
238 (bt_mesh_subnet_has_new_key(sub) && is_hash_equal(sub, res, 1)))) { in has_net_id()
242 return proxy_srv_check_and_get(sub, net_id, &res->srv); in has_net_id()
250 struct bt_mesh_subnet *sub; in handle_net_id() local
270 sub = bt_mesh_subnet_find(has_net_id, (void *)&res); in handle_net_id()
271 if (sub && res.srv) { in handle_net_id()
378 static void subnet_evt(struct bt_mesh_subnet *sub, enum bt_mesh_key_evt evt) in subnet_evt() argument
382 (void)bt_mesh_proxy_disconnect(sub->net_idx); in subnet_evt()