EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
Macros | Functions
radius_server.c File Reference

RADIUS authentication server. More...

#include <stdbool.h>
#include <stdint.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <unistd.h>
#include "../supervisor/mac_mapper.h"
#include "../utils/allocs.h"
#include "../utils/log.h"
#include "../utils/net.h"
#include "radius.h"
#include "radius_server.h"
#include "wpabuf.h"
Include dependency graph for radius_server.c:

Macros

#define RADIUS_SESSION_TIMEOUT   60
 
#define RADIUS_SESSION_MAINTAIN   5
 
#define RADIUS_MAX_SESSION   1000
 
#define RADIUS_ATTR_TUNNEL_VALUE   13
 
#define RADIUS_ATTR_TUNNEL_MEDIUM_VALUE   6
 

Functions

void srv_log (struct radius_session *sess, const char *fmt,...) PRINTF_FORMAT(2
 
void free_radius_attr (struct hostapd_radius_attr *attr)
 
struct hostapd_radius_attrget_password_attribute (const uint8_t *req_authenticator, const uint8_t *secret, size_t secret_len, const uint8_t *key, size_t key_len)
 
struct hostapd_radius_attrget_vlan_attribute (uint16_t vlan_id)
 
void radius_server_free_clients (struct radius_server_data *data, struct radius_client *clients)
 
struct radius_clientinit_radius_client (struct radius_conf *conf, mac_conn_fn mac_conn_fn, void *mac_conn_arg)
 
struct radius_server_dataradius_server_init (struct eloop_data *eloop, int auth_port, struct radius_client *clients)
 
void radius_server_deinit (struct radius_server_data *data)
 
int radius_server_get_mib (struct radius_server_data *data, char *buf, size_t buflen)
 

Detailed Description

RADIUS authentication server.

Author
Alexandru Mereacre, Jouni Malinen
Version
Adapted from hostap 2.10 - src/radius/radius_server.c

Macro Definition Documentation

◆ RADIUS_ATTR_TUNNEL_MEDIUM_VALUE

#define RADIUS_ATTR_TUNNEL_MEDIUM_VALUE   6

◆ RADIUS_ATTR_TUNNEL_VALUE

#define RADIUS_ATTR_TUNNEL_VALUE   13

◆ RADIUS_MAX_SESSION

#define RADIUS_MAX_SESSION   1000

RADIUS_MAX_SESSION - Maximum number of active sessions

◆ RADIUS_SESSION_MAINTAIN

#define RADIUS_SESSION_MAINTAIN   5

RADIUS_SESSION_MAINTAIN - Completed session expiration timeout in seconds

◆ RADIUS_SESSION_TIMEOUT

#define RADIUS_SESSION_TIMEOUT   60

RADIUS_SESSION_TIMEOUT - Session timeout in seconds

Function Documentation

◆ free_radius_attr()

void free_radius_attr ( struct hostapd_radius_attr attr)

◆ get_password_attribute()

struct hostapd_radius_attr* get_password_attribute ( const uint8_t *  req_authenticator,
const uint8_t *  secret,
size_t  secret_len,
const uint8_t *  key,
size_t  key_len 
)

◆ get_vlan_attribute()

struct hostapd_radius_attr* get_vlan_attribute ( uint16_t  vlan_id)

◆ init_radius_client()

struct radius_client* init_radius_client ( struct radius_conf conf,
mac_conn_fn  mac_conn_fn,
void *  mac_conn_arg 
)

◆ radius_server_deinit()

void radius_server_deinit ( struct radius_server_data data)

radius_server_deinit - Deinitialize RADIUS server @data: RADIUS server context from radius_server_init()

◆ radius_server_free_clients()

void radius_server_free_clients ( struct radius_server_data data,
struct radius_client clients 
)

◆ radius_server_get_mib()

int radius_server_get_mib ( struct radius_server_data data,
char *  buf,
size_t  buflen 
)

radius_server_get_mib - Get RADIUS server MIB information @data: RADIUS server context from radius_server_init() @buf: Buffer for returning the MIB data in text format @buflen: buf length in octets Returns: Number of octets written into buf

◆ radius_server_init()

struct radius_server_data* radius_server_init ( struct eloop_data *  eloop,
int  auth_port,
struct radius_client clients 
)

radius_server_init - Initialize RADIUS server @conf: 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().

◆ srv_log()

void void srv_log ( struct radius_session sess,
const char *  fmt,
  ... 
)