10 #ifndef PCMK__CRM_COMMON_IPC__H 11 # define PCMK__CRM_COMMON_IPC__H 15 #include <qb/qbipcc.h> 37 #define create_reply(request, xml_response_data) \ 38 create_reply_adv(request, xml_response_data, __func__) 40 xmlNode *
create_reply_adv(
const xmlNode *request, xmlNode *xml_response_data,
43 #define create_request(task, xml_data, host_to, sys_to, sys_from, uuid_from) \ 44 create_request_adv(task, xml_data, host_to, sys_to, sys_from, uuid_from, \ 48 const char *host_to,
const char *sys_to,
49 const char *sys_from,
const char *uuid_from,
158 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1) 221 pid_t *gotpid, uid_t *gotuid, gid_t *gotgid);
227 const char *major_version,
const char *minor_version);
bool crm_ipc_connect(crm_ipc_t *client)
Establish an IPC connection to a Pacemaker component.
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.
xmlNode * create_reply_adv(const xmlNode *request, xmlNode *xml_response_data, const char *origin)
Create a Pacemaker reply (for IPC or cluster layer)
void pcmk_dispatch_ipc(pcmk_ipc_api_t *api)
Dispatch available messages on an IPC connection (without main loop)
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(const 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
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()
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.
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.
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.
const char * pcmk_ipc_name(const pcmk_ipc_api_t *api, bool for_log)
Get the IPC name used with an IPC API connection.
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.
int crm_ipc_send(crm_ipc_t *client, const xmlNode *message, enum crm_ipc_flags flags, int32_t ms_timeout, xmlNode **reply)
Send an IPC XML message.
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.