1f05cddf9SRui Paulo /* 2f05cddf9SRui Paulo * RADIUS Dynamic Authorization Server (DAS) 3f05cddf9SRui Paulo * Copyright (c) 2012, Jouni Malinen <j@w1.fi> 4f05cddf9SRui Paulo * 5f05cddf9SRui Paulo * This software may be distributed under the terms of the BSD license. 6f05cddf9SRui Paulo * See README for more details. 7f05cddf9SRui Paulo */ 8f05cddf9SRui Paulo 9f05cddf9SRui Paulo #ifndef RADIUS_DAS_H 10f05cddf9SRui Paulo #define RADIUS_DAS_H 11f05cddf9SRui Paulo 12f05cddf9SRui Paulo struct radius_das_data; 13f05cddf9SRui Paulo 14f05cddf9SRui Paulo enum radius_das_res { 15f05cddf9SRui Paulo RADIUS_DAS_SUCCESS, 16f05cddf9SRui Paulo RADIUS_DAS_NAS_MISMATCH, 175b9c547cSRui Paulo RADIUS_DAS_SESSION_NOT_FOUND, 185b9c547cSRui Paulo RADIUS_DAS_MULTI_SESSION_MATCH, 19*85732ac8SCy Schubert RADIUS_DAS_COA_FAILED, 20f05cddf9SRui Paulo }; 21f05cddf9SRui Paulo 22f05cddf9SRui Paulo struct radius_das_attrs { 235b9c547cSRui Paulo /* NAS identification attributes */ 245b9c547cSRui Paulo const u8 *nas_ip_addr; 255b9c547cSRui Paulo const u8 *nas_identifier; 265b9c547cSRui Paulo size_t nas_identifier_len; 275b9c547cSRui Paulo const u8 *nas_ipv6_addr; 285b9c547cSRui Paulo 295b9c547cSRui Paulo /* Session identification attributes */ 30f05cddf9SRui Paulo const u8 *sta_addr; 31f05cddf9SRui Paulo const u8 *user_name; 32f05cddf9SRui Paulo size_t user_name_len; 33f05cddf9SRui Paulo const u8 *acct_session_id; 34f05cddf9SRui Paulo size_t acct_session_id_len; 355b9c547cSRui Paulo const u8 *acct_multi_session_id; 365b9c547cSRui Paulo size_t acct_multi_session_id_len; 37f05cddf9SRui Paulo const u8 *cui; 38f05cddf9SRui Paulo size_t cui_len; 39*85732ac8SCy Schubert 40*85732ac8SCy Schubert /* Authorization changes */ 41*85732ac8SCy Schubert const u8 *hs20_t_c_filtering; 42f05cddf9SRui Paulo }; 43f05cddf9SRui Paulo 44f05cddf9SRui Paulo struct radius_das_conf { 45f05cddf9SRui Paulo int port; 46f05cddf9SRui Paulo const u8 *shared_secret; 47f05cddf9SRui Paulo size_t shared_secret_len; 48f05cddf9SRui Paulo const struct hostapd_ip_addr *client_addr; 49f05cddf9SRui Paulo unsigned int time_window; 50f05cddf9SRui Paulo int require_event_timestamp; 51780fb4a2SCy Schubert int require_message_authenticator; 52f05cddf9SRui Paulo void *ctx; 53f05cddf9SRui Paulo enum radius_das_res (*disconnect)(void *ctx, 54f05cddf9SRui Paulo struct radius_das_attrs *attr); 55*85732ac8SCy Schubert enum radius_das_res (*coa)(void *ctx, struct radius_das_attrs *attr); 56f05cddf9SRui Paulo }; 57f05cddf9SRui Paulo 58f05cddf9SRui Paulo struct radius_das_data * 59f05cddf9SRui Paulo radius_das_init(struct radius_das_conf *conf); 60f05cddf9SRui Paulo 61f05cddf9SRui Paulo void radius_das_deinit(struct radius_das_data *data); 62f05cddf9SRui Paulo 63f05cddf9SRui Paulo #endif /* RADIUS_DAS_H */ 64