blob: ce731d46a9ace1a7379ff36e6dff7ecd536b4fc9 [file] [log] [blame]
Dmitry Shmidt04949592012-07-19 12:16:46 -07001/*
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
12struct radius_das_data;
13
14enum radius_das_res {
15 RADIUS_DAS_SUCCESS,
16 RADIUS_DAS_NAS_MISMATCH,
Dmitry Shmidt2f74e362015-01-21 13:19:05 -080017 RADIUS_DAS_SESSION_NOT_FOUND,
18 RADIUS_DAS_MULTI_SESSION_MATCH,
Dmitry Shmidt04949592012-07-19 12:16:46 -070019};
20
21struct radius_das_attrs {
Dmitry Shmidt13ca8d82014-02-20 10:18:40 -080022 /* 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 Shmidt04949592012-07-19 12:16:46 -070029 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 Shmidt2f74e362015-01-21 13:19:05 -080034 const u8 *acct_multi_session_id;
35 size_t acct_multi_session_id_len;
Dmitry Shmidt04949592012-07-19 12:16:46 -070036 const u8 *cui;
37 size_t cui_len;
38};
39
40struct 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
52struct radius_das_data *
53radius_das_init(struct radius_das_conf *conf);
54
55void radius_das_deinit(struct radius_das_data *data);
56
57#endif /* RADIUS_DAS_H */