class Frame

Defined at line 48 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

A class representing a data frame.

This class contains meta data for a frame but not the actual data itself. It simply points to a

VMO where the data is contained. The VMO is identified by an ID which can mean anything the user

would like it to but it would typically match the VMO id from the network device's prepare VMO

call. The frame object also contains an address to where the VMO has been mapped in memory as

well as the size of the data residing in the VMO. Most commonly frames will all reside in the

same VMO but have different offsets in the VMO and the frames are bounded by their size, creating

individual slices of the VMO. Each individual frame will have a unique buffer ID meaning that one

VMO (and therefore VMO ID) can contain multiple frames with distinct buffer IDs.

Note that the buffer ID does not uniquely identify the location in the VMO and will not

necessarily be the same for a particular location in the VMO every time. Therefore code should

not rely on the buffer ID for any kind of global uniqueness or unique identifier within a VMO. It

is merely a bookkeeping tool for the generic network device.

The data pointer and size can be manipulated by shrinking and growing both head and tail as well

as changing the size. The VMO offset will adjust accordingly which ensures that any operation

that works on the VMO data can always use the VMO offset to get the correct data.

Optionally each frame automatically manages its lifetime in relation to the storage it belongs

to. This means that when an object of this class is destructed it will be returned to storage if

it belongs to a storage instance. If a null pointer is provided as storage the frame will not be

managed. For this management to be reliable a Frame can only be move constructed or move

assigned. No copying is allowed. Frames can be manually returned to storage by calling

ReturnToStorage or they can be released from storage by calling ReleaseFromStorage. Releasing a

frame from storage will prevent it from automatically returning to storage on destruction.

Note that returning a frame to storage, either automatically on destruction or manually, will

acquire the lock on the storage. This means that the user has to be careful to not hold the lock

on the storage in the same thread as frames are being returned or there will be a deadlock.

Public Methods

void ReturnToStorage ()

Defined at line 9 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/frame.cc

void Frame ()

Defined at line 50 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

void ~Frame ()

Defined at line 51 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

void Frame (FrameStorage * storage, uint8_t vmo_id, size_t vmo_offset, uint16_t buffer_id, uint8_t * data, uint32_t size, uint8_t port_id)

Defined at line 53 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

void Frame (const Frame & )

Defined at line 69 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

Frame & operator= (const Frame & )

Defined at line 70 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

void Frame (Frame && other)

Defined at line 72 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

Frame & operator= (Frame && other)

Defined at line 87 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

const uint8_t * Data ()

Defined at line 108 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

uint8_t * Data ()

Defined at line 109 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

uint32_t Size ()

Defined at line 111 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

void SetSize (uint32_t size)

Defined at line 112 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

uint16_t Headroom ()

Defined at line 117 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

void ReleaseFromStorage ()

Release ownership of a frame, after this it can no longer be returned to storage

Defined at line 122 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

void ShrinkHead (uint32_t size)

Defined at line 124 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

void GrowHead (uint32_t size)

Defined at line 131 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

void ShrinkTail (uint32_t size)

Defined at line 138 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

void GrowTail (uint32_t size)

Defined at line 143 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

uint16_t BufferId ()

Defined at line 148 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

uint8_t Priority ()

Defined at line 150 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

void SetPriority (uint8_t priority)

Defined at line 151 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

size_t VmoOffset ()

Defined at line 153 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

uint8_t VmoId ()

Defined at line 154 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

uint8_t PortId ()

Defined at line 156 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

void SetPortId (uint8_t port_id)

Defined at line 157 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame.h

Friends

class FrameStorage
class FrameContainer