#ifndef MAIL_STATS_H
#define MAIL_STATS_H
#include "net.h"
#include "guid.h"
#include "stats.h"
struct stats_send_ctx;
struct mail_command {
/* non-zero id means the command is still running */
unsigned int id;
int refcount;
};
struct mail_session {
/* if id="", the session no longer exists */
char *id;
const char *service;
/* ip address may be NULL if there's none */
unsigned int num_cmds;
bool disconnected;
unsigned int highest_cmd_id;
int refcount;
};
struct mail_user {
char *name;
unsigned int num_logins;
unsigned int num_cmds;
int refcount;
};
struct mail_domain {
char *name;
unsigned int num_logins;
unsigned int num_cmds;
unsigned int num_connected_sessions;
int refcount;
};
struct mail_ip {
unsigned int num_logins;
unsigned int num_cmds;
unsigned int num_connected_sessions;
int refcount;
};
struct mail_global {
unsigned int num_logins;
unsigned int num_cmds;
unsigned int num_connected_sessions;
};
extern struct mail_global mail_global_stats;
void mail_global_init(void);
void mail_global_deinit(void);
void mail_global_login(void);
void mail_global_disconnected(void);
#endif