Module: sip-router Branch: master Commit: 80a7d7bb647a73098798fdc4f1c8acf40563ac7a URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=80a7d7bb...
Author: Charles Chance charles.chance@sipcentric.com Committer: Charles Chance charles.chance@sipcentric.com Date: Thu Nov 13 21:43:22 2014 +0000
dmq: Add find_dmq_node_uri function to API - based on patch submitted by Andrey Rybkin.
---
modules/dmq/bind_dmq.c | 1 + modules/dmq/bind_dmq.h | 2 ++ modules/dmq/dmqnode.c | 5 +++++ modules/dmq/dmqnode.h | 1 + 4 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/modules/dmq/bind_dmq.c b/modules/dmq/bind_dmq.c index 37c2a7e..5d80e12 100644 --- a/modules/dmq/bind_dmq.c +++ b/modules/dmq/bind_dmq.c @@ -34,6 +34,7 @@ int bind_dmq(dmq_api_t* api) { api->register_dmq_peer = register_dmq_peer; api->send_message = dmq_send_message; api->bcast_message = bcast_dmq_message; + api->find_dmq_node_uri = find_dmq_node_uri2; return 0; }
diff --git a/modules/dmq/bind_dmq.h b/modules/dmq/bind_dmq.h index 0447040..dc90fb4 100644 --- a/modules/dmq/bind_dmq.h +++ b/modules/dmq/bind_dmq.h @@ -34,11 +34,13 @@ typedef int (*bcast_message_t)(dmq_peer_t* peer, str* body, dmq_node_t* except, dmq_resp_cback_t* resp_cback, int max_forwards, str* content_type); typedef int (*send_message_t)(dmq_peer_t* peer, str* body, dmq_node_t* node, dmq_resp_cback_t* resp_cback, int max_forwards, str* content_type); +typedef dmq_node_t* (*find_dmq_node_uri_t)(str* uri);
typedef struct dmq_api { register_dmq_peer_t register_dmq_peer; bcast_message_t bcast_message; send_message_t send_message; + find_dmq_node_uri_t find_dmq_node_uri; } dmq_api_t;
typedef int (*bind_dmq_f)(dmq_api_t* api); diff --git a/modules/dmq/dmqnode.c b/modules/dmq/dmqnode.c index b293369..d4bde2a 100644 --- a/modules/dmq/dmqnode.c +++ b/modules/dmq/dmqnode.c @@ -239,6 +239,11 @@ dmq_node_t* find_dmq_node_uri(dmq_node_list_t* list, str* uri) return ret; }
+dmq_node_t* find_dmq_node_uri2(str* uri) +{ + return find_dmq_node_uri(node_list, uri); +} + /** * @brief destroy dmq node */ diff --git a/modules/dmq/dmqnode.h b/modules/dmq/dmqnode.h index 10e2962..0bfd9ba 100644 --- a/modules/dmq/dmqnode.h +++ b/modules/dmq/dmqnode.h @@ -66,6 +66,7 @@ int update_node_list(dmq_node_list_t* remote_list); dmq_node_t* add_dmq_node(dmq_node_list_t* list, str* uri); dmq_node_t* find_dmq_node(dmq_node_list_t* list, dmq_node_t* node); dmq_node_t* find_dmq_node_uri(dmq_node_list_t* list, str* uri); +dmq_node_t* find_dmq_node_uri2(str* uri); int del_dmq_node(dmq_node_list_t* list, dmq_node_t* node); int cmp_dmq_node(dmq_node_t* node, dmq_node_t* cmpnode); dmq_node_t* shm_dup_node(dmq_node_t* node);