hashref.h

Reference Documentation

product_line_custom
IntelĀ® PAC
Napatech SmartNIC
category
Reference Information
Napatech Software Suite: include/ntutil/hashref.h File Reference
hashref.h File Reference

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 (const NtHashRef_t handle, const NtHashRefInput_t *input, NtHashRefResult_t *result)
 Calculate hash value. More...
 
int NT_HashRefCalcV2 (const 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...
 

Data Structures

struct  NtHashRefConfig_v0_s
 
struct  NtHashRefConfig_s
 
union  NtHashRefConfig_s::NtHashRefConfig_u
 
struct  NtHashRefInput_t
 
union  NtHashRefInput_t::NtHashRefInput_u
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtLastMplsLabel_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtAllMplsLabels_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtTuple2IPv4_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtTuple2IPv6_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtLastVlanId_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtAllVlanIds_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtTuple5IPv4_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtTuple5IPv6_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtTuple3GREv0IPv4_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtTuple3GREv0IPv6_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtTuple5SCTPIPv4_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtTuple5SCTPIPv6_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtIpFragmentTupleIPv4_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtIpFragmentTupleIPv6_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtTuple3GTPv0IPv4_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtTuple3GTPv0IPv6_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtTuple3GTPv1v2IPv4_s
 
struct  NtHashRefInput_t::NtHashRefInput_u::NtTuple3GTPv1v2IPv6_s
 
struct  NtHashRefResult_s
 

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
 

Enumerations

enum  NtHashRefHashMode_e {
  NT_HASHREF_HASHMODE_UNDEFINED = 0, NT_HASHREF_HASHMODE_LAST_MPLS_LABEL, NT_HASHREF_HASHMODE_ALL_MPLS_LABELS, NT_HASHREF_HASHMODE_2_TUPLE,
  NT_HASHREF_HASHMODE_2_TUPLE_SORTED, NT_HASHREF_HASHMODE_LAST_VLAN_ID, NT_HASHREF_HASHMODE_ALL_VLAN_IDS, NT_HASHREF_HASHMODE_5_TUPLE,
  NT_HASHREF_HASHMODE_5_TUPLE_SORTED, NT_HASHREF_HASHMODE_3_TUPLE_GRE_V0, NT_HASHREF_HASHMODE_3_TUPLE_GRE_V0_SORTED, NT_HASHREF_HASHMODE_5_TUPLE_SCTP,
  NT_HASHREF_HASHMODE_5_TUPLE_SCTP_SORTED, NT_HASHREF_HASHMODE_INNER_2_TUPLE, NT_HASHREF_HASHMODE_3_TUPLE_GTP_V0, NT_HASHREF_HASHMODE_INNER_2_TUPLE_SORTED,
  NT_HASHREF_HASHMODE_3_TUPLE_GTP_V0_SORTED, NT_HASHREF_HASHMODE_INNER_5_TUPLE, NT_HASHREF_HASHMODE_3_TUPLE_GTP_V1V2, NT_HASHREF_HASHMODE_INNER_5_TUPLE_SORTED,
  NT_HASHREF_HASHMODE_3_TUPLE_GTP_V1V2_SORTED, NT_HASHREF_HASHMODE_IP_FRAGMENT_TUPLE, NT_HASHREF_HASHMODE_LAST
}
 
enum  NtHashRefConfig_e { NT_HASHREF_CONFIG_UNDEFINED = 0, NT_HASHREF_CONFIG_V0, NT_HASHREF_CONFIG_LAST }
 
enum  NtHashRefInputType_e {
  NT_HASHREF_INPUT_TYPE_UNDEFINED = 0, NT_HASHREF_INPUT_TYPE_LAST_MPLS_LABEL, NT_HASHREF_INPUT_TYPE_ALL_MPLS_LABELS, NT_HASHREF_INPUT_TYPE_TUPLE_2_IP_V4,
  NT_HASHREF_INPUT_TYPE_TUPLE_2_IP_V6, NT_HASHREF_INPUT_TYPE_LAST_VLAN_ID, NT_HASHREF_INPUT_TYPE_ALL_VLAN_IDS, NT_HASHREF_INPUT_TYPE_TUPLE_5_IP_V4,
  NT_HASHREF_INPUT_TYPE_TUPLE_5_IP_V6, NT_HASHREF_INPUT_TYPE_TUPLE_3_GRE_V0_IP_V4, NT_HASHREF_INPUT_TYPE_TUPLE_3_GRE_V0_IP_V6, NT_HASHREF_INPUT_TYPE_TUPLE_5_SCTP_IP_V4,
  NT_HASHREF_INPUT_TYPE_TUPLE_5_SCTP_IP_V6, NT_HASHREF_INPUT_TYPE_IP_FRAGMENT_TUPLE_IP_V4, NT_HASHREF_INPUT_TYPE_IP_FRAGMENT_TUPLE_IP_V6, NT_HASHREF_INPUT_TYPE_TUPLE_3_GTP_V0_IP_V4,
  NT_HASHREF_INPUT_TYPE_TUPLE_3_GTP_V0_IP_V6, NT_HASHREF_INPUT_TYPE_TUPLE_3_GTP_V1_V2_IP_V4, NT_HASHREF_INPUT_TYPE_TUPLE_3_GTP_V1_V2_IP_V6, NT_HASHREF_INPUT_TYPE_LAST
}
 

Function Documentation

int NT_HashRefOpen ( NtHashRef_t handle,
const NtHashRefConfig_t config 
)

Allocate and configure a hash reference handle.

Parameters
[out]handleAllocated hash reference handle
[in]configHash reference configuration
Return values
0Success
!=0Error
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 ( const 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]handleHash reference handle
[in]inputInput for hash calculation. Must match the selected input type
[out]resultThe result of the hash calculation
Return values
0Success
!=0Error
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 ( const 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]handleHash reference handle
[in]inputInput for hash calculation. Must match the selected input type
[out]resultThe result of the 32-bit hash calculation
Return values
0Success
!=0Error
int NT_HashRefClose ( NtHashRef_t  handle)

Close the hash reference handle and free associated resources.

Return values
0Success
!=0Error
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

Hash reference configuration

Hash reference configuration

typedef struct NtHashRef_s* NtHashRef_t

Hash reference handle

Definition at line 249 of file hashref.h.

Enumeration Type Documentation

Available hash modes

Enumerator
NT_HASHREF_HASHMODE_UNDEFINED 
NT_HASHREF_HASHMODE_LAST_MPLS_LABEL 

Hash Key Type 2: Last MPLS Label.

NT_HASHREF_HASHMODE_ALL_MPLS_LABELS 

Hash Key Type 3: All MPLS Labels.

NT_HASHREF_HASHMODE_2_TUPLE 

Hash Key Type 4: 2-Tuple.

NT_HASHREF_HASHMODE_2_TUPLE_SORTED 

Hash Key Type 5: 2-Tuple Sorted.

NT_HASHREF_HASHMODE_LAST_VLAN_ID 

Hash Key Type 6: Last VLAN ID.

NT_HASHREF_HASHMODE_ALL_VLAN_IDS 

Hash Key Type 7: All VLAN IDs.

NT_HASHREF_HASHMODE_5_TUPLE 

Hash Key Type 8: 5-Tuple.

NT_HASHREF_HASHMODE_5_TUPLE_SORTED 

Hash Key Type 9: 5-Tuple Sorted.

NT_HASHREF_HASHMODE_3_TUPLE_GRE_V0 

Hash Key Type 10: 3-Tuple GREv0.

NT_HASHREF_HASHMODE_3_TUPLE_GRE_V0_SORTED 

Hash Key Type 11: 3-Tuple GREv0 Sorted.

NT_HASHREF_HASHMODE_5_TUPLE_SCTP 

Hash Key Type 12: 5-Tuple SCTP.

NT_HASHREF_HASHMODE_5_TUPLE_SCTP_SORTED 

Hash Key Type 13: 5-Tuple SCTP Sorted.

NT_HASHREF_HASHMODE_INNER_2_TUPLE 

Hash Key Type 14 for PCIe Gen2 Adapters: Inner 2-Tuple.

NT_HASHREF_HASHMODE_3_TUPLE_GTP_V0 

Hash Key Type 14 for PCIe Gen1 Adapters: 3-Tuple GTPv0.

NT_HASHREF_HASHMODE_INNER_2_TUPLE_SORTED 

Hash Key Type 15 for PCIe Gen2 Adapters: Inner 2-Tuple Sorted.

NT_HASHREF_HASHMODE_3_TUPLE_GTP_V0_SORTED 

Hash Key Type 15 for PCIe Gen1 Adapters: 3-Tuple GTPv0 Sorted.

NT_HASHREF_HASHMODE_INNER_5_TUPLE 

Hash Key Type 16 for PCIe Gen2 Adapters: Inner 5-Tuple.

NT_HASHREF_HASHMODE_3_TUPLE_GTP_V1V2 

Hash Key Type 16 for PCIe Gen1 Adapters: 3-Tuple GTPv1/GTPv2.

NT_HASHREF_HASHMODE_INNER_5_TUPLE_SORTED 

Hash Key Type 17 for PCIe Gen2 Adapters: Inner 5-Tuple Sorted.

NT_HASHREF_HASHMODE_3_TUPLE_GTP_V1V2_SORTED 

Hash Key Type 17 for PCIe Gen1 Adapters: 3-Tuple GTPv1/GTPv2 Sorted.

NT_HASHREF_HASHMODE_IP_FRAGMENT_TUPLE 

Hash Key Type 30 for PCIe Gen2 Adapters: IP Fragment Tuple.

NT_HASHREF_HASHMODE_LAST 

Definition at line 58 of file hashref.h.

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.

Enumerator
NT_HASHREF_INPUT_TYPE_UNDEFINED 
NT_HASHREF_INPUT_TYPE_LAST_MPLS_LABEL 
NT_HASHREF_INPUT_TYPE_ALL_MPLS_LABELS 
NT_HASHREF_INPUT_TYPE_TUPLE_2_IP_V4 
NT_HASHREF_INPUT_TYPE_TUPLE_2_IP_V6 
NT_HASHREF_INPUT_TYPE_LAST_VLAN_ID 
NT_HASHREF_INPUT_TYPE_ALL_VLAN_IDS 
NT_HASHREF_INPUT_TYPE_TUPLE_5_IP_V4 
NT_HASHREF_INPUT_TYPE_TUPLE_5_IP_V6 
NT_HASHREF_INPUT_TYPE_TUPLE_3_GRE_V0_IP_V4 
NT_HASHREF_INPUT_TYPE_TUPLE_3_GRE_V0_IP_V6 
NT_HASHREF_INPUT_TYPE_TUPLE_5_SCTP_IP_V4 
NT_HASHREF_INPUT_TYPE_TUPLE_5_SCTP_IP_V6 
NT_HASHREF_INPUT_TYPE_IP_FRAGMENT_TUPLE_IP_V4 
NT_HASHREF_INPUT_TYPE_IP_FRAGMENT_TUPLE_IP_V6 
NT_HASHREF_INPUT_TYPE_TUPLE_3_GTP_V0_IP_V4 
NT_HASHREF_INPUT_TYPE_TUPLE_3_GTP_V0_IP_V6 
NT_HASHREF_INPUT_TYPE_TUPLE_3_GTP_V1_V2_IP_V4 
NT_HASHREF_INPUT_TYPE_TUPLE_3_GTP_V1_V2_IP_V6 
NT_HASHREF_INPUT_TYPE_LAST 

Definition at line 116 of file hashref.h.