pub trait UserFilter: Sized {
    const METHODS: u8 = 255u8;
    const CONTINUE_IF_ERROR: bool = true;

    fn new(lua: &Lua, args: Table<'_>) -> Result<Self>;

    fn start_analyze(
        &mut self,
        lua: &Lua,
        txn: Txn<'_>,
        chn: Channel<'_>
    ) -> Result<FilterResult> { ... } fn end_analyze(
        &mut self,
        lua: &Lua,
        txn: Txn<'_>,
        chn: Channel<'_>
    ) -> Result<FilterResult> { ... } fn http_headers(
        &mut self,
        lua: &Lua,
        txn: Txn<'_>,
        msg: HttpMessage<'_>
    ) -> Result<FilterResult> { ... } fn http_payload(
        &mut self,
        lua: &Lua,
        txn: Txn<'_>,
        msg: HttpMessage<'_>
    ) -> Result<Option<usize>> { ... } fn http_end(
        &mut self,
        lua: &Lua,
        txn: Txn<'_>,
        msg: HttpMessage<'_>
    ) -> Result<FilterResult> { ... } fn register_data_filter(
        lua: &Lua,
        txn: Txn<'_>,
        chn: Channel<'_>
    ) -> Result<()> { ... } fn unregister_data_filter(
        lua: &Lua,
        txn: Txn<'_>,
        chn: Channel<'_>
    ) -> Result<()> { ... } }
Expand description

A trait that defines all required callback functions to implement filters.

Provided Associated Constants

Sets methods available for this filter. By default ALL

Continue execution if a filter callback returns an error.

Required Methods

Creates a new instance of filter.

Provided Methods

Called when the analysis starts on the channel chn.

Called when the analysis ends on the channel chn.

Called just before the HTTP payload analysis and after any processing on the HTTP message msg.

Called during the HTTP payload analysis on the HTTP message msg.

Called after the HTTP payload analysis on the HTTP message msg.

Enable the data filtering on the channel chn for the current filter. It may be called at any time from any callback functions proceeding the data analysis.

Disable the data filtering on the channel chn for the current filter. It may be called at any time from any callback functions.

Implementors