libgadu  1.11.4
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje Grupay Strony
Struktury danych | Funkcje | Zmienne
Dokumentacja pliku handlers.c

Funkcje obsługi przychodzących pakietów. Więcej...

Struktury danych

struct  gg_packet_handler_t
 

Funkcje

static int gg_session_handle_welcome (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_login_ok (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_login_failed (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_send_msg_ack (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_pong (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_disconnecting (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_disconnect_ack (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_xml_event (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_pubdir50_reply (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_userlist_reply (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_dcc7_id_reply (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_dcc7_accept (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_dcc7_new (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_dcc7_reject (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_dcc7_info (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static void gg_image_queue_parse (struct gg_event *e, const char *p, unsigned int len, struct gg_session *sess, uin_t sender)
 
static int gg_handle_recv_msg_options (struct gg_session *sess, struct gg_event *e, uin_t sender, const char *p, const char *packet_end)
 
static int gg_session_send_msg_ack (struct gg_session *gs, uint32_t seq)
 
static int gg_session_handle_recv_msg (struct gg_session *sess, uint32_t type, const char *packet, size_t length, struct gg_event *e)
 
static int gg_session_handle_recv_msg_80 (struct gg_session *sess, uint32_t type, const char *packet, size_t length, struct gg_event *e)
 
static int gg_session_handle_status (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_status_60_77_80beta (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_notify_reply (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_status_80 (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_notify_reply_80 (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_notify_reply_77_80beta (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_notify_reply_60 (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_user_data (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_typing_notification (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_multilogon_info (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_userlist_100_version (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
static int gg_session_handle_userlist_100_reply (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 
int gg_session_handle_packet (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
 

Zmienne

static const gg_packet_handler_t handlers []
 

Opis szczegółowy

Funkcje obsługi przychodzących pakietów.

Dokumentacja funkcji

static int gg_session_handle_welcome ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_WELCOME.

Patrz gg_packet_handler_t

static int gg_session_handle_login_ok ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_LOGIN_OK.

Patrz gg_packet_handler_t

static int gg_session_handle_login_failed ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_LOGIN_FAILED.

Patrz gg_packet_handler_t

static int gg_session_handle_send_msg_ack ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_SEND_MSG_ACK.

Patrz gg_packet_handler_t

static int gg_session_handle_pong ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_PONG.

Patrz gg_packet_handler_t

static int gg_session_handle_disconnecting ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_DISCONNECTING.

Patrz gg_packet_handler_t

static int gg_session_handle_disconnect_ack ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_DISCONNECT_ACK.

Patrz gg_packet_handler_t

static int gg_session_handle_xml_event ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiety GG_XML_EVENT i GG_XML_ACTION.

Patrz gg_packet_handler_t

static int gg_session_handle_pubdir50_reply ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_PUBDIR50_REPLY.

Patrz gg_packet_handler_t

static int gg_session_handle_userlist_reply ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_USERLIST_REPLY.

Patrz gg_packet_handler_t

static int gg_session_handle_dcc7_id_reply ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_DCC7_ID_REPLY.

Patrz gg_packet_handler_t

static int gg_session_handle_dcc7_accept ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_DCC7_ACCEPT.

Patrz gg_packet_handler_t

static int gg_session_handle_dcc7_new ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_DCC7_NEW.

Patrz gg_packet_handler_t

static int gg_session_handle_dcc7_reject ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_DCC7_REJECT.

Patrz gg_packet_handler_t

static int gg_session_handle_dcc7_info ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_DCC7_INFO.

Patrz gg_packet_handler_t

static void gg_image_queue_parse ( struct gg_event e,
const char *  p,
unsigned int  len,
struct gg_session sess,
uin_t  sender 
)
static

Analizuje przychodzący pakiet z obrazkiem.

Parametry
eStruktura zdarzenia
pBufor z danymi
lenDługość bufora
sessStruktura sesji
senderNumer nadawcy
static int gg_handle_recv_msg_options ( struct gg_session sess,
struct gg_event e,
uin_t  sender,
const char *  p,
const char *  packet_end 
)
static

Analizuje informacje rozszerzone wiadomości.

Parametry
sessStruktura sesji.
eStruktura zdarzenia.
senderNumer nadawcy.
pWskaźnik na dane rozszerzone.
packet_endWskaźnik na koniec pakietu.
Zwraca
0 jeśli się powiodło, -1 jeśli wiadomość obsłużono i wynik ma zostać przekazany aplikacji, -2 jeśli wystąpił błąd ogólny, -3 jeśli wiadomość jest niepoprawna.
static int gg_session_send_msg_ack ( struct gg_session gs,
uint32_t  seq 
)
static

Wysyła potwierdzenie odebrania wiadomości.

Parametry
gsStruktura sesji
seqNumer sekwencyjny odebranej wiadomości
Zwraca
0 jeśli się powiodło, -1 jeśli wystąpił błąd
static int gg_session_handle_recv_msg ( struct gg_session sess,
uint32_t  type,
const char *  packet,
size_t  length,
struct gg_event e 
)
static

Obsługuje pakiet GG_RECV_MSG.

Patrz gg_packet_handler_t

static int gg_session_handle_recv_msg_80 ( struct gg_session sess,
uint32_t  type,
const char *  packet,
size_t  length,
struct gg_event e 
)
static

Obsługuje pakiet GG_RECV_MSG80.

Patrz gg_packet_handler_t

static int gg_session_handle_status ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_STATUS.

Patrz gg_packet_handler_t

static int gg_session_handle_status_60_77_80beta ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiety GG_STATUS60, GG_STATUS77 i GG_STATUS80BETA.

Patrz gg_packet_handler_t

static int gg_session_handle_notify_reply ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_NOTIFY_REPLY.

Patrz gg_packet_handler_t

static int gg_session_handle_status_80 ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_STATUS80.

Patrz gg_packet_handler_t

static int gg_session_handle_notify_reply_80 ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_NOTIFY_REPLY80.

Patrz gg_packet_handler_t

static int gg_session_handle_notify_reply_77_80beta ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiety GG_NOTIFY_REPLY77 i GG_NOTIFY_REPLY80BETA.

Patrz gg_packet_handler_t

static int gg_session_handle_notify_reply_60 ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_NOTIFY_REPLY60.

Patrz gg_packet_handler_t

static int gg_session_handle_user_data ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_USER_DATA.

Patrz gg_packet_handler_t

static int gg_session_handle_typing_notification ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_TYPING_NOTIFICATION.

Patrz gg_packet_handler_t

static int gg_session_handle_multilogon_info ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_MULTILOGON_INFO.

Patrz gg_packet_handler_t

static int gg_session_handle_userlist_100_version ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_USERLIST100_VERSION.

Patrz gg_packet_handler_t

static int gg_session_handle_userlist_100_reply ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)
static

Obsługuje pakiet GG_USERLIST100_REPLY.

Patrz gg_packet_handler_t

int gg_session_handle_packet ( struct gg_session gs,
uint32_t  type,
const char *  ptr,
size_t  len,
struct gg_event ge 
)

Analizuje przychodzący pakiet danych.

Parametry
gsStruktura sesji
typeTyp pakietu
ptrWskaźnik do bufora pakietu
lenDługość bufora pakietu
[out]geStruktura zdarzenia
Zwraca
0 jeśli się powiodło, -1 w przypadku błędu

Dokumentacja zmiennych

const gg_packet_handler_t handlers[]
static

Tablica obsługiwanych pakietów