/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "str.h"
#include "strescape.h"
#include "istream.h"
#include "write-full.h"
#include "master-service.h"
#include "doveadm.h"
#include "doveadm-print.h"
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
struct replicator_context {
const char *socket_path;
const char *priority;
bool full_sync;
};
extern struct doveadm_cmd doveadm_cmd_replicator[];
static void
{
}
{
const char *line;
int fd;
alarm(5);
alarm(0);
else
}
"%s not a compatible replicator-doveadm socket",
ctx->socket_path);
}
}
{
}
}
static struct replicator_context *
{
int c;
"/replicator-doveadm", NULL);
switch (c) {
case 'a':
break;
case 'f':
break;
case 'p':
break;
default:
}
}
return ctx;
}
{
if (t == 0)
return "-";
}
{
if (*line == '\0')
break;
*value++ = '\0';
else
value = "";
}
}
{
return;
}
doveadm_print_header_simple("priority");
doveadm_print_header_simple("fast sync");
doveadm_print_header_simple("full sync");
doveadm_print_header_simple("success sync");
doveadm_print_header_simple("failed");
if (*line == '\0')
break;
T_BEGIN {
doveadm_print(args[0]);
}
} T_END;
}
i_error("Replicator disconnected unexpectedly");
}
}
{
const char *line;
unsigned int i;
doveadm_print_header_simple("type");
doveadm_print_header_simple("status");
if (*line == '\0')
break;
T_BEGIN {
for (i = 0; i < 3; i++) {
break;
doveadm_print(args[i]);
}
for (; i < 3; i++)
doveadm_print("");
} T_END;
}
}
{
const char *line;
else
i_error("Replicator disconnected unexpectedly");
} else if (line[0] != '+') {
} else {
}
}
{
const char *line;
i_error("Replicator disconnected unexpectedly");
} else if (line[0] != '+') {
}
}
{
const char *line;
i_error("Replicator disconnected unexpectedly");
} else if (line[0] != '+') {
}
}
{ cmd_replicator_status, "replicator status",
"[-a <replicator socket path>] [<user mask>]" },
{ cmd_replicator_dsync_status, "replicator dsync-status",
"[-a <replicator socket path>]" },
{ cmd_replicator_replicate, "replicator replicate",
"[-a <replicator socket path>] [-f] [-p <priority>] <user mask>" },
{ cmd_replicator_add, "replicator add",
"[-a <replicator socket path>] <user mask>" },
{ cmd_replicator_remove, "replicator remove",
"[-a <replicator socket path>] <username>" },
};
{
unsigned int i;
for (i = 0; i < N_ELEMENTS(doveadm_cmd_replicator); i++) {
help(&doveadm_cmd_replicator[i]);
}
i_unreached();
}
void doveadm_register_replicator_commands(void)
{
unsigned int i;
for (i = 0; i < N_ELEMENTS(doveadm_cmd_replicator); i++)
}