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 | 2f74e36 | 2015-01-21 13:19:05 -0800 | [diff] [blame^] | 17 | RADIUS_DAS_SESSION_NOT_FOUND, |
| 18 | RADIUS_DAS_MULTI_SESSION_MATCH, |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 19 | }; |
| 20 | |
| 21 | struct radius_das_attrs { |
Dmitry Shmidt | 13ca8d8 | 2014-02-20 10:18:40 -0800 | [diff] [blame] | 22 | /* NAS identification attributes */ |
| 23 | const u8 *nas_ip_addr; |
| 24 | const u8 *nas_identifier; |
| 25 | size_t nas_identifier_len; |
| 26 | const u8 *nas_ipv6_addr; |
| 27 | |
| 28 | /* Session identification attributes */ |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 29 | const u8 *sta_addr; |
| 30 | const u8 *user_name; |
| 31 | size_t user_name_len; |
| 32 | const u8 *acct_session_id; |
| 33 | size_t acct_session_id_len; |
Dmitry Shmidt | 2f74e36 | 2015-01-21 13:19:05 -0800 | [diff] [blame^] | 34 | const u8 *acct_multi_session_id; |
| 35 | size_t acct_multi_session_id_len; |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 36 | const u8 *cui; |
| 37 | size_t cui_len; |
| 38 | }; |
| 39 | |
| 40 | struct radius_das_conf { |
| 41 | int port; |
| 42 | const u8 *shared_secret; |
| 43 | size_t shared_secret_len; |
| 44 | const struct hostapd_ip_addr *client_addr; |
| 45 | unsigned int time_window; |
| 46 | int require_event_timestamp; |
| 47 | void *ctx; |
| 48 | enum radius_das_res (*disconnect)(void *ctx, |
| 49 | struct radius_das_attrs *attr); |
| 50 | }; |
| 51 | |
| 52 | struct radius_das_data * |
| 53 | radius_das_init(struct radius_das_conf *conf); |
| 54 | |
| 55 | void radius_das_deinit(struct radius_das_data *data); |
| 56 | |
| 57 | #endif /* RADIUS_DAS_H */ |