Browse code

- internal redesign of pseudo-variable (PV) model - more compact and clear format for name and index - naming format of structures and functions are prefixed with pv_ instead of xl_ - types of PV are prefixed with PVT_ instead of XL_ - PV spec formats: - $class_name - $class_name(inner_name) - $(class_name[index]) - $(class_name(inner_name)[index]) - $(class_name{transformation}) - $(class_name(inner_name){transformation}) - $(class_name[index]{transformation}) - $(class_name(inner_name)[index]{transformation}) - NOTE: the index for avp and hdr has to be specified after the pharantesis enclosing the name ( $avp(name[index]) => $(avp(name)[index]) ) - there are three classes that accept inner name: avp, hdr and var - there are two classes that accept index: avp and hdr - NOTE: color printing PV not yet migrated -- they will be introduced as a new PV class exported by xlog module - modules migrated to new PV model - NOTE: avpsops need special attention -- it was prety much affected - PV exporting by modules is done via a new simpler structure that allows to add PV with inner name and index - NEW FEATURE: inner_name and index for avp and hdr can be PV ( example: $(avp($var(avp_name))[$var(index)]) - name of avp is taken from $var(avp_name) and the index from $var(index)) - dev version increased

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2725 689a6050-402a-0410-94f2-e92a70836424

Daniel-Constantin Mierla authored on 09/09/2007 20:55:56
Showing 78 changed files
... ...
@@ -37,7 +37,6 @@
37 37
 #include <ctype.h>
38 38
 #include "../../dprint.h"
39 39
 #include "../../ut.h"
40
-#include "../../items.h"
41 40
 #include "../../usr_avp.h"
42 41
 #include "../../mem/mem.h"
43 42
 #include "acc_extra.h"
... ...
@@ -78,7 +77,7 @@ struct acc_extra *parse_acc_leg(char *extra_str)
78 77
 
79 78
 	/* check the type and len */
