Skip to main content

Module endian

Module endian 

Source
Expand description

Explicit-endian integer reads/writes.

SMB is little-endian on the wire regardless of host architecture. These helpers make the byte order explicit at every call site so the code is correct on big-endian machines too.

Functionsยง

read_le
Read a little-endian unsigned integer of N bytes starting at buf[pos].
read_u8_le
Read a little-endian value from the buffer at pos.
read_u16_le
Read a little-endian value from the buffer at pos.
read_u32_le
Read a little-endian value from the buffer at pos.
read_u64_le
Read a little-endian value from the buffer at pos.
write_le
Write a little-endian unsigned integer of n bytes into buf at pos.