2019-04-10 19:48:08 +02:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Wireless daemon for Linux
|
|
|
|
*
|
|
|
|
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-04-17 23:53:40 +02:00
|
|
|
struct erp_state;
|
|
|
|
struct erp_cache_entry;
|
|
|
|
|
|
|
|
enum erp_result {
|
|
|
|
ERP_RESULT_SUCCESS,
|
|
|
|
ERP_RESULT_FAIL,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef void (*erp_tx_packet_func_t)(const uint8_t *erp_data, size_t len,
|
|
|
|
void *user_data);
|
2019-04-10 19:48:08 +02:00
|
|
|
|
2019-04-17 23:53:40 +02:00
|
|
|
struct erp_state *erp_new(struct erp_cache_entry *cache,
|
|
|
|
erp_tx_packet_func_t tx_packet,
|
2019-05-03 20:59:49 +02:00
|
|
|
void *user_data);
|
2019-04-17 23:53:40 +02:00
|
|
|
void erp_free(struct erp_state *erp);
|
|
|
|
|
|
|
|
bool erp_start(struct erp_state *erp);
|
2019-05-03 20:59:49 +02:00
|
|
|
int erp_rx_packet(struct erp_state *erp, const uint8_t *erp_data, size_t len);
|
|
|
|
|
2019-05-03 21:17:17 +02:00
|
|
|
const void *erp_get_rmsk(struct erp_state *erp, size_t *rmsk_len);
|
2019-04-17 23:53:40 +02:00
|
|
|
|
|
|
|
void erp_cache_add(const char *id, const void *session_id, size_t session_len,
|
|
|
|
const void *emsk, size_t emsk_len,
|
|
|
|
const char *ssid);
|
2019-04-10 19:48:08 +02:00
|
|
|
|
2019-04-17 23:53:40 +02:00
|
|
|
void erp_cache_remove(const char *id);
|
2019-04-10 19:48:08 +02:00
|
|
|
|
2019-04-17 23:53:40 +02:00
|
|
|
struct erp_cache_entry *erp_cache_get(const char *ssid);
|
|
|
|
void erp_cache_put(struct erp_cache_entry *cache);
|
2019-04-10 19:48:08 +02:00
|
|
|
|
2019-04-17 23:53:40 +02:00
|
|
|
const char *erp_cache_entry_get_identity(struct erp_cache_entry *cache);
|