Skip to main content

Module ftlogin_wire

Module ftlogin_wire 

Source
Expand description

FTLogin/F3CLogin channel wire layer.

C++ Futu_OpenD receives already-unwrapped protobuf bodies from F3CLogin.framework. This Rust daemon does not link that framework, so this module implements the equivalent inbound wire layer from FTLogin source.

Hardcoded / assumption ledger:

  • Header layout and protocol version are protocol constants from /Users/leaf/ai-lab/o-src/FTLogin/Src/ftlogin/channel/impl/protocol_header.h and protocol_header.cpp (kProtoVersion = 39). We emit v39, but inbound non-v39 frames are decoded with the legacy byte-11 cmd_type interpretation used by the pre-v39 Rust decoder. This prevents a broker-side mixed-version response from tearing down the whole channel.
  • Compressed bodies reserve the first 4 body bytes for BE uncompressed size, then carry an LZ4 raw block. Ref: /Users/leaf/ai-lab/o-src/FTLogin/Src/ftlogin/channel/impl/channel_impl.cpp (kBodyFrontReservedBytes = 4, LZ4_decompress_safe).
  • Decompressed length limit is 12 MiB per the same C++ file (kDecompressedDataLengthLimit = 12 * 1024 * 1024).

Structs§

ProtocolHeader

Constants§

BODY_FRONT_RESERVED_BYTES
DECOMPRESSED_DATA_LEN_LIMIT
HEADER_LEN
MAGIC
PROTO_VERSION
RESERVED_LEN

Functions§

compressed_original_len
decode_inbound_body
decompress_lz4_block
LZ4 raw block decompression compatible with C++ LZ4_decompress_safe.