| 37 | static unsigned sync_packets_cnt; |
| 38 | |
| 39 | int send_sync_req(str *capability, int cluster_id, int source_id) |
| 40 | { |
| 41 | bin_packet_t packet; |
| 42 | int rc; |
| 43 | |
| 44 | if (bin_init(&packet, &cl_extra_cap, CLUSTERER_SYNC_REQ, BIN_SYNC_VERSION, 0) < 0) { |
| 45 | LM_ERR("Failed to init bin send buffer\n"); |
| 46 | return -1; |
| 47 | } |
| 48 | |
| 49 | bin_push_str(&packet, capability); |
| 50 | msg_add_trailer(&packet, cluster_id, source_id); |
| 51 | |
| 52 | rc = clusterer_send_msg(&packet, cluster_id, source_id, 0, 1); |
| 53 | if (rc == CLUSTERER_SEND_SUCCESS) |
| 54 | LM_INFO("Sent sync request for capability '%.*s' to node %d, " |
| 55 | "cluster %d\n", capability->len, capability->s, source_id, |
| 56 | cluster_id); |
| 57 | |
| 58 | bin_free_packet(&packet); |
| 59 | |
| 60 | return rc; |
| 61 | } |
| 62 | |
| 63 | static int get_sync_source(cluster_info_t *cluster, str *capability, |
| 64 | enum cl_node_match_op match_cond) |
no test coverage detected