| 642 | |
| 643 | |
| 644 | static int prep_gen_msg(bin_packet_t *packet, int cluster_id, int dst_id, |
| 645 | str *gen_msg, str *exchg_tag, int req_like) |
| 646 | { |
| 647 | /* build packet */ |
| 648 | if (bin_init(packet, &cl_extra_cap, CLUSTERER_GENERIC_MSG, BIN_VERSION, 0) < 0) { |
| 649 | LM_ERR("Failed to init bin send buffer\n"); |
| 650 | return -1; |
| 651 | } |
| 652 | |
| 653 | /* mark this message as request-like if it is the case */ |
| 654 | if (bin_push_int(packet, req_like) < 0) |
| 655 | return -1; |
| 656 | /* include an 'exchange tag' in order to possbily correlate the messages |
| 657 | * sent with replies to be received (which should contain the same tag) */ |
| 658 | if (bin_push_str(packet, exchg_tag) < 0) |
| 659 | return -1; |
| 660 | if (bin_push_str(packet, gen_msg) < 0) |
| 661 | return -1; |
| 662 | /* add the trailer as for an usual module message */ |
| 663 | if (msg_add_trailer(packet, cluster_id, dst_id) < 0) |
| 664 | return -1; |
| 665 | |
| 666 | return 0; |
| 667 | } |
| 668 | |
| 669 | int has_bridge(int src_cluster_id) |
| 670 | { |
no test coverage detected