#include "ip_addr.h"
#include "str.h"
#include "locking.h"


Go to the source code of this file.
Data Structures | |
| struct | bl_head |
| struct | bl_rule |
Defines | |
| #define | BL_BY_DEFAULT (1<<2) |
| #define | BL_CORE_ID 13 |
| #define | BL_DO_EXPIRE (1<<1) |
| #define | BL_READONLY_LIST (1<<0) |
| #define | BLR_APPLY_CONTRARY (1<<0) |
Functions | |
| int | add_list_to_head (struct bl_head *elem, struct bl_rule *first, struct bl_rule *last, int truncate, int expire_limit) |
| int | add_rule_to_list (struct bl_rule **first, struct bl_rule **last, struct net *ip_net, str *body, unsigned short port, unsigned short proto, int flags) |
| adds a new rule to a list of rules | |
| int | check_against_blacklist (struct ip_addr *ip, str *text, unsigned short port, unsigned short proto) |
| static int | check_blacklists (unsigned short proto, union sockaddr_union *to, char *body_s, int body_len) |
| struct bl_head * | create_bl_head (int owner, int flags, struct bl_rule *head, struct bl_rule *tail, str *name) |
| void | destroy_black_lists (void) |
| struct bl_head * | get_bl_head_by_name (str *name) |
| int | init_black_lists (void) |
| int | mark_for_search (struct bl_head *list, unsigned int set) |
| int | preinit_black_lists (void) |
| void | reset_bl_markers (void) |
Definition in file blacklists.h.
| #define BL_BY_DEFAULT (1<<2) |
Definition at line 38 of file blacklists.h.
Referenced by create_bl_head(), and resolv_blacklist_init().
| #define BL_CORE_ID 13 |
Definition at line 65 of file blacklists.h.
| #define BL_DO_EXPIRE (1<<1) |
Definition at line 37 of file blacklists.h.
Referenced by add_list_to_head(), create_bl_head(), delete_expired_routine(), mi_print_blacklists(), and resolv_blacklist_init().
| #define BL_READONLY_LIST (1<<0) |
Definition at line 36 of file blacklists.h.
Referenced by add_list_to_head(), check_against_rule_list(), create_bl_head(), and mi_print_blacklists().
| #define BLR_APPLY_CONTRARY (1<<0) |
| int add_list_to_head | ( | struct bl_head * | elem, | |
| struct bl_rule * | first, | |||
| struct bl_rule * | last, | |||
| int | truncate, | |||
| int | expire_limit | |||
| ) |
Definition at line 488 of file blacklists.c.
References BL_DO_EXPIRE, BL_READONLY_LIST, bl_head::count_read, bl_head::count_write, bl_rule::expire_end, bl_head::first, bl_head::flags, get_ticks(), bl_head::last, _str::len, LM_CRIT, LM_DBG, bl_head::lock, bl_head::name, bl_rule::next, NULL, reload_permanent_list(), rm_dups(), _str::s, and sleep_us().
Referenced by get_next_su().
| int add_rule_to_list | ( | struct bl_rule ** | first, | |
| struct bl_rule ** | last, | |||
| struct net * | ip_net, | |||
| str * | body, | |||
| unsigned short | port, | |||
| unsigned short | proto, | |||
| int | flags | |||
| ) |
adds a new rule to a list of rules
Definition at line 339 of file blacklists.c.
References bl_rule::body, bl_rule::expire_end, bl_rule::flags, ip_class_compare(), bl_rule::ip_net, _str::len, LM_ERR, bl_rule::next, no_shm, NULL, pkg_malloc, bl_rule::port, bl_rule::proto, _str::s, and shm_malloc().
Referenced by get_next_su(), and init_black_lists().
| int check_against_blacklist | ( | struct ip_addr * | ip, | |
| str * | text, | |||
| unsigned short | port, | |||
| unsigned short | proto | |||
| ) |
Definition at line 665 of file blacklists.c.
References bl_marker, check_against_rule_list(), and used_heads.
Referenced by check_blacklists().
| static int check_blacklists | ( | unsigned short | proto, | |
| union sockaddr_union * | to, | |||
| char * | body_s, | |||
| int | body_len | |||
| ) | [inline, static] |
Definition at line 95 of file blacklists.h.
References check_against_blacklist(), _str::len, port, _str::s, su2ip_addr(), and su_getport().
Referenced by forward_request(), and t_forward_nonack().
| struct bl_head* create_bl_head | ( | int | owner, | |
| int | flags, | |||
| struct bl_rule * | head, | |||
| struct bl_rule * | tail, | |||
| str * | name | |||
| ) | [read] |
Definition at line 154 of file blacklists.c.
References BL_BY_DEFAULT, bl_default_marker, BL_DO_EXPIRE, BL_READONLY_LIST, bl_head::first, bl_head::flags, get_bl_head_by_name(), bl_head::last, _str::len, LM_CRIT, LM_ERR, lock, max_heads, bl_head::name, no_shm, NULL, bl_head::owner, pkg_malloc, _str::s, shm_free, shm_malloc(), and used_heads.
Referenced by init_black_lists(), and resolv_blacklist_init().
| void destroy_black_lists | ( | void | ) |
Definition at line 218 of file blacklists.c.
References bl_head::first, bl_head::last, lock, bl_rule::next, no_shm, NULL, shm_free, and used_heads.
Referenced by cleanup().
Definition at line 573 of file blacklists.c.
References _str::len, bl_head::name, NULL, _str::s, and used_heads.
Referenced by create_bl_head(), and fix_actions().
| int init_black_lists | ( | void | ) |
Definition at line 81 of file blacklists.c.
References add_rule_to_list(), bl_default_marker, bl_rule::body, create_bl_head(), delete_expired_routine(), bl_head::first, bl_rule::flags, bl_rule::ip_net, LM_CRIT, LM_ERR, max_heads, bl_head::name, bl_rule::next, no_shm, NULL, bl_head::owner, pkg_free, bl_rule::port, bl_rule::proto, register_mi_mod(), register_timer(), shm_malloc(), and used_heads.
Referenced by main().
| int mark_for_search | ( | struct bl_head * | list, | |
| unsigned int | set | |||
| ) |
| int preinit_black_lists | ( | void | ) |
Definition at line 64 of file blacklists.c.
References LM_ERR, max_heads, NULL, pkg_malloc, and used_heads.
Referenced by main().
| void reset_bl_markers | ( | void | ) |
Definition at line 611 of file blacklists.c.
References bl_default_marker, and bl_marker.
Referenced by run_top_route().
1.5.6