The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Functions
subrequest.h File Reference
#include <freeradius-devel/server/request.h>
#include <freeradius-devel/server/rcode.h>
#include <stdbool.h>
+ Include dependency graph for subrequest.h:

Go to the source code of this file.

Data Structures

struct  unlang_subrequest_session_t
 

Functions

request_tunlang_subrequest_alloc (request_t *parent, fr_dict_t const *namespace)
 Allocate a subrequest to run through a virtual server at some point in the future. More...
 
int unlang_subrequest_child_push (rlm_rcode_t *out, request_t *child, unlang_subrequest_session_t const *session, bool free_child, bool top_frame)
 Push a pre-existing child back onto the stack as a subrequest. More...
 
int unlang_subrequest_child_push_and_detach (request_t *child)
 
void unlang_subrequest_detach_and_free (request_t **child)
 Free a child request, detaching it from its parent and freeing allocated memory. More...
 
int unlang_subrequest_lifetime_set (request_t *request)
 Initialize a detached child. More...
 

Detailed Description

Id
01ca28284443e0ed2f09d4ce9301704a462e36ae

Definition in file subrequest.h.


Data Structure Documentation

◆ unlang_subrequest_session_t

struct unlang_subrequest_session_t

Definition at line 34 of file subrequest.h.

Data Fields
bool enable Whether we should store/restore sessions.
int unique_int Session unique int identifier.
void const * unique_ptr Session unique ptr identifier.

Function Documentation

◆ unlang_subrequest_alloc()

request_t* unlang_subrequest_alloc ( request_t parent,
fr_dict_t const *  namespace 
)

Allocate a subrequest to run through a virtual server at some point in the future.

Parameters
[in]parentto hang sub request off of.
[in]namespacethe child will operate in.
Returns
  • A new child request.
  • NULL on failure.

Definition at line 287 of file subrequest.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_subrequest_child_push()

int unlang_subrequest_child_push ( rlm_rcode_t out,
request_t child,
unlang_subrequest_session_t const *  session,
bool  free_child,
bool  top_frame 
)

Push a pre-existing child back onto the stack as a subrequest.

The child MUST have been allocated with unlang_io_subrequest_alloc, or something that calls it.

After the child is no longer required it MUST be freed with unlang_subrequest_detach_and_free. It's not enough to free it with talloc_free.

This function should be called before pushing any additional frames onto the child's stack for it to execute.

The parent should return UNLANG_ACTION_PUSHED_CHILD, when it's done setting up the child request. It should NOT return UNLANG_ACTION_YIELD.

Parameters
[in]outWhere to write the result of the subrequest.
[in]childto push.
[in]sessioncontrol values. Whether we restore/store session info.
[in]free_childautomatically free the child when it's finished executing. This is useful if extracting the result from the child is done using the child's stack, and so the parent never needs to access it.
[in]top_frameSet to UNLANG_TOP_FRAME if the interpreter should return. Set to UNLANG_SUB_FRAME if the interprer should continue.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 329 of file subrequest_child.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_subrequest_child_push_and_detach()

int unlang_subrequest_child_push_and_detach ( request_t child)

Definition at line 373 of file subrequest_child.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_subrequest_detach_and_free()

void unlang_subrequest_detach_and_free ( request_t **  child)

Free a child request, detaching it from its parent and freeing allocated memory.

Parameters
[in]childto free.

Definition at line 272 of file subrequest.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_subrequest_lifetime_set()

int unlang_subrequest_lifetime_set ( request_t request)

Initialize a detached child.

Detach it from the parent, set up it's lifetime, and mark it as runnable.

Definition at line 67 of file subrequest_child.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: