Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 1 | /* |
| 2 | * RADIUS Dynamic Authorization Server (DAS) |
| 3 | * Copyright (c) 2012, Jouni Malinen <j@w1.fi> |
| 4 | * |
| 5 | * This software may be distributed under the terms of the BSD license. |
| 6 | * See README for more details. |
| 7 | */ |
| 8 | |
| 9 | #ifndef RADIUS_DAS_H |
| 10 | #define RADIUS_DAS_H |
| 11 | |
| 12 | struct radius_das_data; |
| 13 | |
| 14 | enum radius_das_res { |
| 15 | RADIUS_DAS_SUCCESS, |
| 16 | RADIUS_DAS_NAS_MISMATCH, |
Dmitry Shmidt | 432d603 | 2015-01-21 13:19:05 -0800 | [diff] [blame] | 17 | RADIUS_DAS_SESSION_NOT_FOUND, |
| 18 | RADIUS_DAS_MULTI_SESSION_MATCH, |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 19 | RADIUS_DAS_COA_FAILED, |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | struct radius_das_attrs { |
Dmitry Shmidt | 13ca8d8 | 2014-02-20 10:18:40 -0800 | [diff] [blame] | 23 | /* NAS identification attributes */ |
| 24 | const u8 *nas_ip_addr; |
| 25 | const u8 *nas_identifier; |
| 26 | size_t nas_identifier_len; |
| 27 | const u8 *nas_ipv6_addr; |
| 28 | |
| 29 | /* Session identification attributes */ |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 30 | const u8 *sta_addr; |
| 31 | const u8 *user_name; |
| 32 | size_t user_name_len; |
| 33 | const u8 *acct_session_id; |
| 34 | size_t acct_session_id_len; |
Dmitry Shmidt | 432d603 | 2015-01-21 13:19:05 -0800 | [diff] [blame] | 35 | const u8 *acct_multi_session_id; |
| 36 | size_t acct_multi_session_id_len; |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 37 | const u8 *cui; |
| 38 | size_t cui_len; |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 39 | |
| 40 | /* Authorization changes */ |
| 41 | const u8 *hs20_t_c_filtering; |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | struct radius_das_conf { |
| 45 | int port; |
| 46 | const u8 *shared_secret; |
| 47 | size_t shared_secret_len; |
| 48 | const struct hostapd_ip_addr *client_addr; |
| 49 | unsigned int time_window; |
| 50 | int require_event_timestamp; |
Dmitry Shmidt | 7f2c753 | 2016-08-15 09:48:12 -0700 | [diff] [blame] | 51 | int require_message_authenticator; |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 52 | void *ctx; |
| 53 | enum radius_das_res (*disconnect)(void *ctx, |
| 54 | struct radius_das_attrs *attr); |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 55 | enum radius_das_res (*coa)(void *ctx, struct radius_das_attrs *attr); |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | struct radius_das_data * |
| 59 | radius_das_init(struct radius_das_conf *conf); |
| 60 | |
| 61 | void radius_das_deinit(struct radius_das_data *data); |
| 62 | |
| 63 | #endif /* RADIUS_DAS_H */ |