#include "includes.h"
#include <net/if.h>
#include "common.h"
#include "radius.h"
#include "eloop.h"
#include "eap_server/eap.h"
#include "radius_server.h"
Go to the source code of this file.
Classes | |
struct | radius_client |
struct | radius_server_counters |
struct | radius_server_data |
struct | radius_session |
Defines | |
#define | RADIUS_DEBUG(args...) wpa_printf(MSG_DEBUG, "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) |
#define | RADIUS_ERROR(args...) wpa_printf(MSG_ERROR, "RADIUS SRV: " args) |
#define | RADIUS_MAX_MSG_LEN 3000 |
#define | RADIUS_MAX_SESSION 100 |
#define | RADIUS_SESSION_TIMEOUT 60 |
Functions | |
void | radius_server_deinit (struct radius_server_data *data) |
static int | radius_server_disable_pmtu_discovery (int s) |
void | radius_server_eap_pending_cb (struct radius_server_data *data, void *ctx) |
static struct radius_msg * | radius_server_encapsulate_eap (struct radius_server_data *data, struct radius_client *client, struct radius_session *sess, struct radius_msg *request) |
static void | radius_server_free_clients (struct radius_server_data *data, struct radius_client *clients) |
static void | radius_server_free_sessions (struct radius_server_data *data, struct radius_session *sessions) |
static struct radius_client * | radius_server_get_client (struct radius_server_data *data, struct in_addr *addr, int ipv6) |
static const char * | radius_server_get_eap_req_id_text (void *ctx, size_t *len) |
static int | radius_server_get_eap_user (void *ctx, const u8 *identity, size_t identity_len, int phase2, struct eap_user *user) |
int | radius_server_get_mib (struct radius_server_data *data, char *buf, size_t buflen) |
static struct radius_session * | radius_server_get_new_session (struct radius_server_data *data, struct radius_client *client, struct radius_msg *msg) |
static struct radius_session * | radius_server_get_session (struct radius_client *client, unsigned int sess_id) |
struct radius_server_data * | radius_server_init (struct radius_server_conf *conf) |
static struct radius_session * | radius_server_new_session (struct radius_server_data *data, struct radius_client *client) |
static int | radius_server_open_socket (int port) |
static struct radius_client * | radius_server_read_clients (const char *client_file, int ipv6) |
static void | radius_server_receive_auth (int sock, void *eloop_ctx, void *sock_ctx) |
static int | radius_server_reject (struct radius_server_data *data, struct radius_client *client, struct radius_msg *request, struct sockaddr *from, socklen_t fromlen, const char *from_addr, int from_port) |
static int | radius_server_request (struct radius_server_data *data, struct radius_msg *msg, struct sockaddr *from, socklen_t fromlen, struct radius_client *client, const char *from_addr, int from_port, struct radius_session *force_sess) |
static void | radius_server_session_free (struct radius_server_data *data, struct radius_session *sess) |
static void | radius_server_session_remove (struct radius_server_data *data, struct radius_session *sess) |
static void | radius_server_session_remove_timeout (void *eloop_ctx, void *timeout_ctx) |
static void | radius_server_session_timeout (void *eloop_ctx, void *timeout_ctx) |
Variables | |
static struct eapol_callbacks | radius_server_eapol_cb |
int | wpa_debug_level |
#define RADIUS_DEBUG | ( | args... | ) | wpa_printf(MSG_DEBUG, "RADIUS SRV: " args) |
Definition at line 293 of file radius_server.c.
#define RADIUS_DUMP | ( | args... | ) | wpa_hexdump(MSG_MSGDUMP, "RADIUS SRV: " args) |
Definition at line 297 of file radius_server.c.
#define RADIUS_DUMP_ASCII | ( | args... | ) | wpa_hexdump_ascii(MSG_MSGDUMP, "RADIUS SRV: " args) |
Definition at line 299 of file radius_server.c.
#define RADIUS_ERROR | ( | args... | ) | wpa_printf(MSG_ERROR, "RADIUS SRV: " args) |
Definition at line 295 of file radius_server.c.
#define RADIUS_MAX_MSG_LEN 3000 |
RADIUS_MAX_MSG_LEN - Maximum message length for incoming RADIUS messages
Definition at line 37 of file radius_server.c.
#define RADIUS_MAX_SESSION 100 |
RADIUS_MAX_SESSION - Maximum number of active sessions
Definition at line 32 of file radius_server.c.
#define RADIUS_SESSION_TIMEOUT 60 |
RADIUS_SESSION_TIMEOUT - Session timeout in seconds
Definition at line 27 of file radius_server.c.
void radius_server_deinit | ( | struct radius_server_data * | data | ) |
radius_server_deinit - Deinitialize RADIUS server : RADIUS server context from radius_server_init()
Definition at line 1306 of file radius_server.c.
static int radius_server_disable_pmtu_discovery | ( | int | s | ) | [static] |
Definition at line 954 of file radius_server.c.
void radius_server_eap_pending_cb | ( | struct radius_server_data * | data, |
void * | ctx | ||
) |
radius_server_eap_pending_cb - Pending EAP data notification : RADIUS server context from radius_server_init() : Pending 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.
Definition at line 1480 of file radius_server.c.
static struct radius_msg* radius_server_encapsulate_eap | ( | struct radius_server_data * | data, |
struct radius_client * | client, | ||
struct radius_session * | sess, | ||
struct radius_msg * | request | ||
) | [static, read] |
Definition at line 527 of file radius_server.c.
static void radius_server_free_clients | ( | struct radius_server_data * | data, |
struct radius_client * | clients | ||
) | [static] |
Definition at line 1037 of file radius_server.c.
static void radius_server_free_sessions | ( | struct radius_server_data * | data, |
struct radius_session * | sessions | ||
) | [static] |
Definition at line 1023 of file radius_server.c.
static struct radius_client* radius_server_get_client | ( | struct radius_server_data * | data, |
struct in_addr * | addr, | ||
int | ipv6 | ||
) | [static, read] |
Definition at line 309 of file radius_server.c.
static const char* radius_server_get_eap_req_id_text | ( | void * | ctx, |
size_t * | len | ||
) | [static] |
Definition at line 1456 of file radius_server.c.
static int radius_server_get_eap_user | ( | void * | ctx, |
const u8 * | identity, | ||
size_t | identity_len, | ||
int | phase2, | ||
struct eap_user * | user | ||
) | [static] |
Definition at line 1444 of file radius_server.c.
int radius_server_get_mib | ( | struct radius_server_data * | data, |
char * | buf, | ||
size_t | buflen | ||
) |
radius_server_get_mib - Get RADIUS server MIB information : RADIUS server context from radius_server_init() : Buffer for returning the MIB data in text format : buf length in octets Returns: Number of octets written into buf
Definition at line 1333 of file radius_server.c.
static struct radius_session* radius_server_get_new_session | ( | struct radius_server_data * | data, |
struct radius_client * | client, | ||
struct radius_msg * | msg | ||
) | [static, read] |
Definition at line 452 of file radius_server.c.
static struct radius_session* radius_server_get_session | ( | struct radius_client * | client, |
unsigned int | sess_id | ||
) | [static, read] |
Definition at line 348 of file radius_server.c.
struct radius_server_data* radius_server_init | ( | struct radius_server_conf * | conf | ) | [read] |
radius_server_init - Initialize RADIUS server : Configuration 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().
Definition at line 1218 of file radius_server.c.
static struct radius_session* radius_server_new_session | ( | struct radius_server_data * | data, |
struct radius_client * | client | ||
) | [static, read] |
Definition at line 424 of file radius_server.c.
static int radius_server_open_socket | ( | int | port | ) | [static] |
Definition at line 970 of file radius_server.c.
static struct radius_client* radius_server_read_clients | ( | const char * | client_file, |
int | ipv6 | ||
) | [static, read] |
Definition at line 1055 of file radius_server.c.
static void radius_server_receive_auth | ( | int | sock, |
void * | eloop_ctx, | ||
void * | sock_ctx | ||
) | [static] |
Definition at line 845 of file radius_server.c.
static int radius_server_reject | ( | struct radius_server_data * | data, |
struct radius_client * | client, | ||
struct radius_msg * | request, | ||
struct sockaddr * | from, | ||
socklen_t | fromlen, | ||
const char * | from_addr, | ||
int | from_port | ||
) | [static] |
Definition at line 600 of file radius_server.c.
static int radius_server_request | ( | struct radius_server_data * | data, |
struct radius_msg * | msg, | ||
struct sockaddr * | from, | ||
socklen_t | fromlen, | ||
struct radius_client * | client, | ||
const char * | from_addr, | ||
int | from_port, | ||
struct radius_session * | force_sess | ||
) | [static] |
Definition at line 661 of file radius_server.c.
static void radius_server_session_free | ( | struct radius_server_data * | data, |
struct radius_session * | sess | ||
) | [static] |
Definition at line 363 of file radius_server.c.
static void radius_server_session_remove | ( | struct radius_server_data * | data, |
struct radius_session * | sess | ||
) | [static] |
Definition at line 377 of file radius_server.c.
static void radius_server_session_remove_timeout | ( | void * | eloop_ctx, |
void * | timeout_ctx | ||
) | [static] |
Definition at line 403 of file radius_server.c.
static void radius_server_session_timeout | ( | void * | eloop_ctx, |
void * | timeout_ctx | ||
) | [static] |
Definition at line 413 of file radius_server.c.
static struct eapol_callbacks radius_server_eapol_cb [static] |
{ .get_eap_user = radius_server_get_eap_user, .get_eap_req_id_text = radius_server_get_eap_req_id_text, }
Definition at line 39 of file radius_server.c.
int wpa_debug_level |
Definition at line 29 of file wpa_debug.c.