/* net.h */ /* $Id: net.h,v 1.3 1993/08/22 04:54:06 nils Exp $ */ #ifndef _NET_H #define _NET_H #ifndef __sys_types_h #include <sys/types.h> #endif #ifndef IPPROTO_IP #include <netinet/in.h> #endif #ifndef bool typedef char bool; #endif /* bool */ #define MAX_COMMAND_LEN 1000 #define BUFFER_LEN ((MAX_COMMAND_LEN)*8) #define STATE_WAITCONNECT 1 /* Just before WAITLOGIN */ #define STATE_WAITLOGIN 2 /* Wait for login */ #define STATE_WAITPASS 3 /* Wait for password */ #define STATE_CONNECTED 4 /* Normal state */ #define STATE_RELOADCONNECT 5 /* During @reboot */ #define STATE_WAITINPUT 6 /* Wait for generic input */ #define STATE_WAITPLAYERNAME 7 /* For player creation */ #define STATE_WAITPLAYERPASS 8 /* For player creation */ #define STATE_WAITPASSVERIFY 9 /* For player creation */ #define STATE_WAITPLAYEREMAIL 10 /* For player creation */ struct des_state_struct { int num; int (*func)(); }; typedef struct des_state_struct STATE; extern STATE state_list[]; /* Descriptor modes */ #define MODE_NORMAL 1 /* Normal operation */ #define MODE_SOFTCODE 2 /* In the softcode interpreter */ #define MODE_PASTE 3 /* In @paste mode */ struct io_queue { char *text; struct io_queue *next; }; struct create_info { char *name; char *password; char *passverify; }; struct descriptor_data { int descriptor; STATE *state; int mode; struct io_queue *input; struct io_queue *output; unsigned int output_size; unsigned int total_input; unsigned int total_output; bool flushed; char *user; /* identd username. */ char *addr; int *update_flag; /* 1 when UID/hostname is done */ pid_t lookup_pid; OBJ *player; int player_ref; long connected_at; long last_time; struct hash_struct *hashtable; struct sockaddr_in address; struct create_info *create_info; struct descriptor_data *next; }; typedef struct descriptor_data DDATA; extern DDATA *descriptor_list; #endif /* NET_H */