1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
/*
* statserv.h
* Copyright (C) 1999 Patrick Alken
*
* $Id: statserv.h,v 1.1.1.1 2001/03/03 01:48:53 wcampbel Exp $
*/
#ifndef INCLUDED_statserv_h
#define INCLUDED_statserv_h
#ifndef INCLUDED_config_h
#include "config.h" /* STATSERVICES */
#define INCLUDED_config_h
#endif
#ifdef STATSERVICES
#ifndef INCLUDED_sys_types_h
#include <sys/types.h> /* time_t */
#define INCLUDED_sys_types_h
#endif
/* StatServ flags */
#define SS_DOMAIN 0x00000001 /* struct contains a domain, not host */
/* Stores info for clients' hostnames */
struct HostHash
{
struct HostHash *hnext;
char *hostname;
time_t lastseen; /* last time someone had this host */
long currclients; /* current clients from this host */
long curropers; /* current opers from this host */
long currunique; /* current unique clients from this host */
long curridentd; /* current clients running identd */
long maxclients; /* max clients seen from this host */
time_t maxclients_ts; /* time max clients were seen */
long maxunique; /* max unique (not cloned) clients from this host */
time_t maxunique_ts; /* time unique clients were seen */
long maxopers; /* max opers seen from this host */
time_t maxopers_ts; /* time max opers were seen */
int flags; /* is it a hostname or domain? */
};
/*
* Prototypes
*/
void ss_process(char *nick, char *command);
void ExpireStats(time_t unixtime);
void DoPings();
struct HostHash *FindHost(char *hostname);
struct HostHash *FindDomain(char *domain);
char *GetDomain(char *hostname);
#endif /* STATSERVICES */
#endif /* INCLUDED_statserv_h */
|