doveadm-director.c revision b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011
/* Copyright (c) 2009-2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "network.h"
#include "istream.h"
#include "doveadm.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
struct director_context {
const char *socket_path;
};
extern struct doveadm_cmd doveadm_cmd_director[];
static void
{
}
{
#define DIRECTOR_HANDSHAKE_EXPECTED "VERSION\tdirector-doveadm\t1\t"
const char *line;
int fd;
if (fd == -1)
strlen(DIRECTOR_HANDSHAKE_EXPECTED)) != 0) {
i_fatal("%s not a compatible director-doveadm socket",
ctx->socket_path);
}
}
{
}
static struct director_context *
{
struct director_context *ctx;
int c;
switch (c) {
case 'a':
break;
default:
}
}
return ctx;
}
static void
{
const char *line;
printf("Lookup failed\n");
return;
}
printf("User not assigned to any server\n");
else
}
{
struct director_context *ctx;
return;
}
if (*line == '\0')
break;
T_BEGIN {
printf("%-20s %6s %6s\n",
}
} T_END;
}
}
{
struct director_context *ctx;
}
ips_count = 1;
} else {
}
for (i = 0; i < ips_count; i++) {
t_strdup_printf("HOST-SET\t%s\n",
net_ip2addr(&ips[i])) :
t_strdup_printf("HOST-SET\t%s\t%u\n",
}
for (i = 0; i < ips_count; i++) {
} else if (doveadm_verbose) {
}
}
if (i != ips_count)
i_fatal("director add failed");
}
{
struct director_context *ctx;
unsigned int i, ips_count;
ips_count = 1;
} else {
}
for (i = 0; i < ips_count; i++) {
}
for (i = 0; i < ips_count; i++) {
"doesn't exist" : line));
} else if (doveadm_verbose) {
}
}
if (i != ips_count)
i_fatal("director remove failed");
}
struct doveadm_cmd doveadm_cmd_director[] = {
{ cmd_director_status, "director status",
"[-a <director socket path>] [<username>]", NULL },
{ cmd_director_add, "director add",
"[-a <director socket path>] <host> [<vhost count>]", NULL },
{ cmd_director_remove, "director remove",
"[-a <director socket path>] <host>", NULL }
};
void doveadm_register_director_commands(void)
{
unsigned int i;
for (i = 0; i < N_ELEMENTS(doveadm_cmd_director); i++)
}