EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
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"
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_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) |
struct hostapd_radius_attr * | get_vlan_attribute (uint16_t vlan_id) |
void | radius_server_free_clients (struct radius_server_data *data, struct radius_client *clients) |
struct radius_client * | init_radius_client (struct radius_conf *conf, mac_conn_fn mac_conn_fn, void *mac_conn_arg) |
struct radius_server_data * | radius_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) |
RADIUS authentication server.
src/radius/radius_server.c
#define RADIUS_ATTR_TUNNEL_MEDIUM_VALUE 6 |
#define RADIUS_ATTR_TUNNEL_VALUE 13 |
#define RADIUS_MAX_SESSION 1000 |
RADIUS_MAX_SESSION - Maximum number of active sessions
#define RADIUS_SESSION_MAINTAIN 5 |
RADIUS_SESSION_MAINTAIN - Completed session expiration timeout in seconds
#define RADIUS_SESSION_TIMEOUT 60 |
RADIUS_SESSION_TIMEOUT - Session timeout in seconds
void free_radius_attr | ( | struct hostapd_radius_attr * | attr | ) |
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 | ||
) |
struct hostapd_radius_attr* get_vlan_attribute | ( | uint16_t | vlan_id | ) |
struct radius_client* init_radius_client | ( | struct radius_conf * | conf, |
mac_conn_fn | mac_conn_fn, | ||
void * | mac_conn_arg | ||
) |
void radius_server_deinit | ( | struct radius_server_data * | data | ) |
radius_server_deinit - Deinitialize RADIUS server @data: RADIUS server context from radius_server_init()
void radius_server_free_clients | ( | struct radius_server_data * | data, |
struct radius_client * | clients | ||
) |
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
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().
void void srv_log | ( | struct radius_session * | sess, |
const char * | fmt, | ||
... | |||
) |