48 RDEBUG2(
"Freeing session id=%d identity='%s' state='%s'",
60 if (session->
sdiHandle != SDI_HANDLE_NONE) {
75 for (node = inst->
session_head; node != NULL; node = next) {
127 RDEBUG2(
"Inserting session id=%d identity='%s' state='%s' to the session list",
136 if (!state)
return -1;
148 prev->
next = session;
149 session->
prev = prev;
150 session->
next = NULL;
155 session->
next = session->
prev = NULL;
168 ERROR(
"rlm_securid: Failed to store session");
201 ERROR(
"rlm_securid: Invalid State variable. length=%d", (
int) state->vp_length);
205 memset(&mySession,0,
sizeof(mySession));
207 memcpy(mySession.
state, state->vp_strvalue,
sizeof(mySession.
state));
221 ERROR(
"rlm_securid: No SECURID session matching the State variable");
225 RDEBUG2(
"Session found identity='%s' state='%s', released from the list",
244 if (!node)
return NULL;
266 session->
prev = session->
next = NULL;
278 RDEBUG2(
"There are %d sessions in the tree\n",num_sessions);
302 RDEBUG2(
"Cleaning expired session: identity='%s' state='%s'\n",
void fr_pair_list_free(VALUE_PAIR **)
Free memory used by a valuepair list.
int securid_sessionlist_add(rlm_securid_t *inst, REQUEST *request, SECURID_SESSION *session)
rbnode_t * rbtree_find(rbtree_t *tree, void const *data)
Find an element in the tree, returning the data, not the node.
void * rad_malloc(size_t size)
SECURID_SESSION * securid_sessionlist_find(rlm_securid_t *inst, REQUEST *request)
static void securid_sessionlist_clean_expired(rlm_securid_t *inst, REQUEST *request, time_t timestamp)
fr_ipaddr_t src_ipaddr
Src IP address of packet.
SECURID_SESSION * securid_session_alloc(void)
VALUE_PAIR * vps
Result of decoding the packet into VALUE_PAIRs.
PUBLIC int snprintf(char *string, size_t length, char *format, va_alist)
#define pthread_mutex_unlock(_x)
void securid_sessionlist_free(rlm_securid_t *inst, REQUEST *request)
struct _securid_session_t * next
void rbtree_delete(rbtree_t *tree, rbnode_t *z)
Stores an attribute, a value and various bits of other data.
SECURID_SESSION * session_tail
unsigned int last_session_id
uint32_t max_trips_per_session
struct timeval timestamp
When we started processing the request.
static SECURID_SESSION * securid_sessionlist_delete(rlm_securid_t *inst, SECURID_SESSION *session)
struct _securid_session_t * prev
#define pair_make_reply(_a, _b, _c)
#define SECURID_STATE_LEN
bool rbtree_insert(rbtree_t *tree, void *data)
RADIUS_PACKET * packet
Incoming request.
SECURID_SESSION * session_head
VALUE_PAIR * fr_pair_find_by_num(VALUE_PAIR *head, unsigned int vendor, unsigned int attr, int8_t tag)
Find the pair with the matching attribute.
#define pthread_mutex_lock(_x)
char state[SECURID_STATE_LEN]
void securid_session_free(UNUSED rlm_securid_t *inst, REQUEST *request, SECURID_SESSION *session)
void * rbtree_node2data(rbtree_t *tree, rbnode_t *node)
pthread_mutex_t session_mutex
uint32_t rbtree_num_elements(rbtree_t *tree)