MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / bcast_remove_node

Function bcast_remove_node

modules/clusterer/clusterer.c:808–832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

806}
807
808enum clusterer_send_ret bcast_remove_node(int cluster_id, int target_node)
809{
810 bin_packet_t packet;
811 int rc;
812
813 if (bin_init(&packet, &cl_extra_cap, CLUSTERER_REMOVE_NODE,
814 BIN_VERSION, 0) < 0) {
815 LM_ERR("Failed to init bin send buffer\n");
816 return CLUSTERER_SEND_ERR;
817 }
818
819 if (bin_push_int(&packet, target_node) < 0)
820 return CLUSTERER_SEND_ERR;
821
822 if (msg_add_trailer(&packet, cluster_id, -1) < 0) {
823 LM_ERR("Failed to add trailer to module's message\n");
824 return CLUSTERER_SEND_ERR;
825 }
826
827 rc = clusterer_bcast_msg(&packet, cluster_id, NODE_CMP_ANY, 0);
828
829 bin_free_packet(&packet);
830
831 return rc;
832}
833
834static inline int su_ip_cmp(union sockaddr_union* s1, union sockaddr_union* s2)
835{

Callers 1

cluster_remove_nodeFunction · 0.85

Calls 4

bin_push_intFunction · 0.85
msg_add_trailerFunction · 0.85
clusterer_bcast_msgFunction · 0.85
bin_free_packetFunction · 0.85

Tested by

no test coverage detected