/*
* Re-present the previously stored child's session state if there is one
*/
- fr_state_restore_to_child(request, eap_session->identity, REQUEST_DATA_EAP_SESSION);
+ fr_state_restore_from_parent(request, eap_session->identity, REQUEST_DATA_EAP_SESSION);
if (fr_pair_prepend_by_da(request->request_ctx, &vp, &request->request_pairs,
attr_packet_type) < 0) return UNLANG_ACTION_FAIL;
* entry holds data that should be available during the complete lifecycle
* of the authentication attempt.
*
- * When a request is complete, #fr_request_to_state is called to transfer
+ * When a request is complete, #fr_state_store is called to transfer
* ownership of the state fr_pair_ts and state_ctx (which the fr_pair_ts
* are allocated in) to a #fr_state_entry_t. This #fr_state_entry_t holds the
* value of the State attribute, that will be send out in the response.
*
- * When the next request is received, #fr_state_to_request is called to transfer
+ * When the next request is received, #fr_state_restore is called to transfer
* the fr_pair_ts and state ctx to the new request.
*
* The ownership of the state_ctx and state fr_pair_ts is transferred as below:
PTHREAD_MUTEX_UNLOCK(&state->mutex);
/*
- * If fr_state_to_request was never called, this ensures
+ * If fr_state_restore was never called, this ensures
* the state owned by entry is freed, otherwise this is
* mostly a NOOP, other than freeing the memory held by
* the entry.
TALLOC_FREE(entry);
/*
- * If fr_state_to_request was called, then the request
+ * If fr_state_restore was called, then the request
* holds the existing state data. We need to destroy it,
* and return the request to the state it was in when
* it was first allocated, just in case a user does something
* - 0 on success (state restored)
* - -1 if a state entry has already been thawed by a another request.
*/
-int fr_state_to_request(fr_state_tree_t *state, request_t *request)
+int fr_state_restore(fr_state_tree_t *state, request_t *request)
{
fr_state_entry_t *entry;
fr_pair_t *vp;
*
* Also creates a new state entry.
*/
-int fr_request_to_state(fr_state_tree_t *state, request_t *request)
+int fr_state_store(fr_state_tree_t *state, request_t *request)
{
fr_state_entry_t *entry, *old;
fr_dlist_head_t data;
* or other facility that spawned the subrequest.
* @param[in] unique_int Further identification.
*/
-void fr_state_restore_to_child(request_t *child, void const *unique_ptr, int unique_int)
+void fr_state_restore_from_parent(request_t *child, void const *unique_ptr, int unique_int)
{
state_child_entry_t *child_entry;
request_t *request = child; /* Stupid logging */
void fr_state_discard(fr_state_tree_t *state, request_t *request);
-int fr_state_to_request(fr_state_tree_t *state, request_t *request);
-int fr_request_to_state(fr_state_tree_t *state, request_t *request);
+int fr_state_restore(fr_state_tree_t *state, request_t *request);
+int fr_state_store(fr_state_tree_t *state, request_t *request);
void fr_state_store_in_parent(request_t *request, void const *unique_ptr, int unique_int);
-void fr_state_restore_to_child(request_t *child, void const *unique_ptr, int unique_int);
+void fr_state_restore_from_parent(request_t *child, void const *unique_ptr, int unique_int);
void fr_state_discard_child(request_t *parent, void const *unique_ptr, int unique_int);
/*
* into the child.
*/
if (state->children[i].config.session_unique_ptr) {
- fr_state_restore_to_child(state->children[i].request,
+ fr_state_restore_from_parent(state->children[i].request,
state->children[i].config.session_unique_ptr,
state->children[i].num);
}
* Ensure we restore the session state information
* into the child.
*/
- if (cr->config.session_unique_ptr) fr_state_restore_to_child(child,
+ if (cr->config.session_unique_ptr) fr_state_restore_from_parent(child,
cr->config.session_unique_ptr,
cr->num);
/*
{
process_radius_t const *inst = talloc_get_type_abort_const(mctx->mi->data, process_radius_t);
- if (fr_state_to_request(inst->auth.state_tree, request) < 0) {
+ if (fr_state_restore(inst->auth.state_tree, request) < 0) {
return CALL_SEND_TYPE(FR_RADIUS_CODE_ACCESS_REJECT);
}
*
* If this fails, don't respond to the request.
*/
- if (!request->parent && fr_request_to_state(inst->auth.state_tree, request) < 0) {
+ if (!request->parent && fr_state_store(inst->auth.state_tree, request) < 0) {
return CALL_SEND_TYPE(FR_RADIUS_CODE_DO_NOT_RESPOND);
}
* Cache the session state context.
*/
if ((state_create(request->reply_ctx, &request->reply_pairs, request, true) < 0) ||
- (fr_request_to_state(inst->auth.state_tree, request) < 0)) {
+ (fr_state_store(inst->auth.state_tree, request) < 0)) {
return CALL_SEND_TYPE(FR_TACACS_CODE_AUTH_ERROR);
}
process_tacacs_session_t *session;
if ((state_create(request->request_ctx, &request->request_pairs, request, false) < 0) ||
- (fr_state_to_request(inst->auth.state_tree, request) < 0)) {
+ (fr_state_restore(inst->auth.state_tree, request) < 0)) {
return CALL_SEND_TYPE(FR_TACACS_CODE_AUTH_ERROR);
}
process_tacacs_t const *inst = talloc_get_type_abort_const(mctx->mi->data, process_tacacs_t);
if ((state_create(request->request_ctx, &request->request_pairs, request, false) < 0) ||
- (fr_state_to_request(inst->auth.state_tree, request) < 0)) {
+ (fr_state_restore(inst->auth.state_tree, request) < 0)) {
return CALL_SEND_TYPE(FR_TACACS_CODE_AUTH_ERROR);
}
*
* If this fails, don't respond to the request.
*/
- if (fr_request_to_state(inst->auth.state_tree, request) < 0) {
+ if (fr_state_store(inst->auth.state_tree, request) < 0) {
request->reply->code = FR_RADIUS_CODE_DO_NOT_RESPOND;
UPDATE_STATE_CS(reply);
return CALL_SEND_STATE(state);