| 1043 | } |
| 1044 | |
| 1045 | clusterer_node_t* get_clusterer_nodes(int cluster_id) |
| 1046 | { |
| 1047 | clusterer_node_t *ret_nodes = NULL; |
| 1048 | node_info_t *node; |
| 1049 | cluster_info_t *cl; |
| 1050 | |
| 1051 | lock_start_read(cl_list_lock); |
| 1052 | |
| 1053 | cl = get_cluster_by_id(cluster_id); |
| 1054 | if (!cl) { |
| 1055 | LM_ERR("cluster id: %d not found!\n", cluster_id); |
| 1056 | lock_stop_read(cl_list_lock); |
| 1057 | return NULL; |
| 1058 | } |
| 1059 | for (node = cl->node_list; node; node = node->next) |
| 1060 | if (get_next_hop(node) > 0) |
| 1061 | if (add_clusterer_node(&ret_nodes, node) < 0) { |
| 1062 | lock_stop_read(cl_list_lock); |
| 1063 | LM_ERR("Unable to add node: %d to the returned list of reachable nodes\n", |
| 1064 | node->node_id); |
| 1065 | free_clusterer_nodes(ret_nodes); |
| 1066 | return NULL; |
| 1067 | } |
| 1068 | |
| 1069 | lock_stop_read(cl_list_lock); |
| 1070 | |
| 1071 | return ret_nodes; |
| 1072 | } |
| 1073 | |
| 1074 | clusterer_node_t *api_get_next_hop(int cluster_id, int node_id) |
| 1075 | { |
nothing calls this directly
no test coverage detected