The FreeRADIUS server $Id: f3670dba8951ca10eb4948feb3dc3db9423a334f $
Loading...
Searching...
No Matches
load_balance_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: 86d4425d926dea3d7153785e7e237f74a8033f1d $
20 *
21 * @file unlang/load_balance_priv.h
22 *
23 * @copyright 2020 The FreeRADIUS server project
24 */
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#include "unlang_priv.h"
30#include <freeradius-devel/server/tmpl.h>
31
32typedef struct {
33 unlang_group_t group; //!< our instruction
34 tmpl_t *vpt; //!< template to expand for keyed balancing
35 unlang_t **children; //!< array of child instructions.
37
38/** State of a redundant operation
39 *
40 */
41typedef struct {
42 unlang_t *child; //!< the current child we're processing
43 unlang_t *start; //!< the starting child
44 uint32_t num; //!< the current child number
45 unlang_result_t result; //!< for intermediate child results
47
48/** Cast a group structure to the load_balance keyword extension
49 *
50 */
52{
53 return talloc_get_type_abort(g, unlang_load_balance_t);
54}
55
56/** Cast a load_balance keyword extension to a group structure
57 *
58 */
60{
61 return (unlang_group_t *)load_balance;
62}
63
64int unlang_load_balance_persist(request_t *request) CC_HINT(nonnull);
66
67#ifdef __cplusplus
68}
69#endif
tmpl_t * vpt
template to expand for keyed balancing
static unlang_load_balance_t * unlang_group_to_load_balance(unlang_group_t *g)
Cast a group structure to the load_balance keyword extension.
unlang_result_t result
for intermediate child results
uint32_t num
the current child number
uint8_t unlang_load_balance_child(request_t *request)
Returns the current child of the load balance section.
int unlang_load_balance_persist(request_t *request)
Persist the current load-balance selection.
static unlang_group_t * unlang_load_balance_to_group(unlang_load_balance_t *load_balance)
Cast a load_balance keyword extension to a group structure.
unlang_group_t group
our instruction
unlang_t * child
the current child we're processing
unlang_t * start
the starting child
unlang_t ** children
array of child instructions.
State of a redundant operation.
unsigned int uint32_t
unsigned char uint8_t
Private interpreter structures and functions.
Generic representation of a grouping.
A node in a graph of unlang_op_t (s) that we execute.
int nonnull(2, 5))