Module: kamailio
Branch: master
Commit: d82ccbd9480c96e12b7fa668a1a950e2873a834c
URL:
https://github.com/kamailio/kamailio/commit/d82ccbd9480c96e12b7fa668a1a950e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-06-12T09:25:59+02:00
core: xavp - extended to hold a bare void pointer value
- useful to link data that doesn't need cloning or freeing
---
Modified: src/core/xavp.c
Modified: src/core/xavp.h
---
Diff:
https://github.com/kamailio/kamailio/commit/d82ccbd9480c96e12b7fa668a1a950e…
Patch:
https://github.com/kamailio/kamailio/commit/d82ccbd9480c96e12b7fa668a1a950e…
---
diff --git a/src/core/xavp.c b/src/core/xavp.c
index c9529a02f6..c8ff12365f 100644
--- a/src/core/xavp.c
+++ b/src/core/xavp.c
@@ -522,6 +522,9 @@ void xavp_print_list_content(sr_xavp_t **head, int level)
LM_INFO(" XAVP value: <xavp:%p>\n", avp->val.v.xavp);
xavp_print_list_content(&avp->val.v.xavp, level+1);
break;
+ case SR_XTYPE_VPTR:
+ LM_INFO(" XAVP value: <vptr:%p>\n", avp->val.v.vptr);
+ break;
case SR_XTYPE_DATA:
LM_INFO(" XAVP value: <data:%p>\n", avp->val.v.data);
break;
diff --git a/src/core/xavp.h b/src/core/xavp.h
index 8014bc5694..839e486523 100644
--- a/src/core/xavp.h
+++ b/src/core/xavp.h
@@ -35,6 +35,7 @@ typedef enum {
SR_XTYPE_LONG, /* long value */
SR_XTYPE_LLONG, /* long long value */
SR_XTYPE_XAVP, /* xavp value */
+ SR_XTYPE_VPTR, /* void pointer value */
SR_XTYPE_DATA /* custom data value */
} sr_xtype_t;
@@ -57,6 +58,7 @@ typedef struct _sr_xval {
long l;
long long ll;
struct _sr_xavp *xavp; /* must be given in shm (not cloned) */
+ void *vptr; /* void pointer - address copied, not freed */
sr_data_t *data; /* must be given in shm (not cloned) */
} v;
} sr_xval_t;