class NetlinkEncoder

Defined at line 277 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

Encoder for serializing netlink messages

Public Methods

template <typename T>
void Write (const T & value)

Writes a value to the buffer at the current offset

Defined at line 281 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

void WriteSpan (const std::span<const uint8_t> & data)

Defined at line 285 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

void WriteString (const std::string_view & data)

Defined at line 287 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

template <typename T>
void Write (T & value, size_t offset)

Writes a value to the buffer at a specified offset

Defined at line 291 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

template <typename T>
void Read (T & out, size_t offset)

Reads a value from the buffer at a specified offset

Defined at line 297 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

void NetlinkEncoder ()

Defined at line 301 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

void NetlinkEncoder (__u16 type, __u16 flags)

Defined at line 302 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

void StartMessage (__u16 type, __u16 flags)

Starts a new netlink message

Defined at line 305 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

void BeginGenetlinkHeader (__u8 cmd)

Begins a genetlink message

Defined at line 319 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

void BeginNla (__u16 type)

Starts encoding an NLA

Defined at line 328 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

void EndNla ()

Finishes encoding an NLA

Defined at line 338 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

template <typename T>
void AddRtAttr (uint16_t type, T & attr)

Defined at line 346 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

void Finalize (iovec & out)

Finalizes the message, allowing it to be sent using sendmsg.

Defined at line 355 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

void Clear ()

Clears the buffer, invalidating any iovecs that were

obtained from this encoder.

Defined at line 367 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

uint32_t sequence ()

Defined at line 369 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h