wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Functions
radius_server.c File Reference

RADIUS authentication server. More...

#include "includes.h"
#include <net/if.h>
#include "common.h"
#include "radius.h"
#include "eloop.h"
#include "eap_server/eap.h"
#include "ap/ap_config.h"
#include "crypto/tls.h"
#include "radius_server.h"

Data Structures

struct  radius_server_counters
 RADIUS server statistics counters. More...
 
struct  radius_session
 Internal RADIUS server data for a session. More...
 
struct  radius_client
 Internal RADIUS server data for a client. More...
 
struct  radius_server_data
 Internal RADIUS server data. More...
 

Macros

#define RADIUS_SESSION_TIMEOUT   60
 Session timeout in seconds.
 
#define RADIUS_MAX_SESSION   100
 Maximum number of active sessions.
 
#define RADIUS_MAX_MSG_LEN   3000
 Maximum message length for incoming RADIUS messages.
 
#define RADIUS_DEBUG(args...)   wpa_printf(MSG_DEBUG, "RADIUS SRV: " args)
 
#define RADIUS_ERROR(args...)   wpa_printf(MSG_ERROR, "RADIUS SRV: " args)
 
#define RADIUS_DUMP(args...)   wpa_hexdump(MSG_MSGDUMP, "RADIUS SRV: " args)
 
#define RADIUS_DUMP_ASCII(args...)   wpa_hexdump_ascii(MSG_MSGDUMP, "RADIUS SRV: " args)
 

Functions

void srv_log (struct radius_session *sess, const char *fmt,...) PRINTF_FORMAT(2
 
struct radius_server_dataradius_server_init (struct radius_server_conf *conf)
 Initialize RADIUS server. More...
 
void radius_server_erp_flush (struct radius_server_data *data)
 Flush all ERP keys. More...
 
void radius_server_deinit (struct radius_server_data *data)
 Deinitialize RADIUS server. More...
 
int radius_server_get_mib (struct radius_server_data *data, char *buf, size_t buflen)
 Get RADIUS server MIB information. More...
 
void radius_server_eap_pending_cb (struct radius_server_data *data, void *ctx)
 Pending EAP data notification. More...
 

Detailed Description

RADIUS authentication server.

Function Documentation

void radius_server_deinit ( struct radius_server_data data)

Deinitialize RADIUS server.

Parameters
dataRADIUS server context from radius_server_init()
void radius_server_eap_pending_cb ( struct radius_server_data data,
void *  ctx 
)

Pending EAP data notification.

Parameters
dataRADIUS server context from radius_server_init()
ctxPending EAP context pointer

This function is used to notify EAP server module that a pending operation has been completed and processing of the EAP session can proceed.

void radius_server_erp_flush ( struct radius_server_data data)

Flush all ERP keys.

Parameters
dataRADIUS server context from radius_server_init()
int radius_server_get_mib ( struct radius_server_data data,
char *  buf,
size_t  buflen 
)

Get RADIUS server MIB information.

Parameters
dataRADIUS server context from radius_server_init()
bufBuffer for returning the MIB data in text format
buflenbuf length in octets
Returns
Number of octets written into buf
struct radius_server_data* radius_server_init ( struct radius_server_conf conf)

Initialize RADIUS server.

Parameters
confConfiguration for the RADIUS server
Returns
Pointer to private RADIUS server context or NULL on failure

This initializes a RADIUS server instance and returns a context pointer that will be used in other calls to the RADIUS server module. The server can be deinitialize by calling radius_server_deinit().