Table of Contents
List of Examples
blst_add
usageblst_add_retry_after
usageblst_del
usageblst_is_blocklisted
usageblst_set_ignore
usageblst_clear_ignore
usageTable of Contents
Adds the source of the current message to the blocklist for
timeout
seconds. If timeout is missing or 0
it uses the default blocklist timeout
(dst_blocklist_expire
).
Example 1.1. blst_add
usage
... if (src_ip==10.0.0.0/9) blst_add(30); # 30 s else blst_add(); # use default blocklist timeout ...
Adds the source of the current message to the blocklist for
the time interval specified in the Retry-After
header.
If the Retry-After header is missing, it will
fail (returns false).
If the Retry-After value is less than
min
, then min
seconds will be
used instead.
If the Retry-After value is greater than
max
, then max
seconds will be
used instead.
Example 1.2. blst_add_retry_after
usage
... # on_reply route if (msg_status==503){ # blocklist 503 source for Retry-After seconds if (! blst_add_retry_after(30, 3600)) blst_add(60); # if no retry_after header add it for 60s } ...
Removes the source of the current message from the blocklist. If the address is not present in the blocklist at the time of the call it returns false.
Returns true if the source of the current message is blocklisted.
Example 1.4. blst_is_blocklisted
usage
... if (blst_is_blocklisted()){ log("message from a blocklisted source"); drop; } ...
Set errors that will not be taken into account when deciding whether to blocklist a destination for the current message or a local reply to the current message.
blst_set_ignore(..)
works for forwarding the
current message and blst_rpl_set_ignore(...)
works for local replies to the current message.
The variants of these functions with no parameters will ignore everything (equivalent to passing 0xff).
The flags are stored internally as a bitmask, and are applied by bitwise ANDing them together. The following flags are available:
blst_503
.
Clears blocklist ignore flags previously set by the corresponding
blst_set_ignore(...)
or
blst_rpl_set_ignore(...)
functions.
See also blst_set_ignore
.