-/*
-
-*/
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain@chatspike.net>
+ * <Craig@chatspike.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
#include "inspircd_config.h"
#include "base.h"
#include <string>
#include <map>
-#include <sys/socket.h>
#include <sys/types.h>
+#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <unistd.h>
#include <time.h>
#include <vector>
#include <deque>
+#include <sstream>
#ifndef __CONNECTION_H__
#define __CONNECTION_H__
* connection(s) relating to the server you want information on.
* The core and module API provide functions for this.
*/
-class ircd_connector : public classbase
+class ircd_connector : public Extensible
{
private:
/** Sockaddr of the outbound ip and port
*/
bool SetHostAddress(char* host, int port);
+
public:
+
+ /** IRCD Buffer for input characters, holds one line
+ */
+ std::string ircdbuffer;
+
/** When MakeOutboundConnection is called, these public members are
* filled with the details passed to the function, for future
/** Create an outbound connection to a listening socket
*/
- bool MakeOutboundConnection(char* host, int port);
+ bool MakeOutboundConnection(char* newhost, int newport);
/** Return the servername on this established connection
*/
/** Set both the host and the port in one operation for this connection
*/
- bool SetHostAndPort(char* host, int port);
+ bool SetHostAndPort(char* newhost, int newport);
/** Close the connection by calling close() on its file descriptor
* This function call updates no other data.
*/
void CloseConnection();
-};
-
-/** Class packet is deprecated.
- * This declaration is preserved here to maintain documentation only.
- */
-class packet : public classbase
-{
+ void AddBuffer(std::string a);
+ bool BufferIsComplete();
+ void ClearBuffer();
+ std::string GetBuffer();
};
+
/** Please note: classes serverrec and userrec both inherit from class connection.
*/
-class connection : public classbase
+class connection : public Extensible
{
public:
/** File descriptor of the connection
/** Begin an outbound mesh link to another ircd on a network you are already an authenticated member of
*/
- bool MeshCookie(char* targethost, int port, long cookie, char* servername);
+ bool MeshCookie(char* targethost, int port, unsigned long cookie, char* servername);
/** Terminate a link to 'targethost' by calling the ircd_connector::CloseConnection method.
*/