|
Packit |
34410b |
/*
|
|
Packit |
34410b |
*
|
|
Packit |
34410b |
* BlueZ - Bluetooth protocol stack for Linux
|
|
Packit |
34410b |
*
|
|
Packit |
34410b |
* Copyright (C) 2018-2019 Intel Corporation. All rights reserved.
|
|
Packit |
34410b |
*
|
|
Packit |
34410b |
*
|
|
Packit |
34410b |
* This library is free software; you can redistribute it and/or
|
|
Packit |
34410b |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit |
34410b |
* License as published by the Free Software Foundation; either
|
|
Packit |
34410b |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
34410b |
*
|
|
Packit |
34410b |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
34410b |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
34410b |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
34410b |
* Lesser General Public License for more details.
|
|
Packit |
34410b |
*
|
|
Packit |
34410b |
*/
|
|
Packit |
34410b |
|
|
Packit |
34410b |
/* TODO: get this number from configuration */
|
|
Packit |
34410b |
#define MAX_APP_KEYS 32
|
|
Packit |
34410b |
|
|
Packit |
34410b |
struct mesh_app_key;
|
|
Packit |
34410b |
|
|
Packit |
34410b |
bool appkey_key_init(struct mesh_net *net, uint16_t net_idx, uint16_t app_idx,
|
|
Packit |
34410b |
uint8_t *key_value, uint8_t *new_key_value);
|
|
Packit |
34410b |
void appkey_key_free(void *data);
|
|
Packit |
34410b |
bool appkey_msg_in_replay_cache(struct mesh_net *net, uint16_t idx,
|
|
Packit |
34410b |
uint16_t src, uint16_t crpl, uint32_t seq,
|
|
Packit |
34410b |
uint32_t iv_index);
|
|
Packit |
34410b |
const uint8_t *appkey_get_key(struct mesh_net *net, uint16_t app_idx,
|
|
Packit |
34410b |
uint8_t *key_id);
|
|
Packit |
34410b |
int appkey_get_key_idx(struct mesh_app_key *app_key,
|
|
Packit |
34410b |
const uint8_t **key, uint8_t *key_aid,
|
|
Packit |
34410b |
const uint8_t **new_key, uint8_t *new_key_aid);
|
|
Packit |
34410b |
bool appkey_have_key(struct mesh_net *net, uint16_t app_idx);
|
|
Packit |
34410b |
uint16_t appkey_net_idx(struct mesh_net *net, uint16_t app_idx);
|
|
Packit |
34410b |
int appkey_key_add(struct mesh_net *net, uint16_t net_idx, uint16_t app_idx,
|
|
Packit |
34410b |
const uint8_t *new_key);
|
|
Packit |
34410b |
int appkey_key_update(struct mesh_net *net, uint16_t net_idx, uint16_t app_idx,
|
|
Packit |
34410b |
const uint8_t *new_key);
|
|
Packit |
34410b |
int appkey_key_delete(struct mesh_net *net, uint16_t net_idx, uint16_t app_idx);
|
|
Packit |
34410b |
void appkey_delete_bound_keys(struct mesh_net *net, uint16_t net_idx);
|
|
Packit |
34410b |
uint8_t appkey_list(struct mesh_net *net, uint16_t net_idx, uint8_t *buf,
|
|
Packit |
34410b |
uint16_t buf_size, uint16_t *size);
|