libptpmgmt 2.0
libptpmgmt library that provides the functionality of linuxptp pmc
Loading...
Searching...
No Matches
Public Attributes | List of all members
ptpmgmt_tlv_mem_t Struct Reference

#include <msg.h>

Collaboration diagram for ptpmgmt_tlv_mem_t:
Collaboration graph
[legend]

Public Attributes

enum ptpmgmt_mng_vals_e id
 
void * tlv
 
void(* free )(ptpmgmt_tlv_mem self)
 
void(* clear )(ptpmgmt_tlv_mem self)
 
bool(* newTlv )(ptpmgmt_tlv_mem self, enum ptpmgmt_mng_vals_e ID)
 
bool(* copy )(ptpmgmt_tlv_mem self, const_ptpmgmt_tlv_mem other)
 
bool(* copyTlv )(ptpmgmt_tlv_mem self, enum ptpmgmt_mng_vals_e ID, void *tlv)
 
enum ptpmgmt_mng_vals_e(* getID )(const_ptpmgmt_tlv_mem self)
 
void *(* getTLV )(const_ptpmgmt_tlv_mem self)
 
void *(* allocMem )(ptpmgmt_tlv_mem self, size_t size)
 
void *(* callocMem )(ptpmgmt_tlv_mem self, size_t number, size_t size)
 
void *(* reallocMem )(ptpmgmt_tlv_mem self, void *memory, size_t size)
 
void *(* recallocMem )(ptpmgmt_tlv_mem self, void *memory, size_t number, size_t size)
 
struct ptpmgmt_PTPText_t(* allocString )(ptpmgmt_tlv_mem self, const char *str)
 
struct ptpmgmt_PTPText_t(* allocStringLen )(ptpmgmt_tlv_mem self, const char *str, size_t len)
 
bool(* reallocString )(ptpmgmt_tlv_mem self, struct ptpmgmt_PTPText_t *text, const char *str)
 
bool(* reallocStringLen )(ptpmgmt_tlv_mem self, struct ptpmgmt_PTPText_t *text, const char *str, size_t len)
 
bool(* freeMem )(ptpmgmt_tlv_mem self, void *mem)
 
bool(* freeString )(ptpmgmt_tlv_mem self, struct ptpmgmt_PTPText_t *txt)
 

Detailed Description

Structure to track allocations for TLV objects and release all memory at once

Member Data Documentation

◆ allocMem

void *(* ptpmgmt_tlv_mem_t::allocMem) (ptpmgmt_tlv_mem self, size_t size)

Allocate new memory to use with the tlv

Parameters
[in]selfmemory object
[in]sizefor new allocation
Returns
new memory
Note
memory will be free when freeing the tlv memory object

◆ allocString

struct ptpmgmt_PTPText_t(* ptpmgmt_tlv_mem_t::allocString) (ptpmgmt_tlv_mem self, const char *str)

Allocate new PTPText with string

Parameters
[in]selfmemory object
[in]strnull terminated string used in new allocation
Returns
PTPText with new allocated string or length zero if fail

◆ allocStringLen

struct ptpmgmt_PTPText_t(* ptpmgmt_tlv_mem_t::allocStringLen) (ptpmgmt_tlv_mem self, const char *str, size_t len)

Allocate new PTPText with string

Parameters
[in]selfmemory object
[in]strstring used in new allocation
[in]lenstring length used in new allocation
Returns
PTPText with new allocated string or length zero if fail

◆ callocMem

void *(* ptpmgmt_tlv_mem_t::callocMem) (ptpmgmt_tlv_mem self, size_t number, size_t size)

Allocate new memory to use with the tlv

Parameters
[in]selfmemory object
[in]numberof elements
[in]sizeof element
Returns
new memory size of number of elements multuiple by size of element
Note
memory will be free when freeing the tlv memory object

◆ clear

void(* ptpmgmt_tlv_mem_t::clear) (ptpmgmt_tlv_mem self)

clear the tlv and free all memory allocations

Parameters
[in,out]selfmemory object

◆ copy

bool(* ptpmgmt_tlv_mem_t::copy) (ptpmgmt_tlv_mem self, const_ptpmgmt_tlv_mem other)

Copy tlv

