The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
rlm_securid.h
Go to the documentation of this file.
1#pragma once
2#include <freeradius-devel/server/base.h>
3#include <freeradius-devel/server/module_rlm.h>
4#include <freeradius-devel/util/debug.h>
5
6#include "acexport.h"
7
8#define SAFE_STR(s) s==NULL?"EMPTY":s
9
20
21/*
22 * SECURID_SESSION is used to identify existing securID sessions
23 * to continue Next-Token code and New-Pin conversations with a client
24 *
25 * next = pointer to next
26 * state = state attribute from the reply we sent
27 * state_len = length of data in the state attribute.
28 * src_ipaddr = client which sent us the RADIUS request containing
29 * this SecurID conversation.
30 * timestamp = timestamp when this handler was last used.
31 * trips = number of trips
32 * identity = Identity of the user
33 * request = RADIUS request data structure
34 */
35
36#define SECURID_STATE_LEN 32
37typedef struct {
38 struct _securid_session_t *prev, *next;
40 SDI_HANDLE sdiHandle;
42
43 char state[SECURID_STATE_LEN];
44
46 time_t timestamp;
47 unsigned int session_id;
49
50 char *pin; /* previous pin if user entered it during NEW-PIN mode process */
51 char *identity; /* save user's identity name for future use */
52
54
55
56/*
57 * Define a structure for our module configuration.
58 *
59 * These variables do not need to be in a structure, but it's
60 * a lot cleaner to do so, and a pointer to the structure can
61 * be used as the instance handle.
62 * sessions = remembered sessions, in a tree for speed.
63 * mutex = ensure only one thread is updating the sessions list
64 */
79
82extern HIDDEN fr_dict_attr_t const *attr_state;
84
85/* Memory Management */
88 CC_HINT(nonnull);
89
91
93 CC_HINT(nonnull);
#define HIDDEN
Definition build.h:314
IPv4/6 prefix.
unsigned int uint32_t
The main red black tree structure.
Definition rb.h:73
SECURID_SESSION * securid_sessionlist_find(rlm_securid_t *inst, request_t *request)
Definition mem.c:172
int securid_sessionlist_add(rlm_securid_t *inst, request_t *request, SECURID_SESSION *session)
Definition mem.c:83
SECURID_SESSION * securid_session_alloc(void)
Definition mem.c:32
SECURID_SESSION * session_head
Definition rlm_securid.h:68
unsigned int session_id
Definition rlm_securid.h:47
uint32_t max_sessions
Definition rlm_securid.h:76
uint32_t timer_limit
Definition rlm_securid.h:75
fr_ipaddr_t src_ipaddr
Definition rlm_securid.h:45
HIDDEN fr_dict_attr_t const * attr_state
Definition base.c:103
fr_rb_tree_t * session_tree
Definition rlm_securid.h:67
SDI_HANDLE sdiHandle
Definition rlm_securid.h:40
unsigned int last_session_id
Definition rlm_securid.h:70
HIDDEN fr_dict_attr_t const * attr_user_password
fr_rb_node_t node
Definition rlm_securid.h:39
HIDDEN fr_dict_attr_t const * attr_reply_message
void securid_session_free(rlm_securid_t *inst, request_t *request, SECURID_SESSION *session)
struct _securid_session_t * next
Definition rlm_securid.h:38
SECURID_SESSION_STATE securidSessionState
Definition rlm_securid.h:41
pthread_mutex_t session_mutex
Definition rlm_securid.h:66
SECURID_SESSION_STATE
Definition rlm_securid.h:10
@ INITIAL_STATE
Definition rlm_securid.h:11
@ NEW_PIN_SYSTEM_CONFIRM_STATE
Definition rlm_securid.h:17
@ NEW_PIN_REQUIRED_STATE
Definition rlm_securid.h:13
@ NEW_PIN_USER_SELECT_STATE
Definition rlm_securid.h:18
@ NEW_PIN_AUTH_VALIDATE_STATE
Definition rlm_securid.h:15
@ NEW_PIN_SYSTEM_ACCEPT_STATE
Definition rlm_securid.h:16
@ NEXT_CODE_REQUIRED_STATE
Definition rlm_securid.h:12
@ NEW_PIN_USER_CONFIRM_STATE
Definition rlm_securid.h:14
HIDDEN fr_dict_attr_t const * attr_prompt
void securid_sessionlist_free(rlm_securid_t *inst, request_t *request)
Definition mem.c:59
#define SECURID_STATE_LEN
Definition rlm_securid.h:36
uint32_t max_trips_per_session
Definition rlm_securid.h:77
eap_aka_sim_process_conf_t * inst
int nonnull(2, 5))