Coverage Report

Created: 2025-07-11 06:28

/src/opensips/mod_fix.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (C) 2001-2003 FhG Fokus
3
 *
4
 * This file is part of opensips, a free SIP server.
5
 *
6
 * opensips is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 2 of the License, or
9
 * (at your option) any later version
10
 *
11
 * opensips is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
19
 */
20
21
22
#ifndef _mod_fix_h_
23
#define _mod_fix_h_
24
25
#include <regex.h>
26
#include "mem/mem.h"
27
#include "pvar.h"
28
#include "route_struct.h"
29
30
0
#define GPARAM_TYPE_VAL   0
31
0
#define GPARAM_TYPE_PVS   1
32
0
#define GPARAM_TYPE_PVE   2
33
0
#define GPARAM_TYPE_FIXUP 3
34
35
typedef struct _gparam
36
{
37
  int type;
38
  void *pval;
39
  union {
40
    int ival;
41
    str sval;
42
  } v;
43
} gparam_t, *gparam_p;
44
45
46
struct cmd_param;
47
48
int check_cmd(const struct cmd_param *params, action_elem_t *elems);
49
int fix_cmd(const struct cmd_param *params, action_elem_t *elems);
50
int get_cmd_fixups(struct sip_msg* msg, const struct cmd_param *params,
51
        action_elem_t *elems, void **cmdp, pv_value_t *tmp_val);
52
int free_cmd_fixups(const struct cmd_param *params, action_elem_t *elems, void **cmdp);
53
54
/**
55
 * Parses CSV named flags and sets the bitmasks / returns
56
 * the string values for key-value type of flags ("flag_name=flag_value").
57
 * @param: function parameter as received by the fixup function; *param will
58
 *  be set with the OR'ed bitmasks.
59
 * @flag_names: array of flag names which will be translated to bitmasks
60
 *  according to the indexes of the flag names in the array, i.e. (1<<array_idx).
61
 * @kv_flag_names: array of key-value flag names.
62
 * @kv_flag_vals: array of flag values to be returned. Each str the in the
63
 *  array will be set with the flag value if the corresponding flag from
64
 *  @kv_flag_names is present, otherwise it will be set to {NULL, 0}
65
 */
66
int fixup_named_flags(void** param, str *flag_names, str *kv_flag_names,
67
  str *kv_flag_vals);
68
69
static inline int fixup_free_pkg(void **param)
70
0
{
71
0
  pkg_free(*param);
72
0
  return 0;
73
0
}
Unexecuted instantiation: route.c:fixup_free_pkg
Unexecuted instantiation: action.c:fixup_free_pkg
Unexecuted instantiation: mod_fix.c:fixup_free_pkg
Unexecuted instantiation: core_cmds.c:fixup_free_pkg
74
75
#endif