appkey.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: LGPL-2.1-or-later */
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 2018-2019 Intel Corporation. All rights reserved.
  7. *
  8. *
  9. */
  10. /* TODO: get this number from configuration */
  11. #define MAX_APP_KEYS 32
  12. struct mesh_app_key;
  13. bool appkey_key_init(struct mesh_net *net, uint16_t net_idx, uint16_t app_idx,
  14. uint8_t *key_value, uint8_t *new_key_value);
  15. void appkey_key_free(void *data);
  16. void appkey_finalize(struct mesh_net *net, uint16_t net_idx);
  17. const uint8_t *appkey_get_key(struct mesh_net *net, uint16_t app_idx,
  18. uint8_t *key_id);
  19. int appkey_get_key_idx(struct mesh_app_key *app_key,
  20. const uint8_t **key, uint8_t *key_aid,
  21. const uint8_t **new_key, uint8_t *new_key_aid);
  22. bool appkey_have_key(struct mesh_net *net, uint16_t app_idx);
  23. uint16_t appkey_net_idx(struct mesh_net *net, uint16_t app_idx);
  24. int appkey_key_add(struct mesh_net *net, uint16_t net_idx, uint16_t app_idx,
  25. const uint8_t *new_key);
  26. int appkey_key_update(struct mesh_net *net, uint16_t net_idx, uint16_t app_idx,
  27. const uint8_t *new_key);
  28. int appkey_key_delete(struct mesh_net *net, uint16_t net_idx, uint16_t app_idx);
  29. void appkey_delete_bound_keys(struct mesh_net *net, uint16_t net_idx);
  30. uint8_t appkey_list(struct mesh_net *net, uint16_t net_idx, uint8_t *buf,
  31. uint16_t buf_size, uint16_t *size);