SIP-router core :: Destination blacklists.
More...
#include "ip_addr.h"
#include "parser/msg_parser.h"
#include "timer_ticks.h"
#include "cfg_core.h"
Go to the source code of this file.
Defines
-
#define DEFAULT_BLST_MAX_MEM 250
- 250 KB
- #define DEFAULT_BLST_TIMEOUT 60
- 1 min.
-
#define DST_BLACKLIST_ACCEPT 1
- add: force accept, search: force match
- #define dst_blacklist_add(err_flags, si, msg)
- adds a dst to the blacklist with default timeout.
- #define dst_blacklist_add_to(err_flags, si, msg, timeout)
- adds a dst to the blacklist.
-
#define DST_BLACKLIST_CONTINUE 0
- add: do nothing/ignore, search: ignore
-
#define DST_BLACKLIST_DENY -1
- add: deny, search: force no match
- #define dst_blacklist_su(err_flags, proto, dst, snd_flags, msg)
- adds a dst to the blacklist with default timeout, long version.
- #define dst_blacklist_su_to(err_flags, proto, dst, snd_flags, msg, timeout)
- adds a dst to the blacklist, long version.
- #define should_blacklist(err_flags, si)
- checks if blacklist should be used.
- #define should_blacklist_su(err_flags, snd_flags, proto, su)
- checks if blacklist should be used, long version.
|
|
Functions
- int blst_max_mem_fixup (void *handle, str *gname, str *name, void **val)
- KByte to Byte conversion.
- int dst_blacklist_del (struct dest_info *si, struct sip_msg *msg)
- delete an entry from the blacklist.
- int dst_blacklist_force_add_to (unsigned char err_flags, struct dest_info *si, struct sip_msg *msg, ticks_t timeout)
- force add to the blacklist.
- int dst_blacklist_force_su_to (unsigned char err_flags, unsigned char proto, union sockaddr_union *dst, struct sip_msg *msg, ticks_t timeout)
- force add to the blacklist, long version.
- void dst_blst_flush (void)
- deletes all the entries from the blacklist except the permanent ones.
Detailed Description
Module: SIP-router core
Definition in file dst_blacklist.h.
Define Documentation
| #define DEFAULT_BLST_TIMEOUT 60 |
| #define dst_blacklist_add |
( |
|
err_flags, |
|
|
|
si, |
|
|
|
msg | |
|
) |
| | |
Value:- Parameters:
-
| err_flags | - blacklist reason |
| si | - dest_info structure (dst). |
| msg | - sip msg struct. pointer if known, 0 otherwise. |
- Returns:
- >=0 on success, -1 on error.
- See also:
- dst_blacklist_add_to.
Definition at line 180 of file dst_blacklist.h.
| #define dst_blacklist_add_to |
( |
|
err_flags, |
|
|
|
si, |
|
|
|
msg, |
|
|
|
timeout | |
|
) |
| | |
Value:- Parameters:
-
| err_flags | - blacklist reason |
| si | - dest_info structure (dst). |
| msg | - sip msg struct. pointer if known, 0 otherwise. |
| timeout | - timeout in ticks. |
- Returns:
- >=0 on success, -1 on error.
Definition at line 149 of file dst_blacklist.h.
| #define dst_blacklist_su |
( |
|
err_flags, |
|
|
|
proto, |
|
|
|
dst, |
|
|
|
snd_flags, |
|
|
|
msg | |
|
) |
| | |
Value:Similar to dst_blacklist_add_to, but uses "unpacked" parameters.
- Parameters:
-
| err_flags | - blacklist reason |
| proto | - protocol. |
| dst | - sockaddr_union pointer. |
| snd_flags | - snd_flags pointer, can be 0. |
| msg | - sip msg struct. pointer if known, 0 otherwise. |
- Returns:
- >=0 on success, -1 on error.
- See also:
- dst_blacklist_su_to.
Definition at line 195 of file dst_blacklist.h.
| #define dst_blacklist_su_to |
( |
|
err_flags, |
|
|
|
proto, |
|
|
|
dst, |
|
|
|
snd_flags, |
|
|
|
msg, |
|
|
|
timeout | |
|
) |
| | |
Value:Similar to dst_blacklist_add_to, but uses "unpacked" parameters.
- Parameters:
-
| err_flags | - blacklist reason |
| proto | - protocol. |
| dst | - sockaddr_union pointer. |
| snd_flags | - snd_flags pointer, can be 0. |
| msg | - sip msg struct. pointer if known, 0 otherwise. |
| timeout | - timeout in ticks. |
- Returns:
- >=0 on success, -1 on error.
Definition at line 165 of file dst_blacklist.h.
| #define should_blacklist |
( |
|
err_flags, |
|
|
|
si | |
|
) |
| | |
Value:(cfg_get(core, core_cfg, use_dst_blacklist) && \
((err_flags) & ~blst_proto_imask[(unsigned)((si)->proto)] & \
~(si)->send_flags.blst_imask ))
- Parameters:
-
| err_flags | - blacklist reason |
| si | - filled dest_info structure pointer. |
- Returns:
- 1 if blacklist is enabled (core_cfg) and the event/error is not in the ignore list. 0 otherwise
Definition at line 121 of file dst_blacklist.h.
| #define should_blacklist_su |
( |
|
err_flags, |
|
|
|
snd_flags, |
|
|
|
proto, |
|
|
|
su | |
|
) |
| | |
Value:(cfg_get(core, core_cfg, use_dst_blacklist) && \
((err_flags) & ~blst_proto_imask[(unsigned)(proto)] & \
~((snd_flags)?((snd_flags_t*)(snd_flags))->blst_imask:0)))
- Parameters:
-
| err_flags | - blacklist reason |
| snd_flags | - snd_flags pointer, can be 0. |
| proto | - protocol, can be 0 (PROTO_NONE). |
| su | - sockaddr_union pointer, can be 0. |
- Returns:
- 1 if blacklist is enabled (core_cfg) and the event/error is not in the ignore list. 0 otherwise
Definition at line 135 of file dst_blacklist.h.
Function Documentation
| int blst_max_mem_fixup |
( |
void * |
handle, |
|
|
str * |
gname, |
|
|
str * |
name, |
|
|
void ** |
val | |
|
) |
| | |
| int dst_blacklist_del |
( |
struct dest_info * |
si, |
|
|
struct sip_msg * |
msg | |
|
) |
| | |
| int dst_blacklist_force_add_to |
( |
unsigned char |
err_flags, |
|
|
struct dest_info * |
si, |
|
|
struct sip_msg * |
msg, |
|
|
ticks_t |
timeout | |
|
) |
| | |
like function dst_blacklist_add_to, but no ignore mask or blacklist enabled checks are made.
- See also:
- dst_blacklist_add_to for the parameters and return value.
| int dst_blacklist_force_su_to |
( |
unsigned char |
err_flags, |
|
|
unsigned char |
proto, |
|
|
union sockaddr_union * |
dst, |
|
|
struct sip_msg * |
msg, |
|
|
ticks_t |
timeout | |
|
) |
| | |
like function dst_blacklist_su_to, but no ignore mask or blacklist enabled checks are made.
- See also:
- dst_blacklist_su_to for the parameters and return value.
| void dst_blst_flush |
( |
void |
|
) |
|
(which are marked with BLST_PERMANENT)