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

append_request_with_id(state, request, message_id, bool)
content_related?(arg1)
decode(packet_with_size)
decode(binary) :: {:more, pos_integer, binary} :: {:ok, binary, binary}

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}}
encode(request, state, message_id)
encode_bare(packet, message_id)
encode_bare(binary, non_neg_integer) :: binary

Encodes packet as “bare”, without encryption and empty auth_key, used for authorizaion only.

encode_packet_size(packet)
make_msg_seqno(current_seqno, bool)