X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2FClientSocket.h;h=9e73fd1fbe72ba5c12dddfae51be0301e70a4632;hp=7926767c973b0135b6077c2cc1f3938e8ee2884b;hb=HEAD;hpb=c254e7d9a1622b19aae9b4ebecb4082657288f4a diff --git a/src/ClientSocket.h b/src/ClientSocket.h index 7926767..9e73fd1 100644 --- a/src/ClientSocket.h +++ b/src/ClientSocket.h @@ -1,5 +1,5 @@ -/* ClientSocket.h - NeonServ v5.1 - * Copyright (C) 2011 Philipp Kreil (pk910) +/* ClientSocket.h - NeonServ v5.6 + * Copyright (C) 2011-2012 Philipp Kreil (pk910) * * 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 @@ -19,46 +19,79 @@ #include "main.h" -#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 SOCKET_FLAG_USE_QUEUE 0x10 +#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 SOCKET_FLAG_USE_QUEUE 0x10 +#define SOCKET_FLAG_RECONNECT 0x20 +#define SOCKET_FLAG_SSL 0x40 + +#define SOCKET_FLAG_FAST_JUMP 0x200 +#define SOCKET_FLAG_SILENT 0x400 +#define SOCKET_FLAG_CHANGENICK 0x800 +#define SOCKET_FLAG_REQUEST_INVITE 0x1000 +#define SOCKET_FLAG_REQUEST_OP 0x2000 +#define SOCKET_FLAG_SECRET_BOT 0x4000 + +#define SOCKET_HAVE_BOTCLASSVALUE1 0x10000000 +#define SOCKET_HAVE_BOTCLASSVALUE2 0x20000000 +#define SOCKET_HAVE_BOTCLASSVALUE3 0x40000000 #define BUF_SIZ 512 struct UserNode; struct trigger_cache; +struct IODescriptor; struct ClientSocket { - int sock; - unsigned char flags; - char buffer[BUF_SIZ*2]; //we need to store up to 2 full commands at once - unsigned int bufferpos; + struct IODescriptor *iofd; + unsigned int flags; char *host; int port; + char *bind; char *pass; + char *nick; + char *ident; + char *realname; struct UserNode *user; + char *network_name; unsigned long traffic_in; unsigned long traffic_out; time_t connection_time; struct BotQueue *queue; + + struct WHOQueueEntry *whoqueue_first; + struct WHOQueueEntry *whoqueue_last; + + struct HandleInfoQueueEntry *handleinfo_first; + struct HandleInfoQueueEntry *handleinfo_last; int botid : 16; int clientid : 16; + void *botclassvalue1; + void *botclassvalue2; + void *botclassvalue3; + + void *changenick_channels; //parted channels due raw 437 + struct ClientSocket *next; }; -struct ClientSocket* create_socket(char *host, int port, char *pass, struct UserNode *user); -int connect_socket(struct ClientSocket *client); -int close_socket(struct ClientSocket *client); +#ifndef DND_FUNCTIONS +/* MODULAR ACCESSIBLE */ struct ClientSocket* create_socket(char *host, int port, char *bindto, char *pass, char *nick, char *ident, char *realname); +/* MODULAR ACCESSIBLE */ void connect_socket(struct ClientSocket *client); +/* MODULAR ACCESSIBLE */ int close_socket(struct ClientSocket *client); +/* MODULAR ACCESSIBLE */ int destroy_socket(struct ClientSocket *client); int write_socket_force(struct ClientSocket *client, char* msg, int len); -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 +/* MODULAR ACCESSIBLE */ int write_socket(struct ClientSocket *client, char* msg, int len); +#ifdef HAVE_THREADS +int clientsocket_parseorder_top(unsigned int tid); +#endif +/* MODULAR ACCESSIBLE */ void putsock(struct ClientSocket *client, const char *text, ...) PRINTF_LIKE(2, 3); +/* MODULAR ACCESSIBLE */ struct ClientSocket* getBots(int flags, struct ClientSocket* last_bot); +void init_sockets(); +void free_sockets(int close_only); +#endif +#endif