Rate This Document
Findability
Accuracy
Completeness
Readability

mmpm_handler_init

Feature

Initializes the multi-pattern rule matching handler.

Definition

int mmpm_handler_init(mmpm_handler_t *handler, mmpm_matcher_type type, uint32_t buckets, uint32_t secondary_buckets);

Parameter Description

Parameter

Description

Value Range

Input/Output

handler

Handler of the matching engine

Not null

Input

type

Type of the matching engine

Variables enumerated by mmpm_matcher_type

Input

buckets

Number of level-1 hash buckets. If the input value is 0, the default configuration is used, that is, the number of level-1 hash buckets is 100,000.

Non-negative value. The value falls within the range of uint32_t.

Input

secondary_buckets

Number of level-2 hash buckets under each level-1 hash bucket. If the input value is 0, the default configuration is used, that is, each level-1 hash bucket contains 96 level-2 hash buckets.

Non-negative value. The value falls within the range of uint32_t.

Input

Return Value

  • Success: 0 is returned.
  • Failure: The error code is returned.

Constraints

Do not call this function repeatedly on the same handler. If you want to reinitialize a handler, destroy the handler by calling mmpm_handler_destroy and then initialize the handler again by calling mmpm_handler_init.