Module: sip-router
Branch: master
Commit: 5319d08db206b92b21df646e63415dd1cfd7a6e9
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5319d08…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Jan 31 01:39:17 2011 +0100
dispatcher(k): mi ds_list prints combined flags
---
modules_k/dispatcher/dispatch.c | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/modules_k/dispatcher/dispatch.c b/modules_k/dispatcher/dispatch.c
index 34124d0..d49b4dc 100644
--- a/modules_k/dispatcher/dispatch.c
+++ b/modules_k/dispatcher/dispatch.c
@@ -2206,7 +2206,7 @@ int ds_print_mi_list(struct mi_node* rpl)
{
int len, j;
char* p;
- char c;
+ char c[3];
str data;
ds_set_t *list;
struct mi_node* node = NULL;
@@ -2238,16 +2238,25 @@ int ds_print_mi_list(struct mi_node* rpl)
if(node == NULL)
return -1;
- if (list->dlist[j].flags & DS_INACTIVE_DST) c = 'I';
- else if (list->dlist[j].flags & DS_PROBING_DST) c = 'P';
- else c = 'A';
+ memset(&c, 0, sizeof(c));
+ if (list->dlist[j].flags & DS_INACTIVE_DST)
+ c[0] = 'I';
+ else if (list->dlist[j].flags & DS_DISABLED_DST)
+ c[0] = 'D';
+ else
+ c[0] = 'A';
- attr = add_mi_attr (node, MI_DUP_VALUE, "flag",4, &c, 1);
- if(attr == 0)
+ if (list->dlist[j].flags & DS_PROBING_DST)
+ c[1] = 'P';
+ else
+ c[1] = 'X';
+
+ attr = add_mi_attr (node, MI_DUP_VALUE, "flags", 5, c, 2);
+ if(attr == 0)
return -1;
data.s = int2str(list->dlist[j].priority, &data.len);
- attr = add_mi_attr (node, MI_DUP_VALUE, "priority", 8,
+ attr = add_mi_attr (node, MI_DUP_VALUE, "priority", 8,
data.s, data.len);
if(attr == 0)
return -1;