|
hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
|
Provides utility functions and macros. More...
Go to the source code of this file.
Data Structures | |
| struct | ifx_blob_t |
| Data storage for data and data length where both are required as parameters. More... | |
Macros | |
| #define | IFX_MEMCPY(dest, src, size) memcpy(dest, src, size) /* flawfinder: ignore*/ |
| Allows custom definition of memory copy API. By default, memcpy() from string.h is used. | |
| #define | IFX_MEMCMP(first_memory, second_memory, size) memcmp(first_memory, second_memory, size) |
| Allows custom definition of memory compare API. By default, memcmp() from string.h is used. | |
| #define | IFX_MEMSET(buffer, value, size) memset(buffer, value, size) |
| Allows custom definition of memory set API. By default, memset() from string.h is used. | |
| #define | IFX_FREE(buffer) free(buffer) |
| Allows custom definition of free(free pointer) API. By default, free() from string.h is used. | |
| #define | IFX_UNUSED_VARIABLE(var) (void) var |
| Macro to suppress unused variable warnings. | |
| #define | IFX_UTILS_CONCAT UINT8_C(0x01) |
| Function identifier of utils concat for ifx_blob_t type data. | |
| #define | IFX_ENABLE UINT8_C(0x01) |
| Defines 0x01. | |
| #define | IFX_DISABLE UINT8_C(0x00) |
| Defines 0x00. | |
| #define | IFX_LITTLE_ENDIAN IFX_ENABLE |
| Indicates Endianness of architecture. | |
| #define | IFX_VALIDATE_NULL_PTR IFX_ENABLE |
| Validation of NULL pointer. | |
| #define | IFX_VALIDATE_NULL_PTR_BLOB(blob) (blob == NULL || blob->buffer == NULL) |
| Macro to check if the blob or its buffer is NULL. | |
| #define | IFX_VALIDATE_NULL_PTR_MEMORY(data) (data == NULL) |
| Macro to check if the memory address is pointing to NULL. | |
| #define | IFX_GET_LOWER_BYTE(p1_value, p2_value) (p1_value) = (((p2_value) & 0xff00) >> 8); |
| Stores lower(big endian) byte from p2 to p1. | |
| #define | IFX_GET_UPPER_BYTE(p1_value, p2_value) (p1_value) = ((p2_value) & 0x00FF); |
| Stores upper(big endian) byte from p2 to p1. | |
| #define | IFX_READ_U32(buffer, u32value) |
| Macro for little endian/big endian read operation To read array data to a word variable. | |
| #define | IFX_UPDATE_U32(buffer, u32value) |
| Macro for little endian/big endian update operation To update array data with value of word variable. | |
Functions | |
| ifx_status_t | ifx_utils_concat (const ifx_blob_t *append_data, ifx_blob_t *result) |
| Concatenates the buffers of two ifx_blob_t type data structures. Buffer field of append_data will be appended at end of the buffer field of result. | |
Provides utility functions and macros.
Definition in file ifx-utils.h.
| #define IFX_DISABLE UINT8_C(0x00) |
Defines 0x00.
Definition at line 79 of file ifx-utils.h.
| #define IFX_ENABLE UINT8_C(0x01) |
Defines 0x01.
Definition at line 74 of file ifx-utils.h.
| #define IFX_FREE | ( | buffer | ) | free(buffer) |
Allows custom definition of free(free pointer) API. By default, free() from string.h is used.
Definition at line 52 of file ifx-utils.h.
| #define IFX_GET_LOWER_BYTE | ( | p1_value, | |
| p2_value ) (p1_value) = (((p2_value) & 0xff00) >> 8); |
Stores lower(big endian) byte from p2 to p1.
Definition at line 141 of file ifx-utils.h.
| #define IFX_GET_UPPER_BYTE | ( | p1_value, | |
| p2_value ) (p1_value) = ((p2_value) & 0x00FF); |
Stores upper(big endian) byte from p2 to p1.
Definition at line 147 of file ifx-utils.h.
| #define IFX_LITTLE_ENDIAN IFX_ENABLE |
Indicates Endianness of architecture.
Definition at line 84 of file ifx-utils.h.
| #define IFX_MEMCMP | ( | first_memory, | |
| second_memory, | |||
| size ) memcmp(first_memory, second_memory, size) |
Allows custom definition of memory compare API. By default, memcmp() from string.h is used.
Definition at line 35 of file ifx-utils.h.
| #define IFX_MEMCPY | ( | dest, | |
| src, | |||
| size ) memcpy(dest, src, size) /* flawfinder: ignore*/ |
Allows custom definition of memory copy API. By default, memcpy() from string.h is used.
Definition at line 25 of file ifx-utils.h.
| #define IFX_MEMSET | ( | buffer, | |
| value, | |||
| size ) memset(buffer, value, size) |
Allows custom definition of memory set API. By default, memset() from string.h is used.
Definition at line 44 of file ifx-utils.h.
| #define IFX_READ_U32 | ( | buffer, | |
| u32value ) |
Macro for little endian/big endian read operation To read array data to a word variable.
Read data from 'Buffer' Array and update 'Value' variable, Array is input parameter and value is output parameter
Definition at line 159 of file ifx-utils.h.
| #define IFX_UNUSED_VARIABLE | ( | var | ) | (void) var |
Macro to suppress unused variable warnings.
Definition at line 62 of file ifx-utils.h.
| #define IFX_UPDATE_U32 | ( | buffer, | |
| u32value ) |
Macro for little endian/big endian update operation To update array data with value of word variable.
Read data from 'Value' variable and update 'Buffer' Array, Array is output parameter and value is input parameter
Definition at line 176 of file ifx-utils.h.
| #define IFX_UTILS_CONCAT UINT8_C(0x01) |
Function identifier of utils concat for ifx_blob_t type data.
Definition at line 69 of file ifx-utils.h.
| #define IFX_VALIDATE_NULL_PTR IFX_ENABLE |
Validation of NULL pointer.
Definition at line 89 of file ifx-utils.h.
| #define IFX_VALIDATE_NULL_PTR_BLOB | ( | blob | ) | (blob == NULL || blob->buffer == NULL) |
Macro to check if the blob or its buffer is NULL.
Definition at line 94 of file ifx-utils.h.
| #define IFX_VALIDATE_NULL_PTR_MEMORY | ( | data | ) | (data == NULL) |
Macro to check if the memory address is pointing to NULL.
Definition at line 99 of file ifx-utils.h.
| ifx_status_t ifx_utils_concat | ( | const ifx_blob_t * | append_data, |
| ifx_blob_t * | result ) |
Concatenates the buffers of two ifx_blob_t type data structures. Buffer field of append_data will be appended at end of the buffer field of result.
| [in] | append_data | Data to be appended. |
| [in,out] | result | Destination in which the data will be appended. |
| IFX_ILLEGAL_ARGUMENT | : If invalid/NULL parameter is passed to function |
| IFX_OUT_OF_MEMORY | : If memory allocation fails |