blob: 233d662f631b09fcb46800d3bf3d2433f2e32d13 [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 Shmidt432d6032015-01-21 13:19:05 -080017 RADIUS_DAS_SESSION_NOT_FOUND,
18 RADIUS_DAS_MULTI_SESSION_MATCH,
Roshan Pius3a1667e2018-07-03 15:17:14 -070019 RADIUS_DAS_COA_FAILED,
Dmitry Shmidt04949592012-07-19 12:16:46 -070020};
21
22struct radius_das_attrs {
Dmitry Shmidt13ca8d82014-02-20 10:18:40 -080023 /* 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 Shmidt04949592012-07-19 12:16:46 -070030 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 Shmidt432d6032015-01-21 13:19:05 -080035 const u8 *acct_multi_session_id;
36 size_t acct_multi_session_id_len;
Dmitry Shmidt04949592012-07-19 12:16:46 -070037 const u8 *cui;
38 size_t cui_len;
Roshan Pius3a1667e2018-07-03 15:17:14 -070039
40 /* Authorization changes */
41 const u8 *hs20_t_c_filtering;
Dmitry Shmidt04949592012-07-19 12:16:46 -070042};
43
44struct 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 Shmidt7f2c7532016-08-15 09:48:12 -070051 int require_message_authenticator;
Dmitry Shmidt04949592012-07-19 12:16:46 -070052 void *ctx;
53 enum radius_das_res (*disconnect)(void *ctx,
54 struct radius_das_attrs *attr);
Roshan Pius3a1667e2018-07-03 15:17:14 -070055 enum radius_das_res (*coa)(void *ctx, struct radius_das_attrs *attr);
Dmitry Shmidt04949592012-07-19 12:16:46 -070056};
57
58struct radius_das_data *
59radius_das_init(struct radius_das_conf *conf);
60
61void radius_das_deinit(struct radius_das_data *data);
62
63#endif /* RADIUS_DAS_H */