mtproto v57.3.0-beta MTProto.Packet
Module for dealing with packets - encode, decode, ecnrypt, decrypt.
Summary
Functions
Tries to extract packet by it size, returns :more when packet is incomplete, otherwise :ok
Encodes packet as “bare”, without encryption and empty auth_key, used for authorizaion only
Functions
Tries to extract packet by it size, returns :more when packet is incomplete, otherwise :ok
decode_packet(packet_with_meta, state)
decode_packet(binary, %MTProto.State{auth_key: term, auth_key_hash: term, auth_params: term, auth_state: term, dc: term, dc_options: term, last_message_id: term, msg_ids: term, msg_ids_to_ack: term, msg_seqno: term, notifier: term, packet_buffer: term, reconnect: term, server_salt: term, server_time_offset: term, session_id: term, socket: term}) :: {:ok, struct | binary, %MTProto.Packet.Meta{message_id: term, msg_seqno: term}, %MTProto.State{auth_key: term, auth_key_hash: term, auth_params: term, auth_state: term, dc: term, dc_options: term, last_message_id: term, msg_ids: term, msg_ids_to_ack: term, msg_seqno: term, notifier: term, packet_buffer: term, reconnect: term, server_salt: term, server_time_offset: term, session_id: term, socket: term}}
Encodes packet as “bare”, without encryption and empty auth_key, used for authorizaion only.