Defines | Functions

dst_blacklist.h File Reference

SIP-router core :: Destination blacklists. More...

#include "ip_addr.h"
#include "parser/msg_parser.h"
#include "timer_ticks.h"
#include "cfg_core.h"
Include dependency graph for dst_blacklist.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

flags:

Functions


Detailed Description

Module: SIP-router core

Definition in file dst_blacklist.h.


Define Documentation

#define DEFAULT_BLST_TIMEOUT   60

Definition at line 43 of file dst_blacklist.h.

#define dst_blacklist_add (   err_flags,
  si,
  msg 
)
Value:
dst_blacklist_add_to(err_flags, si, msg, \
                                                        S_TO_TICKS(cfg_get(core, core_cfg, blst_timeout)))
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:
(should_blacklist(err_flags, si)? \
                dst_blacklist_force_add_to((err_flags), (si), (msg), (timeout))\
                : 0)
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:
dst_blacklist_su_to(err_flags, proto, dst, snd_flags, msg, \
                                                        S_TO_TICKS(cfg_get(core, core_cfg, blst_timeout)))

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:
(should_blacklist_su(err_flags, snd_flags, proto, dst) ? \
                dst_blacklist_force_su_to((err_flags), (proto), (dst), (msg), \
                                                                        (timeout))\
                : 0)

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)