-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_fix.h
117 lines (95 loc) · 3.48 KB
/
mod_fix.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
*$Id$
*
* Copyright (C) 2001-2003 FhG Fokus
*
* This file is part of opensips, a free SIP server.
*
* opensips is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version
*
* opensips is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*!
* \file
* \brief Generic fixup functions for module function parameter.
*/
#ifndef _mod_fix_h_
#define _mod_fix_h_
#include "pvar.h"
#define GPARAM_TYPE_INT 0
#define GPARAM_TYPE_STR 1
#define GPARAM_TYPE_PVS 2
#define GPARAM_TYPE_PVE 3
#define GPARAM_INT_VALUE_FLAG (1U<<0)
#define GPARAM_STR_VALUE_FLAG (1U<<1)
/*!
* generic parameter that holds a string, an int or a pseudo-variable
*/
typedef struct _gparam
{
int type;
union {
int ival;
str sval;
pv_spec_t *pvs;
pv_elem_t *pve;
} v;
} gparam_t, *gparam_p;
int fixup_str_null(void** param, int param_no);
int fixup_str_str(void** param, int param_no);
int fixup_free_str_null(void** param, int param_no);
int fixup_free_str_str(void** param, int param_no);
int fixup_uint_null(void** param, int param_no);
int fixup_uint_uint(void** param, int param_no);
int fixup_sint_null(void** param, int param_no);
int fixup_sint_sint(void** param, int param_no);
#if 0
int fixup_sint_uint(void** param, int param_no);
int fixup_uint_sint(void** param, int param_no);
#endif
int fixup_regexp_null(void** param, int param_no);
int fixup_regexpNL_null(void** param, int param_no);
int fixup_free_regexp_null(void** param, int param_no);
int fixup_regexp_none(void** param, int param_no);
int fixup_regexpNL_none(void** param, int param_no);
int fixup_free_regexp_none(void** param, int param_no);
int fixup_pvar_null(void **param, int param_no);
int fixup_free_pvar_null(void** param, int param_no);
int fixup_pvar_pvar(void **param, int param_no);
int fixup_free_pvar_pvar(void** param, int param_no);
int fixup_pvar_str(void** param, int param_no);
int fixup_free_pvar_str(void** param, int param_no);
int fixup_pvar_str_str(void** param, int param_no);
int fixup_free_pvar_str_str(void** param, int param_no);
int fixup_igp_igp(void** param, int param_no);
int fixup_igp_igp_igp(void** param, int param_no);
int fixup_igp_null(void** param, int param_no);
int fixup_get_ivalue(struct sip_msg* msg, gparam_p gp, int *val);
int fixup_igp_pvar_pvar(void** param, int param_no);
int fixup_free_igp_pvar_pvar(void** param, int param_no);
int fixup_spve_spve(void** param, int param_no);
int fixup_spve_null(void** param, int param_no);
int fixup_spve_uint(void** param, int param_no);
int fixup_get_svalue(struct sip_msg* msg, gparam_p gp, str *val);
int fixup_get_isvalue(struct sip_msg* msg, gparam_p gp,
int *i_val, str *s_val, unsigned int *flags);
int fixup_spve(void** param);
int fixup_pvar(void **param);
int fixup_str(void **param);
int fixup_uint(void** param);
int fixup_sint(void** param);
int fixup_igp(void** param);
int fixup_sgp(void** param);
int fixup_sgp_null(void** param, int param_no);
int fixup_sgp_sgp(void** param, int param_no);
#endif