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: eb71d1cd6ad81a4adcb5d8c3cf4e8c2bfb0617c9 $
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 "child_request_priv.h"
30#include "unlang_priv.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36typedef struct {
37 unlang_result_t result; //!< our result
38
39 unsigned int num_children; //!< How many children are executing.
40 unsigned int num_runnable; //!< How many children are complete.
41
42 bool detach; //!< are we creating the child detached
43 bool clone; //!< are the children cloned
44
45 unlang_t *instruction; //!< The instruction the children should
46 ///< start executing.
47
48 unlang_child_request_t children[]; //!< Array of children.
50
51typedef struct {
53 bool detach; //!< are we creating the child detached
54 bool clone;
56
57/** Cast a group structure to the parallel keyword extension
58 *
59 */
61{
62 return talloc_get_type_abort(g, unlang_parallel_t);
63}
64
65/** Cast a parallel keyword extension to a group structure
66 *
67 */
69{
70 return (unlang_group_t *)parallel;
71}
72
73#ifdef __cplusplus
74}
75#endif
Each child has a state, a number, a request, and a count of their siblings.
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
static unlang_parallel_t * unlang_group_to_parallel(unlang_group_t *g)
Cast a group structure to the parallel keyword extension.
unlang_result_t result
our result
unsigned int num_runnable
How many children are complete.
unlang_t * instruction
The instruction the children should start executing.
bool clone
are the children cloned
bool detach
are we creating the child detached
unlang_group_t group
unsigned int num_children
How many children are executing.
Private interpreter structures and functions.
Generic representation of a grouping.
A node in a graph of unlang_op_t (s) that we execute.