Parameters
[in,out]selfmemory object
[in]othertlv to copy
Returns
true on success
Note
On success this function will free any previous memory allocation and tlv allocated previously, same as calling clear() before.

◆ copyTlv

bool(* ptpmgmt_tlv_mem_t::copyTlv) (ptpmgmt_tlv_mem self, enum ptpmgmt_mng_vals_e ID, void *tlv)

Copy tlv

Parameters
[in,out]selfmemory object
[in]IDof tlv to copy
[in]tlvto copy
Returns
true on success
Note
On success this function will free any previous memory allocation and tlv allocated previously, same as calling clear() before.

◆ free

void(* ptpmgmt_tlv_mem_t::free) (ptpmgmt_tlv_mem self)

Free this tlv object and free all memory allocations

Parameters
[in,out]selfmemory object

◆ freeMem

bool(* ptpmgmt_tlv_mem_t::freeMem) (ptpmgmt_tlv_mem self, void *mem)

Free memory use with the tlv

Parameters
[in]selfmemory object
[in]memto free
Returns
true if memory belong to this memory tlv and successfuly released

◆ freeString

bool(* ptpmgmt_tlv_mem_t::freeString) (ptpmgmt_tlv_mem self, struct ptpmgmt_PTPText_t *txt)

Free memory use in the PTPText

Parameters
[in]selfmemory object
[in]memto free
Returns
true if memory belong to this memory tlv and successfuly released

◆ getID

enum ptpmgmt_mng_vals_e(* ptpmgmt_tlv_mem_t::getID) (const_ptpmgmt_tlv_mem self)

get tlv ID

Parameters
[in]selfmemory object
Returns
tlv ID
Note
On success this function will free any previous memory allocation and tlv allocated previously, same as calling clear() before.

◆ getTLV

void *(* ptpmgmt_tlv_mem_t::getTLV) (const_ptpmgmt_tlv_mem self)

Get the tlv itsef

Parameters
[in]selfmemory object
Returns
tlv

◆ id

enum ptpmgmt_mng_vals_e ptpmgmt_tlv_mem_t::id

< The TLV ID

◆ newTlv

bool(* ptpmgmt_tlv_mem_t::newTlv) (ptpmgmt_tlv_mem self, enum ptpmgmt_mng_vals_e ID)

Allocate new empty tlv

Parameters
[in,out]selfmemory object
[in]IDof tlv to allocate
Returns
true on success
Note
On success this function will free any previous memory allocation and tlv allocated previously, same as calling clear() before.

◆ reallocMem

void *(* ptpmgmt_tlv_mem_t::reallocMem) (ptpmgmt_tlv_mem self, void *memory, size_t size)

Reallocate memory to use with the tlv

Parameters
[in]selfmemory object
[in]memorypointer to reallocate
[in]sizefor new allocation
Returns
reallocated memory or null if fail
Note
memory will be free when freeing the tlv memory object

◆ reallocString

bool(* ptpmgmt_tlv_mem_t::reallocString) (ptpmgmt_tlv_mem self, struct ptpmgmt_PTPText_t *text, const char *str)

reallocate new PTPText with string

Parameters
[in]selfmemory object
[in]textobject to reallocate
[in]strnull terminated string used in new allocation
Returns
true on success
Note
The function relay on PTPText.lengthField value.

◆ reallocStringLen

bool(* ptpmgmt_tlv_mem_t::reallocStringLen) (ptpmgmt_tlv_mem self, struct ptpmgmt_PTPText_t *text, const char *str, size_t len)

reallocate new PTPText with string

Parameters
[in]selfmemory object
[in]textobject to reallocate
[in]strstring used in new allocation
[in]lenstring length used in new allocation
Returns
true on success
Note
The function relay on PTPText.lengthField value.

◆ recallocMem

void *(* ptpmgmt_tlv_mem_t::recallocMem) (ptpmgmt_tlv_mem self, void *memory, size_t number, size_t size)

Reallocate new memory to use with the tlv

Parameters
[in]selfmemory object
[in]memorypointer to reallocate
[in]numberof elements
[in]sizeof element
Returns
new memory size of number of elements multuiple by size of element
Note
memory will be free when freeing the tlv memory object

◆ tlv

void* ptpmgmt_tlv_mem_t::tlv

The TLV object


The documentation for this struct was generated from the following file: