]>
jfr.im git - irc/quakenet/snircd.git/blob - tools/Bounce/Bounce.h
2 * IRC - Internet Relay Chat, tools/Bounce/Bounce.h
3 * Copyright (C) 1990 Jarkko Oikarinen and
4 * University of Oulu, Computing Center
6 * See file AUTHORS in IRC package for additional names of
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 1, or (at your option)
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 * $Id: Bounce.h,v 1.3 2002/03/07 22:52:57 ghostwolf Exp $
27 #include <sys/types.h>
30 #include <sys/socket.h>
31 #include <sys/ioctl.h>
32 #include <arpa/inet.h>
33 #include <netinet/in.h>
63 list
<Listener
*> listenerList
; // List of 'Listeners'.
64 list
<Connection
*> connectionsList
; // List of 'Connections'.
66 void bindListeners(); // Binds Listening Ports.
67 void checkSockets(); // Polls all sockets.
68 void recieveNewConnection(Listener
*); // Accepts connections.
78 int fd
; // File descriptor.
79 int lastReadSize
; // Size of last read buffer.
80 struct sockaddr_in address
; // Socket addr_in struct.
81 int connectTo(char*, unsigned short); // Connects the socket.
82 int write(char*, int); // Writes 'int' bytes from message.
83 int write(char*); // Writes strlen(message).
84 char* read(); // Reads as much as possible into a 4k buffer.
85 Socket(); // Constructor.
96 int fd
; // File descriptor.
97 int remotePort
; // Remote port from config.
98 int localPort
; // Local port for binding.
99 char myVhost
[15]; // Vhost to bind locally.
100 char remoteServer
[15]; // Remote server to connect to.
102 void beginListening(); // Bind listening ports.
103 Socket
* handleAccept(); // Accept a new connection.
107 * "Connection" Class.
108 * Simply a container for a local/remote Socket pair.
115 Socket
* remoteSocket
;