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