00001 /* 00002 00003 $Log$ 00003 Revision 1.1 2003/01/26 23:52:48 brain 00003 Modified documentation for base classes 00003 00004 Revision 1.1 2003/01/26 20:15:00 brain 00005 Added server classes for linking 00006 00007 00008 */ 00009 00010 #include "inspircd_config.h" 00011 #include "connection.h" 00012 #include <string> 00013 #include <map.h> 00014 00015 #ifndef __SERVERS_H__ 00016 #define __SERVERS_H__ 00017 00018 #define LINK_ACTIVE 1 00019 #define LINK_INACTIVE 0 00020 00021 class serverrec : public connection 00022 { 00023 private: 00024 map<string, serverrec*> leaf; // list of child servers (leaves) 00025 public: 00026 char name[MAXBUF]; // server name 00027 int pingtime; // last ping response (ms) 00028 int linktype; // link type, LINK_ACTIVE or LINK_INACTIVE 00029 time_t lastping; // time the link was last pinged 00030 long usercount_i; // invisible users on server 00031 long usercount; // non-invisible users on server 00032 long opercount; // opers on server 00033 time_t connected_at; // time server was connected into the network 00034 time_t hops_away; // number of hops away (for quick access) 00035 long version; // ircd version 00036 bool jupiter; // is a JUPE server (faked to enforce a server ban) 00037 00038 serverrec(); 00039 serverrec(char* n, int link_t, long ver, bool jupe); 00040 ~serverrec(); 00041 void AddLeaf(serverrec *child); 00042 void DelLeaf(string n); 00043 }; 00044 00045 00046 00047 typedef map<string, serverrec*> server_list; 00048 00049 #endif 00050