#define SOCKENG_H
#include <stdio.h>
+#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
unsigned short port; /* the remote port */
int type; /* the type of this connection (tcp/udp/raw) */
+ Listener *listener; /* listener this client came in on (optional) */
+
/* functions */
int (*send)();
int (*close)();
int (*qopts)();
+
+ int (*set_packeter)();
+ int (*set_parser)();
+
+ char *(*packeter)();
+ int (*parser)();
};
/*
*/
struct _listener {
int fd; /* file descriptor of the listener */
- u_short port; /* port of the descriptor */
+ unsigned short port; /* port of the descriptor */
unsigned int count; /* count of the clients connected */
ipvx addr; /* address of the listener to bind to */
time_t last; /* TS of last connect */
+ SockEng *sockeng; /* socket engine this is running on */
+
int flags; /* flags? */
int (*qopts)(); /* function to set options */
cLink *clients; /* clients in this group */
gLink *groups; /* subgroups to this group */
+ Group *parent; /* parent group (if applicable) */
+
int (*add)(Group *gr, Client *cl); /* function for adding clients to this group */
int (*remove)(Group *gr, Client *cl); /* function for removing clients from this group */
Group *(*create_subgroup)(Group *gr); /* function to create a subgroup */
Listener *(*create_listener)();
Group *(*create_group)();
int (*poll)();
+ int (*set_errorhandler)();
+ void (*error)();
};
#endif