45 #include <sys/types.h>
46 #include <sys/socket.h>
47 #include <sys/select.h>
51 #include <qb/qbipcc.h>
66 qb_ipcc_connection_t *
c;
76 static void cfg_inst_free (
void *inst);
94 goto error_no_destroy;
106 goto error_put_destroy;
113 (void)hdb_handle_put (&cfg_hdb, *cfg_handle);
118 (void)hdb_handle_put (&cfg_hdb, *cfg_handle);
120 (void)hdb_handle_destroy (&cfg_hdb, *cfg_handle);
128 int32_t *selection_fd)
134 if (error !=
CS_OK) {
140 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
155 struct qb_ipc_response_header *dispatch_data;
160 if (error !=
CS_OK) {
172 dispatch_data = (
struct qb_ipc_response_header *)dispatch_buf;
197 if (error !=
CS_OK) {
211 switch (dispatch_data->id) {
242 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
247 static void cfg_inst_free (
void *inst)
261 if (error !=
CS_OK) {
269 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
275 (void)hdb_handle_destroy (&cfg_hdb, cfg_handle);
277 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
285 char ***interface_names,
287 unsigned int *interface_count)
297 if (error !=
CS_OK) {
313 if (error !=
CS_OK) {
314 goto exit_handle_put;
318 *interface_names = malloc (
sizeof (
char *) * *interface_count);
319 if (*interface_names == NULL) {
322 memset (*interface_names, 0,
sizeof (
char *) * *interface_count);
324 *status = malloc (
sizeof (
char *) * *interface_count);
325 if (*status == NULL) {
327 goto error_free_interface_names_array;
329 memset (*status, 0,
sizeof (
char *) * *interface_count);
333 if ((*(interface_names))[i] == NULL) {
335 goto error_free_interface_names;
341 if ((*(status))[i] == NULL) {
343 goto error_free_status;
346 goto exit_handle_put;
349 for (j = 0; j < i; j++) {
350 free ((*(status))[j]);
352 i = *interface_count;
354 error_free_interface_names:
355 for (j = 0; j < i; j++) {
356 free ((*(interface_names))[j]);
361 error_free_interface_names_array:
362 free (*interface_names);
365 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
381 size_t cfg_node_status_size;
382 void *res_lib_cfg_nodestatuget_ptr;
402 if (error !=
CS_OK) {
417 res_lib_cfg_nodestatuget_ptr,
419 if (error !=
CS_OK) {
425 if (error !=
CS_OK) {
445 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
468 if (error !=
CS_OK) {
481 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
498 if (error !=
CS_OK) {
514 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
536 if (error !=
CS_OK) {
557 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
575 if (error !=
CS_OK) {
592 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
610 if (error !=
CS_OK) {
644 const char *addr_buf;
646 char zeroes[
sizeof(
struct sockaddr_storage)];
650 if (error !=
CS_OK) {
653 memset(zeroes, 0,
sizeof(zeroes));
668 if (error !=
CS_OK) {
673 addrlen =
sizeof(
struct sockaddr_in);
675 addrlen =
sizeof(
struct sockaddr_in6);
680 struct sockaddr_in *in;
681 struct sockaddr_in6 *in6;
686 in = (
struct sockaddr_in *)addrs[i].address;
687 if (memcmp(addr_buf, zeroes, addrlen) == 0) {
690 in->sin_family = AF_INET;
692 memcpy(&in->sin_addr, addr_buf,
sizeof(
struct in_addr));
695 in6 = (
struct sockaddr_in6 *)addrs[i].address;
697 if (memcmp(addr_buf, zeroes, addrlen) == 0) {
698 in6->sin6_family = 0;
700 in6->sin6_family = AF_INET6;
702 memcpy(&in6->sin6_addr, addr_buf,
sizeof(
struct in6_addr));
712 hdb_handle_put (&cfg_hdb, cfg_handle);
719 unsigned int *local_nodeid)
728 if (error !=
CS_OK) {
745 if (error !=
CS_OK) {
754 (void)hdb_handle_put (&cfg_hdb, handle);
769 if (error !=
CS_OK) {
786 if (error !=
CS_OK) {
793 (void)hdb_handle_put (&cfg_hdb, handle);
808 if (error !=
CS_OK) {
825 if (error !=
CS_OK) {
832 (void)hdb_handle_put (&cfg_hdb, handle);