The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
parallel_priv.h
Go to the documentation of this file.
1#pragma once
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2, or (at your option)
6 * any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 */
17
18/**
19 * $Id: 06c615a810e7f062e57a6e2d71aafcb206e264b6 $
20 *
21 * @file unlang/parallel_priv.h
22 * @brief Declarations for the unlang "parallel" keyword
23 *
24 * Should be moved into parallel.c when the parallel stuff is fully extracted
25 * from interpret.c
26 *
27 * @copyright 2006-2019 The FreeRADIUS server project
28 */
29#include "unlang_priv.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/** Parallel child states
36 *
37 */
38typedef enum {
39 CHILD_INIT = 0, //!< Initial state.
40 CHILD_RUNNABLE, //!< Running/runnable.
41 CHILD_EXITED, //!< Child has exited
42 CHILD_DETACHED, //!< Child has detached.
43 CHILD_CANCELLED, //!< Child was cancelled.
44 CHILD_DONE //!< The child has completed.
46
47/** Each parallel child has a state, and an associated request
48 *
49 */
50typedef struct {
51 int num; //!< The child number.
52
53 unlang_parallel_child_state_t state; //!< State of the child.
54 request_t *request; //!< Child request.
55 char *name; //!< Cache the request name.
56 unlang_t const *instruction; //!< broken out of g->children
58
59typedef struct {
62
63 int num_children; //!< How many children are executing.
64 int num_complete; //!< How many children are complete.
65
66 bool detach; //!< are we creating the child detached
67 bool clone; //!< are the children cloned
68
69 unlang_parallel_child_t children[]; //!< Array of children.
71
72typedef struct {
74 bool detach; //!< are we creating the child detached
75 bool clone;
77
78/** Cast a group structure to the parallel keyword extension
79 *
80 */
82{
83 return talloc_get_type_abort(g, unlang_parallel_t);
84}
85
86/** Cast a parallel keyword extension to a group structure
87 *
88 */
90{
91 return (unlang_group_t *)parallel;
92}
93
94#ifdef __cplusplus
95}
96#endif
static unlang_group_t * unlang_parallel_to_group(unlang_parallel_t *parallel)
Cast a parallel keyword extension to a group structure.
bool detach
are we creating the child detached
char * name
Cache the request name.
static unlang_parallel_t * unlang_group_to_parallel(unlang_group_t *g)
Cast a group structure to the parallel keyword extension.
int num_complete
How many children are complete.
int num_children
How many children are executing.
request_t * request
Child request.
int num
The child number.
bool clone
are the children cloned
unlang_t const * instruction
broken out of g->children
bool detach
are we creating the child detached
unlang_parallel_child_state_t
Parallel child states.
@ CHILD_RUNNABLE
Running/runnable.
@ CHILD_DETACHED
Child has detached.
@ CHILD_INIT
Initial state.
@ CHILD_EXITED
Child has exited.
@ CHILD_CANCELLED
Child was cancelled.
@ CHILD_DONE
The child has completed.
unlang_group_t group
unlang_parallel_child_state_t state
State of the child.
Each parallel child has a state, and an associated request.
rlm_rcode_t
Return codes indicating the result of the module call.
Definition rcode.h:40
Private interpreter structures and functions.
Generic representation of a grouping.
A node in a graph of unlang_op_t (s) that we execute.