Coverage Report

Created: 2026-10-18 06:56

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/freeradius-server/src/lib/unlang/load_balance_priv.h
Line
Count
Source
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
26
extern "C" {
27
#endif
28
29
#include "unlang_priv.h"
30
#include <freeradius-devel/server/tmpl.h>
31
32
typedef 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.
36
} unlang_load_balance_t;
37
38
/** State of a redundant operation
39
 *
40
 */
41
typedef 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
46
} unlang_frame_state_redundant_t;
47
48
/** Cast a group structure to the load_balance keyword extension
49
 *
50
 */
51
static inline unlang_load_balance_t *unlang_group_to_load_balance(unlang_group_t *g)
52
0
{
53
0
  return talloc_get_type_abort(g, unlang_load_balance_t);
54
0
}
Unexecuted instantiation: compile.c:unlang_group_to_load_balance
Unexecuted instantiation: interpret.c:unlang_group_to_load_balance
Unexecuted instantiation: load_balance.c:unlang_group_to_load_balance
55
56
/** Cast a load_balance keyword extension to a group structure
57
 *
58
 */
59
static inline unlang_group_t *unlang_load_balance_to_group(unlang_load_balance_t *load_balance)
60
0
{
61
0
  return (unlang_group_t *)load_balance;
62
0
}
Unexecuted instantiation: compile.c:unlang_load_balance_to_group
Unexecuted instantiation: interpret.c:unlang_load_balance_to_group
Unexecuted instantiation: load_balance.c:unlang_load_balance_to_group
63
64
int unlang_load_balance_persist(request_t *request) CC_HINT(nonnull);
65
uint8_t unlang_load_balance_child(request_t *request) CC_HINT(nonnull);
66
67
#ifdef __cplusplus
68
}
69
#endif