main.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Copyright (c) 2002-2006 MontaVista Software, Inc.
  3. * Copyright (c) 2006-2012 Red Hat, Inc.
  4. *
  5. * All rights reserved.
  6. *
  7. * Author: Steven Dake (sdake@redhat.com)
  8. *
  9. * This software licensed under BSD license, the text of which follows:
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above copyright notice,
  15. * this list of conditions and the following disclaimer.
  16. * - Redistributions in binary form must reproduce the above copyright notice,
  17. * this list of conditions and the following disclaimer in the documentation
  18. * and/or other materials provided with the distribution.
  19. * - Neither the name of the MontaVista Software, Inc. nor the names of its
  20. * contributors may be used to endorse or promote products derived from this
  21. * software without specific prior written permission.
  22. *
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  24. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  25. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  26. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  27. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  28. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  29. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  30. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  31. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  32. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  33. * THE POSSIBILITY OF SUCH DAMAGE.
  34. */
  35. /**
  36. * @file
  37. *
  38. * @warning DO NOT USE SYMBOLS IN THIS FILE
  39. */
  40. #ifndef MAIN_H_DEFINED
  41. #define MAIN_H_DEFINED
  42. #define TRUE 1
  43. #define FALSE 0
  44. #include <corosync/corotypes.h>
  45. #include <corosync/hdb.h>
  46. #include <qb/qbloop.h>
  47. #include <corosync/totem/totempg.h>
  48. #include <corosync/icmap.h>
  49. #include <corosync/coroapi.h>
  50. extern unsigned long long *(*main_clm_get_by_nodeid) (unsigned int node_id);
  51. extern int main_mcast (
  52. const struct iovec *iovec,
  53. unsigned int iov_len,
  54. unsigned int guarantee);
  55. extern void message_source_set (mar_message_source_t *source, void *conn);
  56. extern int message_source_is_local (const mar_message_source_t *source);
  57. extern void corosync_shutdown_request (void);
  58. extern void corosync_state_dump (void);
  59. extern qb_loop_t *cs_poll_handle_get (void);
  60. extern int cs_poll_dispatch_add (qb_loop_t * handle,
  61. int fd,
  62. int events,
  63. void *data,
  64. int (*dispatch_fn) (int fd,
  65. int revents,
  66. void *data));
  67. extern int cs_poll_dispatch_delete (
  68. qb_loop_t * handle,
  69. int fd);
  70. extern int corosync_sending_allowed (
  71. unsigned int service,
  72. unsigned int id,
  73. const void *msg,
  74. void *sending_allowed_private_data);
  75. extern void corosync_sending_allowed_release (void *sending_allowed_private_data);
  76. extern void corosync_recheck_the_q_level(void *data);
  77. extern void cs_ipcs_init(void);
  78. extern const char *cs_ipcs_service_init(struct corosync_service_engine *service);
  79. extern void cs_ipcs_stats_update(void);
  80. extern int32_t cs_ipcs_service_destroy(int32_t service_id);
  81. extern int32_t cs_ipcs_q_level_get(void);
  82. extern int cs_ipcs_dispatch_send(void *conn, const void *msg, size_t mlen);
  83. extern int cs_ipcs_dispatch_iov_send (void *conn,
  84. const struct iovec *iov,
  85. unsigned int iov_len);
  86. extern int cs_ipcs_response_send(void *conn, const void *msg, size_t mlen);
  87. extern int cs_ipcs_response_iov_send (void *conn,
  88. const struct iovec *iov,
  89. unsigned int iov_len);
  90. extern void cs_ipcs_sync_state_changed(int32_t sync_in_process);
  91. extern void *cs_ipcs_private_data_get(void *conn);
  92. extern void cs_ipc_refcnt_inc(void *conn);
  93. extern void cs_ipc_refcnt_dec(void *conn);
  94. extern void cs_ipc_allow_connections(int32_t allow);
  95. int coroparse_configparse (icmap_map_t config_map, const char **error_string);
  96. #endif /* MAIN_H_DEFINED */