libgadu 1.12.2

- Strona główna
- Dodatkowe strony
- Moduły
- Struktury Danych
- Pliki

- Lista plików
- Globalne

Struktury danych | Definicje | Funkcje | Zmienne
Dokumentacja pliku handlers.c

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

## Struktury danych
struct | gg_packet_handler_t

## Definicje
#define | GG_USERLIST_REPLY_MAX_LENGTH 10485760

## Funkcje
static int | gg_ack_110 (struct gg_session *gs, GG110Ack__Type type, uint32_t seq, struct gg_event *ge)
static void | gg_sync_time (struct gg_session *gs, time_t server_time)
static int | gg_session_handle_welcome_110 (struct gg_session *gs, uint32_t seed, struct gg_event *ge)
static int | gg_session_handle_login110_ok (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
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_send_msg_ack_110 (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_event_110 (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, uint32_t type)
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, uint32_t packet_type)
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_recv_msg_110 (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
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)
static int | gg_session_handle_imtoken (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
static int | gg_session_handle_pong_110 (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
static int | gg_session_handle_chat_info (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
static int | gg_session_handle_chat_info_update (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
static int | gg_session_handle_chat_created (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
static int | gg_session_handle_chat_invite_ack (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
static int | gg_session_handle_chat_left (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
static int | gg_session_handle_options (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
static int | gg_session_handle_access_info (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
static int | gg_session_handle_uin_info (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
static int | gg_session_handle_transfer_info (struct gg_session *gs, uint32_t type, const char *ptr, size_t len, struct gg_event *ge)
static int | gg_session_handle_magic_notification (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 definicji

#define GG_USERLIST_REPLY_MAX_LENGTH 10485760

## Dokumentacja funkcji

static int gg_ack_110 | ( | struct gg_session * | gs,
|  | GG110Ack__Type | type,
|  | uint32_t | seq,
|  | struct gg_event * | ge
| ) |  |
| static

static void gg_sync_time | ( | struct gg_session * | gs,
|  | time_t | server_time
| ) |  |
| static

static int gg_session_handle_welcome_110 | ( | struct gg_session * | gs,
|  | uint32_t | seed,
|  | struct gg_event * | ge
| ) |  |
| static

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

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_send_msg_ack_110 | ( | struct gg_session * | gs,
|  | uint32_t | type,
|  | const char * | ptr,
|  | size_t | len,
|  | struct gg_event * | ge
| ) |  |
| static

Obsługuje pakiet GG_SEND_MSG_ACK110.

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_event_110 | ( | struct gg_session * | gs,
|  | uint32_t | type,
|  | const char * | ptr,
|  | size_t | len,
|  | struct gg_event * | ge
| ) |  |
| static

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,
|  | uint32_t | type
| ) |  |
| static

Analizuje przychodzący pakiet z obrazkiem.

Parametry

  e | Struktura zdarzenia
  p | Bufor z danymi
  len | Długość bufora
  sess | Struktura sesji
  sender | Numer nadawcy
  type | Typ pakietu (NIE typ GG_MSG_OPTION_IMAGE_*)

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,
|  | uint32_t | packet_type
| ) |  |
| static

Analizuje informacje rozszerzone wiadomości.

Parametry

  sess | Struktura sesji.
  e | Struktura zdarzenia.
  sender | Numer nadawcy.
  p | Wskaźnik na dane rozszerzone.
  packet_end | Wskaźnik na koniec pakietu.
  packet_type | Typ pakietu, w którym otrzymaliśmy wiadomość.

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

  gs | Struktura sesji
  seq | Numer 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_recv_msg_110 | ( | struct gg_session * | gs,
|  | uint32_t | type,
|  | const char * | ptr,
|  | size_t | len,
|  | struct gg_event * | ge
| ) |  |
| static

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Obsługuje przychodzący pakiet danych.

Parametry

  | gs | Struktura sesji
  | type | Typ pakietu
  | ptr | Wskaźnik do bufora pakietu
  | len | Długość bufora pakietu
  [out] | ge | Struktura 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