Skip to main content

Crate libddwaf_sys

Crate libddwaf_sys 

Source

Structs§

_ddwaf_allocator
_ddwaf_builder
_ddwaf_context
_ddwaf_handle
_ddwaf_object_array
_ddwaf_object_bool
_ddwaf_object_float
_ddwaf_object_kv
_ddwaf_object_map
_ddwaf_object_signed
_ddwaf_object_small_string
_ddwaf_object_string
_ddwaf_object_unsigned
_ddwaf_subcontext

Constants§

DDWAF_ERR_INTERNAL
Unknown error, typically due to an unexpected exception
DDWAF_ERR_INVALID_ARGUMENT
One or more of the provided arguments to a function is invalid
DDWAF_ERR_INVALID_OBJECT
The provided data object didn’t match the expected schema
DDWAF_LOG_DEBUG
Debugging information for development
DDWAF_LOG_ERROR
Error messages for failures
DDWAF_LOG_INFO
General informational messages
DDWAF_LOG_OFF
Disable all logging
DDWAF_LOG_TRACE
Finest-grained logging for detailed tracing
DDWAF_LOG_WARN
Warning messages for potential issues
DDWAF_MATCH
The data evaluation resulted in an event, attribute, etc
DDWAF_OBJ_ARRAY
Array of ddwaf_object, up to max(uint16) capacity
DDWAF_OBJ_BOOL
Boolean type
DDWAF_OBJ_FLOAT
64-bit float (or double) type
DDWAF_OBJ_INVALID
Unkmown or uninitialised type
DDWAF_OBJ_LITERAL_STRING
Literal UTF-8 string of up to max(uint32) length, these are never freed
DDWAF_OBJ_MAP
Array of ddwaf_object_kv, up to max(uint16) capacity
DDWAF_OBJ_NULL
Null type, only used for its semantical value
DDWAF_OBJ_SIGNED
64-bit signed integer type
DDWAF_OBJ_SMALL_STRING
UTF-8 string of up to 14 bytes in length
DDWAF_OBJ_STRING
Dynamic UTF-8 string of up to max(uint32) length
DDWAF_OBJ_UNSIGNED
64-bit unsigned integer type
DDWAF_OK
The data evaluation didn’t yield any events, attributes, etc

Functions§

