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);
387 if (error !=
CS_OK) {
408 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
426 if (error !=
CS_OK) {
443 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
461 if (error !=
CS_OK) {
495 const char *addr_buf;
497 char zeroes[
sizeof(
struct sockaddr_storage)];
501 if (error !=
CS_OK) {
504 memset(zeroes, 0,
sizeof(zeroes));
519 if (error !=
CS_OK) {
524 addrlen =
sizeof(
struct sockaddr_in);
526 addrlen =
sizeof(
struct sockaddr_in6);
531 struct sockaddr_in *in;
532 struct sockaddr_in6 *in6;
537 in = (
struct sockaddr_in *)addrs[i].address;
538 if (memcmp(addr_buf, zeroes, addrlen) == 0) {
541 in->sin_family = AF_INET;
543 memcpy(&in->sin_addr, addr_buf,
sizeof(
struct in_addr));
546 in6 = (
struct sockaddr_in6 *)addrs[i].address;
548 if (memcmp(addr_buf, zeroes, addrlen) == 0) {
549 in6->sin6_family = 0;
551 in6->sin6_family = AF_INET6;
553 memcpy(&in6->sin6_addr, addr_buf,
sizeof(
struct in6_addr));
563 hdb_handle_put (&cfg_hdb, cfg_handle);
570 unsigned int *local_nodeid)
579 if (error !=
CS_OK) {
596 if (error !=
CS_OK) {
605 (void)hdb_handle_put (&cfg_hdb, handle);
620 if (error !=
CS_OK) {
637 if (error !=
CS_OK) {
644 (void)hdb_handle_put (&cfg_hdb, handle);
659 if (error !=
CS_OK) {
676 if (error !=
CS_OK) {
683 (void)hdb_handle_put (&cfg_hdb, handle);