|
ekg2
|
#include "ekg2-config.h"#include "win32.h"#include <stdio.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <string.h>#include "debug.h"#include "dynstuff.h"#include "dynstuff_inline.h"#include "xmalloc.h"#include "commands.h"#include "emoticons.h"#include "objects.h"#include "userlist.h"#include "windows.h"#include "log.h"#include "msgqueue.h"#include "protocol.h"#include "stuff.h"#include "themes.h"#include "queries.h"Funkcje | |
| static int | protocol_disconnected (void *data, va_list ap) |
| static int | protocol_connected (void *data, va_list ap) |
| static int | protocol_message_ack (void *data, va_list ap) |
| static int | protocol_status (void *data, va_list ap) |
| static int | protocol_message (void *data, va_list ap) |
| static int | protocol_xstate (void *data, va_list ap) |
| static int | protocol_userlist_changed (void *data, va_list ap) |
| void | protocol_init () |
| static int | protocol_reconnect_handler (int type, session_t *s) |
| int | protocol_disconnected_emit (const session_t *s, const char *reason, int type) |
| int | protocol_connected_emit (const session_t *s) |
| int | protocol_status_emit (const session_t *s, const char *uid, int status, char *descr, time_t when) |
| char * | message_print (const char *session, const char *sender, const char **rcpts, const char *__text, const uint32_t *format, time_t sent, int mclass, const char *seq, int dobeep, int secure) |
| int | protocol_message_emit (const session_t *s, const char *uid, char **rcpts, const char *text, const uint32_t *format, time_t sent, int mclass, const char *seq, int dobeep, int secure) |
| int | protocol_message_ack_emit (const session_t *s, const char *rcpt, const char *seq, int status) |
| int | protocol_xstate_emit (const session_t *s, const char *uid, int state, int offstate) |
| char * | protocol_uid (const char *proto, const char *target) |
| static | LIST_FREE_ITEM (dcc_free_item, dcc_t *) |
| DYNSTUFF_LIST_DECLARE (dccs, dcc_t, dcc_free_item, static __DYNSTUFF_LIST_ADD, static __DYNSTUFF_LIST_REMOVE_SAFE, __DYNSTUFF_NODESTROY) dcc_t *dcc_add(session_t *session | |
Zmienne | |
| static int | auto_find_limit = 100 |
| dcc_t * | dccs = NULL |
| const char * | uid |
| const char dcc_type_t | type |
| DYNSTUFF_LIST_DECLARE | ( | dccs | , |
| dcc_t | , | ||
| dcc_free_item | , | ||
| static | __DYNSTUFF_LIST_ADD, | ||
| static | __DYNSTUFF_LIST_REMOVE_SAFE, | ||
| __DYNSTUFF_NODESTROY | |||
| ) |
|
static |
| char* message_print | ( | const char * | session, |
| const char * | sender, | ||
| const char ** | rcpts, | ||
| const char * | __text, | ||
| const uint32_t * | format, | ||
| time_t | sent, | ||
| int | mclass, | ||
| const char * | seq, | ||
| int | dobeep, | ||
| int | secure | ||
| ) |
|
static |
Handler for PROTOCOL_CONNECTED
When session notify core about connection we do here:
| ap | 1st param: (char *) session - session uid which goes connected. |
| data | NULL |
|
static |
Handler for PROTOCOL_DISCONNECTED
When session notify core about disconnection we do here:
| ap | 1st param: (char *) session - session uid which goes disconnect |
| ap | 2nd param: (char *) reason - reason why session goes disconnect.. It's reason specifed by user if EKG_DISCONNECT_USER, else string with error description like from: strerror().. [if EKG_DISCONNECT_FAILURE] |
| ap | 3rd param: (int) type - type of disconnection one of: [EKG_DISCONNECT_USER, EKG_DISCONNECT_NETWORK, EKG_DISCONNECT_FORCED, EKG_DISCONNECT_FAILURE, EKG_DISCONNECT_STOPPED] |
| data | NULL |
| void protocol_init | ( | ) |
Init communication between core and PROTOCOL plugins
Here, we register main communication channels like:
|
static |
|
static |
Handler for PROTOCOL_MESSAGE_ACK When session notifies core about receiving acknowledgement for our message, we:
| ap | 1st param: (char *) session - session which send this notify |
| ap | 2nd param: (char *) rcpt - user uid who confirm receiving messages |
| ap | 3rd param: (char *) seq - sequence id of message |
| ap | 4th param: int __status - type of confirmation; one of: [EKG_ACK_DELIVERED, EKG_ACK_QUEUED, EKG_ACK_DROPPED, EKG_ACK_TEMPFAIL, EKG_ACK_UNKNOWN] |
| data | NULL |
| int protocol_message_ack_emit | ( | const session_t * | s, |
| const char * | rcpt, | ||
| const char * | seq, | ||
| int | status | ||
| ) |
| int protocol_message_emit | ( | const session_t * | s, |
| const char * | uid, | ||
| char ** | rcpts, | ||
| const char * | text, | ||
| const uint32_t * | format, | ||
| time_t | sent, | ||
| int | mclass, | ||
| const char * | seq, | ||
| int | dobeep, | ||
| int | secure | ||
| ) |
|
static |
Handler of reconnect timer created by protocol_disconnected()
| type | - 0 - If timer should do his job 1 - If timer'll be destroy, and handler should free his data |
| s | - session to reconnect |
|
static |
| int protocol_status_emit | ( | const session_t * | s, |
| const char * | uid, | ||
| int | status, | ||
| char * | descr, | ||
| time_t | when | ||
| ) |
|
static |
|
static |
|
static |
| const char dcc_type_t type |
| const char* uid |
1.8.1.2