5 #include "inspircd_config.h"
9 #include <sys/socket.h>
10 #include <sys/types.h>
12 #include <netinet/in.h>
17 #ifndef __CONNECTION_H__
18 #define __CONNECTION_H__
22 #define PT_SYN_WITH_DATA 2
25 class packet : public classbase
38 class connection : public classbase
42 int fd; // file descriptor
43 char host[256]; // hostname
44 long ip; // ipv4 address
45 char inbuf[MAXBUF]; // recvQ
59 bool CreateListener(char* host, int p);
60 bool BeginLink(char* targethost, int port, char* password);
61 void TerminateLink(char* targethost);
62 bool SendPacket(char *message, char* host, int port);
63 bool RecvPacket(char *message, char* host, int &prt);
64 bool SendSYN(char* host, int port);
65 bool SendACK(char* host, int port, int reply_id);