10 #ifndef PCMK__IPC_INTERNAL_H 11 #define PCMK__IPC_INTERNAL_H 20 #include <sys/types.h> 22 #ifdef HAVE_GNUTLS_GNUTLS_H 23 # include <gnutls/gnutls.h> 27 #include <libxml/tree.h> 28 #include <qb/qbipcs.h> 41 #define PCMK__SPECIAL_PID 1 44 #define PCMK__IPC_TIMEOUT 120 46 #if defined(US_AUTH_GETPEEREID) 51 #define PCMK__SPECIAL_PID_AS_0(p) (((p) == PCMK__SPECIAL_PID) ? 0 : (p)) 53 #define PCMK__SPECIAL_PID_AS_0(p) (p) 89 gid_t refgid, pid_t *gotpid);
112 # ifdef HAVE_GNUTLS_GNUTLS_H 114 bool tls_handshake_complete;
125 pcmk__client_tls = (UINT64_C(1) << 34),
134 #define PCMK__CLIENT_TYPE(client) ((client)->flags & UINT64_C(0xff00000000)) 162 #define pcmk__set_client_flags(client, flags_to_set) do { \ 163 (client)->flags = pcmk__set_flags_as(__func__, __LINE__, \ 165 "Client", pcmk__client_name(client), \ 166 (client)->flags, (flags_to_set), #flags_to_set); \ 169 #define pcmk__clear_client_flags(client, flags_to_clear) do { \ 170 (client)->flags = pcmk__clear_flags_as(__func__, __LINE__, \ 172 "Client", pcmk__client_name(client), \ 173 (client)->flags, (flags_to_clear), #flags_to_clear); \ 176 #define pcmk__set_ipc_flags(ipc_flags, ipc_name, flags_to_set) do { \ 177 ipc_flags = pcmk__set_flags_as(__func__, __LINE__, LOG_TRACE, \ 179 (ipc_flags), (flags_to_set), \ 183 #define pcmk__clear_ipc_flags(ipc_flags, ipc_name, flags_to_clear) do { \ 184 ipc_flags = pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, \ 186 (ipc_flags), (flags_to_clear), \ 207 uint32_t request, uint32_t
flags,
const char *tag,
209 #define pcmk__ipc_send_ack(c, req, flags, tag, st) \ 210 pcmk__ipc_send_ack_as(__func__, __LINE__, (c), (req), (flags), (tag), (st)) 213 uint32_t max_send_size,
214 struct iovec **result, ssize_t *bytes);
219 uint32_t *
id, uint32_t *
flags);
224 struct qb_ipcs_service_handlers *cb);
226 struct qb_ipcs_service_handlers *cb);
228 struct qb_ipcs_service_handlers *cb);
232 qb_ipcs_service_t **ipcs_rw,
233 qb_ipcs_service_t **ipcs_shm,
234 struct qb_ipcs_service_handlers *ro_cb,
235 struct qb_ipcs_service_handlers *rw_cb);
238 qb_ipcs_service_t *ipcs_rw,
239 qb_ipcs_service_t *ipcs_shm);
int pcmk__ipc_prepare_iov(uint32_t request, xmlNode *message, uint32_t max_send_size, struct iovec **result, ssize_t *bytes)
xmlNode * pcmk__client_data2xml(pcmk__client_t *c, void *data, uint32_t *id, uint32_t *flags)
pcmk__client_t * pcmk__new_client(qb_ipcs_connection_t *c, uid_t uid, gid_t gid)
pcmk__client_t * pcmk__find_client(qb_ipcs_connection_t *c)
qb_ipcs_service_t * pcmk__serve_controld_ipc(struct qb_ipcs_service_handlers *cb)
struct mainloop_io_s mainloop_io_t
enum crm_exit_e crm_exit_t
void pcmk__stop_based_ipc(qb_ipcs_service_t *ipcs_ro, qb_ipcs_service_t *ipcs_rw, qb_ipcs_service_t *ipcs_shm)
void pcmk__client_cleanup(void)
Wrappers for and extensions to glib mainloop.
int pcmk__client_pid(qb_ipcs_connection_t *c)
int pcmk__ipc_send_xml(pcmk__client_t *c, uint32_t request, xmlNode *message, uint32_t flags)
int pcmk__ipc_send_iov(pcmk__client_t *c, struct iovec *iov, uint32_t flags)
int pcmk__ipc_send_ack_as(const char *function, int line, pcmk__client_t *c, uint32_t request, uint32_t flags, const char *tag, crm_exit_t status)
bool pcmk__set_client_queue_max(pcmk__client_t *client, const char *qmax)
#define HAVE_GNUTLS_GNUTLS_H
void pcmk__foreach_ipc_client(GHFunc func, gpointer user_data)
guint pcmk__ipc_client_count(void)
pcmk__client_t * pcmk__find_client_by_id(const char *id)
void pcmk__serve_based_ipc(qb_ipcs_service_t **ipcs_ro, qb_ipcs_service_t **ipcs_rw, qb_ipcs_service_t **ipcs_shm, struct qb_ipcs_service_handlers *ro_cb, struct qb_ipcs_service_handlers *rw_cb)
IPC interface to Pacemaker daemons.
const char * pcmk__client_type_str(uint64_t client_type)
pcmk__client_t * pcmk__new_unauth_client(void *key)
Allocate a new pcmk__client_t object and generate its ID.
const char * pcmk__client_name(pcmk__client_t *c)
void pcmk__drop_all_clients(qb_ipcs_service_t *s)
void pcmk__serve_fenced_ipc(qb_ipcs_service_t **ipcs, struct qb_ipcs_service_handlers *cb)
struct pcmk__remote_s * remote
void pcmk__serve_attrd_ipc(qb_ipcs_service_t **ipcs, struct qb_ipcs_service_handlers *cb)
void pcmk__serve_pacemakerd_ipc(qb_ipcs_service_t **ipcs, struct qb_ipcs_service_handlers *cb)
int pcmk__ipc_is_authentic_process_active(const char *name, uid_t refuid, gid_t refgid, pid_t *gotpid)
unsigned int queue_backlog
qb_ipcs_connection_t * ipcs
void pcmk__free_client(pcmk__client_t *c)