#include "nt.h"Go to the source code of this file.
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 |
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... | |
Detailed Description
This header file contains the interface to the hash reference library.
Definition in file hashref.h.
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 |
| typedef const struct NtHashRef_s* const_NtHashRef_t |
Enumeration Type Documentation
| enum NtHashRefHashMode_e |
Available hash modes
| 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 | |
| enum NtHashRefInputType_e |
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().