doveadm-who.c revision 4865a1ded730cde7ecf0e6d10ed11fad17c2f8d5
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomi/* Copyright (c) 2009 Dovecot authors, see the included COPYING file */
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomi const char *service;
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomi unsigned int refcount;
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomi const char *service;
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomi unsigned int net_bits;
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomi struct hash_table *users; /* username -> who_user */
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomitypedef void who_callback_t(struct who_context *ctx,
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomistatic unsigned int who_user_hash(const void *p)
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomi return str_hash(user->username) + str_hash(user->service);
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomistatic int who_user_cmp(const void *p1, const void *p2)
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomi if (strcmp(user1->username, user2->username) != 0)
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomiwho_user_has_ip(const struct who_user *user, const struct ip_addr *ip)
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomistatic void who_parse_line(const char *line, struct who_line *line_r)
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomi const char *ident = args[0];
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomi const char *p, *ip_str;
205f29a013ee4aa95e9be993ebf261a9d9bc251bAki Tuomistatic void who_aggregate_line(struct who_context *ctx,
const char *line;
int fd;
T_BEGIN {
} T_END;
return FALSE;
if (!ret)
return FALSE;
return TRUE;
if (first)
} T_END;
if (first)
} T_END;
return FALSE;
return FALSE;
return TRUE;
} T_END;
unsigned int net_bits;
usage();
usage();
argv++;
if (!separate_connections) {