ddwaf_allocator_alloc
Allocates a block of memory from the given allocator with the requested alignment.
ddwaf_allocator_destroy
Destroys an allocator created by one of the ddwaf_*_allocator_init functions and releases any internal resources it holds.
ddwaf_allocator_free
Releases a block of memory previously obtained via ddwaf_allocator_alloc from the same allocator.
ddwaf_builder_add_or_update_config
Adds or updates a configuration based on the given path, which must be a unique identifier for the provided configuration.
ddwaf_builder_build_instance
Builds a ddwaf instance based on the current set of configurations.
ddwaf_builder_destroy
Destroy an instance of the builder.
ddwaf_builder_get_config_paths
Provides an array of the currently loaded paths, optionally matching the regex provided in filter. In addition, the count is provided as the return value, allowing paths to be nullptr.
ddwaf_builder_init
Initialize an instace of the waf builder.
ddwaf_builder_remove_config
Removes a configuration based on the provided path.
ddwaf_context_destroy
Performs the destruction of the context, freeing the data passed to it through ddwaf_context_eval using the provided allocator during evaluation.
ddwaf_context_eval
Perform a matching operation on the provided data
ddwaf_context_init
Context object to perform matching using the provided WAF instance.
ddwaf_destroy
Destroy a WAF instance.
ddwaf_get_default_allocator
Returns the default allocator used by the library.
ddwaf_get_version
Return the version of the library
ddwaf_init
Initialize a ddwaf instance
ddwaf_known_actions
Get an array of all the action types which could be triggered as a result of the current set of rules and exclusion filters.
ddwaf_known_addresses
Get an array of known (root) addresses used by rules, exclusion filters and processors. This array contains both required and optional addresses. A more accurate distinction between required and optional addresses is provided within the diagnostics.
ddwaf_monotonic_allocator_init
Creates a monotonic (growing) allocator. Allocations are fast and never freed individually; all memory is reclaimed only when the allocator is destroyed. This allocator must not be used concurrently from multiple threads unless externally synchronized.
ddwaf_object_at_key
Returns the key contained in the container at the given index.
ddwaf_object_at_value
Returns the object contained in the container at the given index.
ddwaf_object_clone
Creates a deep copy of the source object into the destination object.
ddwaf_object_destroy
Frees the memory contained within the object.
ddwaf_object_find
Returns the object within the given map with a key matching the provided one.
ddwaf_object_from_json
Creates a ddwaf_object from a JSON string. The JSON will be parsed and converted into the appropriate ddwaf_object structure, supporting all JSON types including objects, arrays, strings, numbers, booleans, and null values.
ddwaf_object_get_bool
Returns the boolean contained within the object.
ddwaf_object_get_float
Returns the float64 (double) contained within the object.
ddwaf_object_get_length
Returns the length of the string object.
ddwaf_object_get_signed
Returns the int64 contained within the object.
ddwaf_object_get_size
Returns the size of the container object.
ddwaf_object_get_string
Returns the string contained within the object.
ddwaf_object_get_type
Returns the type of the object.
ddwaf_object_get_unsigned
Returns the uint64 contained within the object.
ddwaf_object_insert
Inserts a new object into an array object.
ddwaf_object_insert_key
Inserts a new object into a map object, using a key.
ddwaf_object_insert_key_nocopy
Inserts a new object into a map object, using a key and its length, but without creating a copy of the key.
ddwaf_object_insert_literal_key
Inserts a new object into a map object, using a literal key.
ddwaf_object_is_array
Returns true if the object is an array.
ddwaf_object_is_bool
Returns true if the object is a boolean.
ddwaf_object_is_float
Returns true if the object is a float.
ddwaf_object_is_invalid
Returns true if the object is invalid.
ddwaf_object_is_map
Returns true if the object is a map.
ddwaf_object_is_null
Returns true if the object is null.
ddwaf_object_is_signed
Returns true if the object is a signed integer.
ddwaf_object_is_string
Returns true if the object is a string.
ddwaf_object_is_unsigned
Returns true if the object is an unsigned integer.
ddwaf_object_set_array
Creates an array object, for sequential storage.
ddwaf_object_set_bool
Creates an object using a boolean, the resulting object will contain a boolean as opposed to a string.
ddwaf_object_set_float
Creates an object using a double, the resulting object will contain a double as opposed to a string.
ddwaf_object_set_invalid
Creates an invalid object.
ddwaf_object_set_map
Creates a map object, for key-value storage.
ddwaf_object_set_null
Creates an null object. Provides a different semantical value to invalid as it can be used to signify that a value is null rather than of an unknown type.
ddwaf_object_set_signed
Creates an object using a signed integer (64-bit). The resulting object will contain a signed integer as opposed to a string.
ddwaf_object_set_string
Creates an object from a string.
ddwaf_object_set_string_literal
Creates an object from a literal string and its length.
ddwaf_object_set_string_nocopy
Creates an object with the string pointer and length provided, without copying the string.
ddwaf_object_set_unsigned
Creates an object using an unsigned integer (64-bit). The resulting object will contain an unsigned integer as opposed to a string.
ddwaf_set_log_cb
Sets the callback to relay logging messages to the binding
ddwaf_subcontext_destroy
Performs the destruction of the subcontext, freeing the data passed to it through ddwaf_subcontext_eval using the used-defined allocator.
ddwaf_subcontext_eval
Perform a matching operation on the provided data
ddwaf_subcontext_init
Subcontext object to perform matching using the provided WAF instance.
ddwaf_synchronized_pool_allocator_init
Creates a thread-safe pool allocator. Allocations are served from internal pools sized by block class to reduce fragmentation and allocator overhead; memory freed via the corresponding ddwaf APIs is returned to the pools for reuse. This allocator can be shared across threads safely.
ddwaf_unsynchronized_pool_allocator_init
Creates a pool allocator without internal synchronization. It provides the same pooling characteristics as the synchronized variant but with lower overhead. This allocator must not be used concurrently from multiple threads unless externally synchronized.
ddwaf_user_allocator_init
Creates an allocator that forwards allocation and deallocation to user provided callbacks.

Type Aliases§

DDWAF_LOG_LEVEL
@enum DDWAF_LOG_LEVEL
DDWAF_OBJ_TYPE
@enum DDWAF_OBJ_TYPE
DDWAF_RET_CODE
@enum DDWAF_RET_CODE
ddwaf_alloc_fn_type
ddwaf_allocator
ddwaf_builder
ddwaf_context
ddwaf_free_fn_type
ddwaf_handle
ddwaf_log_cb
@typedef ddwaf_log_cb
ddwaf_object
ddwaf_subcontext
ddwaf_udata_free_fn_type

Unions§

_ddwaf_object
_ddwaf_object__bindgen_ty_1