Home | History | Annotate | Download | only in radius
      1 /*
      2  * RADIUS Dynamic Authorization Server (DAS)
      3  * Copyright (c) 2012, Jouni Malinen <j (at) 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,
     17 	RADIUS_DAS_SESSION_NOT_FOUND
     18 };
     19 
     20 struct radius_das_attrs {
     21 	/* NAS identification attributes */
     22 	const u8 *nas_ip_addr;
     23 	const u8 *nas_identifier;
     24 	size_t nas_identifier_len;
     25 	const u8 *nas_ipv6_addr;
     26 
     27 	/* Session identification attributes */
     28 	const u8 *sta_addr;
     29 	const u8 *user_name;
     30 	size_t user_name_len;
     31 	const u8 *acct_session_id;
     32 	size_t acct_session_id_len;
     33 	const u8 *cui;
     34 	size_t cui_len;
     35 };
     36 
     37 struct radius_das_conf {
     38 	int port;
     39 	const u8 *shared_secret;
     40 	size_t shared_secret_len;
     41 	const struct hostapd_ip_addr *client_addr;
     42 	unsigned int time_window;
     43 	int require_event_timestamp;
     44 	void *ctx;
     45 	enum radius_das_res (*disconnect)(void *ctx,
     46 					  struct radius_das_attrs *attr);
     47 };
     48 
     49 struct radius_das_data *
     50 radius_das_init(struct radius_das_conf *conf);
     51 
     52 void radius_das_deinit(struct radius_das_data *data);
     53 
     54 #endif /* RADIUS_DAS_H */
     55