00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "inspircd_config.h"
00018 #include "connection.h"
00019 #include <string>
00020 #include <map>
00021
00022 #ifndef __SERVERS_H__
00023 #define __SERVERS_H__
00024
00025 #define LINK_ACTIVE 1
00026 #define LINK_INACTIVE 0
00027
00030 class serverrec : public connection
00031 {
00032 private:
00033 public:
00036 char name[MAXBUF];
00039 long pingtime;
00042 long usercount_i;
00045 long usercount;
00048 long opercount;
00051 int hops_away;
00054 long version;
00057 bool jupiter;
00058
00061 char description[MAXBUF];
00062
00065 char nickserv[NICKMAX];
00066
00067 bool sync_soon;
00068
00071 serverrec();
00074 serverrec(char* n, long ver, bool jupe);
00077 ~serverrec();
00078
00081 std::vector<ircd_connector> connectors;
00082
00083
00086 bool CreateListener(char* host, int p);
00087
00090 bool BeginLink(char* targethost, int port, char* password, char* servername, int myport);
00091
00094 bool MeshCookie(char* targethost, int port, unsigned long cookie, char* servername);
00095
00098 void TerminateLink(char* targethost);
00099
00103 bool SendPacket(char *message, const char* host);
00104
00109 bool RecvPacket(std::deque<std::string> &messages, char* host, std::deque<std::string> &sums);
00110
00113 ircd_connector* FindHost(std::string host);
00114
00118 bool AddIncoming(int fd,char* targethost, int sourceport);
00119
00122 void FlushWriteBuffers();
00123 };
00124
00125 #endif
00126