Module: sip-router
Branch: 3.1
Commit: 703f34ce98cff100c2f1d3315ac795729ba2a0dd
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=703f34c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sun Mar 6 11:19:56 2011 +0100
core xavp: refurbised xavp_print_list()
- print the level of xavp list
(cherry picked from commit 395e0dae1ec45452e5d445ea3061f798b7877bba)
---
xavp.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/xavp.c b/xavp.c
index 6b19d40..a008afd 100644
--- a/xavp.c
+++ b/xavp.c
@@ -459,15 +459,17 @@ sr_xavp_t **xavp_get_crt_list(void)
return _xavp_list_crt;
}
-void xavp_print_list(sr_xavp_t **head)
+void xavp_print_list_content(sr_xavp_t **head, int level)
{
sr_xavp_t *avp=0;
+ sr_xavp_t *start=0;
if(head!=NULL)
- avp = *head;
+ start = *head;
else
- avp=*_xavp_list_crt;
- LM_DBG("+++++ XAVP list: %p\n", avp);
+ start=*_xavp_list_crt;
+ LM_DBG("+++++ start XAVP list: %p (level=%d)\n", start, level);
+ avp = start;
while(avp)
{
LM_DBG(" *** XAVP name: %s\n", avp->name.s);
@@ -494,7 +496,7 @@ void xavp_print_list(sr_xavp_t **head)
break;
case SR_XTYPE_XAVP:
LM_DBG(" XAVP value: <xavp:%p>\n", avp->val.v.xavp);
- xavp_print_list(&avp->val.v.xavp);
+ xavp_print_list_content(&avp->val.v.xavp, level+1);
break;
case SR_XTYPE_DATA:
LM_DBG(" XAVP value: <data:%p>\n", avp->val.v.data);
@@ -502,7 +504,11 @@ void xavp_print_list(sr_xavp_t **head)
}
avp = avp->next;
}
- LM_DBG("----- XAVP list\n");
+ LM_DBG("----- end XAVP list: %p (level=%d)\n", start, level);
}
+void xavp_print_list(sr_xavp_t **head)
+{
+ xavp_print_list_content(head, 0);
+}
#endif