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> 39 #define PCMK__XA_IPC_PROTO_VERSION "ipc-protocol-version" 48 #define PCMK__SPECIAL_PID 1 51 #define PCMK__IPC_TIMEOUT 120 53 #if defined(HAVE_GETPEEREID) 58 #define PCMK__SPECIAL_PID_AS_0(p) (((p) == PCMK__SPECIAL_PID) ? 0 : (p)) 60 #define PCMK__SPECIAL_PID_AS_0(p) (p) 96 gid_t refgid, pid_t *gotpid);
118 # ifdef HAVE_GNUTLS_GNUTLS_H 136 pcmk__client_tls = (UINT64_C(1) << 34),
159 pcmk__client_tls_handshake_complete = (UINT64_C(1) << 44),
163 #define PCMK__CLIENT_TYPE(client) ((client)->flags & UINT64_C(0xff00000000)) 191 #define pcmk__set_client_flags(client, flags_to_set) do { \ 192 (client)->flags = pcmk__set_flags_as(__func__, __LINE__, \ 194 "Client", pcmk__client_name(client), \ 195 (client)->flags, (flags_to_set), #flags_to_set); \ 198 #define pcmk__clear_client_flags(client, flags_to_clear) do { \ 199 (client)->flags = pcmk__clear_flags_as(__func__, __LINE__, \ 201 "Client", pcmk__client_name(client), \ 202 (client)->flags, (flags_to_clear), #flags_to_clear); \ 205 #define pcmk__set_ipc_flags(ipc_flags, ipc_name, flags_to_set) do { \ 206 ipc_flags = pcmk__set_flags_as(__func__, __LINE__, LOG_TRACE, \ 208 (ipc_flags), (flags_to_set), \ 212 #define pcmk__clear_ipc_flags(ipc_flags, ipc_name, flags_to_clear) do { \ 213 ipc_flags = pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, \ 215 (ipc_flags), (flags_to_clear), \ 236 const char *tag,
const char *ver,
crm_exit_t status);
237 #define pcmk__ipc_create_ack(flags, tag, ver, st) \ 238 pcmk__ipc_create_ack_as(__func__, __LINE__, (flags), (tag), (ver), (st)) 241 uint32_t request, uint32_t
flags,
const char *tag,
243 #define pcmk__ipc_send_ack(c, req, flags, tag, ver, st) \ 244 pcmk__ipc_send_ack_as(__func__, __LINE__, (c), (req), (flags), (tag), (ver), (st)) 247 uint32_t max_send_size,
248 struct iovec **
result, ssize_t *bytes);
253 uint32_t *
id, uint32_t *
flags);
258 struct qb_ipcs_service_handlers *cb);
260 struct qb_ipcs_service_handlers *cb);
262 struct qb_ipcs_service_handlers *cb);
267 qb_ipcs_service_t **ipcs_rw,
268 qb_ipcs_service_t **ipcs_shm,
269 struct qb_ipcs_service_handlers *ro_cb,
270 struct qb_ipcs_service_handlers *rw_cb);
273 qb_ipcs_service_t *ipcs_rw,
274 qb_ipcs_service_t *ipcs_shm);
276 static inline const char *
277 pcmk__ipc_sys_name(
const char *ipc_name,
const char *fallback)
Client uses TCP connection.
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)
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)
Client is run by root or cluster user.
int pcmk__ipc_send_xml(pcmk__client_t *c, uint32_t request, xmlNode *message, 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, const char *ver, crm_exit_t status)
pcmk__client_t * pcmk__find_client(const qb_ipcs_connection_t *c)
xmlNode * pcmk__ipc_create_ack_as(const char *function, int line, uint32_t flags, const char *tag, const char *ver, crm_exit_t status)
int pcmk__ipc_send_iov(pcmk__client_t *c, struct iovec *iov, uint32_t flags)
IPC commands for Pacemakerd.
bool pcmk__set_client_queue_max(pcmk__client_t *client, const char *qmax)
Client IPC connection accepted.
#define HAVE_GNUTLS_GNUTLS_H
void pcmk__foreach_ipc_client(GHFunc func, gpointer user_data)
guint pcmk__ipc_client_count(void)
pcmk__action_result_t result
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)
const char * pcmk__pcmkd_state_enum2friendly(enum pcmk_pacemakerd_state state)
IPC interface to Pacemaker daemons.
const char * pcmk__client_name(const pcmk__client_t *c)
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.
Local client to be proxied.
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
qb_ipcs_service_t * pcmk__serve_schedulerd_ipc(struct qb_ipcs_service_handlers *cb)
void pcmk__free_client(pcmk__client_t *c)