1e5b75505Sopenharmony_ci/*
2e5b75505Sopenharmony_ci * WPA Supplicant - Mesh RSN routines
3e5b75505Sopenharmony_ci * Copyright (c) 2013-2014, cozybit, Inc.  All rights reserved.
4e5b75505Sopenharmony_ci *
5e5b75505Sopenharmony_ci * This software may be distributed under the terms of the BSD license.
6e5b75505Sopenharmony_ci * See README for more details.
7e5b75505Sopenharmony_ci */
8e5b75505Sopenharmony_ci
9e5b75505Sopenharmony_ci#ifndef MESH_RSN_H
10e5b75505Sopenharmony_ci#define MESH_RSN_H
11e5b75505Sopenharmony_ci
12e5b75505Sopenharmony_cistruct mesh_rsn {
13e5b75505Sopenharmony_ci	struct wpa_supplicant *wpa_s;
14e5b75505Sopenharmony_ci	struct wpa_authenticator *auth;
15e5b75505Sopenharmony_ci	unsigned int pairwise_cipher;
16e5b75505Sopenharmony_ci	unsigned int group_cipher;
17e5b75505Sopenharmony_ci	u8 mgtk[WPA_TK_MAX_LEN];
18e5b75505Sopenharmony_ci	size_t mgtk_len;
19e5b75505Sopenharmony_ci	u8 mgtk_key_id;
20e5b75505Sopenharmony_ci	unsigned int mgmt_group_cipher;
21e5b75505Sopenharmony_ci	u8 igtk_key_id;
22e5b75505Sopenharmony_ci	u8 igtk[WPA_TK_MAX_LEN];
23e5b75505Sopenharmony_ci	size_t igtk_len;
24e5b75505Sopenharmony_ci#ifdef CONFIG_SAE
25e5b75505Sopenharmony_ci	struct wpabuf *sae_token;
26e5b75505Sopenharmony_ci	int sae_group_index;
27e5b75505Sopenharmony_ci#endif /* CONFIG_SAE */
28e5b75505Sopenharmony_ci};
29e5b75505Sopenharmony_ci
30e5b75505Sopenharmony_cistruct mesh_rsn * mesh_rsn_auth_init(struct wpa_supplicant *wpa_s,
31e5b75505Sopenharmony_ci				     struct mesh_conf *conf);
32e5b75505Sopenharmony_ciint mesh_rsn_auth_sae_sta(struct wpa_supplicant *wpa_s, struct sta_info *sta);
33e5b75505Sopenharmony_ciint mesh_rsn_derive_mtk(struct wpa_supplicant *wpa_s, struct sta_info *sta);
34e5b75505Sopenharmony_civoid mesh_rsn_get_pmkid(struct mesh_rsn *rsn, struct sta_info *sta, u8 *pmkid);
35e5b75505Sopenharmony_civoid mesh_rsn_init_ampe_sta(struct wpa_supplicant *wpa_s,
36e5b75505Sopenharmony_ci			    struct sta_info *sta);
37e5b75505Sopenharmony_ciint mesh_rsn_protect_frame(struct mesh_rsn *rsn, struct sta_info *sta,
38e5b75505Sopenharmony_ci			   const u8 *cat, struct wpabuf *buf);
39e5b75505Sopenharmony_ciint mesh_rsn_process_ampe(struct wpa_supplicant *wpa_s, struct sta_info *sta,
40e5b75505Sopenharmony_ci			  struct ieee802_11_elems *elems, const u8 *cat,
41e5b75505Sopenharmony_ci			  const u8 *chosen_pmk,
42e5b75505Sopenharmony_ci			  const u8 *start, size_t elems_len);
43e5b75505Sopenharmony_civoid mesh_auth_timer(void *eloop_ctx, void *user_data);
44e5b75505Sopenharmony_ci
45e5b75505Sopenharmony_ci#endif /* MESH_RSN_H */
46