/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "net.h"
#include "istream.h"
#include "wildcard-match.h"
#include "hash.h"
#include "str.h"
#include "strescape.h"
#include "doveadm.h"
#include "doveadm-print.h"
#include "doveadm-who.h"
#include <stdio.h>
#include <unistd.h>
struct who_user {
const char *username;
const char *service;
unsigned int connection_count;
};
{
else {
}
}
{
else {
}
return hash;
}
{
return 1;
return 1;
/* tracking only IP addresses, not usernames */
}
return 0;
}
static bool
{
return TRUE;
}
return FALSE;
}
{
const char *ident = args[0];
const char *p, *ip_str;
p = strchr(ident, '/');
if (p == NULL)
return -1;
return -1;
/* no IP */
} else {
}
return -1;
return 0;
}
{
return TRUE;
}
return FALSE;
}
{
}
}
{
unsigned int i, net_bits;
i_error("Multiple network masks not supported");
return -1;
}
} else {
i_error("Multiple username masks not supported");
return -1;
}
}
}
return 0;
}
{
const char *line;
int fd;
if (*line == '\0')
break;
T_BEGIN {
else
} T_END;
}
if (input->stream_errno != 0) {
}
}
const struct who_filter *filter)
{
return FALSE;
}
break;
}
}
if (!ret)
return FALSE;
}
return TRUE;
}
{
str_truncate(str, 0);
}
{
} T_END;
}
}
const struct who_filter *filter)
{
return FALSE;
}
return FALSE;
}
return TRUE;
}
{
unsigned int i;
return;
} T_END;
}
{
const char *const *masks;
return;
}
}
if (!separate_connections) {
} else {
doveadm_print_header_simple("pid");
doveadm_print_header_simple("ip");
}
}
.name = "who",
};