libfru 3.0.2.gb79b203
FRU Manupulation Library
Loading...
Searching...
No Matches
Internal Use Area

Definitions related to Internal Use Area. More...

Functions

bool fru_set_internal_binary (fru_t *fru, const void *buffer, size_t size)
 Set internal use area from binary buffer.
 
bool fru_set_internal_hexstring (fru_t *fru, const void *hexstr)
 Set internal use area from a hex string.
 
bool fru_delete_internal (fru_t *fru)
 Delete internal use area from FRU structure.
 

Detailed Description

Definitions related to Internal Use Area.

Function Documentation

◆ fru_delete_internal()

bool fru_delete_internal ( fru_t fru)

Delete internal use area from FRU structure.

Deallocates the internal use area and removes it from the given FRU info structure.

Parameters
[in]fruThe decoded FRU information structure to modify.
Returns
Success status
Return values
trueSuccess
falseFailure, sets fru_errno

◆ fru_set_internal_binary()

bool fru_set_internal_binary ( fru_t fru,
const void *  buffer,
size_t  size 
)

Set internal use area from binary buffer.

Converts contents of the provided binary buffer into a hex string and copies them into fru->internal, allocating or reallocating the latter as needed. On success enables the FRU_INTERNAL_USE area. On failure, leaves it and fru->internal as they were.

Parameters
[in]fruThe decoded FRU information structure to modify.
[in]bufferSource binary buffer
[in]sizeNumber of bytes in buffer
Returns
Success status
Return values
trueSuccess
falseFailure, fru unmodified, check fru_errno

◆ fru_set_internal_hexstring()

bool fru_set_internal_hexstring ( fru_t fru,
const void *  hexstr 
)

Set internal use area from a hex string.

Copies contents of the provided hex string into internal use area of the the given FRU info structure. Allocates a new buffer for that, the original buffer may safely be deallocated after the call.

On success will allocate or reallocate internal use area in fru as needed and will enable FRU_INTERNAL_USE area. The area is put at the default position.

On failure will leave fru completely unmodified.

The source string must contain only hex digits and optional delimiters that will be skipped during copying. Supported delimiters are:

  • space ' '
  • dot '.'
  • dash '-'
  • colon ':'

Any other symbols will result in a failure.

Example

fru_set_internal_hexstring(fru, "1337C0DE");
bool fru_set_internal_hexstring(fru_t *fru, const void *hexstr)
Set internal use area from a hex string.
Parameters
[in]fruThe decoded FRU information structure to modify.
[in]hexstrThe source hex string
Returns
Success status
Return values
trueSuccess
falseFailure, fru left unmodified, check fru_errno