All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
state.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
15  */
16 #ifndef _FR_STATE_H
17 #define _FR_STATE_H
18 /**
19  * $Id: f879e6084fd61064e85048b62d2c753a073e7fd9 $
20  *
21  * @file include/stats.h
22  * @brief Track overarching 'state' of the authentication session over multiple packets.
23  *
24  * @copyright 2014 The FreeRADIUS server project
25  * @copyright 2014 Alan DeKok <aland@deployingradius.com>
26  */
27 RCSIDH(state_h, "$Id: f879e6084fd61064e85048b62d2c753a073e7fd9 $")
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
35 
36 fr_state_tree_t *fr_state_tree_init(TALLOC_CTX *ctx, uint32_t max_sessions, uint32_t timeout);
37 
38 void fr_state_discard(fr_state_tree_t *state, REQUEST *request, RADIUS_PACKET *original);
39 
41 bool fr_request_to_state(fr_state_tree_t *state, REQUEST *request, RADIUS_PACKET *original, RADIUS_PACKET *packet);
42 
43 /*
44  * Stats
45  */
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 #endif /* _FR_STATE_H */
#define RCSIDH(h, id)
Definition: build.h:136
uint64_t fr_state_entries_created(fr_state_tree_t *state)
Return number of entries created.
Definition: state.c:624
fr_state_tree_t * fr_state_tree_init(TALLOC_CTX *ctx, uint32_t max_sessions, uint32_t timeout)
Initialise a new state tree.
Definition: state.c:156
static float timeout
Definition: radclient.c:43
void fr_state_to_request(fr_state_tree_t *state, REQUEST *request, RADIUS_PACKET *packet)
Copy a pointer to the head of the list of state VALUE_PAIRs (and their ctx) into the request...
Definition: state.c:523
void fr_state_discard(fr_state_tree_t *state, REQUEST *request, RADIUS_PACKET *original)
Called when sending an Access-Accept/Access-Reject to discard state information.
Definition: state.c:487
uint32_t max_sessions
Maximum number of sessions we track.
Definition: state.c:77
uint32_t fr_state_entries_tracked(fr_state_tree_t *state)
Return number of entries we're currently tracking.
Definition: state.c:640
unsigned int state
Definition: proto_bfd.c:200
bool fr_request_to_state(fr_state_tree_t *state, REQUEST *request, RADIUS_PACKET *original, RADIUS_PACKET *packet)
Transfer ownership of the state VALUE_PAIRs and ctx, back to a state entry.
Definition: state.c:579
uint64_t fr_state_entries_timeout(fr_state_tree_t *state)
Return number of entries that timed out.
Definition: state.c:632
fr_state_tree_t * global_state
Definition: state.c:87