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] | fru | The decoded FRU information structure to modify.

Returns
  Success status

Return values

  true | Success
  false | Failure, 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] | fru | The decoded FRU information structure to modify.
  [in] | buffer | Source binary buffer
  [in] | size | Number of bytes in buffer

Returns
  Success status

Return values

  true | Success
  false | Failure, 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");
fru_set_internal_hexstring
bool fru_set_internal_hexstring(fru_t *fru, const void *hexstr)
Set internal use area from a hex string.

Parameters

  [in] | fru | The decoded FRU information structure to modify.
  [in] | hexstr | The source hex string

Returns
  Success status

Return values

  true | Success
  false | Failure, fru left unmodified, check fru_errno