2012-05-06 21:02:42 +02:00
|
|
|
/*
|
|
|
|
* RADIUS Dynamic Authorization Server (DAS)
|
|
|
|
* Copyright (c) 2012, Jouni Malinen <j@w1.fi>
|
|
|
|
*
|
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef RADIUS_DAS_H
|
|
|
|
#define RADIUS_DAS_H
|
|
|
|
|
|
|
|
struct radius_das_data;
|
|
|
|
|
2012-06-17 18:30:01 +02:00
|
|
|
enum radius_das_res {
|
|
|
|
RADIUS_DAS_SUCCESS,
|
|
|
|
RADIUS_DAS_NAS_MISMATCH,
|
|
|
|
RADIUS_DAS_SESSION_NOT_FOUND
|
|
|
|
};
|
|
|
|
|
|
|
|
struct radius_das_attrs {
|
2014-02-20 12:55:36 +01:00
|
|
|
/* NAS identification attributes */
|
|
|
|
const u8 *nas_ip_addr;
|
|
|
|
const u8 *nas_identifier;
|
|
|
|
size_t nas_identifier_len;
|
|
|
|
const u8 *nas_ipv6_addr;
|
|
|
|
|
|
|
|
/* Session identification attributes */
|
2012-06-17 18:30:01 +02:00
|
|
|
const u8 *sta_addr;
|
|
|
|
const u8 *user_name;
|
|
|
|
size_t user_name_len;
|
|
|
|
const u8 *acct_session_id;
|
|
|
|
size_t acct_session_id_len;
|
2012-06-17 18:44:46 +02:00
|
|
|
const u8 *cui;
|
|
|
|
size_t cui_len;
|
2012-06-17 18:30:01 +02:00
|
|
|
};
|
|
|
|
|
2012-05-06 21:02:42 +02:00
|
|
|
struct radius_das_conf {
|
|
|
|
int port;
|
|
|
|
const u8 *shared_secret;
|
|
|
|
size_t shared_secret_len;
|
|
|
|
const struct hostapd_ip_addr *client_addr;
|
2012-06-17 16:43:36 +02:00
|
|
|
unsigned int time_window;
|
|
|
|
int require_event_timestamp;
|
2012-06-17 18:30:01 +02:00
|
|
|
void *ctx;
|
|
|
|
enum radius_das_res (*disconnect)(void *ctx,
|
|
|
|
struct radius_das_attrs *attr);
|
2012-05-06 21:02:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct radius_das_data *
|
|
|
|
radius_das_init(struct radius_das_conf *conf);
|
|
|
|
|
|
|
|
void radius_das_deinit(struct radius_das_data *data);
|
|
|
|
|
|
|
|
#endif /* RADIUS_DAS_H */
|