2008-02-28 02:34:43 +01:00
|
|
|
/*
|
2009-12-02 20:29:32 +01:00
|
|
|
* RADIUS authentication server
|
2011-12-08 23:15:04 +01:00
|
|
|
* Copyright (c) 2005-2009, 2011, Jouni Malinen <j@w1.fi>
|
2008-02-28 02:34:43 +01:00
|
|
|
*
|
2012-02-11 15:46:35 +01:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2008-02-28 02:34:43 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef RADIUS_SERVER_H
|
|
|
|
#define RADIUS_SERVER_H
|
|
|
|
|
|
|
|
struct radius_server_data;
|
|
|
|
struct eap_user;
|
|
|
|
|
2009-12-02 20:29:32 +01:00
|
|
|
/**
|
|
|
|
* struct radius_server_conf - RADIUS server configuration
|
|
|
|
*/
|
2008-02-28 02:34:43 +01:00
|
|
|
struct radius_server_conf {
|
2009-12-02 20:29:32 +01:00
|
|
|
/**
|
|
|
|
* auth_port - UDP port to listen to as an authentication server
|
|
|
|
*/
|
2008-02-28 02:34:43 +01:00
|
|
|
int auth_port;
|
2009-12-02 20:29:32 +01:00
|
|
|
|
2014-02-15 14:37:53 +01:00
|
|
|
/**
|
|
|
|
* acct_port - UDP port to listen to as an accounting server
|
|
|
|
*/
|
|
|
|
int acct_port;
|
|
|
|
|
2009-12-02 20:29:32 +01:00
|
|
|
/**
|
|
|
|
* client_file - RADIUS client configuration file
|
|
|
|
*
|
|
|
|
* This file contains the RADIUS clients and the shared secret to be
|
|
|
|
* used with them in a format where each client is on its own line. The
|
|
|
|
* first item on the line is the IPv4 or IPv6 address of the client
|
|
|
|
* with an optional address mask to allow full network to be specified
|
|
|
|
* (e.g., 192.168.1.2 or 192.168.1.0/24). This is followed by white
|
|
|
|
* space (space or tabulator) and the shared secret. Lines starting
|
|
|
|
* with '#' are skipped and can be used as comments.
|
|
|
|
*/
|
2008-02-28 02:34:43 +01:00
|
|
|
char *client_file;
|
2009-12-02 20:29:32 +01:00
|
|
|
|
2014-02-28 13:11:13 +01:00
|
|
|
/**
|
|
|
|
* sqlite_file - SQLite database for storing debug log information
|
|
|
|
*/
|
|
|
|
const char *sqlite_file;
|
|
|
|
|
2009-12-02 20:29:32 +01:00
|
|
|
/**
|
|
|
|
* conf_ctx - Context pointer for callbacks
|
|
|
|
*
|
|
|
|
* This is used as the ctx argument in get_eap_user() calls.
|
|
|
|
*/
|
2008-02-28 02:34:43 +01:00
|
|
|
void *conf_ctx;
|
2009-12-02 20:29:32 +01:00
|
|
|
|
2014-11-29 20:28:24 +01:00
|
|
|
const char *erp_domain;
|
|
|
|
|
2009-12-02 20:29:32 +01:00
|
|
|
/**
|
|
|
|
* ipv6 - Whether to enable IPv6 support in the RADIUS server
|
|
|
|
*/
|
2008-02-28 02:34:43 +01:00
|
|
|
int ipv6;
|
2009-12-02 20:29:32 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get_eap_user - Callback for fetching EAP user information
|
|
|
|
* @ctx: Context data from conf_ctx
|
|
|
|
* @identity: User identity
|
|
|
|
* @identity_len: identity buffer length in octets
|
|
|
|
* @phase2: Whether this is for Phase 2 identity
|
|
|
|
* @user: Data structure for filling in the user information
|
|
|
|
* Returns: 0 on success, -1 on failure
|
|
|
|
*
|
|
|
|
* This is used to fetch information from user database. The callback
|
|
|
|
* will fill in information about allowed EAP methods and the user
|
|
|
|
* password. The password field will be an allocated copy of the
|
|
|
|
* password data and RADIUS server will free it after use.
|
|
|
|
*/
|
2008-02-28 02:34:43 +01:00
|
|
|
int (*get_eap_user)(void *ctx, const u8 *identity, size_t identity_len,
|
|
|
|
int phase2, struct eap_user *user);
|
2009-12-02 20:29:32 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* eap_req_id_text - Optional data for EAP-Request/Identity
|
|
|
|
*
|
|
|
|
* This can be used to configure an optional, displayable message that
|
|
|
|
* will be sent in EAP-Request/Identity. This string can contain an
|
|
|
|
* ASCII-0 character (nul) to separate network infromation per RFC
|
|
|
|
* 4284. The actual string length is explicit provided in
|
|
|
|
* eap_req_id_text_len since nul character will not be used as a string
|
|
|
|
* terminator.
|
|
|
|
*/
|
2008-12-26 19:22:12 +01:00
|
|
|
const char *eap_req_id_text;
|
2009-12-02 20:29:32 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* eap_req_id_text_len - Length of eap_req_id_text buffer in octets
|
|
|
|
*/
|
2008-12-26 19:22:12 +01:00
|
|
|
size_t eap_req_id_text_len;
|
2010-04-07 10:13:14 +02:00
|
|
|
|
2011-12-08 23:15:04 +01:00
|
|
|
#ifdef CONFIG_RADIUS_TEST
|
|
|
|
const char *dump_msk_file;
|
|
|
|
#endif /* CONFIG_RADIUS_TEST */
|
2012-11-21 16:04:21 +01:00
|
|
|
|
|
|
|
char *subscr_remediation_url;
|
|
|
|
u8 subscr_remediation_method;
|
2018-12-14 14:58:13 +01:00
|
|
|
char *hs20_sim_provisioning_url;
|
2018-06-21 19:50:54 +02:00
|
|
|
|
|
|
|
char *t_c_server_url;
|
2019-08-20 01:32:05 +02:00
|
|
|
|
|
|
|
struct eap_config *eap_cfg;
|
2008-02-28 02:34:43 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct radius_server_data *
|
|
|
|
radius_server_init(struct radius_server_conf *conf);
|
|
|
|
|
2014-12-14 12:31:12 +01:00
|
|
|
void radius_server_erp_flush(struct radius_server_data *data);
|
2008-02-28 02:34:43 +01:00
|
|
|
void radius_server_deinit(struct radius_server_data *data);
|
|
|
|
|
|
|
|
int radius_server_get_mib(struct radius_server_data *data, char *buf,
|
|
|
|
size_t buflen);
|
|
|
|
|
|
|
|
void radius_server_eap_pending_cb(struct radius_server_data *data, void *ctx);
|
2018-06-22 18:32:46 +02:00
|
|
|
int radius_server_dac_request(struct radius_server_data *data, const char *req);
|
2008-02-28 02:34:43 +01:00
|
|
|
|
|
|
|
#endif /* RADIUS_SERVER_H */
|