HEX
Server: LiteSpeed
System: Linux server.searchcove.com 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64
User: lurax (1083)
PHP: 8.3.30
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/include/dovecot/master-admin-client.h
#ifndef MASTER_ADMIN_CLIENT_H
#define MASTER_ADMIN_CLIENT_H

#include "guid.h"

struct master_service_connection;
struct master_admin_client;

struct master_admin_client_callback {
	/* Handle a command sent to admin socket. Send the reply with
	   master_admin_client_send_reply(). The command can be processed
	   asynchronously. Returns TRUE if the command was handled, FALSE if
	   the command was unknown. */
	bool (*cmd)(struct master_admin_client *client,
		    const char *cmd, const char *const *args);

	/* Standard commands implemented by multiple processes: */

	/* Kick user's connections and return the number of connections kicked.
	   If conn_guid is not empty, only the specific connection is kicked. */
	unsigned int (*cmd_kick_user)(const char *user,
				      const guid_128_t conn_guid);
};

void master_admin_client_create(struct master_service_connection *master_conn);

/* Send reply to admin command from admin_client_command_t. */
void master_admin_client_send_reply(struct master_admin_client *client,
				    const char *reply);

/* Returns TRUE if service name points to admin socket. */
bool master_admin_client_can_accept(const char *name);

void master_admin_clients_init(const struct master_admin_client_callback *callbacks);

#endif