80 79
 	for( it=legs,n=0 ; it ; it=it->next ) {
81
-		if (it->spec.type!=XL_AVP) {
80
+		if (it->spec.type!=PVT_AVP) {
82 81
 			LOG(L_ERR,"ERROR:acc:parse_acc_leg: only AVP are accepted as "
83 82
 				"leg info\n");
84 83
 			destroy_extras(legs);
... ...
@@ -104,15 +103,14 @@ struct acc_extra *parse_acc_extra(char *extra_str)
104 103
 	struct acc_extra *extra;
105 104
 	char *foo;
106 105
 	char *s;
107
-	int  xl_flags;
108 106
 	int  n;
107
+	str stmp;
109 108
 
110 109
 	n = 0;
111 110
 	head = 0;
112 111
 	extra = 0;
113 112
 	tail = 0;
114 113
 	s = extra_str;
115
-	xl_flags = XL_THROW_ERROR | XL_DISABLE_COLORS;
116 114
 
117 115
 	if (s==0) {
118 116
 		LOG(L_ERR,"ERROR:acc:parse_acc_extra: null string received\n");
... ...
@@ -166,7 +164,8 @@ struct acc_extra *parse_acc_extra(char *extra_str)
166 164
 		while (*s && isspace((int)*s))  s++;
167 165
 
168 166
 		/* get value type */
169
-		if ( (foo=xl_parse_spec( s, &extra->spec, xl_flags))==0 )
167
+		stmp.s = s; stmp.len = strlen(s);
168
+		if ( (foo=pv_parse_spec(&stmp, &extra->spec))==0 )
170 169
 			goto parse_error;
171 170
 		s = foo;
172 171
 
... ...
@@ -243,7 +242,7 @@ int extra2int( struct acc_extra *extra, int *attrs )
243 242
 
244 243
 int extra2strar( struct acc_extra *extra, struct sip_msg *rq, str *val_arr)
245 244
 {
246
-	xl_value_t value;
245
+	pv_value_t value;
247 246
 	int n;
248 247
 	int r;
249 248
 
... ...
@@ -252,7 +251,7 @@ int extra2strar( struct acc_extra *extra, struct sip_msg *rq, str *val_arr)
252 251
 
253 252
 	while (extra) {
254 253
 		/* get the value */
255
-		if (xl_get_spec_value( rq, &extra->spec, &value, 0)!=0) {
254
+		if (pv_get_spec_value( rq, &extra->spec, &value)!=0) {
256 255
 			LOG(L_ERR,"ERROR:acc:extra2strar: failed to get '%.*s'\n",
257 256
 				extra->name.len,extra->name.s);
258 257
 		}
... ...
@@ -264,7 +263,7 @@ int extra2strar( struct acc_extra *extra, struct sip_msg *rq, str *val_arr)
264 263
 			goto done;
265 264
 		}
266 265
 
267
-		if(value.flags&XL_VAL_NULL) {
266
+		if(value.flags&PV_VAL_NULL) {
268 267
 			/* convert <null> to empty to have consistency */
269 268
 			val_arr[n].s = 0;
270 269
 			val_arr[n].len = 0;
... ...
@@ -306,7 +305,7 @@ int legs2strar( struct acc_extra *legs, struct sip_msg *rq, str *val_arr,
306 305
 	for( n=0 ; legs ; legs=legs->next,n++ ) {
307 306
 		/* search for the AVP */
308 307
 		if (start) {
309
-			if ( xl_get_avp_name( rq, &legs->spec, &name, &name_type)<0 )
308
+			if ( pv_get_avp_name( rq, &(legs->spec.pvp), &name, &name_type)<0 )
310 309
 				goto exit;
311 310
 			avp[n] = search_first_avp( name_type, name, &value, 0);
312 311
 		} else {
... ...
@@ -35,13 +35,13 @@
35 35
 #define _ACC_EXTRA_H_
36 36
 
37 37
 #include "../../str.h"
38
-#include "../../items.h"
38
+#include "../../pvar.h"
39 39
 #include "../../parser/msg_parser.h"
40 40
 
41 41
 struct acc_extra
42 42
 {
43 43
 	str        name;       /* name (log comment/ column name) */
44
-	xl_spec_t  spec;       /* value's spec */
44
+	pv_spec_t  spec;       /* value's spec */
45 45
 	struct acc_extra *next;
46 46
 };
47 47
 
... ...
@@ -40,7 +40,7 @@
40 40
 #include "../../dprint.h"
41 41
 #include "../../mem/mem.h"
42 42
 #include "../../error.h"
43
-#include "../../items.h"
43
+#include "../../pvar.h"
44 44
 #include "../../ut.h"
45 45
 #include "../../mod_fix.h"
46 46
 #include "../sl/sl_api.h"
... ...
@@ -111,12 +111,12 @@ char* rpid_avp_param = DEF_RPID_AVP;
111 111
 
112 112
 /* definition of AVP containing username value */
113 113
 char* user_spec_param = 0;
114
-static xl_spec_t user_spec;
114
+static pv_spec_t user_spec;
115 115
 
116 116
 
117 117
 /* definition of AVP containing password value */
118 118
 char* passwd_spec_param = 0;
119
-static xl_spec_t passwd_spec;
119
+static pv_spec_t passwd_spec;
120 120
 
121 121
 /*
122 122
  * Exported functions 
... ...
@@ -211,6 +211,7 @@ static inline int generate_random_secret(void)
211 211
 
212 212
 static int mod_init(void)
213 213
 {
214
+	str stmp;
214 215
 	LOG(L_INFO,"AUTH module - initializing\n");
215 216
 	
216 217
 	/* load the SL API */
... ...
@@ -244,17 +245,18 @@ static int mod_init(void)
244 245
 
245 246
 	if(user_spec_param!=0)
246 247
 	{
247
-		if(xl_parse_spec(user_spec_param, &user_spec, 0)==NULL)
248
+		stmp.s = user_spec_param; stmp.len = strlen(stmp.s);
249
+		if(pv_parse_spec(&stmp, &user_spec)==NULL)
248 250
 		{
249 251
 			LOG(L_ERR,"ERROR:auth:mod_init: failed to parse username spec\n");
250 252
 			return -5;
251 253
 		}
252 254
 		switch(user_spec.type) {
253
-			case XL_NONE:
254
-			case XL_EMPTY:
255
-			case XL_NULL:
256
-			case XL_MARKER:
257
-			case XL_COLOR:
255
+			case PVT_NONE:
256
+			case PVT_EMPTY:
257
+			case PVT_NULL:
258
+			case PVT_MARKER:
259
+			case PVT_COLOR:
258 260
 				LOG(L_ERR,"ERROR:auth:mod_init: invalid username spec\n");
259 261
 				return -6;
260 262
 			default: ;
... ...
@@ -262,17 +264,18 @@ static int mod_init(void)
262 264
 	}
263 265
 	if(passwd_spec_param!=0)
264 266
 	{
265
-		if(xl_parse_spec(passwd_spec_param, &passwd_spec, 0)==NULL)
267
+		stmp.s = passwd_spec_param; stmp.len = strlen(stmp.s);
268
+		if(pv_parse_spec(&stmp, &passwd_spec)==NULL)
266 269
 		{
267 270
 			LOG(L_ERR,"ERROR:auth:mod_init: failed to parse password spec\n");
268 271
 			return -7;
269 272
 		}
270 273
 		switch(passwd_spec.type) {
271
-			case XL_NONE:
272
-			case XL_EMPTY:
273
-			case XL_NULL:
274
-			case XL_MARKER:
275
-			case XL_COLOR:
274
+			case PVT_NONE:
275
+			case PVT_EMPTY:
276
+			case PVT_NULL:
277
+			case PVT_MARKER:
278
+			case PVT_COLOR:
276 279
 				LOG(L_ERR,"ERROR:auth:mod_init: invalid password spec\n");
277 280
 				return -8;
278 281
 			default: ;
... ...
@@ -292,16 +295,16 @@ static void destroy(void)
292 295
 static inline int auth_get_ha1(struct sip_msg *msg, struct username* _username,
293 296
 		str* _domain, char* _ha1)
294 297
 {
295
-	xl_value_t sval;
298
+	pv_value_t sval;
296 299
 	
297 300
 	/* get username from PV */
298
-	memset(&sval, 0, sizeof(xl_value_t));
299
-	if(xl_get_spec_value(msg, &user_spec, &sval, 0)==0)
301
+	memset(&sval, 0, sizeof(pv_value_t));
302
+	if(pv_get_spec_value(msg, &user_spec, &sval)==0)
300 303
 	{
301
-		if(sval.flags==XL_VAL_NONE || (sval.flags&XL_VAL_NULL)
302
-				|| (sval.flags&XL_VAL_EMPTY) || (!(sval.flags&XL_VAL_STR)))
304
+		if(sval.flags==PV_VAL_NONE || (sval.flags&PV_VAL_NULL)
305
+				|| (sval.flags&PV_VAL_EMPTY) || (!(sval.flags&PV_VAL_STR)))
303 306
 		{
304
-			xl_value_destroy(&sval);
307
+			pv_value_destroy(&sval);
305 308
 			return 1;
306 309
 		}
307 310
 		if(sval.rs.len!= _username->user.len
... ...
@@ -309,20 +312,20 @@ static inline int auth_get_ha1(struct sip_msg *msg, struct username* _username,
309 312
 		{
310 313
 			DBG("auth: auth_get_ha1: username mismatch [%.*s] [%.*s]\n",
311 314
 				_username->user.len, _username->user.s, sval.rs.len, sval.rs.s);
312
-			xl_value_destroy(&sval);
315
+			pv_value_destroy(&sval);
313 316
 			return 1;
314 317
 		}
315 318
 	} else {
316 319
 		return 1;
317 320
 	}
318 321
 	/* get password from PV */
319
-	memset(&sval, 0, sizeof(xl_value_t));
320
-	if(xl_get_spec_value(msg, &passwd_spec, &sval, 0)==0)
322
+	memset(&sval, 0, sizeof(pv_value_t));
323
+	if(pv_get_spec_value(msg, &passwd_spec, &sval)==0)
321 324
 	{
322
-		if(sval.flags==XL_VAL_NONE || (sval.flags&XL_VAL_NULL)
323
-				|| (sval.flags&XL_VAL_EMPTY) || (!(sval.flags&XL_VAL_STR)))
325
+		if(sval.flags==PV_VAL_NONE || (sval.flags&PV_VAL_NULL)
326
+				|| (sval.flags&PV_VAL_EMPTY) || (!(sval.flags&PV_VAL_STR)))
324 327
 		{
325
-			xl_value_destroy(&sval);
328
+			pv_value_destroy(&sval);
326 329
 			return 1;
327 330
 		}
328 331
 	} else {
... ...
@@ -341,7 +344,7 @@ static inline int auth_get_ha1(struct sip_msg *msg, struct username* _username,
341 344
 	return 0;
342 345
 }
343 346
 
344
-static inline int pv_authorize(struct sip_msg* msg, xl_elem_t* realm,
347
+static inline int pv_authorize(struct sip_msg* msg, pv_elem_t* realm,
345 348
 										hdr_types_t hftype)
346 349
 {
347 350
 	static char ha1[256];
... ...
@@ -352,8 +355,8 @@ static inline int pv_authorize(struct sip_msg* msg, xl_elem_t* realm,
352 355
 	str domain;
353 356
 
354 357
 	if (realm) {
355
-		if (xl_printf_s(msg, realm, &domain)!=0) {
356
-			LOG(L_ERR, "ERROR:auth:authorize: xl_printf_s failed\n");
358
+		if (pv_printf_s(msg, realm, &domain)!=0) {
359
+			LOG(L_ERR, "ERROR:auth:authorize: pv_printf_s failed\n");
357 360
 			return AUTH_ERROR;
358 361
 		}
359 362
 	} else {
... ...
@@ -392,30 +395,31 @@ static inline int pv_authorize(struct sip_msg* msg, xl_elem_t* realm,
392 395
 
393 396
 int pv_proxy_authorize(struct sip_msg* msg, char* realm, char* str2)
394 397
 {
395
-	return pv_authorize(msg, (xl_elem_t*)realm, HDR_PROXYAUTH_T);
398
+	return pv_authorize(msg, (pv_elem_t*)realm, HDR_PROXYAUTH_T);
396 399
 }
397 400
 
398 401
 
399 402
 int pv_www_authorize(struct sip_msg* msg, char* realm, char* str2)
400 403
 {
401
-	return pv_authorize(msg, (xl_elem_t*)realm, HDR_AUTHORIZATION_T);
404
+	return pv_authorize(msg, (pv_elem_t*)realm, HDR_AUTHORIZATION_T);
402 405
 }
403 406
 
404 407
 
405 408
 static int challenge_fixup(void** param, int param_no)
406 409
 {
407
-	xl_elem_t *model;
410
+	pv_elem_t *model;
408 411
 	unsigned long qop;
409 412
 	int err;
410
-	char *s;
413
+	str s;
411 414
 	
412 415
 	if (param_no == 1) {
413
-		s = (char*)*param;
414
-		if (s==0 || s[0]==0) {
416
+		s.s = (char*)*param;
417
+		if (s.s==0 || s.s[0]==0) {
415 418
 			model = 0;
416 419
 		} else {
417
-			if (xl_parse_format(s,&model,XL_DISABLE_COLORS)<0) {
418
-				LOG(L_ERR, "ERROR:auth:challenge_fixup: xl_parse_format "
420
+			s.len = strlen(s.s);
421
+			if (pv_parse_format(&s,&model)<0) {
422
+				LOG(L_ERR, "ERROR:auth:challenge_fixup: pv_parse_format "
419 423
 					"failed\n");
420 424
 				return E_OUT_OF_MEM;
421 425
 			}
... ...
@@ -456,16 +460,17 @@ static int rpid_fixup(void** param, int param_no)
456 460
  */
457 461
 static int auth_fixup(void** param, int param_no)
458 462
 {
459
-	xl_elem_t *model;
460
-	char* s;
463
+	pv_elem_t *model;
464
+	str s;
461 465
 
462 466
 	if (param_no == 1) {
463
-		s = (char*)*param;
464
-		if (s==0 || s[0]==0) {
467
+		s.s = (char*)*param;
468
+		if (s.s==0 || s.s[0]==0) {
465 469
 			model = 0;
466 470
 		} else {
467
-			if (xl_parse_format(s,&model,XL_DISABLE_COLORS)<0) {
468
-				LOG(L_ERR, "ERROR:auth:auth_fixup: xl_parse_format "
471
+			s.len =  strlen(s.s);
472
+			if (pv_parse_format(&s,&model)<0) {
473
+				LOG(L_ERR, "ERROR:auth:auth_fixup: pv_parse_format "
469 474
 					"failed\n");
470 475
 				return E_OUT_OF_MEM;
471 476
 			}
... ...
@@ -32,7 +32,7 @@
32 32
 #include "../../data_lump.h"
33 33
 #include "../../mem/mem.h"
34 34
 #include "../../parser/digest/digest.h"
35
-#include "../../items.h"
35
+#include "../../pvar.h"
36 36
 #include "../../str.h"
37 37
 #include "../../ut.h"
38 38
 #include "auth_mod.h"
... ...
@@ -130,7 +130,7 @@ static inline char *build_auth_hf(int _retries, int _stale, str* _realm,
130 130
 /*
131 131
  * Create and send a challenge
132 132
  */
133
-static inline int challenge(struct sip_msg* _msg, xl_elem_t* _realm, int _qop,
133
+static inline int challenge(struct sip_msg* _msg, pv_elem_t* _realm, int _qop,
134 134
 						int _code, char* _message, char* _challenge_msg)
135 135
 {
136 136
 	int auth_hf_len;
... ...
@@ -169,8 +169,8 @@ static inline int challenge(struct sip_msg* _msg, xl_elem_t* _realm, int _qop,
169 169
 		realm = uri->host;
170 170
 		strip_realm(&realm);
171 171
 	} else {
172
-		if(xl_printf_s(_msg, _realm, &realm)!=0) {
173
-			LOG(L_ERR, "ERROR:auth:challenge: xl_printf_s failed\n");
172
+		if(pv_printf_s(_msg, _realm, &realm)!=0) {
173
+			LOG(L_ERR, "ERROR:auth:challenge: pv_printf_s failed\n");
174 174
 			if (send_resp(_msg, 500, &auth_500_err, 0, 0)==-1)
175 175
 				return -1;
176 176
 			else
... ...
@@ -203,7 +203,7 @@ static inline int challenge(struct sip_msg* _msg, xl_elem_t* _realm, int _qop,
203 203
  */
204 204
 int www_challenge(struct sip_msg* _msg, char* _realm, char* _qop)
205 205
 {
206
-	return challenge(_msg, (xl_elem_t*)_realm, (int)(long)_qop, 401,
206
+	return challenge(_msg, (pv_elem_t*)_realm, (int)(long)_qop, 401,
207 207
 			MESSAGE_401, WWW_AUTH_CHALLENGE);
208 208
 }
209 209
 
... ...
@@ -213,7 +213,7 @@ int www_challenge(struct sip_msg* _msg, char* _realm, char* _qop)
213 213
  */
214 214
 int proxy_challenge(struct sip_msg* _msg, char* _realm, char* _qop)
215 215
 {
216
-	return challenge(_msg, (xl_elem_t*)_realm, (int)(long)_qop, 407,
216
+	return challenge(_msg, (pv_elem_t*)_realm, (int)(long)_qop, 407,
217 217
 			MESSAGE_407, PROXY_AUTH_CHALLENGE);
218 218
 }
219 219
 
... ...
@@ -37,7 +37,7 @@
37 37
 #include "../../parser/parse_uri.h"
38 38
 #include "../../parser/parser_f.h"
39 39
 #include "../../ut.h"
40
-#include "../../items.h"
40
+#include "../../pvar.h"
41 41
 #include "auth_mod.h"
42 42
 #include "api.h"
43 43
 #include "rpid.h"
... ...
@@ -56,17 +56,19 @@ static int_str rpid_avp_name;
56 56
  */
57 57
 int init_rpid_avp(char *rpid_avp_param)
58 58
 {
59
-	xl_spec_t avp_spec;
59
+	pv_spec_t avp_spec;
60
+	str stmp;
60 61
 	if (rpid_avp_param && *rpid_avp_param) {
61
-		if (xl_parse_spec(rpid_avp_param, &avp_spec,
62
-					XL_THROW_ERROR|XL_DISABLE_MULTI|XL_DISABLE_COLORS)==0
63
-				|| avp_spec.type!=XL_AVP) {
62
+		stmp.s = rpid_avp_param; stmp.len = strlen(stmp.s);
63
+		if (pv_parse_spec(&stmp, &avp_spec)==0
64
+				|| avp_spec.type!=PVT_AVP) {
64 65
 			LOG(L_ERR, "ERROR:auth:init_rpid_avp: malformed or non AVP %s "
65 66
 				"AVP definition\n", rpid_avp_param);
66 67
 			return -1;
67 68
 		}
68 69
 
69
-		if(xl_get_avp_name(0, &avp_spec, &rpid_avp_name, &rpid_avp_type)!=0)
70
+		if(pv_get_avp_name(0, &(avp_spec.pvp), &rpid_avp_name,
71
+					&rpid_avp_type)!=0)
70 72
 		{
71 73
 			LOG(L_ERR, "ERROR:auth:init_rpid_avp: [%s]- invalid "
72 74
 				"AVP definition\n", rpid_avp_param);
... ...
@@ -30,7 +30,7 @@
30 30
 #include "../../mem/mem.h"
31 31
 #include "../../dprint.h"
32 32
 #include "../../trim.h"
33
-#include "../../items.h"
33
+#include "../../pvar.h"
34 34
 
35 35
 #include <string.h>
36 36
 
... ...
@@ -75,7 +75,7 @@ static inline int parse_aaa_avps(char *definition,
75 75
 {
76 76
 	struct aaa_avp *avp;
77 77
 	int_str avp_name;
78
-	xl_spec_t avp_spec;
78
+	pv_spec_t avp_spec;
79 79
 	str  foo;
80 80
 	char *p;
81 81
 	char *e;
... ...
@@ -108,15 +108,15 @@ static inline int parse_aaa_avps(char *definition,
108 108
 			t = foo.s[foo.len];
109 109
 			foo.s[foo.len] = '\0';
110 110
 			
111
-			if (xl_parse_spec(foo.s, &avp_spec,
112
-						XL_THROW_ERROR|XL_DISABLE_MULTI|XL_DISABLE_COLORS)==0
113
-					|| avp_spec.type!=XL_AVP) {
111
+			if (pv_parse_spec(&foo, &avp_spec)==0
112
+					|| avp_spec.type!=PVT_AVP) {
114 113
 				LOG(L_ERR, "ERROR:auth_aaa_avps: malformed or non AVP %s "
115 114
 					"AVP definition\n", foo.s);
116 115
 				goto parse_error;;
117 116
 			}
118 117
 
119
-			if(xl_get_avp_name(0, &avp_spec, &avp_name, &avp->avp_type)!=0)
118
+			if(pv_get_avp_name(0, &(avp_spec.pvp), &avp_name,
119
+						&avp->avp_type)!=0)
120 120
 			{
121 121
 				LOG(L_ERR, "ERROR:auth_aaa_avps: [%s]- invalid "
122 122
 					"AVP definition\n", foo.s);
... ...
@@ -40,7 +40,7 @@
40 40
 #include "../../db/db.h"
41 41
 #include "../../dprint.h"
42 42
 #include "../../error.h"
43
-#include "../../items.h"
43
+#include "../../pvar.h"
44 44
 #include "../../mem/mem.h"
45 45
 #include "../auth/api.h"
46 46
 #include "../sl/sl_api.h"
... ...
@@ -232,19 +232,20 @@ static void destroy(void)
232 232
  */
233 233
 static int auth_fixup(void** param, int param_no)
234 234
 {
235
-	xl_elem_t *model;
235
+	pv_elem_t *model;
236 236
 	db_con_t* dbh;
237
-	char* s;
237
+	str s;
238 238
 	int ver;
239 239
 	str name;
240 240
 
241 241
 	if (param_no == 1) {
242
-		s = (char*)*param;
243
-		if (s==0 || s[0]==0) {
242
+		s.s = (char*)*param;
243
+		if (s.s==0 || s.s[0]==0) {
244 244
 			model = 0;
245 245
 		} else {
246
-			if (xl_parse_format(s,&model,XL_DISABLE_COLORS)<0) {
247
-				LOG(L_ERR, "ERROR:auth_db:auth_fixup: xl_parse_format "
246
+			s.len = strlen(s.s);
247
+			if (pv_parse_format(&s,&model)<0) {
248
+				LOG(L_ERR, "ERROR:auth_db:auth_fixup: pv_parse_format "
248 249
 					"failed\n");
249 250
 				return E_OUT_OF_MEM;
250 251
 			}
... ...
@@ -42,7 +42,7 @@
42 42
 #include "../../parser/hf.h"
43 43
 #include "../../parser/parser_f.h"
44 44
 #include "../../usr_avp.h"
45
-#include "../../items.h"
45
+#include "../../pvar.h"
46 46
 #include "../../mem/mem.h"
47 47
 #include "aaa_avps.h"
48 48
 #include "authdb_mod.h"
... ...
@@ -205,7 +205,7 @@ static int generate_avps(db_res_t* result)
205 205
 /*
206 206
  * Authorize digest credentials
207 207
  */
208
-static inline int authorize(struct sip_msg* _m, xl_elem_t* _realm,
208
+static inline int authorize(struct sip_msg* _m, pv_elem_t* _realm,
209 209
 										char* _table, hdr_types_t _hftype)
210 210
 {
211 211
 	char ha1[256];
... ...
@@ -217,8 +217,8 @@ static inline int authorize(struct sip_msg* _m, xl_elem_t* _realm,
217 217
 	db_res_t* result = NULL;
218 218
 
219 219
 	if (_realm) {
220
-		if (xl_printf_s(_m, _realm, &domain)!=0) {
221
-			LOG(L_ERR, "ERROR:auth_db:authorize: xl_printf_s failed\n");
220
+		if (pv_printf_s(_m, _realm, &domain)!=0) {
221
+			LOG(L_ERR, "ERROR:auth_db:authorize: pv_printf_s failed\n");
222 222
 			return AUTH_ERROR;
223 223
 		}
224 224
 	} else {
... ...
@@ -267,7 +267,7 @@ static inline int authorize(struct sip_msg* _m, xl_elem_t* _realm,
267 267
  */
268 268
 int proxy_authorize(struct sip_msg* _m, char* _realm, char* _table)
269 269
 {
270
-	return authorize(_m, (xl_elem_t*)_realm, _table, HDR_PROXYAUTH_T);
270
+	return authorize(_m, (pv_elem_t*)_realm, _table, HDR_PROXYAUTH_T);
271 271
 }
272 272
 
273 273
 
... ...
@@ -276,5 +276,5 @@ int proxy_authorize(struct sip_msg* _m, char* _realm, char* _table)
276 276
  */
277 277
 int www_authorize(struct sip_msg* _m, char* _realm, char* _table)
278 278
 {
279
-	return authorize(_m, (xl_elem_t*)_realm, _table, HDR_AUTHORIZATION_T);
279
+	return authorize(_m, (pv_elem_t*)_realm, _table, HDR_AUTHORIZATION_T);
280 280
 }
... ...
@@ -39,7 +39,7 @@
39 39
 #include "../../sr_module.h"
40 40
 #include "../../error.h"
41 41
 #include "../../dprint.h"
42
-#include "../../items.h"
42
+#include "../../pvar.h"
43 43
 #include "../../mem/mem.h"
44 44
 #include "../sl/sl_api.h"
45 45
 
... ...
@@ -169,20 +169,21 @@ static void destroy(void)
169 169
 
170 170
 
171 171
 /*
172
- * Convert char* parameter to xl_elem_t* parameter
172
+ * Convert char* parameter to pv_elem_t* parameter
173 173
  */
174 174
 static int auth_fixup(void** param, int param_no)
175 175
 {
176
-	xl_elem_t *model;
177
-	char* s;
176
+	pv_elem_t *model;
177
+	str s;
178 178
 
179 179
 	if (param_no == 1) {
180
-		s = (char*)*param;
181
-		if (s==0 || s[0]==0) {
180
+		s.s = (char*)*param;
181
+		if (s.s==0 || s.s[0]==0) {
182 182
 			model = 0;
183 183
 		} else {
184
-			if (xl_parse_format(s,&model,XL_DISABLE_COLORS)<0) {
185
-				LOG(L_ERR, "ERROR:auth_diameter:auth_fixup: xl_parse_format "
184
+			s.len = strlen(s.s);
185
+			if (pv_parse_format(&s,&model)<0) {
186
+				LOG(L_ERR, "ERROR:auth_diameter:auth_fixup: pv_parse_format "
186 187
 					"failed\n");
187 188
 				return E_OUT_OF_MEM;
188 189
 			}
... ...
@@ -200,7 +201,7 @@ static int auth_fixup(void** param, int param_no)
200 201
 int diameter_proxy_authorize(struct sip_msg* _msg, char* _realm, char* _s2)
201 202
 {
202 203
 	/* realm parameter is converted to str* in str_fixup */
203
-	return authorize(_msg, (xl_elem_t*)_realm, HDR_PROXYAUTH_T);
204
+	return authorize(_msg, (pv_elem_t*)_realm, HDR_PROXYAUTH_T);
204 205
 }
205 206
 
206 207
 
... ...
@@ -209,7 +210,7 @@ int diameter_proxy_authorize(struct sip_msg* _msg, char* _realm, char* _s2)
209 210
  */
210 211
 int diameter_www_authorize(struct sip_msg* _msg, char* _realm, char* _s2)
211 212
 {
212
-	return authorize(_msg, (xl_elem_t*)_realm, HDR_AUTHORIZATION_T);
213
+	return authorize(_msg, (pv_elem_t*)_realm, HDR_AUTHORIZATION_T);
213 214
 }
214 215
 
215 216
 
... ...
@@ -283,7 +283,7 @@ auth_result_t diam_pre_auth(struct sip_msg* _m, str* _realm, int _hftype,
283 283
 
284 284
 
285 285
 /* Authorize digest credentials */
286
-int authorize(struct sip_msg* msg, xl_elem_t* realm, int hftype)
286
+int authorize(struct sip_msg* msg, pv_elem_t* realm, int hftype)
287 287
 {
288 288
 	auth_result_t ret;
289 289
 	struct hdr_field* h;
... ...
@@ -293,8 +293,8 @@ int authorize(struct sip_msg* msg, xl_elem_t* realm, int hftype)
293 293
 	str  domain;
294 294
 
295 295
 	if (realm) {
296
-		if (xl_printf_s(msg, realm, &domain)!=0) {
297
-			LOG(L_ERR,"ERROR:auth_diamtere:authorize: xl_printf_s "
296
+		if (pv_printf_s(msg, realm, &domain)!=0) {
297
+			LOG(L_ERR,"ERROR:auth_diamtere:authorize: pv_printf_s "
298 298
 				"failed\n");
299 299
 			return AUTH_ERROR;
300 300
 		}
... ...
@@ -33,7 +33,7 @@
33 33
 #include "diameter_msg.h"
34 34
 #include "../../parser/digest/digest_parser.h"
35 35
 #include "../../parser/hf.h"
36
-#include "../../items.h"
36
+#include "../../pvar.h"
37 37
 #include "../../str.h"
38 38
 #include "../auth/api.h"
39 39
 #include "defs.h"
... ...
@@ -48,7 +48,7 @@ auth_result_t diam_pre_auth(struct sip_msg* m, str* realm, int hftype,
48 48
 int find_credentials(struct sip_msg* m, str* realm, int hftype, 
49 49
 						struct hdr_field** h);
50 50
 
51
-int authorize(struct sip_msg* msg, xl_elem_t* realm, int hftype);
51
+int authorize(struct sip_msg* msg, pv_elem_t* realm, int hftype);
52 52
 
53 53
 int diameter_authorize(struct hdr_field* cred, str* p_method, 
54 54
 					struct sip_uri uri,	struct sip_uri ruri,
... ...
@@ -39,7 +39,7 @@
39 39
 #include "../../parser/parse_to.h"
40 40
 #include "../../dprint.h"
41 41
 #include "../../ut.h"
42
-#include "../../items.h"
42
+#include "../../pvar.h"
43 43
 #include "../auth/api.h"
44 44
 #include "authorize.h"
45 45
 #include "sterman.h"
... ...
@@ -75,8 +75,8 @@ static inline int get_uri_user(struct sip_msg* _m, str** _uri_user)
75 75
 /*
76 76
  * Authorize digest credentials
77 77
  */
78
-static inline int authorize(struct sip_msg* _msg, xl_elem_t* _realm,
79
-			    xl_spec_t * _uri_user, int _hftype)
78
+static inline int authorize(struct sip_msg* _msg, pv_elem_t* _realm,
79
+			    pv_spec_t * _uri_user, int _hftype)
80 80
 {
81 81
     int res;
82 82
     auth_result_t ret;
... ...
@@ -84,12 +84,12 @@ static inline int authorize(struct sip_msg* _msg, xl_elem_t* _realm,
84 84
     auth_body_t* cred;
85 85
     str *uri_user;
86 86
     str user, domain;
87
-    xl_value_t xl_val;
87
+    pv_value_t pv_val;
88 88
 
89 89
     /* get pre_auth domain from _realm pvar (if exists) */
90 90
     if (_realm) {
91
-	if (xl_printf_s(_msg, _realm, &domain)!=0) {
92
-	    LOG(L_ERR,"ERROR:auth_radius:authorize: xl_printf_s failed\n");
91
+	if (pv_printf_s(_msg, _realm, &domain)!=0) {
92
+	    LOG(L_ERR,"ERROR:auth_radius:authorize: pv_printf_s failed\n");
93 93
 	    return AUTH_ERROR;
94 94
 	}
95 95
     } else {
... ...
@@ -108,11 +108,11 @@ static inline int authorize(struct sip_msg* _msg, xl_elem_t* _realm,
108 108
     /* get uri_user from _uri_user pvap (if exists) or
109 109
        from To/From URI */
110 110
     if (_uri_user) {
111
-	if (xl_get_spec_value(_msg, _uri_user, &xl_val, 0) == 0) {
112
-	    if (xl_val.flags & XL_VAL_STR) {
111
+	if (pv_get_spec_value(_msg, _uri_user, &pv_val) == 0) {
112
+	    if (pv_val.flags & PV_VAL_STR) {
113 113
 		res = radius_authorize_sterman(_msg, &cred->digest, 
114 114
 					       &_msg->first_line.u.request.method,
115
-					       &xl_val.rs);
115
+					       &pv_val.rs);
116 116
 	    } else {
117 117
 		LOG(L_ERR, "ERROR:auth_radius:authorize: "
118 118
 		    "uri_user pvar value is not string\n");
... ...
@@ -155,7 +155,7 @@ static inline int authorize(struct sip_msg* _msg, xl_elem_t* _realm,
155 155
 int radius_proxy_authorize_1(struct sip_msg* _msg, char* _realm, char* _s2)
156 156
 {
157 157
     /* realm parameter is converted to str* in str_fixup */
158
-    return authorize(_msg, (xl_elem_t*)_realm, (xl_spec_t *)0,
158
+    return authorize(_msg, (pv_elem_t*)_realm, (pv_spec_t *)0,
159 159
 		     HDR_PROXYAUTH_T);
160 160
 }
161 161
 
... ...
@@ -166,7 +166,7 @@ int radius_proxy_authorize_1(struct sip_msg* _msg, char* _realm, char* _s2)
166 166
 int radius_proxy_authorize_2(struct sip_msg* _msg, char* _realm,
167 167
 			     char* _uri_user)
168 168
 {
169
-    return authorize(_msg, (xl_elem_t*)_realm, (xl_spec_t *)_uri_user,
169
+    return authorize(_msg, (pv_elem_t*)_realm, (pv_spec_t *)_uri_user,
170 170
 		     HDR_PROXYAUTH_T);
171 171
 }
172 172
 
... ...
@@ -176,6 +176,6 @@ int radius_proxy_authorize_2(struct sip_msg* _msg, char* _realm,
176 176
  */
177 177
 int radius_www_authorize(struct sip_msg* _msg, char* _realm, char* _s2)
178 178
 {
179
-	return authorize(_msg, (xl_elem_t*)_realm, (xl_spec_t *)0,
179
+	return authorize(_msg, (pv_elem_t*)_realm, (pv_spec_t *)0,
180 180
 			 HDR_AUTHORIZATION_T);
181 181
 }
... ...
@@ -39,7 +39,7 @@
39 39
 #include "../../error.h"
40 40
 #include "../../dprint.h"
41 41
 #include "../../config.h"
42
-#include "../../items.h"
42
+#include "../../pvar.h"
43 43
 #include "../../radius.h"
44 44
 #include "../../mem/mem.h"
45 45
 #include "authrad_mod.h"
... ...
@@ -175,22 +175,23 @@ static int mod_init(void)
175 175
 
176 176
 
177 177
 /*
178
- * Convert char* parameter to xl_elem_t* parameter
178
+ * Convert char* parameter to pv_elem_t* parameter
179 179
  */
180 180
 static int auth_fixup(void** param, int param_no)
181 181
 {
182
-	xl_elem_t *model;
183
-	char* s;
184
-	xl_spec_t *sp;
182
+	pv_elem_t *model;
183
+	str s;
184
+	pv_spec_t *sp;
185 185
 
186 186
 	if (param_no == 1) { /* realm (string that may contain pvars) */
187
-		s = (char*)*param;
188
-		if (s==0 || s[0]==0) {
187
+		s.s = (char*)*param;
188
+		if (s.s==0 || s.s[0]==0) {
189 189
 			model = 0;
190 190
 		} else {
191
-			if (xl_parse_format(s,&model,XL_DISABLE_COLORS)<0) {
191
+			s.len = strlen(s.s);
192
+			if (pv_parse_format(&s,&model)<0) {
192 193
 				LOG(L_ERR, "ERROR:auth_radius:auth_fixup: "
193
-				    "xl_parse_format failed\n");
194
+				    "pv_parse_format failed\n");
194 195
 				return E_OUT_OF_MEM;
195 196
 			}
196 197
 		}
... ...
@@ -198,21 +199,21 @@ static int auth_fixup(void** param, int param_no)
198 199
 	}
199 200
 
200 201
 	if (param_no == 2) { /* URI user (a pvar) */
201
-		sp = (xl_spec_t*)pkg_malloc(sizeof(xl_spec_t));
202
+		sp = (pv_spec_t*)pkg_malloc(sizeof(pv_spec_t));
202 203
 		if (sp == 0) {
203 204
 			LOG(L_ERR, "ERROR:auth_radius:auth_fixup(): "
204 205
 			    "no pkg memory left\n");
205 206
 			return -1;
206 207
 		}
207
-		if (xl_parse_spec((char*)*param, sp,
208
-				  XL_THROW_ERROR|XL_DISABLE_MULTI|
209
-				  XL_DISABLE_COLORS) == 0) {
208
+		s.s = (char*)*param;
209
+		s.len = strlen(s.s);
210
+		if (pv_parse_spec(&s, sp) == 0) {
210 211
 			LOG(L_ERR,"ERROR:auth_radius:auth_fixup(): parsing of "
211 212
 			    "pseudo variable %s failed!\n", (char*)*param);
212 213
 			pkg_free(sp);
213 214
 			return -1;
214 215
 		}
215
-		if (sp->type == XL_NULL) {
216
+		if (sp->type == PVT_NULL) {
216 217
 			LOG(L_ERR,"ERROR:auth_radius:auth_fixup(): bad pseudo "
217 218
 			    "variable\n");
218 219
 			pkg_free(sp);
... ...
@@ -206,7 +206,7 @@ static int fixup_db_avp(void** param, int param_no, int allow_scheme)
206 206
 	struct db_param  *dbp;
207 207
 	int flags;
208 208
 	int flags0;
209
-	char *s;
209
+	str s;
210 210
 	char *p;
211 211
 
212 212
 	flags=0;
... ...
@@ -218,7 +218,7 @@ static int fixup_db_avp(void** param, int param_no, int allow_scheme)
218 218
 		return E_UNSPEC;
219 219
 	}
220 220
 
221
-	s = (char*)*param;
221
+	s.s = (char*)*param;
222 222
 	if (param_no==1)
223 223
 	{
224 224
 		/* prepare the fis_param structure */
... ...
@@ -229,7 +229,7 @@ static int fixup_db_avp(void** param, int param_no, int allow_scheme)
229 229
 		}
230 230
 		memset( sp, 0, sizeof(struct fis_param));
231 231
 
232
-		if ( (p=strchr(s,'/'))!=0)
232
+		if ( (p=strchr(s.s,'/'))!=0)
233 233
 		{
234 234
 			*(p++) = 0;
235 235
 			/* check for extra flags/params */
... ...
@@ -247,30 +247,30 @@ static int fixup_db_avp(void** param, int param_no, int allow_scheme)
247 247
 				return E_UNSPEC;
248 248
 			}
249 249
 		}
250
-		if (*s!='$')
250
+		if (*s.s!='$')
251 251
 		{
252 252
 			/* is a constant string -> use it as uuid*/
253 253
 			sp->opd = ((flags==0)?AVPOPS_FLAG_UUID0:flags)|AVPOPS_VAL_STR;
254
-			sp->sval.p.val.s = (char*)pkg_malloc(strlen(s)+1);
255
-			if (sp->sval.p.val.s==0) {
254
+			sp->u.s.s = (char*)pkg_malloc(strlen(s.s)+1);
255
+			if (sp->u.s.s==0) {
256 256
 				LOG(L_ERR,"ERROR:avpops:fixup_db_avp: no more pkg mem!!\n");
257 257
 				return E_OUT_OF_MEM;
258 258
 			}
259
-			sp->sval.p.val.len = strlen(s);
260
-			strcpy(sp->sval.p.val.s,s);
259
+			sp->u.s.len = strlen(s.s);
260
+			strcpy(sp->u.s.s, s.s);
261 261
 		} else {
262 262
 			/* is a variable $xxxxx */
263
-			p = xl_parse_spec(s, &sp->sval,
264
-					XL_THROW_ERROR|XL_DISABLE_MULTI|XL_DISABLE_COLORS);
265
-			if (p==0 || sp->sval.type==XL_NULL || sp->sval.type==XL_EMPTY)
263
+			s.len = strlen(s.s);
264
+			p = pv_parse_spec(&s, &sp->u.sval);
265
+			if (p==0 || sp->u.sval.type==PVT_NULL || sp->u.sval.type==PVT_EMPTY)
266 266
 			{
267 267
 				LOG(L_ERR,"ERROR:avops:fixup_db_avp: bad param 1; "
268 268
 					"expected : $pseudo-variable or int/str value\n");
269 269
 				return E_UNSPEC;
270 270
 			}
271 271
 			
272
-			if(sp->sval.type==XL_RURI || sp->sval.type==XL_FROM
273
-					|| sp->sval.type==XL_TO || sp->sval.type==XL_OURI)
272
+			if(sp->u.sval.type==PVT_RURI || sp->u.sval.type==PVT_FROM
273
+					|| sp->u.sval.type==PVT_TO || sp->u.sval.type==PVT_OURI)
274 274
 			{
275 275
 				sp->opd = ((flags==0)?AVPOPS_FLAG_URI0:flags)|AVPOPS_VAL_PVAR;
276 276
 			} else {
... ...
@@ -287,7 +287,7 @@ static int fixup_db_avp(void** param, int param_no, int allow_scheme)
287 287
 			return E_OUT_OF_MEM;
288 288
 		}
289 289
 		memset( dbp, 0, sizeof(struct db_param));
290
-		if ( parse_avp_db( s, dbp, allow_scheme)!=0 )
290
+		if ( parse_avp_db( s.s, dbp, allow_scheme)!=0 )
291 291
 		{
292 292
 			LOG(L_ERR,"ERROR:avpops:fixup_db_avp: parse failed\n");
293 293
 			return E_UNSPEC;
... ...
@@ -317,9 +317,9 @@ static int fixup_db_store_avp(void** param, int param_no)
317 317
 
318 318
 static int fixup_db_query_avp(void** param, int param_no)
319 319
 {
320
-	xl_elem_t *model = NULL;
321
-	itemname_list_t *anlist = NULL;
322
-	char *s;
320
+	pv_elem_t *model = NULL;
321
+	pvname_list_t *anlist = NULL;
322
+	str s;
323 323
 
324 324
 	if (DB_URL==0)
325 325
 	{
... ...
@@ -328,38 +328,41 @@ static int fixup_db_query_avp(void** param, int param_no)
328 328
 		return E_UNSPEC;
329 329
 	}
330 330
 
331
-	s = (char*)(*param);
331
+	s.s = (char*)(*param);
332 332
 	if (param_no==1)
333 333
 	{
334
-		if(s==NULL)
334
+		if(s.s==NULL)
335 335
 		{
336 336
 			LOG(L_ERR, "ERROR:avpops:fixup_db_query_avp: null format in P%d\n",
337 337
 					param_no);
338 338
 			return E_UNSPEC;
339 339
 		}
340
-		if(xl_parse_format(s, &model, XL_DISABLE_COLORS|XL_THROW_ERROR)<0)
340
+		s.len = strlen(s.s);
341
+		if(pv_parse_format(&s, &model)<0)
341 342
 		{
342 343
 			LOG(L_ERR,
343 344
 				"ERROR:avpops:fixup_db_query_avp: wrong format[%s]\n",
344
-				s);
345
+				s.s);
345 346
 			return E_UNSPEC;
346 347
 		}
347 348
 			
348 349
 		*param = (void*)model;
349 350
 		return 0;
350 351
 	} else if(param_no==2) {
351
-		if(s==NULL)
352
+		if(s.s==NULL)
352 353
 		{
353 354
 			LOG(L_ERR, "ERROR:avpops:fixup_db_query_avp: null format in P%d\n",
354 355
 					param_no);
355 356
 			return E_UNSPEC;
356 357
 		}
357
-		anlist = parse_itemname_list(s, XL_AVP);
358
+				s.len = strlen(s.s);
359
+
360
+		anlist = parse_pvname_list(&s, PVT_AVP);
358 361
 		if(anlist==NULL)
359 362
 		{
360 363
 			LOG(L_ERR,
361 364
 				"ERROR:avpops:fixup_db_query_avp: bad format in P%d [%s]\n",
362
-				param_no, s);
365
+				param_no, s.s);
363 366
 			return E_UNSPEC;
364 367
 		}
365 368
 		*param = (void*)anlist;
... ...
@@ -387,21 +390,21 @@ static int fixup_delete_avp(void** param, int param_no)
387 390
 		if(*s=='$')
388 391
 		{
389 392
 			/* is variable */
390
-			ap = avpops_parse_pvar(s, 
391
-				XL_THROW_ERROR|XL_DISABLE_MULTI|XL_DISABLE_COLORS);
393
+			ap = avpops_parse_pvar(s);
392 394
 			if (ap==0)
393 395
 			{
394 396
 				LOG(L_ERR,"ERROR:avpops:fixup_delete_avp: unable to get"
395 397
 					" pseudo-variable in param \n");
396 398
 				return E_UNSPEC;
397 399
 			}
398
-			if (ap->sval.type!=XL_AVP)
400
+			if (ap->u.sval.type!=PVT_AVP)
399 401
 			{
400 402
 				LOG(L_ERR,"ERROR:avops:fixup_delete_avp: bad param; "
401 403
 					"expected : $avp(name)\n");
402 404
 				return E_UNSPEC;
403 405
 			}
404 406
 			ap->opd|=AVPOPS_VAL_PVAR;
407
+			ap->type = AVPOPS_VAL_PVAR;
405 408
 		} else {
406 409
 			if(strlen(s)<1)
407 410
 			{
... ...
@@ -448,7 +451,8 @@ static int fixup_delete_avp(void** param, int param_no)
448 451
 					return E_UNSPEC;
449 452
 				}
450 453
 			}
451
-			ap->sval.flags |= flags<<24;
454
+			ap->type = AVPOPS_VAL_INT;
455
+			ap->u.n = flags<<8;
452 456
 		}
453 457
 
454 458
 		/* flags */
... ...
@@ -495,8 +499,7 @@ static int fixup_copy_avp(void** param, int param_no)
495 499
 			*(p++)=0;
496 500
 	}
497 501
 
498
-	ap = avpops_parse_pvar(s, 
499
-			XL_THROW_ERROR|XL_DISABLE_MULTI|XL_DISABLE_COLORS);
502
+	ap = avpops_parse_pvar(s);
500 503
 	if (ap==0)
501 504
 	{
502 505
 		LOG(L_ERR,"ERROR:avpops:fixup_copy_avp: unable to get"
... ...
@@ -505,7 +508,7 @@ static int fixup_copy_avp(void** param, int param_no)
505 508
 	}
506 509
 
507 510
 	/* attr name is mandatory */
508
-	if (ap->sval.type!=XL_AVP)
511
+	if (ap->u.sval.type!=PVT_AVP)
509 512
 	{
510 513
 		LOG(L_ERR,"ERROR:avpops:fixup_copy_avp: you must specify "
511 514
 			"only AVP as parameter\n");
... ...
@@ -567,8 +570,7 @@ static int fixup_pushto_avp(void** param, int param_no)
567 570
 
568 571
 		if ( (p=strchr(s,'/'))!=0 )
569 572
 			*(p++)=0;
570
-		ap = avpops_parse_pvar(s, 
571
-			XL_THROW_ERROR|XL_DISABLE_MULTI|XL_DISABLE_COLORS);
573
+		ap = avpops_parse_pvar(s);
572 574
 		if (ap==0)
573 575
 		{
574 576
 			LOG(L_ERR,"ERROR:avpops:fixup_pushto_avp: unable to get"
... ...
@@ -576,8 +578,8 @@ static int fixup_pushto_avp(void** param, int param_no)
576 578
 			return E_OUT_OF_MEM;
577 579
 		}
578 580
 
579
-		switch(ap->sval.type) {
580
-			case XL_RURI:
581
+		switch(ap->u.sval.type) {
582
+			case PVT_RURI:
581 583
 				ap->opd = AVPOPS_VAL_NONE|AVPOPS_USE_RURI;
582 584
 				if ( p && !(
583 585
 					(!strcasecmp("username",p)
... ...
@@ -590,7 +592,7 @@ static int fixup_pushto_avp(void** param, int param_no)
590 592
 					return E_UNSPEC;
591 593
 				}
592 594
 			break;
593
-			case XL_DSTURI:
595
+			case PVT_DSTURI:
594 596
 				if ( p!=0 )
595 597
 				{
596 598
 					LOG(L_ERR,"ERROR:avpops:fixup_pushto_avp: unknown "
... ...
@@ -599,14 +601,14 @@ static int fixup_pushto_avp(void** param, int param_no)
599 601
 				}
600 602
 				ap->opd = AVPOPS_VAL_NONE|AVPOPS_USE_DURI;
601 603
 			break;
602
-			case XL_HDR:
604
+			case PVT_HDR:
603 605
 				/* what's the hdr destination ? request or reply? */
604 606
 				LOG(L_ERR,"ERROR:avpops:fixup_pushto_avp: push to header "
605 607
 						" is obsoleted - use append_hf() or append_to_reply()"
606 608
 						" from textops module!\n");
607 609
 				return E_UNSPEC;
608 610
 			break;
609
-			case XL_BRANCH:
611
+			case PVT_BRANCH:
610 612
 				if ( p!=0 )
611 613
 				{
612 614
 					LOG(L_ERR,"ERROR:avpops:fixup_pushto_avp: unknown "
... ...
@@ -632,15 +634,14 @@ static int fixup_pushto_avp(void** param, int param_no)
632 634
 
633 635
 		if ( (p=strchr(s,'/'))!=0 )
634 636
 			*(p++)=0;
635
-		ap = avpops_parse_pvar(s, 
636
-			XL_THROW_ERROR|XL_DISABLE_COLORS);
637
+		ap = avpops_parse_pvar(s);
637 638
 		if (ap==0)
638 639
 		{
639 640
 			LOG(L_ERR,"ERROR:avpops:fixup_pudhto_avp: unable to get"
640 641
 					" pseudo-variable in param 2\n");
641 642
 			return E_OUT_OF_MEM;
642 643
 		}
643
-		if (ap->sval.type==XL_NULL)
644
+		if (ap->u.sval.type==PVT_NULL)
644 645
 		{
645 646
 			LOG(L_ERR,"ERROR:avops:fixup_pushto_avp: bad param 2; "
646 647
 				"expected : $pseudo-variable ...\n");
... ...
@@ -681,8 +682,7 @@ static int fixup_check_avp(void** param, int param_no)
681 682
 
682 683
 	if (param_no==1)
683 684
 	{
684
-		ap = avpops_parse_pvar(s, 
685
-			XL_THROW_ERROR|XL_DISABLE_MULTI|XL_DISABLE_COLORS);
685
+		ap = avpops_parse_pvar(s);
686 686
 		if (ap==0)
687 687
 		{
688 688
 			LOG(L_ERR,"ERROR:avpops:fixup_check_avp: unable to get"
... ...
@@ -690,7 +690,7 @@ static int fixup_check_avp(void** param, int param_no)
690 690
 			return E_OUT_OF_MEM;
691 691
 		}
692 692
 		/* attr name is mandatory */
693
-		if (ap->sval.type==XL_NULL)
693
+		if (ap->u.sval.type==PVT_NULL)
694 694
 		{
695 695
 			LOG(L_ERR,
696 696
 				"ERROR:avpops:fixup_check_avp: NULL pseudo-variable in P1\n");
... ...
@@ -719,18 +719,18 @@ static int fixup_check_avp(void** param, int param_no)
719 719
 				return E_OUT_OF_MEM;
720 720
 			}
721 721
 			DBG("DEBUG:avpops:fixup_check_avp: compiling regexp <%.*s>\n",
722
-				ap->sval.p.val.len, ap->sval.p.val.s);
723
-			if (regcomp(re, ap->sval.p.val.s,
722
+				ap->u.s.len, ap->u.s.s);
723
+			if (regcomp(re, ap->u.s.s,
724 724
 						REG_EXTENDED|REG_ICASE|REG_NEWLINE))
725 725
 			{
726 726
 				pkg_free(re);
727 727
 				LOG(L_ERR,"ERROR:avpops:fixip_check_avp: bad re <%.*s>\n",
728
-					ap->sval.p.val.len, ap->sval.p.val.s);
728
+					ap->u.s.len, ap->u.s.s);
729 729
 				return E_BAD_RE;
730 730
 			}
731 731
 			/* free the string and link the regexp */
732 732
 			// pkg_free(ap->sval.p.s);
733
-			ap->sval.p.val.s = (char*)re;
733
+			ap->u.s.s = (char*)re;
734 734
 		} else if (ap->ops&AVPOPS_OP_FM) {
735 735
 			if ( !( ap->opd&AVPOPS_VAL_PVAR ||
736 736
 			(!(ap->opd&AVPOPS_VAL_PVAR) && ap->opd&AVPOPS_VAL_STR) ) )
... ...
@@ -750,14 +750,13 @@ static int fixup_check_avp(void** param, int param_no)
750 750
 static int fixup_printf(void** param, int param_no)
751 751
 {
752 752
 	struct fis_param *ap;
753
-	xl_elem_t *model;
754
-	char *s;
753
+	pv_elem_t *model;
754
+	str s;
755 755
 
756
-	s = (char*)(*param);
756
+	s.s = (char*)(*param);
757 757
 	if (param_no==1) {
758 758
 		/* attribute name / alias */
759
-		ap = avpops_parse_pvar(s, 
760
-			XL_THROW_ERROR|XL_DISABLE_MULTI|XL_DISABLE_COLORS);
759
+		ap = avpops_parse_pvar(s.s);
761 760
 		if (ap==0)
762 761
 		{
763 762
 			LOG(L_ERR,"ERROR:avpops:fixup_printf_avp: unable to get"
... ...
@@ -765,7 +764,7 @@ static int fixup_printf(void** param, int param_no)
765 764
 			return E_OUT_OF_MEM;
766 765
 		}
767 766
 
768
-		if (ap->sval.type!=XL_AVP)
767
+		if (ap->u.sval.type!=PVT_AVP)
769 768
 		{
770 769
 			LOG(L_ERR,"ERROR:avpops:fixup_printf: bad avp name"
771 770
 				" <%s>\n", (char*)*param);
... ...
@@ -775,7 +774,8 @@ static int fixup_printf(void** param, int param_no)
775 774
 	} else if (param_no==2) {
776 775
 		if(*param)
777 776
 		{
778
-			if(xl_parse_format((char*)(*param), &model, XL_DISABLE_COLORS)<0)
777
+			s.len = strlen(s.s);
778
+			if(pv_parse_format(&s, &model)<0)
779 779
 			{
780 780
 				LOG(L_ERR, "ERROR:avpops:fixup_printf: wrong format[%s]\n",
781 781
 					(char*)(*param));
... ...
@@ -819,15 +819,14 @@ static int fixup_subst(void** param, int param_no)
819 819
 		/* avp src / avp dst /flags */
820 820
 		if ( (p=strchr(s,'/'))!=0 )
821 821
 			*(p++)=0;
822
-		ap = avpops_parse_pvar(s, 
823
-			XL_THROW_ERROR|XL_DISABLE_MULTI|XL_DISABLE_COLORS);
822
+		ap = avpops_parse_pvar(s);
824 823
 		if (ap==0)
825 824
 		{
826 825
 			LOG(L_ERR,"ERROR:avpops:fixup_subst: unable to get"
827 826
 					" pseudo-variable in param 2 [%s]\n", s);
828 827
 			return E_OUT_OF_MEM;
829 828
 		}
830
-		if (ap->sval.type!=XL_AVP)
829
+		if (ap->u.sval.type!=PVT_AVP)
831 830
 		{
832 831
 			LOG(L_ERR,"ERROR:avpops:fixup_subst: bad attribute name"
833 832
 				" <%s>\n", (char*)*param);
... ...
@@ -850,14 +849,13 @@ static int fixup_subst(void** param, int param_no)
850 849
 		
851 850
 		/* dst || flags */
852 851
 		s = p;
853
-		if(*s==ITEM_MARKER)
852
+		if(*s==PV_MARKER)
854 853
 		{
855 854
 			if ( (p=strchr(s,'/'))!=0 )
856 855
 				*(p++)=0;
857 856
 			if(p==0 || (p!=0 && p-s>1))
858 857
 			{
859
-				ap = avpops_parse_pvar(s, 
860
-					XL_THROW_ERROR|XL_DISABLE_MULTI|XL_DISABLE_COLORS);
858
+				ap = avpops_parse_pvar(s);
861 859
 				if (ap==0)
862 860
 				{
863 861
 					LOG(L_ERR,"ERROR:avpops:fixup_subst: unable to get"
... ...
@@ -865,7 +863,7 @@ static int fixup_subst(void** param, int param_no)
865 863
 					return E_OUT_OF_MEM;
866 864
 				}
867 865
 			
868
-				if (ap->sval.type!=XL_AVP)
866
+				if (ap->u.sval.type!=PVT_AVP)
869 867
 				{
870 868
 					LOG(L_ERR,"ERROR:avpops:fixup_subst: bad attribute name"
871 869
 						" <%s>!\n", s);
... ...
@@ -949,15 +947,14 @@ static int fixup_op_avp(void** param, int param_no)
949 947
 		if ( (p=strchr(s,'/'))!=0 )
950 948
 			*(p++)=0;
951 949
 
952
-		av[0] = avpops_parse_pvar(s, 
953
-			XL_THROW_ERROR|XL_DISABLE_MULTI|XL_DISABLE_COLORS);
950
+		av[0] = avpops_parse_pvar(s);
954 951
 		if (av[0]==0)
955 952
 		{
956 953
 			LOG(L_ERR,"ERROR:avpops:fixup_op_avp: unable to get"
957 954
 					" pseudo-variable in param 1\n");
958 955
 			return E_OUT_OF_MEM;
959 956
 		}
960
-		if (av[0]->sval.type!=XL_AVP)
957
+		if (av[0]->u.sval.type!=PVT_AVP)
961 958
 		{
962 959
 			LOG(L_ERR,"ERROR:avpops:fixup_op_avp: bad attribute name"
963 960
 				" <%s>\n", (char*)*param);
... ...
@@ -971,15 +968,14 @@ static int fixup_op_avp(void** param, int param_no)
971 968
 		}
972 969
 		
973 970
 		s = p;
974
-		ap = avpops_parse_pvar(s, 
975
-			XL_THROW_ERROR|XL_DISABLE_MULTI|XL_DISABLE_COLORS);
971
+		ap = avpops_parse_pvar(s);
976 972
 		if (ap==0)
977 973
 		{
978 974
 			LOG(L_ERR,"ERROR:avpops:fixup_op_avp: unable to get"
979 975
 					" pseudo-variable in param 1 (2)\n");
980 976
 			return E_OUT_OF_MEM;
981 977
 		}
982
-		if (ap->sval.type!=XL_AVP)
978
+		if (ap->u.sval.type!=PVT_AVP)
983 979
 		{
984 980
 			LOG(L_ERR,"ERROR:avpops:fixup_op_avp: bad attribute name"
985 981
 				"/alias <%s>!\n", s);
... ...
@@ -1021,8 +1017,7 @@ static int fixup_is_avp_set(void** param, int param_no)
1021 1017
 		if ( (p=strchr(s,'/'))!=0 )
1022 1018
 			*(p++)=0;
1023 1019
 		
1024
-		ap = avpops_parse_pvar(s, 
1025
-			XL_THROW_ERROR|XL_DISABLE_COLORS);
1020
+		ap = avpops_parse_pvar(s);
1026 1021
 		if (ap==0)
1027 1022
 		{
1028 1023
 			LOG(L_ERR,"ERROR:avpops:fixup_is_avp_set: unable to get"
... ...
@@ -1030,7 +1025,7 @@ static int fixup_is_avp_set(void** param, int param_no)
1030 1025
 			return E_OUT_OF_MEM;
1031 1026
 		}
1032 1027
 		
1033
-		if (ap->sval.type!=XL_AVP)
1028
+		if (ap->u.sval.type!=PVT_AVP)
1034 1029
 		{
1035 1030
 			LOG(L_ERR,"ERROR:avpops:fixup_is_avp_set: bad attribute name"
1036 1031
 					" <%s>\n", (char*)*param);
... ...
@@ -1100,12 +1095,12 @@ static int w_dbstore_avps(struct sip_msg* msg, char* source, char* param)
1100 1095
 
1101 1096
 static int w_dbquery1_avps(struct sip_msg* msg, char* query, char* param)
1102 1097
 {
1103
-	return ops_dbquery_avps ( msg, (xl_elem_t*)query, 0);
1098
+	return ops_dbquery_avps ( msg, (pv_elem_t*)query, 0);
1104 1099
 }
1105 1100
 
1106 1101
 static int w_dbquery2_avps(struct sip_msg* msg, char* query, char* dest)
1107 1102
 {
1108
-	return ops_dbquery_avps ( msg, (xl_elem_t*)query, (itemname_list_t*)dest);
1103
+	return ops_dbquery_avps ( msg, (pv_elem_t*)query, (pvname_list_t*)dest);
1109 1104
 }
1110 1105
 
1111 1106
 static int w_delete_avps(struct sip_msg* msg, char* param, char* foo)
... ...
@@ -1121,7 +1116,7 @@ static int w_copy_avps(struct sip_msg* msg, char* name1, char *name2)
1121 1116
 
1122 1117
 static int w_printf(struct sip_msg* msg, char* dest, char *format)
1123 1118
 {
1124
-	return ops_printf(msg, (struct fis_param*)dest, (xl_elem_t*)format);
1119
+	return ops_printf(msg, (struct fis_param*)dest, (pv_elem_t*)format);
1125 1120
 }
1126 1121
 
1127 1122
 static int w_pushto_avps(struct sip_msg* msg, char* destination, char *param)
... ...
@@ -314,14 +314,14 @@ int db_delete_avp( str *uuid, str *username, str *domain, char *attr,
314 314
 	return 0;
315 315
 }
316 316
 
317
-int db_query_avp(struct sip_msg *msg, char *query, itemname_list_t* dest)
317
+int db_query_avp(struct sip_msg *msg, char *query, pvname_list_t* dest)
318 318
 {
319 319
 	int_str avp_val;
320 320
 	int_str avp_name;
321 321
 	unsigned short avp_type;
322 322
 	db_res_t* db_res = NULL;
323 323
 	int i, j;
324
-	itemname_list_t* crt;
324
+	pvname_list_t* crt;
325 325
 	
326 326
 	if(query==NULL)
327 327
 	{
... ...
@@ -357,7 +357,8 @@ int db_query_avp(struct sip_msg *msg, char *query, itemname_list_t* dest)
357 357
 			{
358 358
 				avp_name.n = j+1;
359 359
 			} else {
360
-				if(xl_get_avp_name(msg, &crt->sname, &avp_name, &avp_type)!=0)
360
+				if(pv_get_avp_name(msg, &crt->sname.pvp, &avp_name,
361
+							&avp_type)!=0)
361 362
 				{
362 363
 					LOG(L_ERR,
363 364
 					"avpops:db_query_avp:error - cant get avp name [%d/%d]\n",
... ...
@@ -34,7 +34,7 @@
34 34
 #include "../../parser/msg_parser.h"
35 35
 #include "../../str.h"
36 36
 #include "../../sr_module.h"
37
-#include "../../items.h"
37
+#include "../../pvar.h"
38 38
 
39 39
 
40 40
 /* definition of a DB scheme*/
... ...
@@ -65,7 +65,7 @@ int db_store_avp( db_key_t *keys, db_val_t *vals, int n, char *table);
65 65
 int db_delete_avp( str *uuid, str *username, str *domain,
66 66
 		char *attr, char *table);
67 67
 
68
-int db_query_avp(struct sip_msg* msg, char *query, itemname_list_t* dest);
68
+int db_query_avp(struct sip_msg* msg, char *query, pvname_list_t* dest);
69 69
 
70 70
 int avp_add_db_scheme( modparam_t type, void* val);
71 71
 
... ...
@@ -41,7 +41,7 @@
41 41
 #include "../../dset.h"
42 42
 #include "../../data_lump.h"
43 43
 #include "../../data_lump_rpl.h"
44
-#include "../../items.h"
44
+#include "../../pvar.h"
45 45
 #include "../../parser/parse_from.h"
46 46
 #include "../../parser/parse_uri.h"
47 47
 #include "../../mem/mem.h"
... ...
@@ -218,7 +218,7 @@ static int dbrow2avp(struct db_row *row, struct db_param *dbp, int_str attr,
218 218
 	/* added the avp */
219 219
 	db_flags |= AVP_IS_IN_DB;
220 220
 	/* set script flags */
221
-	db_flags |= (dbp->a.sval.flags>>16)&0xff00;
221
+	db_flags |= dbp->a.u.sval.pvp.pvn.u.isname.type&0xff00;
222 222
 	return add_avp( (unsigned short)db_flags, avp_attr, avp_val);
223 223
 }
224 224
 
... ...
@@ -279,7 +279,7 @@ static int avpops_get_aname(struct sip_msg* msg, struct fis_param *ap,
279 279
 		return -1;
280 280
 	}
281 281
 
282
-	return xl_get_avp_name(msg, &ap->sval, avp_name, name_type);
282
+	return pv_get_avp_name(msg, &ap->u.sval.pvp, avp_name, name_type);
283 283
 }
284 284
 
285 285
 #define AVPOPS_ATTR_LEN	64
... ...
@@ -294,7 +294,7 @@ int ops_dbload_avps (struct sip_msg* msg, struct fis_param *sp,
294 294
 	int  i, n, sh_flg;
295 295
 	str *s0, *s1, *s2;
296 296
 	int_str avp_name;
297
-	xl_value_t xvalue;
297
+	pv_value_t xvalue;
298 298
 
299 299
 	s0 = s1 = s2 = NULL;
300 300
 	if (!((sp->opd&AVPOPS_VAL_PVAR)||(sp->opd&AVPOPS_VAL_STR))) {
... ...
@@ -306,14 +306,14 @@ int ops_dbload_avps (struct sip_msg* msg, struct fis_param *sp,
306 306
 	/* get uuid from avp */
307 307
 	if (sp->opd&AVPOPS_VAL_PVAR)
308 308
 	{
309
-		if(xl_get_spec_value(msg, &(sp->sval), &xvalue, 0)!=0)
309
+		if(pv_get_spec_value(msg, &(sp->u.sval), &xvalue)!=0)
310 310
 		{
311 311
 			LOG(L_CRIT,
312 312
 				"BUG:avpops:load_avps: error getting PVAR value (%d/%d)\n",
313 313
 				sp->opd, sp->ops);
314 314
 			goto error;
315 315
 		}
316
-		if(xvalue.flags&(XL_VAL_NULL|XL_VAL_EMPTY))
316
+		if(xvalue.flags&(PV_VAL_NULL|PV_VAL_EMPTY))
317 317
 		{
318 318
 			LOG(L_ERR,
319 319
 				"ERROR:avpops:load_avps: no value for first param\n");
... ...
@@ -321,8 +321,8 @@ int ops_dbload_avps (struct sip_msg* msg, struct fis_param *sp,
321 321
 		}
322 322
 		uuid = xvalue.rs;
323 323
 	} else {
324
-		uuid.s   = sp->sval.p.val.s;
325
-		uuid.len = sp->sval.p.val.len;
324
+		uuid.s   = sp->u.s.s;
325
+		uuid.len = sp->u.s.len;
326 326
 	}
327 327
 	
328 328
 	if(sp->opd&AVPOPS_FLAG_UUID0)
... ...
@@ -350,21 +350,21 @@ int ops_dbload_avps (struct sip_msg* msg, struct fis_param *sp,
350 350
 	}
351 351
 
352 352
 	/* is dynamic avp name ? */
353
-	if(dbp->a.sval.flags&XL_DPARAM)
353
+	if(pv_has_dname(&(dbp->a.u.sval)))
354 354
 	{
355
-		if(xl_get_spec_name(msg, &(dbp->a.sval), &xvalue, 0)!=0)
355
+		if(pv_get_spec_name(msg, &(dbp->a.u.sval.pvp), &xvalue)!=0)
356 356
 		{
357 357
 			LOG(L_CRIT,
358 358
 				"BUG:avpops:load_avps: error getting value for P2\n");
359 359
 			goto error;
360 360
 		}
361
-		if(xvalue.flags&(XL_VAL_NULL|XL_VAL_EMPTY))
361
+		if(xvalue.flags&(PV_VAL_NULL|PV_VAL_EMPTY))
362 362
 		{
363 363
 			LOG(L_INFO, 
364 364
 					"INFO:avpops:load_avps: no value for p2\n");
365 365
 			goto error;
366 366
 		}
367
-		if(xvalue.flags&XL_VAL_STR)
367
+		if(xvalue.flags&PV_VAL_STR)
368 368
 		{
369 369
 			if(xvalue.rs.len>=AVPOPS_ATTR_LEN)
370 370
 			{
... ...
@@ -402,16 +402,16 @@ int ops_dbload_avps (struct sip_msg* msg, struct fis_param *sp,
402 402
 	{
403 403
 		/* validate row */
404 404
 		memset(&avp_name, 0, sizeof(int_str));
405
-		if(dbp->a.sval.flags&XL_DPARAM)
405
+		if(pv_has_dname(&dbp->a.u.sval))
406 406
 		{
407
-			if(xvalue.flags&XL_TYPE_INT)
407
+			if(xvalue.flags&PV_TYPE_INT)
408 408
 			{
409 409
 				avp_name.n = xvalue.ri;
410 410
 			} else {
411 411
 				avpops_str2int_str(xvalue.rs, avp_name);
412 412
 			}
413 413
 		} else {
414
-			avpops_str2int_str(dbp->a.sval.p.val, avp_name);
414
+			avp_name = dbp->a.u.sval.pvp.pvn.u.isname.name;
415 415
 		}
416 416
 		//if ( dbrow2avp( &res->rows[i], dbp->a.opd, avp_name, sh_flg) < 0 )
417 417
 		if ( dbrow2avp( &res->rows[i], dbp, avp_name, sh_flg) < 0 )
... ...
@@ -435,7 +435,7 @@ int ops_dbdelete_avps (struct sip_msg* msg, struct fis_param *sp,
435 435
 	struct sip_uri  uri;
436 436
 	int             res;
437 437
 	str             uuid;
438
-	xl_value_t xvalue;
438
+	pv_value_t xvalue;
439 439
 	str *s0, *s1, *s2;
440 440
 
441 441
 	s0 = s1 = s2 = NULL;
... ...
@@ -449,14 +449,14 @@ int ops_dbdelete_avps (struct sip_msg* msg, struct fis_param *sp,
449 449
 	/* get uuid from avp */
450 450
 	if (sp->opd&AVPOPS_VAL_PVAR)
451 451
 	{
452
-		if(xl_get_spec_value(msg, &(sp->sval), &xvalue, 0)!=0)
452
+		if(pv_get_spec_value(msg, &(sp->u.sval), &xvalue)!=0)
453 453
 		{
454 454
 			LOG(L_CRIT,
455 455
 				"BUG:avpops:dbdelete_avps: error getting PVAR value (%d/%d)\n",
456 456
 				sp->opd, sp->ops);
457 457
 			goto error;
458 458
 		}
459
-		if(xvalue.flags&(XL_VAL_NULL|XL_VAL_EMPTY))
459
+		if(xvalue.flags&(PV_VAL_NULL|PV_VAL_EMPTY))
460 460
 		{
461 461
 			LOG(L_ERR,
462 462
 				"ERROR:avpops:dbdelete_avps: no value for first param\n");
... ...
@@ -464,8 +464,8 @@ int ops_dbdelete_avps (struct sip_msg* msg, struct fis_param *sp,
464 464
 		}
465 465
 		uuid = xvalue.rs;
466 466
 	} else {
467
-		uuid.s   = sp->sval.p.val.s;
468
-		uuid.len = sp->sval.p.val.len;
467
+		uuid.s   = sp->u.s.s;
468
+		uuid.len = sp->u.s.len;
469 469
 	}
470 470
 	
471 471
 	if(sp->opd&AVPOPS_FLAG_UUID0)
... ...
@@ -493,21 +493,21 @@ int ops_dbdelete_avps (struct sip_msg* msg, struct fis_param *sp,
493 493
 	}
494 494
 
495 495
 	/* is dynamic avp name ? */
496
-	if(dbp->a.sval.flags&XL_DPARAM)
496
+	if(pv_has_dname(&dbp->a.u.sval))
497 497
 	{
498
-		if(xl_get_spec_name(msg, &(dbp->a.sval), &xvalue, 0)!=0)
498
+		if(pv_get_spec_name(msg, &(dbp->a.u.sval.pvp), &xvalue)!=0)
499 499
 		{
500 500
 			LOG(L_CRIT,
501 501
 				"BUG:avpops:dbdelete_avps: error getting value for P2\n");
502 502
 			goto error;
503 503
 		}
504
-		if(xvalue.flags&(XL_VAL_NULL|XL_VAL_EMPTY))
504
+		if(xvalue.flags&(PV_VAL_NULL|PV_VAL_EMPTY))
505 505
 		{
506 506
 			LOG(L_INFO, 
507 507
 					"INFO:avpops:dbdelete_avps: no value for p2\n");
508 508
 			goto error;
509 509
 		}