10 #ifndef CRM_COMMON_IPC__H
11 # define CRM_COMMON_IPC__H
25 #include <qb/qbipcc.h>
36 #define create_reply(request, xml_response_data) \
37 create_reply_adv(request, xml_response_data, __func__)
42 #define create_request(task, xml_data, host_to, sys_to, sys_from, uuid_from) \
43 create_request_adv(task, xml_data, host_to, sys_to, sys_from, uuid_from, \
47 const char *host_to,
const char *sys_to,
48 const char *sys_from,
const char *uuid_from,
171 int32_t ms_timeout, xmlNode ** reply);
218 pid_t *gotpid, uid_t *gotuid, gid_t *gotgid);
224 const char *major_version,
const char *minor_version);
bool crm_ipc_connect(crm_ipc_t *client)
Establish an IPC connection to a Pacemaker component.
void(* pcmk_ipc_callback_t)(pcmk_ipc_api_t *api, enum pcmk_ipc_event event_type, crm_exit_t status, void *event_data, void *user_data)
Callback function type for Pacemaker daemon IPC APIs.
enum pcmk_ipc_dispatch dispatch_type
int pcmk_connect_ipc(pcmk_ipc_api_t *api, enum pcmk_ipc_dispatch dispatch_type)
Connect to a Pacemaker daemon via IPC.
int crm_ipc_get_fd(crm_ipc_t *client)
int pcmk_new_ipc_api(pcmk_ipc_api_t **api, enum pcmk_ipc_server server)
Create a new object for using Pacemaker daemon IPC.
void pcmk_dispatch_ipc(pcmk_ipc_api_t *api)
Dispatch available messages on an IPC connection (without main loop)
xmlNode * create_reply_adv(xmlNode *request, xmlNode *xml_response_data, const char *origin)
Create a Pacemaker reply (for IPC or cluster layer)
int pcmk_ipc_purge_node(pcmk_ipc_api_t *api, const char *node_name, uint32_t nodeid)
Ask a Pacemaker daemon to purge a node from its peer cache.
enum crm_exit_e crm_exit_t
long crm_ipc_read(crm_ipc_t *client)
xmlNode * create_hello_message(const char *uuid, const char *client_name, const char *major_version, const char *minor_version)
Create XML for a controller IPC "hello" message.
uint32_t crm_ipc_buffer_flags(crm_ipc_t *client)
const char * crm_ipc_buffer(crm_ipc_t *client)
int pcmk_poll_ipc(pcmk_ipc_api_t *api, int timeout_ms)
Check whether an IPC connection has data available (without main loop)
Caller will poll and dispatch IPC.
pcmk_ipc_server
Available IPC interfaces.
struct crm_ipc_s crm_ipc_t
const char * pcmk_ipc_name(pcmk_ipc_api_t *api, bool for_log)
Get the IPC name used with an IPC API connection.
Wrappers for and extensions to libxml2.
unsigned int crm_ipc_default_buffer_size(void)
Return pacemaker's default IPC buffer size.
void crm_ipc_destroy(crm_ipc_t *client)
void pcmk_free_ipc_event(struct iovec *event)
Free an I/O vector created by pcmk__ipc_prepare_iov()
bool crm_ipc_connected(crm_ipc_t *client)
int crm_ipc_ready(crm_ipc_t *client)
Check whether an IPC connection is ready to be read.
pcmk_ipc_dispatch
How IPC replies should be dispatched.
Notification from daemon.
pcmk_ipc_event
Possible event types that an IPC event callback can be called for.
const char * crm_ipc_name(crm_ipc_t *client)
Attach IPC to GMainLoop for dispatch.
Termination of IPC connection.
Sending a command will wait for any reply.
int crm_ipc_send(crm_ipc_t *client, xmlNode *message, enum crm_ipc_flags flags, int32_t ms_timeout, xmlNode **reply)
Send an IPC XML message.
xmlNode * create_request_adv(const char *task, xmlNode *xml_data, const char *host_to, const char *sys_to, const char *sys_from, const char *uuid_from, const char *origin)
Create a Pacemaker request (for IPC or cluster layer)
void pcmk_free_ipc_api(pcmk_ipc_api_t *api)
Free the contents of an IPC API object.
crm_ipc_t * crm_ipc_new(const char *name, size_t max_size)
Create a new (legacy) object for using Pacemaker daemon IPC.
Daemon's reply to client IPC request.
Result of asynchronous connection attempt.
enum pcmk_ipc_server server
void pcmk_register_ipc_callback(pcmk_ipc_api_t *api, pcmk_ipc_callback_t cb, void *user_data)
Register a callback for IPC API events.
void crm_ipc_close(crm_ipc_t *client)
void pcmk_disconnect_ipc(pcmk_ipc_api_t *api)
Disconnect an IPC API instance.
int crm_ipc_is_authentic_process(int sock, uid_t refuid, gid_t refgid, pid_t *gotpid, uid_t *gotuid, gid_t *gotgid)
Check the authenticity of the IPC socket peer process (legacy)
bool pcmk_ipc_is_connected(pcmk_ipc_api_t *api)
Check whether an IPC API connection is active.