X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ClientSocket.h;h=380e051951522ebaef2a5f602f23e9c67e52f493;hb=795115bf680185ae01043bd1222b78bfed8c1d87;hp=dd8df540a02e437ecb4e578ac4ca1fd3ca6c0c7e;hpb=394d5d44953b5f09a7c0a8f2cd79b74191e8cd85;p=NeonServV5.git diff --git a/ClientSocket.h b/ClientSocket.h index dd8df54..380e051 100644 --- a/ClientSocket.h +++ b/ClientSocket.h @@ -3,13 +3,15 @@ #include "main.h" -#define SOCKET_FLAG_DEAD 0x01; -#define SOCKET_FLAG_CONNECTED 0x02; -#define SOCKET_FLAG_READY 0x04; +#define SOCKET_FLAG_DEAD 0x01 +#define SOCKET_FLAG_CONNECTED 0x02 +#define SOCKET_FLAG_READY 0x04 +#define SOCKET_FLAG_PREFERRED 0x08 /* prefered bot to send datas to the IRC World (NOTICE's WHO's etc pp) */ #define BUF_SIZ 512 struct UserNode; +struct trigger_cache; struct ClientSocket { int sock; @@ -20,6 +22,12 @@ struct ClientSocket { int port; char *pass; struct UserNode *user; + unsigned long traffic_in; + unsigned long traffic_out; + time_t connection_time; + + int botid : 16; + int clientid : 16; struct ClientSocket *next; }; @@ -29,5 +37,8 @@ int connect_socket(struct ClientSocket *client); int close_socket(struct ClientSocket *client); int write_socket(struct ClientSocket *client, char* msg, int len); void socket_loop(int timeout_seconds); +void putsock(struct ClientSocket *client, const char *text, ...) PRINTF_LIKE(2, 3); +struct ClientSocket* getBots(int flags, struct ClientSocket* last_bot); +void free_sockets(); #endif \ No newline at end of file