Detailed Description
This header file contains the interface to the hash reference library.
Definition in file hashref.h.
#include "nt.h"
Go to the source code of this file.
Functions | |
int | NT_HashRefOpen (NtHashRef_t *handle, const NtHashRefConfig_t *config) |
Allocate and configure a hash reference handle. More... | |
int | NT_HashRefCalc (NtHashRef_t handle, const NtHashRefInput_t *input, NtHashRefResult_t *result) |
Calculate hash value. More... | |
int | NT_HashRefCalcV2 (NtHashRef_t handle, const NtHashRefInput_t *input, NtHashRefResult_t *result) |
Calculate 32-bit hash value. More... | |
int | NT_HashRefClose (NtHashRef_t handle) |
Close the hash reference handle and free associated resources. More... | |
Typedefs | |
typedef struct NtHashRefConfig_v0_s | NtHashRefConfig_v0_t |
typedef struct NtHashRefConfig_s | NtHashRefConfig_t |
typedef struct NtHashRefResult_s | NtHashRefResult_t |
typedef struct NtHashRef_s * | NtHashRef_t |
typedef const struct NtHashRef_s * | const_NtHashRef_t |
Function Documentation
int NT_HashRefOpen | ( | NtHashRef_t * | handle, |
const NtHashRefConfig_t * | config | ||
) |
Allocate and configure a hash reference handle.
- Parameters
-
[out] handle Allocated hash reference handle [in] config Hash reference configuration
- Return values
-
0 Success !=0 Error
- Examples:
- hashref/calc_single_hash/calc_single_hash.c.
Referenced by do_2tuple_ipv4(), do_2tuple_ipv6(), do_5tuple_ipv4(), do_5tuple_ipv6(), and do_ipfragmenttuple_ipv4().
int NT_HashRefCalc | ( | NtHashRef_t | handle, |
const NtHashRefInput_t * | input, | ||
NtHashRefResult_t * | result | ||
) |
Calculate hash value.
This function calculates the hash value based on the configuration associated with the handle and the input given
- Parameters
-
[in] handle Hash reference handle [in] input Input for hash calculation. Must match the selected input type [out] result The result of the hash calculation
- Return values
-
0 Success !=0 Error
- Examples:
- hashref/calc_single_hash/calc_single_hash.c.
Referenced by do_2tuple_ipv4(), do_2tuple_ipv6(), do_5tuple_ipv4(), do_5tuple_ipv6(), and do_ipfragmenttuple_ipv4().
int NT_HashRefCalcV2 | ( | NtHashRef_t | handle, |
const NtHashRefInput_t * | input, | ||
NtHashRefResult_t * | result | ||
) |
Calculate 32-bit hash value.
This function calculates the hash value based on the configuration associated with the handle and the input given
- Parameters
-
[in] handle Hash reference handle [in] input Input for hash calculation. Must match the selected input type [out] result The result of the 32-bit hash calculation
- Return values
-
0 Success !=0 Error
int NT_HashRefClose | ( | NtHashRef_t | handle | ) |
Close the hash reference handle and free associated resources.
- Return values
-
0 Success !=0 Error
- Examples:
- hashref/calc_single_hash/calc_single_hash.c.
Referenced by do_2tuple_ipv4(), do_2tuple_ipv6(), do_5tuple_ipv4(), do_5tuple_ipv6(), and do_ipfragmenttuple_ipv4().
Typedef Documentation
typedef struct NtHashRefConfig_v0_s NtHashRefConfig_v0_t |
Hash reference configuration
typedef struct NtHashRefConfig_s NtHashRefConfig_t |
Hash reference configuration
typedef struct NtHashRefResult_s NtHashRefResult_t |
typedef struct NtHashRef_s* NtHashRef_t |
Hash reference handle
Definition at line 249 of file hashref.h.
typedef const struct NtHashRef_s* const_NtHashRef_t |
Definition at line 250 of file hashref.h.
Enumeration Type Documentation
enum NtHashRefHashMode_e |
Available hash modes
Definition at line 58 of file hashref.h.
enum NtHashRefConfig_e |
Hash reference configuration versions
Enumerator | |
---|---|
NT_HASHREF_CONFIG_UNDEFINED | |
NT_HASHREF_CONFIG_V0 |
Use hash reference configuration NtHashRefConfig_v0_t. |
NT_HASHREF_CONFIG_LAST |
Definition at line 99 of file hashref.h.
enum NtHashRefInputType_e |
Definition at line 116 of file hashref.h.