diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2025-09-15 18:50:32 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2025-09-15 18:50:32 +0200 |
commit | c3eee8e333866d92e5fd94ae83cef618758c11bb (patch) | |
tree | 234a06fd90bd61a6668490a0cbf8870e6c674b81 /FICS/network.h |
FICS RPBLC v1.4.61.4.6
Diffstat (limited to 'FICS/network.h')
-rw-r--r-- | FICS/network.h | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/FICS/network.h b/FICS/network.h new file mode 100644 index 0000000..2225734 --- /dev/null +++ b/FICS/network.h @@ -0,0 +1,96 @@ +/* network.h + * + */ + +/* + fics - An internet chess server. + Copyright (C) 1993 Richard V. Nash + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +*/ + +/* Revision history: + name email yy/mm/dd Change + Richard Nash 93/10/22 Created + Markus Uhlin 23/12/13 Cleaned up the file +*/ + +#ifndef _NETWORK_H +#define _NETWORK_H + +#include "command.h" /* For MAX_STRING_LENGTH */ + +#define NET_NETERROR 0 +#define NET_NEW 1 +#define NET_DISCONNECT 2 +#define NET_READLINE 3 +#define NET_TIMEOUT 4 +#define NET_NOTCOMPLETE 5 + +#define LINE_WIDTH 80 + +#ifndef O_NONBLOCK +#define O_NONBLOCK 00004 +#endif + +#define NETSTAT_EMPTY 0 +#define NETSTAT_CONNECTED 1 +#define NETSTAT_IDENT 2 + +typedef struct _connection { + int fd; + int outFd; + int status; + unsigned int fromHost; + +#ifdef TIMESEAL + char sys[512]; + char user[512]; + int time; + int timeseal; +#endif + + /* Input buffering */ + int numPending; + int processed; + unsigned char inBuf[MAX_STRING_LENGTH]; + + /* Output buffering */ + char *sndbuf; /* our send buffer, or NULL if none yet */ + int outPos; /* column count */ + int sndbufpos; /* position in send buffer */ + int sndbufsize; /* size of send buffer (this changes) */ + int state; /* 'telnet state' */ + + /* identd stuff */ + char ident[20]; + int mypal; +} connection; + +extern connection con[512]; + +extern int no_file; +extern int max_connections; + +extern int findConnection(int); +extern int net_addConnection(int, unsigned int); +extern int net_consize(void); +extern int net_init(int); +extern int net_send_string(int, char *, int); +extern int readline2(comstr_t *, int); +extern unsigned int + net_connected_host(int); +extern void net_close(void); +extern void net_close_connection(int); +extern void ngc2(comstr_t *, int); +extern void turn_echo_off(int); +extern void turn_echo_on(int); +#endif /* _NETWORK_H */ |