nmsg 1.1.2
Typedefs | Enumerations
filter.h File Reference

Message filtering API. More...

Go to the source code of this file.

Typedefs

typedef nmsg_res(* nmsg_filter_message_fp) (nmsg_message_t *msg, void *user, nmsg_filter_message_verdict *vres)
 Function pointer type for a function that performs message filtering.
 

Enumerations

enum  nmsg_filter_message_verdict {
  nmsg_filter_message_verdict_DECLINED ,
  nmsg_filter_message_verdict_ACCEPT ,
  nmsg_filter_message_verdict_DROP
}
 

Detailed Description

Message filtering API.

Definition in file filter.h.

Typedef Documentation

◆ nmsg_filter_message_fp

typedef nmsg_res(* nmsg_filter_message_fp) (nmsg_message_t *msg, void *user, nmsg_filter_message_verdict *vres)

Function pointer type for a function that performs message filtering.

The filter function should read the message in 'msg' and return a filter verdict in the 'vres' parameter-return variable.

The filter function may alter the message object, or it may replace the message object with an entirely new message. If the filter function replaces the message object, it is responsible for disposing of the old message, for instance by calling nmsg_message_destroy().

Parameters
[in,out]msgPointer to message object.
[in]userNULL or a filter-specific user pointer.
[out]vresThe filter verdict.
Returns
nmsg_res_success The filtering completed and returned a verdict in 'vres'.
Any other result to indicate a fatal error.

Definition at line 72 of file filter.h.

Enumeration Type Documentation

◆ nmsg_filter_message_verdict

Enumerator
nmsg_filter_message_verdict_DECLINED 

The filter declines to handle this message for an unspecified reason, and processing should proceed as if the filter did not exist.

If part of a filter chain, filtering should proceed to the next filter in the chain.

nmsg_filter_message_verdict_ACCEPT 

The filter declares that this message should be accepted into the output stream.

If part of a filter chain, remaining filters should be short-circuited and the message passed into the output stream.

nmsg_filter_message_verdict_DROP 

The filter declares that this message should be dropped from the output stream.

If part of a filter chain, remaining filters should be short-circuited.

Definition at line 24 of file filter.h.