doveadm-who.c revision 52ffa11d672a9bd150ae3e758a19f1cc4f01471b
/* Copyright (c) 2009 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "network.h"
#include "istream.h"
#include "hash.h"
#include "doveadm.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
struct who_user {
const char *username;
unsigned int connection_count;
};
struct who_filter {
const char *username;
unsigned int net_bits;
};
struct who_context {
const char *anvil_path;
struct who_filter filter;
};
static bool
{
return TRUE;
}
return FALSE;
}
const char *const *args)
{
const char *ident = args[0];
char *username_dup;
p = strchr(ident, '/');
service = t_strdup_until(ident, p++);
}
break;
}
}
{
#define ANVIL_HANDSHAKE "VERSION\tanvil\t1\t0\n"
const char *line;
int fd;
if (fd == -1)
if (*line == '\0')
break;
T_BEGIN {
} T_END;
}
if (input->stream_errno != 0)
}
const struct who_filter *filter)
{
return FALSE;
}
break;
}
}
if (!ret)
return FALSE;
}
return TRUE;
}
{
struct hash_iterate_context *iter;
continue;
printf("(");
if (first)
else
printf(" ");
} T_END;
printf(") (");
if (first)
else
printf(" ");
} T_END;
printf(")\n");
};
}
{
struct who_context ctx;
unsigned int net_bits;
int c;
switch (c) {
case 'a':
break;
default:
}
}
usage();
} else {
usage();
}
argv++;
}
who_lookup(&ctx);
}
struct doveadm_cmd doveadm_cmd_who = {
cmd_who, "who",
};