Browse code

core: switch to use blocklist structures and functions

Daniel-Constantin Mierla authored on 30/10/2020 09:25:09
Showing 17 changed files
... ...
@@ -333,16 +333,16 @@ AUTO_BIND_IPV6		auto_bind_ipv6
333 333
 BIND_IPV6_LINK_LOCAL	bind_ipv6_link_local
334 334
 IPV6_HEX_STYLE		ipv6_hex_style
335 335
 
336
-/* blacklist */
337
-DST_BLST_INIT	dst_blacklist_init
338
-USE_DST_BLST		use_dst_blacklist
339
-DST_BLST_MEM		dst_blacklist_mem
340
-DST_BLST_TTL		dst_blacklist_expire|dst_blacklist_ttl
341
-DST_BLST_GC_INT		dst_blacklist_gc_interval
342
-DST_BLST_UDP_IMASK	dst_blacklist_udp_imask
343
-DST_BLST_TCP_IMASK	dst_blacklist_tcp_imask
344
-DST_BLST_TLS_IMASK	dst_blacklist_tls_imask
345
-DST_BLST_SCTP_IMASK	dst_blacklist_sctp_imask
336
+/* blocklist */
337
+DST_BLST_INIT	dst_blocklist_init
338
+USE_DST_BLST		use_dst_blocklist
339
+DST_BLST_MEM		dst_blocklist_mem
340
+DST_BLST_TTL		dst_blocklist_expire|dst_blocklist_ttl
341
+DST_BLST_GC_INT		dst_blocklist_gc_interval
342
+DST_BLST_UDP_IMASK	dst_blocklist_udp_imask
343
+DST_BLST_TCP_IMASK	dst_blocklist_tcp_imask
344
+DST_BLST_TLS_IMASK	dst_blocklist_tls_imask
345
+DST_BLST_SCTP_IMASK	dst_blocklist_sctp_imask
346 346
 
347 347
 IP_FREE_BIND		ip_free_bind|ipfreebind|ip_nonlocal_bind
348 348
 
... ...
@@ -109,10 +109,10 @@
109 109
 	#define IF_NAPTR(x) warn("dns naptr support not compiled in")
110 110
 #endif
111 111
 
112
-#ifdef USE_DST_BLACKLIST
113
-	#define IF_DST_BLACKLIST(x) x
112
+#ifdef USE_DST_BLOCKLIST
113
+	#define IF_DST_BLOCKLIST(x) x
114 114
 #else
115
-	#define IF_DST_BLACKLIST(x) warn("dst blacklist support not compiled in")
115
+	#define IF_DST_BLOCKLIST(x) warn("dst blocklist support not compiled in")
116 116
 #endif
117 117
 
118 118
 #ifdef USE_SCTP
... ...
@@ -362,7 +362,7 @@ extern char *default_routename;
362 362
 
363 363
 %token IPV6_HEX_STYLE
364 364
 
365
-/*blacklist*/
365
+/*blocklist*/
366 366
 %token DST_BLST_INIT
367 367
 %token USE_DST_BLST
368 368
 %token DST_BLST_MEM
... ...
@@ -889,36 +889,36 @@ assign_stm:
889 889
 	| IPV6_HEX_STYLE error { yyerror("string value expected"); }
890 890
 	| BIND_IPV6_LINK_LOCAL EQUAL NUMBER {sr_bind_ipv6_link_local = $3;}
891 891
 	| BIND_IPV6_LINK_LOCAL error { yyerror("boolean value expected"); }
892
-	| DST_BLST_INIT EQUAL NUMBER   { IF_DST_BLACKLIST(dst_blacklist_init=$3); }
892
+	| DST_BLST_INIT EQUAL NUMBER   { IF_DST_BLOCKLIST(dst_blocklist_init=$3); }
893 893
 	| DST_BLST_INIT error { yyerror("boolean value expected"); }
894 894
 	| USE_DST_BLST EQUAL NUMBER {
895
-		IF_DST_BLACKLIST(default_core_cfg.use_dst_blacklist=$3);
895
+		IF_DST_BLOCKLIST(default_core_cfg.use_dst_blocklist=$3);
896 896
 	}
897 897
 	| USE_DST_BLST error { yyerror("boolean value expected"); }
898 898
 	| DST_BLST_MEM EQUAL NUMBER {
899
-		IF_DST_BLACKLIST(default_core_cfg.blst_max_mem=$3);
899
+		IF_DST_BLOCKLIST(default_core_cfg.blst_max_mem=$3);
900 900
 	}
901 901
 	| DST_BLST_MEM error { yyerror("boolean value expected"); }
902 902
 	| DST_BLST_TTL EQUAL NUMBER {
903
-		IF_DST_BLACKLIST(default_core_cfg.blst_timeout=$3);
903
+		IF_DST_BLOCKLIST(default_core_cfg.blst_timeout=$3);
904 904
 	}
905 905
 	| DST_BLST_TTL error { yyerror("boolean value expected"); }
906
-	| DST_BLST_GC_INT EQUAL NUMBER { IF_DST_BLACKLIST(blst_timer_interval=$3);}
906
+	| DST_BLST_GC_INT EQUAL NUMBER { IF_DST_BLOCKLIST(blst_timer_interval=$3);}
907 907
 	| DST_BLST_GC_INT error { yyerror("boolean value expected"); }
908 908
 	| DST_BLST_UDP_IMASK EQUAL NUMBER {
909
-		IF_DST_BLACKLIST(default_core_cfg.blst_udp_imask=$3);
909
+		IF_DST_BLOCKLIST(default_core_cfg.blst_udp_imask=$3);
910 910
 	}
911 911
 	| DST_BLST_UDP_IMASK error { yyerror("number(flags) expected"); }
912 912
 	| DST_BLST_TCP_IMASK EQUAL NUMBER {
913
-		IF_DST_BLACKLIST(default_core_cfg.blst_tcp_imask=$3);
913
+		IF_DST_BLOCKLIST(default_core_cfg.blst_tcp_imask=$3);
914 914
 	}
915 915
 	| DST_BLST_TCP_IMASK error { yyerror("number(flags) expected"); }
916 916
 	| DST_BLST_TLS_IMASK EQUAL NUMBER {
917
-		IF_DST_BLACKLIST(default_core_cfg.blst_tls_imask=$3);
917
+		IF_DST_BLOCKLIST(default_core_cfg.blst_tls_imask=$3);
918 918
 	}
919 919
 	| DST_BLST_TLS_IMASK error { yyerror("number(flags) expected"); }
920 920
 	| DST_BLST_SCTP_IMASK EQUAL NUMBER {
921
-		IF_DST_BLACKLIST(default_core_cfg.blst_sctp_imask=$3);
921
+		IF_DST_BLOCKLIST(default_core_cfg.blst_sctp_imask=$3);
922 922
 	}
923 923
 	| DST_BLST_SCTP_IMASK error { yyerror("number(flags) expected"); }
924 924
 	| IP_FREE_BIND EQUAL intno { _sr_ip_free_bind=$3; }
... ...
@@ -40,8 +40,8 @@
40 40
  */
41 41
 
42 42
 #include "dprint.h"
43
-#ifdef USE_DST_BLACKLIST
44
-#include "dst_blacklist.h"
43
+#ifdef USE_DST_BLOCKLIST
44
+#include "dst_blocklist.h"
45 45
 #endif
46 46
 #include "resolve.h"
47 47
 #ifdef USE_DNS_CACHE
... ...
@@ -60,9 +60,9 @@ struct cfg_group_core default_core_cfg = {
60 60
 	L_WARN, 	/*!<  print only msg. < L_WARN */
61 61
 	LOG_DAEMON,	/*!< log_facility -- see syslog(3) */
62 62
 	L_DBG+1,    /*!< memdbg */
63
-#ifdef USE_DST_BLACKLIST
64
-	/* blacklist */
65
-	0, /*!< dst blacklist is disabled by default */
63
+#ifdef USE_DST_BLOCKLIST
64
+	/* blocklist */
65
+	0, /*!< dst blocklist is disabled by default */
66 66
 	DEFAULT_BLST_TIMEOUT,
67 67
 	DEFAULT_BLST_MAX_MEM,
68 68
 	0, /* blst_udp_imask */
... ...
@@ -186,23 +186,23 @@ cfg_def_t core_cfg_def[] = {
186 186
 		"syslog facility, see \"man 3 syslog\""},
187 187
 	{"memdbg",		CFG_VAR_INT|CFG_ATOMIC,	0, 0, 0, 0,
188 188
 		"log level for memory debugging messages"},
189
-#ifdef USE_DST_BLACKLIST
190
-	/* blacklist */
191
-	{"use_dst_blacklist",	CFG_VAR_INT,	0, 1, use_dst_blacklist_fixup, 0,
192
-		"enable/disable destination blacklisting"},
193
-	{"dst_blacklist_expire",	CFG_VAR_INT,	0, 0, 0, 0,
194
-		"how much time (in s) a blacklisted destination is kept in the list"},
195
-	{"dst_blacklist_mem",	CFG_VAR_INT,	0, 0, blst_max_mem_fixup, 0,
196
-		"maximum shared memory amount (in KB) used for keeping the blacklisted"
189
+#ifdef USE_DST_BLOCKLIST
190
+	/* blocklist */
191
+	{"use_dst_blocklist",	CFG_VAR_INT,	0, 1, use_dst_blocklist_fixup, 0,
192
+		"enable/disable destination blocklisting"},
193
+	{"dst_blocklist_expire",	CFG_VAR_INT,	0, 0, 0, 0,
194
+		"how much time (in s) a blocklisted destination is kept in the list"},
195
+	{"dst_blocklist_mem",	CFG_VAR_INT,	0, 0, blst_max_mem_fixup, 0,
196
+		"maximum shared memory amount (in KB) used for keeping the blocklisted"
197 197
 			" destinations"},
198
-	{"dst_blacklist_udp_imask", CFG_VAR_INT, 0, 0, 0, blst_reinit_ign_masks,
199
-		"blacklist event ignore mask for UDP"},
200
-	{"dst_blacklist_tcp_imask", CFG_VAR_INT, 0, 0, 0, blst_reinit_ign_masks,
201
-		"blacklist event ignore mask for TCP"},
202
-	{"dst_blacklist_tls_imask", CFG_VAR_INT, 0, 0, 0, blst_reinit_ign_masks,
203
-		"blacklist event ignore mask for TLS"},
204
-	{"dst_blacklist_sctp_imask", CFG_VAR_INT, 0, 0, 0, blst_reinit_ign_masks,
205
-		"blacklist event ignore mask for SCTP"},
198
+	{"dst_blocklist_udp_imask", CFG_VAR_INT, 0, 0, 0, blst_reinit_ign_masks,
199
+		"blocklist event ignore mask for UDP"},
200
+	{"dst_blocklist_tcp_imask", CFG_VAR_INT, 0, 0, 0, blst_reinit_ign_masks,
201
+		"blocklist event ignore mask for TCP"},
202
+	{"dst_blocklist_tls_imask", CFG_VAR_INT, 0, 0, 0, blst_reinit_ign_masks,
203
+		"blocklist event ignore mask for TLS"},
204
+	{"dst_blocklist_sctp_imask", CFG_VAR_INT, 0, 0, 0, blst_reinit_ign_masks,
205
+		"blocklist event ignore mask for SCTP"},
206 206
 #endif
207 207
 	/* resolver */
208 208
 #ifdef USE_DNS_CACHE
... ...
@@ -48,12 +48,12 @@ struct cfg_group_core {
48 48
 	int	debug;
49 49
 	int	log_facility;
50 50
 	int memdbg; /*!< log level for memory debugging messages */
51
-#ifdef USE_DST_BLACKLIST
52
-	/* blacklist */
53
-	int	use_dst_blacklist; /*!< 1 if blacklist is enabled */
54
-	unsigned int	blst_timeout; /*!< blacklist entry ttl */
51
+#ifdef USE_DST_BLOCKLIST
52
+	/* blocklist */
53
+	int	use_dst_blocklist; /*!< 1 if blocklist is enabled */
54
+	unsigned int	blst_timeout; /*!< blocklist entry ttl */
55 55
 	unsigned int	blst_max_mem; /*!< maximum memory used for the
56
-					blacklist entries */
56
+					blocklist entries */
57 57
 	unsigned int	blst_udp_imask;  /* ignore mask for udp */
58 58
 	unsigned int	blst_tcp_imask;  /* ignore mask for tcp */
59 59
 	unsigned int	blst_tls_imask;  /* ignore mask for tls */
... ...
@@ -185,7 +185,7 @@ static const char* dns_get_server_state_doc[] = {
185 185
 
186 186
 #endif /* DNS_WATCHDOG_SUPPORT */
187 187
 #endif /* USE_DNS_CACHE */
188
-#ifdef USE_DST_BLACKLIST
188
+#ifdef USE_DST_BLOCKLIST
189 189
 void dst_blst_debug(rpc_t* rpc, void* ctx);
190 190
 void dst_blst_mem_info(rpc_t* rpc, void* ctx);
191 191
 void dst_blst_view(rpc_t* rpc, void* ctx);
... ...
@@ -193,33 +193,33 @@ void dst_blst_delete_all(rpc_t* rpc, void* ctx);
193 193
 void dst_blst_add(rpc_t* rpc, void* ctx);
194 194
 
195 195
 static const char* dst_blst_mem_info_doc[] = {
196
-	"dst blacklist memory usage info.",  /* Documentation string */
196
+	"dst blocklist memory usage info.",  /* Documentation string */
197 197
 	0                                    /* Method signature(s) */
198 198
 };
199 199
 static const char* dst_blst_debug_doc[] = {
200
-	"dst blacklist debug info.",  /* Documentation string */
200
+	"dst blocklist debug info.",  /* Documentation string */
201 201
 	0                               /* Method signature(s) */
202 202
 };
203 203
 static const char* dst_blst_view_doc[] = {
204
-	"dst blacklist dump in human-readable format.",  /* Documentation string */
204
+	"dst blocklist dump in human-readable format.",  /* Documentation string */
205 205
 	0                               /* Method signature(s) */
206 206
 };
207 207
 static const char* dst_blst_delete_all_doc[] = {
208
-	"Deletes all the entries from the dst blacklist except the permanent ones.",  /* Documentation string */
208
+	"Deletes all the entries from the dst blocklist except the permanent ones.",  /* Documentation string */
209 209
 	0                               /* Method signature(s) */
210 210
 };
211 211
 static const char* dst_blst_add_doc[] = {
212
-	"Adds a new entry to the dst blacklist.",  /* Documentation string */
212
+	"Adds a new entry to the dst blocklist.",  /* Documentation string */
213 213
 	0                               /* Method signature(s) */
214 214
 };
215
-#ifdef USE_DST_BLACKLIST_STATS
215
+#ifdef USE_DST_BLOCKLIST_STATS
216 216
 void dst_blst_stats_get(rpc_t* rpc, void* ctx);
217 217
 
218 218
 static const char* dst_blst_stats_get_doc[] = {
219
-	"returns the dst blacklist measurement counters.",
219
+	"returns the dst blocklist measurement counters.",
220 220
 	0
221 221
 };
222
-#endif /* USE_DST_BLACKLIST_STATS */
222
+#endif /* USE_DST_BLOCKLIST_STATS */
223 223
 
224 224
 #endif
225 225
 
... ...
@@ -1146,20 +1146,20 @@ static rpc_export_t core_rpc_methods[] = {
1146 1146
 		dns_get_server_state_doc, 0 },
1147 1147
 #endif
1148 1148
 #endif
1149
-#ifdef USE_DST_BLACKLIST
1150
-	{"dst_blacklist.mem_info",  dst_blst_mem_info,     dst_blst_mem_info_doc,
1149
+#ifdef USE_DST_BLOCKLIST
1150
+	{"dst_blocklist.mem_info",  dst_blst_mem_info,     dst_blst_mem_info_doc,
1151 1151
 		0	},
1152
-	{"dst_blacklist.debug",    dst_blst_debug,         dst_blst_debug_doc,
1152
+	{"dst_blocklist.debug",    dst_blst_debug,         dst_blst_debug_doc,
1153 1153
 		0	},
1154
-	{"dst_blacklist.view",     dst_blst_view,         dst_blst_view_doc,
1154
+	{"dst_blocklist.view",     dst_blst_view,         dst_blst_view_doc,
1155 1155
 		0	},
1156
-	{"dst_blacklist.delete_all", dst_blst_delete_all, dst_blst_delete_all_doc,
1156
+	{"dst_blocklist.delete_all", dst_blst_delete_all, dst_blst_delete_all_doc,
1157 1157
 		0	},
1158
-	{"dst_blacklist.add",      dst_blst_add,          dst_blst_add_doc,
1158
+	{"dst_blocklist.add",      dst_blst_add,          dst_blst_add_doc,
1159 1159
 		0	},
1160
-#ifdef USE_DST_BLACKLIST_STATS
1161
-	{"dst_blacklist.stats_get", dst_blst_stats_get, dst_blst_stats_get_doc, 0},
1162
-#endif /* USE_DST_BLACKLIST_STATS */
1160
+#ifdef USE_DST_BLOCKLIST_STATS
1161
+	{"dst_blocklist.stats_get", dst_blst_stats_get, dst_blst_stats_get_doc, 0},
1162
+#endif /* USE_DST_BLOCKLIST_STATS */
1163 1163
 #endif
1164 1164
 	{0, 0, 0, 0}
1165 1165
 };
... ...
@@ -124,7 +124,7 @@ static const char* dns_str_errors[]={
124 124
 	"bad A or AAAA entry",
125 125
 	"unresolvable A or AAAA request",
126 126
 	"invalid ip in A or AAAA record",
127
-	"blacklisted ip",
127
+	"blocklisted ip",
128 128
 	"name too long ", /* try again with a shorter name */
129 129
 	"ip AF mismatch", /* address family mismatch */
130 130
 	"unresolvable NAPTR request",
... ...
@@ -77,7 +77,7 @@ enum dns_errors{
77 77
 					E_DNS_BAD_IP_ENTRY,
78 78
 					E_DNS_NO_IP /**< unresolvable a or aaaa records*/,
79 79
 					E_DNS_BAD_IP /**< the ip is invalid */,
80
-					E_DNS_BLACKLIST_IP /**< the ip is blacklisted */,
80
+					E_DNS_BLOCKLIST_IP /**< the ip is blocklisted */,
81 81
 					E_DNS_NAME_TOO_LONG /**< try again with a shorter name */,
82 82
 					E_DNS_AF_MISMATCH /**< ipv4 or ipv6 only requested, but
83 83
 										 name contains an ip addr. of the
... ...
@@ -112,7 +112,7 @@ const char* dns_strerror(int err);
112 112
 /*@} */
113 113
 
114 114
 
115
-/** @name ip blacklist error flags */
115
+/** @name ip blocklist error flags */
116 116
 /*@{ */
117 117
 #define IP_ERR_BAD_DST      2 /* destination is marked as bad (e.g. bad ip) */
118 118
 #define IP_ERR_SND          3 /* send error while using this as destination */
... ...
@@ -28,9 +28,9 @@
28 28
  */
29 29
 
30 30
 
31
-#ifdef USE_DST_BLACKLIST
31
+#ifdef USE_DST_BLOCKLIST
32 32
 
33
-#include "dst_blacklist.h"
33
+#include "dst_blocklist.h"
34 34
 #include "globals.h"
35 35
 #include "cfg_core.h"
36 36
 #include "mem/shm_mem.h"
... ...
@@ -43,7 +43,7 @@
43 43
 #include "rpc.h"
44 44
 #include "compiler_opt.h"
45 45
 #include "resolve.h" /* for str2ip */
46
-#ifdef USE_DST_BLACKLIST_STATS
46
+#ifdef USE_DST_BLOCKLIST_STATS
47 47
 #include "pt.h"
48 48
 #endif
49 49
 
... ...
@@ -115,42 +115,42 @@ struct dst_blst_lst_head{
115 115
 #endif
116 116
 };
117 117
 
118
-int dst_blacklist_init=1; /* if 0, the dst blacklist is not initialized at startup */
118
+int dst_blocklist_init=1; /* if 0, the dst blocklist is not initialized at startup */
119 119
 static struct timer_ln* blst_timer_h=0;
120 120
 
121 121
 static volatile unsigned int* blst_mem_used=0;
122 122
 unsigned int blst_timer_interval=DEFAULT_BLST_TIMER_INTERVAL;
123 123
 struct dst_blst_lst_head* dst_blst_hash=0;
124 124
 
125
-#ifdef USE_DST_BLACKLIST_STATS
126
-struct t_dst_blacklist_stats* dst_blacklist_stats=0;
125
+#ifdef USE_DST_BLOCKLIST_STATS
126
+struct t_dst_blocklist_stats* dst_blocklist_stats=0;
127 127
 #endif
128 128
 
129
-/* blacklist per protocol event ignore mask array */
129
+/* blocklist per protocol event ignore mask array */
130 130
 unsigned blst_proto_imask[PROTO_LAST+1];
131 131
 
132
-#ifdef DST_BLACKLIST_HOOKS
132
+#ifdef DST_BLOCKLIST_HOOKS
133 133
 
134
-/* there 2 types of callbacks supported: on add new entry to the blacklist
135
- *  (DST_BLACKLIST_ADD_CB) and on blacklist search (DST_BLACKLIST_SEARCH_CB).
134
+/* there 2 types of callbacks supported: on add new entry to the blocklist
135
+ *  (DST_BLOCKLIST_ADD_CB) and on blocklist search (DST_BLOCKLIST_SEARCH_CB).
136 136
  *  Both of them take a struct dest_info*, a flags pointer(unsigned char*),
137 137
  *  and a struct sip_msg* as parameters. The flags can be changed.
138 138
  *  A callback should return one of:
139
- *    DST_BLACKLIST_CONTINUE - do nothing, let other callbacks run
140
- *    DST_BLACKLIST_ACCEPT   - for blacklist add: force accept immediately,
141
- *                             for blacklist search: force match and use
142
- *                              the flags as the blacklist search return.
139
+ *    DST_BLOCKLIST_CONTINUE - do nothing, let other callbacks run
140
+ *    DST_BLOCKLIST_ACCEPT   - for blocklist add: force accept immediately,
141
+ *                             for blocklist search: force match and use
142
+ *                              the flags as the blocklist search return.
143 143
  *                              ( so the flags should be set to some valid
144 144
  *                                non zero BLST flags value )
145
- *   DST_BLACKLIST_DENY      - for blacklist add: don't allow adding the
146
- *                              destination to the blacklist.
147
- *                             for blacklist search: force return not found
145
+ *   DST_BLOCKLIST_DENY      - for blocklist add: don't allow adding the
146
+ *                              destination to the blocklist.
147
+ *                             for blocklist search: force return not found
148 148
  */
149 149
 
150 150
 #define MAX_BLST_HOOKS 1
151 151
 
152 152
 struct blst_callbacks_lst{
153
-	struct blacklist_hook* hooks;
153
+	struct blocklist_hook* hooks;
154 154
 	unsigned int max_hooks;
155 155
 	int last_idx;
156 156
 };
... ...
@@ -163,12 +163,12 @@ static int init_blst_callback_lst(struct blst_callbacks_lst*  cb_lst, int max)
163 163
 
164 164
 	cb_lst->max_hooks=MAX_BLST_HOOKS;
165 165
 	cb_lst->last_idx=0;
166
-	cb_lst->hooks=pkg_malloc(cb_lst->max_hooks*sizeof(struct blacklist_hook));
166
+	cb_lst->hooks=pkg_malloc(cb_lst->max_hooks*sizeof(struct blocklist_hook));
167 167
 	if (cb_lst->hooks==0) {
168 168
 		PKG_MEM_ERROR;
169 169
 		return -1;
170 170
 	}
171
-	memset(cb_lst->hooks, 0, cb_lst->max_hooks*sizeof(struct blacklist_hook));
171
+	memset(cb_lst->hooks, 0, cb_lst->max_hooks*sizeof(struct blocklist_hook));
172 172
 	return 0;
173 173
 }
174 174
 
... ...
@@ -189,14 +189,14 @@ static void destroy_blst_callback_lst(struct blst_callbacks_lst* cb_lst)
189 189
 }
190 190
 
191 191
 
192
-static void destroy_blacklist_hooks()
192
+static void destroy_blocklist_hooks()
193 193
 {
194 194
 	destroy_blst_callback_lst(&blst_add_cb);
195 195
 	destroy_blst_callback_lst(&blst_search_cb);
196 196
 }
197 197
 
198 198
 
199
-static int init_blacklist_hooks()
199
+static int init_blocklist_hooks()
200 200
 {
201 201
 
202 202
 	if (init_blst_callback_lst(&blst_add_cb, MAX_BLST_HOOKS)!=0)
... ...
@@ -206,7 +206,7 @@ static int init_blacklist_hooks()
206 206
 	return 0;
207 207
 error:
208 208
 	LM_ERR("failure initializing internal lists\n");
209
-	destroy_blacklist_hooks();
209
+	destroy_blocklist_hooks();
210 210
 	return -1;
211 211
 }
212 212
 
... ...
@@ -216,38 +216,38 @@ error:
216 216
 /* allocates a new hook
217 217
  * returns 0 on success and -1 on error
218 218
  * must be called from mod init (from the main process, before forking)*/
219
-int register_blacklist_hook(struct blacklist_hook *h, int type)
219
+int register_blocklist_hook(struct blocklist_hook *h, int type)
220 220
 {
221 221
 	struct blst_callbacks_lst* cb_lst;
222
-	struct blacklist_hook* tmp;
222
+	struct blocklist_hook* tmp;
223 223
 	int new_max_hooks;
224 224
 
225
-	if (dst_blacklist_init==0) {
226
-		LM_ERR("blacklist is turned off, "
225
+	if (dst_blocklist_init==0) {
226
+		LM_ERR("blocklist is turned off, "
227 227
 			"the hook cannot be registered\n");
228 228
 		goto error;
229 229
 	}
230 230
 
231 231
 	switch(type){
232
-		case DST_BLACKLIST_ADD_CB:
232
+		case DST_BLOCKLIST_ADD_CB:
233 233
 			cb_lst=&blst_add_cb;
234 234
 			break;
235
-		case DST_BLACKLIST_SEARCH_CB:
235
+		case DST_BLOCKLIST_SEARCH_CB:
236 236
 			cb_lst=&blst_search_cb;
237 237
 			break;
238 238
 		default:
239
-			BUG("register_blacklist_hook: invalid type %d\n", type);
239
+			BUG("register_blocklist_hook: invalid type %d\n", type);
240 240
 			goto error;
241 241
 	}
242 242
 	if (cb_lst==0 || cb_lst->hooks==0 || cb_lst->max_hooks==0){
243
-		BUG("register_blacklist_hook: intialization error\n");
243
+		BUG("register_blocklist_hook: intialization error\n");
244 244
 		goto error;
245 245
 	}
246 246
 
247 247
 	if (cb_lst->last_idx >= cb_lst->max_hooks){
248 248
 		new_max_hooks=2*cb_lst->max_hooks;
249 249
 		tmp=pkg_realloc(cb_lst->hooks,
250
-				new_max_hooks*sizeof(struct blacklist_hook));
250
+				new_max_hooks*sizeof(struct blocklist_hook));
251 251
 		if (tmp==0){
252 252
 			goto error;
253 253
 		}
... ...
@@ -256,7 +256,7 @@ int register_blacklist_hook(struct blacklist_hook *h, int type)
256 256
 		 * overwritten anyway) */
257 257
 		memset(&cb_lst->hooks[cb_lst->max_hooks+1], 0,
258 258
 					(new_max_hooks-cb_lst->max_hooks-1)*
259
-						sizeof(struct blacklist_hook));
259
+						sizeof(struct blocklist_hook));
260 260
 		cb_lst->max_hooks=new_max_hooks;
261 261
 	}
262 262
 	cb_lst->hooks[cb_lst->last_idx]=*h;
... ...
@@ -267,29 +267,29 @@ error:
267 267
 }
268 268
 
269 269
 
270
-inline static int blacklist_run_hooks(struct blst_callbacks_lst *cb_lst,
270
+inline static int blocklist_run_hooks(struct blst_callbacks_lst *cb_lst,
271 271
 							struct dest_info* si, unsigned char* flags,
272 272
 							struct sip_msg* msg)
273 273
 {
274 274
 	int r;
275 275
 	int ret;
276 276
 
277
-	ret=DST_BLACKLIST_CONTINUE; /* default, if no hook installed accept
278
-								blacklist operation */
277
+	ret=DST_BLOCKLIST_CONTINUE; /* default, if no hook installed accept
278
+								blocklist operation */
279 279
 	if (likely(cb_lst->last_idx==0))
280 280
 		return ret;
281 281
 	for (r=0; r<cb_lst->last_idx; r++){
282 282
 		ret=cb_lst->hooks[r].on_blst_action(si, flags, msg);
283
-		if (ret!=DST_BLACKLIST_CONTINUE) break;
283
+		if (ret!=DST_BLOCKLIST_CONTINUE) break;
284 284
 	}
285 285
 	return ret;
286 286
 }
287 287
 
288 288
 
289
-#endif /* DST_BLACKLIST_HOOKS */
289
+#endif /* DST_BLOCKLIST_HOOKS */
290 290
 
291 291
 
292
-/** init per protocol blacklist event ignore masks.
292
+/** init per protocol blocklist event ignore masks.
293 293
  * @return 0 on success, < 0 on error.
294 294
  */
295 295
 int blst_init_ign_masks(void)
... ...
@@ -350,7 +350,7 @@ inline static unsigned short dst_blst_hash_no(unsigned char proto,
350 350
 
351 351
 
352 352
 
353
-void destroy_dst_blacklist()
353
+void destroy_dst_blocklist()
354 354
 {
355 355
 	int r;
356 356
 	struct dst_blst_entry** crt;
... ...
@@ -395,34 +395,34 @@ void destroy_dst_blacklist()
395 395
 		shm_free((void*)blst_mem_used);
396 396
 		blst_mem_used=0;
397 397
 	}
398
-#ifdef DST_BLACKLIST_HOOKS
399
-	destroy_blacklist_hooks();
398
+#ifdef DST_BLOCKLIST_HOOKS
399
+	destroy_blocklist_hooks();
400 400
 #endif
401 401
 
402
-#ifdef USE_DST_BLACKLIST_STATS
403
-	if (dst_blacklist_stats)
404
-		shm_free(dst_blacklist_stats);
402
+#ifdef USE_DST_BLOCKLIST_STATS
403
+	if (dst_blocklist_stats)
404
+		shm_free(dst_blocklist_stats);
405 405
 #endif
406 406
 }
407 407
 
408 408
 
409 409
 
410
-int init_dst_blacklist()
410
+int init_dst_blocklist()
411 411
 {
412 412
 	int ret;
413 413
 #ifdef BLST_LOCK_PER_BUCKET
414 414
 	int r;
415 415
 #endif
416 416
 
417
-	if (dst_blacklist_init==0) {
418
-		/* the dst blacklist is turned off */
419
-		default_core_cfg.use_dst_blacklist=0;
417
+	if (dst_blocklist_init==0) {
418
+		/* the dst blocklist is turned off */
419
+		default_core_cfg.use_dst_blocklist=0;
420 420
 		return 0;
421 421
 	}
422 422
 
423 423
 	ret=-1;
424
-#ifdef DST_BLACKLIST_HOOKS
425
-	if (init_blacklist_hooks()!=0){
424
+#ifdef DST_BLOCKLIST_HOOKS
425
+	if (init_blocklist_hooks()!=0){
426 426
 		ret=E_OUT_OF_MEM;
427 427
 		goto error;
428 428
 	}
... ...
@@ -497,26 +497,26 @@ int init_dst_blacklist()
497 497
 	}
498 498
 	return 0;
499 499
 error:
500
-	destroy_dst_blacklist();
500
+	destroy_dst_blocklist();
501 501
 	return ret;
502 502
 }
503 503
 
504
-#ifdef USE_DST_BLACKLIST_STATS
505
-int init_dst_blacklist_stats(int iproc_num)
504
+#ifdef USE_DST_BLOCKLIST_STATS
505
+int init_dst_blocklist_stats(int iproc_num)
506 506
 {
507
-	/* do not initialize the stats array if the dst blacklist will not be used */
508
-	if (dst_blacklist_init==0) return 0;
507
+	/* do not initialize the stats array if the dst blocklist will not be used */
508
+	if (dst_blocklist_init==0) return 0;
509 509
 
510 510
 	/* if it is already initialized */
511
-	if (dst_blacklist_stats)
512
-		shm_free(dst_blacklist_stats);
511
+	if (dst_blocklist_stats)
512
+		shm_free(dst_blocklist_stats);
513 513
 
514
-	dst_blacklist_stats=shm_malloc(sizeof(*dst_blacklist_stats) * iproc_num);
515
-	if (dst_blacklist_stats==0){
514
+	dst_blocklist_stats=shm_malloc(sizeof(*dst_blocklist_stats) * iproc_num);
515
+	if (dst_blocklist_stats==0){
516 516
 	        SHM_MEM_ERROR;
517 517
 		return E_OUT_OF_MEM;
518 518
 	}
519
-	memset(dst_blacklist_stats, 0, sizeof(*dst_blacklist_stats) * iproc_num);
519
+	memset(dst_blocklist_stats, 0, sizeof(*dst_blocklist_stats) * iproc_num);
520 520
 
521 521
 	return 0;
522 522
 }
... ...
@@ -524,7 +524,7 @@ int init_dst_blacklist_stats(int iproc_num)
524 524
 
525 525
 /* must be called with the lock held
526 526
  * struct dst_blst_entry** head, struct dst_blst_entry* e */
527
-#define dst_blacklist_lst_add(head, e)\
527
+#define dst_blocklist_lst_add(head, e)\
528 528
 do{ \
529 529
 	(e)->next=*(head); \
530 530
 	*(head)=(e); \
... ...
@@ -533,10 +533,10 @@ do{ \
533 533
 
534 534
 
535 535
 /* must be called with the lock held
536
- * returns a pointer to the blacklist entry if found, 0 otherwise
536
+ * returns a pointer to the blocklist entry if found, 0 otherwise
537 537
  * it also deletes expired elements (expire<=now) as it searches
538 538
  * proto==PROTO_NONE = wildcard */
539
-inline static struct dst_blst_entry* _dst_blacklist_lst_find(
539
+inline static struct dst_blst_entry* _dst_blocklist_lst_find(
540 540
 												unsigned short hash,
541 541
 												struct ip_addr* ip,
542 542
 												unsigned char proto,
... ...
@@ -577,7 +577,7 @@ inline static struct dst_blst_entry* _dst_blacklist_lst_find(
577 577
  * returns 1 if a matching entry was deleted, 0 otherwise
578 578
  * it also deletes expired elements (expire<=now) as it searches
579 579
  * proto==PROTO_NONE = wildcard */
580
-inline static int _dst_blacklist_del(
580
+inline static int _dst_blocklist_del(
581 581
 												unsigned short hash,
582 582
 												struct ip_addr* ip,
583 583
 												unsigned char proto,
... ...
@@ -631,7 +631,7 @@ inline static int _dst_blacklist_del(
631 631
  *  returns: number of deleted entries
632 632
  *  This function should be called periodically from a timer
633 633
  */
634
-inline static int dst_blacklist_clean_expired(unsigned int target,
634
+inline static int dst_blocklist_clean_expired(unsigned int target,
635 635
 									  ticks_t delta,
636 636
 									  ticks_t timeout)
637 637
 {
... ...
@@ -690,17 +690,17 @@ skip:
690 690
 /* timer */
691 691
 static ticks_t blst_timer(ticks_t ticks, struct timer_ln* tl, void* data)
692 692
 {
693
-	dst_blacklist_clean_expired(0, 0, 2); /*spend max. 2 ticks*/
693
+	dst_blocklist_clean_expired(0, 0, 2); /*spend max. 2 ticks*/
694 694
 	return (ticks_t)(-1);
695 695
 }
696 696
 
697 697
 
698 698
 
699
-/* adds a proto ip:port combination to the blacklist
700
- * returns 0 on success, -1 on error (blacklist full -- would use more then
699
+/* adds a proto ip:port combination to the blocklist
700
+ * returns 0 on success, -1 on error (blocklist full -- would use more then
701 701
  *  blst:_max_mem, or out of shm. mem.)
702 702
  */
703
-inline static int dst_blacklist_add_ip(unsigned char err_flags,
703
+inline static int dst_blocklist_add_ip(unsigned char err_flags,
704 704
 									unsigned char proto,
705 705
 									struct ip_addr* ip, unsigned short port,
706 706
 									ticks_t timeout)
... ...
@@ -723,20 +723,20 @@ inline static int dst_blacklist_add_ip(unsigned char err_flags,
723 723
 	hash=dst_blst_hash_no(proto, ip, port);
724 724
 	/* check if the entry already exists */
725 725
 	LOCK_BLST(hash);
726
-		e=_dst_blacklist_lst_find(hash, ip, proto, port, now);
726
+		e=_dst_blocklist_lst_find(hash, ip, proto, port, now);
727 727
 		if (e){
728 728
 			e->flags|=err_flags;
729 729
 			e->expire=now+timeout; /* update the timeout */
730 730
 		}else{
731 731
 			if (unlikely((*blst_mem_used+size) >=
732 732
 					cfg_get(core, core_cfg, blst_max_mem))){
733
-#ifdef USE_DST_BLACKLIST_STATS
734
-				dst_blacklist_stats[process_no].bkl_lru_cnt++;
733
+#ifdef USE_DST_BLOCKLIST_STATS
734
+				dst_blocklist_stats[process_no].bkl_lru_cnt++;
735 735
 #endif
736 736
 				UNLOCK_BLST(hash);
737 737
 				/* first try to free some memory  (~ 12%), but don't
738 738
 				 * spend more then 250 ms*/
739
-				dst_blacklist_clean_expired(*blst_mem_used/16*14, 0,
739
+				dst_blocklist_clean_expired(*blst_mem_used/16*14, 0,
740 740
 															MS_TO_TICKS(250));
741 741
 				if (unlikely(*blst_mem_used+size >=
742 742
 						cfg_get(core, core_cfg, blst_max_mem))){
... ...
@@ -759,7 +759,7 @@ inline static int dst_blacklist_add_ip(unsigned char err_flags,
759 759
 			memcpy(e->ip, ip->u.addr, ip->len);
760 760
 			e->expire=now+timeout; /* update the timeout */
761 761
 			e->next=0;
762
-			dst_blacklist_lst_add(&dst_blst_hash[hash].first, e);
762
+			dst_blocklist_lst_add(&dst_blst_hash[hash].first, e);
763 763
 			BLST_HASH_STATS_INC(hash);
764 764
 		}
765 765
 	UNLOCK_BLST(hash);
... ...
@@ -769,8 +769,8 @@ error:
769 769
 
770 770
 
771 771
 
772
-/* if no blacklisted returns 0, else returns the blacklist flags */
773
-inline static int dst_is_blacklisted_ip(unsigned char proto,
772
+/* if no blocklisted returns 0, else returns the blocklist flags */
773
+inline static int dst_is_blocklisted_ip(unsigned char proto,
774 774
 										struct ip_addr* ip,
775 775
 										unsigned short port)
776 776
 {
... ...
@@ -784,7 +784,7 @@ inline static int dst_is_blacklisted_ip(unsigned char proto,
784 784
 	hash=dst_blst_hash_no(proto, ip, port);
785 785
 	if (unlikely(dst_blst_hash[hash].first)){
786 786
 		LOCK_BLST(hash);
787
-			e=_dst_blacklist_lst_find(hash, ip, proto, port, now);
787
+			e=_dst_blocklist_lst_find(hash, ip, proto, port, now);
788 788
 			if (e){
789 789
 				ret=e->flags;
790 790
 			}
... ...
@@ -795,81 +795,81 @@ inline static int dst_is_blacklisted_ip(unsigned char proto,
795 795
 
796 796
 
797 797
 
798
-/** add dst to the blacklist, specifying the timeout.
798
+/** add dst to the blocklist, specifying the timeout.
799 799
  * @param err_flags - reason (bitmap)
800 800
  * @param si - destination (protocol, ip and port)
801
- * @param msg - sip message that triggered the blacklisting (can be 0 if 
801
+ * @param msg - sip message that triggered the blocklisting (can be 0 if 
802 802
  *               not known)
803 803
  * @param timeout - timeout in ticks
804 804
  * @return 0 on success, -1 on error
805 805
  */
806
-int dst_blacklist_force_add_to(unsigned char err_flags,  struct dest_info* si,
806
+int dst_blocklist_force_add_to(unsigned char err_flags,  struct dest_info* si,
807 807
 								struct sip_msg* msg, ticks_t timeout)
808 808
 {
809 809
 	struct ip_addr ip;
810 810
 
811
-#ifdef DST_BLACKLIST_HOOKS
812
-	if (unlikely (blacklist_run_hooks(&blst_add_cb, si, &err_flags, msg) ==
813
-					DST_BLACKLIST_DENY))
811
+#ifdef DST_BLOCKLIST_HOOKS
812
+	if (unlikely (blocklist_run_hooks(&blst_add_cb, si, &err_flags, msg) ==
813
+					DST_BLOCKLIST_DENY))
814 814
 		return 0;
815 815
 #endif
816 816
 	su2ip_addr(&ip, &si->to);
817
-	return dst_blacklist_add_ip(err_flags, si->proto, &ip,
817
+	return dst_blocklist_add_ip(err_flags, si->proto, &ip,
818 818
 								su_getport(&si->to), timeout);
819 819
 }
820 820
 
821 821
 
822 822
 
823
-/** add dst to the blacklist, specifying the timeout.
824
- * (like @function dst_blacklist_force_add_to)= above, but uses 
823
+/** add dst to the blocklist, specifying the timeout.
824
+ * (like @function dst_blocklist_force_add_to)= above, but uses
825 825
  * (proto, sockaddr_union) instead of struct dest_info)
826 826
  */
827
-int dst_blacklist_force_su_to(unsigned char err_flags, unsigned char proto,
827
+int dst_blocklist_force_su_to(unsigned char err_flags, unsigned char proto,
828 828
 								union sockaddr_union* dst,
829 829
 								struct sip_msg* msg, ticks_t timeout)
830 830
 {
831 831
 	struct ip_addr ip;
832
-#ifdef DST_BLACKLIST_HOOKS
832
+#ifdef DST_BLOCKLIST_HOOKS
833 833
 	struct dest_info si;
834
-	
834
+
835 835
 	init_dest_info(&si);
836 836
 	si.to=*dst;
837 837
 	si.proto=proto;
838
-	if (unlikely (blacklist_run_hooks(&blst_add_cb, &si, &err_flags, msg) ==
839
-					DST_BLACKLIST_DENY))
838
+	if (unlikely (blocklist_run_hooks(&blst_add_cb, &si, &err_flags, msg) ==
839
+					DST_BLOCKLIST_DENY))
840 840
 		return 0;
841 841
 #endif
842 842
 	su2ip_addr(&ip, dst);
843
-	return dst_blacklist_add_ip(err_flags, proto, &ip,
843
+	return dst_blocklist_add_ip(err_flags, proto, &ip,
844 844
 								su_getport(dst), timeout);
845 845
 }
846 846
 
847 847
 
848 848
 
849
-int dst_is_blacklisted(struct dest_info* si, struct sip_msg* msg)
849
+int dst_is_blocklisted(struct dest_info* si, struct sip_msg* msg)
850 850
 {
851 851
 	int ires;
852 852
 	struct ip_addr ip;
853
-#ifdef DST_BLACKLIST_HOOKS
853
+#ifdef DST_BLOCKLIST_HOOKS
854 854
 	unsigned char err_flags;
855 855
 	int action;
856 856
 #endif
857 857
 	su2ip_addr(&ip, &si->to);
858 858
 
859
-#ifdef DST_BLACKLIST_HOOKS
859
+#ifdef DST_BLOCKLIST_HOOKS
860 860
 	err_flags=0;
861
-	if (unlikely((action=(blacklist_run_hooks(&blst_search_cb, si, &err_flags, msg))
862
-					) != DST_BLACKLIST_CONTINUE)){
863
-		if (action==DST_BLACKLIST_DENY)
861
+	if (unlikely((action=(blocklist_run_hooks(&blst_search_cb, si, &err_flags, msg))
862
+					) != DST_BLOCKLIST_CONTINUE)){
863
+		if (action==DST_BLOCKLIST_DENY)
864 864
 			return 0;
865
-		else  /* if (action==DST_BLACKLIST_ACCEPT) */
865
+		else  /* if (action==DST_BLOCKLIST_ACCEPT) */
866 866
 			return err_flags;
867 867
 	}
868 868
 #endif
869
-	ires=dst_is_blacklisted_ip(si->proto, &ip, su_getport(&si->to));
870
-#ifdef USE_DST_BLACKLIST_STATS
869
+	ires=dst_is_blocklisted_ip(si->proto, &ip, su_getport(&si->to));
870
+#ifdef USE_DST_BLOCKLIST_STATS
871 871
 	if (ires)
872
-		dst_blacklist_stats[process_no].bkl_hit_cnt++;
872
+		dst_blocklist_stats[process_no].bkl_hit_cnt++;
873 873
 #endif
874 874
 	return ires;
875 875
 }
... ...
@@ -877,7 +877,7 @@ int dst_is_blacklisted(struct dest_info* si, struct sip_msg* msg)
877 877
 
878 878
 
879 879
 /* returns 1 if the entry was deleted, 0 if not found */
880
-int dst_blacklist_del(struct dest_info* si, struct sip_msg* msg)
880
+int dst_blocklist_del(struct dest_info* si, struct sip_msg* msg)
881 881
 {
882 882
 	unsigned short hash;
883 883
 	struct ip_addr ip;
... ...
@@ -892,7 +892,7 @@ int dst_blacklist_del(struct dest_info* si, struct sip_msg* msg)
892 892
 	hash=dst_blst_hash_no(si->proto, &ip, port);
893 893
 	if (unlikely(dst_blst_hash[hash].first)){
894 894
 		LOCK_BLST(hash);
895
-			ret=_dst_blacklist_del(hash, &ip, si->proto, port, now);
895
+			ret=_dst_blocklist_del(hash, &ip, si->proto, port, now);
896 896
 		UNLOCK_BLST(hash);
897 897
 	}
898 898
 	return ret;
... ...
@@ -903,8 +903,8 @@ int dst_blacklist_del(struct dest_info* si, struct sip_msg* msg)
903 903
 /* rpc functions */
904 904
 void dst_blst_mem_info(rpc_t* rpc, void* ctx)
905 905
 {
906
-	if (!cfg_get(core, core_cfg, use_dst_blacklist)){
907
-		rpc->fault(ctx, 500, "dst blacklist support disabled");
906
+	if (!cfg_get(core, core_cfg, use_dst_blocklist)){
907
+		rpc->fault(ctx, 500, "dst blocklist support disabled");
908 908
 		return;
909 909
 	}
910 910
 	rpc->add(ctx, "dd",  *blst_mem_used, cfg_get(core, core_cfg, blst_max_mem));
... ...
@@ -913,7 +913,7 @@ void dst_blst_mem_info(rpc_t* rpc, void* ctx)
913 913
 
914 914
 
915 915
 
916
-#ifdef USE_DST_BLACKLIST_STATS
916
+#ifdef USE_DST_BLOCKLIST_STATS
917 917
 
918 918
 static unsigned long  stat_sum(int ivar, int breset) {
919 919
 	unsigned long isum=0;
... ...
@@ -922,14 +922,14 @@ static unsigned long  stat_sum(int ivar, int breset) {
922 922
 	for (; i1 < get_max_procs(); i1++)
923 923
 		switch (ivar) {
924 924
 			case 0:
925
-				isum+=dst_blacklist_stats[i1].bkl_hit_cnt;
925
+				isum+=dst_blocklist_stats[i1].bkl_hit_cnt;
926 926
 				if (breset)
927
-					dst_blacklist_stats[i1].bkl_hit_cnt=0;
927
+					dst_blocklist_stats[i1].bkl_hit_cnt=0;
928 928
 				break;
929 929
 			case 1:
930
-				isum+=dst_blacklist_stats[i1].bkl_lru_cnt;
930
+				isum+=dst_blocklist_stats[i1].bkl_lru_cnt;
931 931
 				if (breset)
932
-					dst_blacklist_stats[i1].bkl_lru_cnt=0;
932
+					dst_blocklist_stats[i1].bkl_lru_cnt=0;
933 933
 				break;
934 934
 		}
935 935
 
... ...
@@ -943,46 +943,46 @@ void dst_blst_stats_get(rpc_t* rpc, void* c)
943 943
 	void *handle;
944 944
 	int found=0,i=0;
945 945
 	int reset=0;
946
-	char* dst_blacklist_stats_names[] = {
946
+	char* dst_blocklist_stats_names[] = {
947 947
 		"bkl_hit_cnt",
948 948
 		"bkl_lru_cnt",
949 949
 		NULL
950 950
 	};
951 951
 	
952
-	if (!cfg_get(core, core_cfg, use_dst_blacklist)){
953
-		rpc->fault(c, 500, "dst blacklist support disabled");
952
+	if (!cfg_get(core, core_cfg, use_dst_blocklist)){
953
+		rpc->fault(c, 500, "dst blocklist support disabled");
954 954
 		return;
955 955
 	}
956 956
 	if (rpc->scan(c, "s", &name) < 0)
957 957
 		return;
958 958
 	if (rpc->scan(c, "d", &reset) < 0)
959 959
 		return;
960
-	if (!strcasecmp(name, DST_BLACKLIST_ALL_STATS)) {
960
+	if (!strcasecmp(name, DST_BLOCKLIST_ALL_STATS)) {
961 961
 		/* dump all the dns cache stat values */
962 962
 		rpc->add(c, "{", &handle);
963
-		for (i=0; dst_blacklist_stats_names[i]; i++)
963
+		for (i=0; dst_blocklist_stats_names[i]; i++)
964 964
 			rpc->struct_add(handle, "d",
965
-							dst_blacklist_stats_names[i],
965
+							dst_blocklist_stats_names[i],
966 966
 							stat_sum(i, reset));
967 967
 
968 968
 		found=1;
969 969
 	} else {
970
-		for (i=0; dst_blacklist_stats_names[i]; i++)
971
-			if (!strcasecmp(dst_blacklist_stats_names[i], name)) {
970
+		for (i=0; dst_blocklist_stats_names[i]; i++)
971
+			if (!strcasecmp(dst_blocklist_stats_names[i], name)) {
972 972
 			rpc->add(c, "{", &handle);
973 973
 			rpc->struct_add(handle, "d",
974
-							dst_blacklist_stats_names[i],
974
+							dst_blocklist_stats_names[i],
975 975
 							stat_sum(i, reset));
976 976
 			found=1;
977 977
 			break;
978 978
 			}
979 979
 	}
980 980
 	if(!found)
981
-		rpc->fault(c, 500, "unknown dst blacklist stat parameter");
981
+		rpc->fault(c, 500, "unknown dst blocklist stat parameter");
982 982
 
983 983
 	return;
984 984
 }
985
-#endif /* USE_DST_BLACKLIST_STATS */
985
+#endif /* USE_DST_BLOCKLIST_STATS */
986 986
 
987 987
 /* only for debugging, it helds the lock too long for "production" use */
988 988
 void dst_blst_debug(rpc_t* rpc, void* ctx)
... ...
@@ -992,8 +992,8 @@ void dst_blst_debug(rpc_t* rpc, void* ctx)
992 992
 	ticks_t now;
993 993
 	struct ip_addr ip;
994 994
 
995
-	if (!cfg_get(core, core_cfg, use_dst_blacklist)){
996
-		rpc->fault(ctx, 500, "dst blacklist support disabled");
995
+	if (!cfg_get(core, core_cfg, use_dst_blocklist)){
996
+		rpc->fault(ctx, 500, "dst blocklist support disabled");
997 997
 		return;
998 998
 	}
999 999
 	now=get_ticks_raw();
... ...
@@ -1022,8 +1022,8 @@ void dst_blst_hash_stats(rpc_t* rpc, void* ctx)
1022 1022
 
1023 1023
 	n=0;
1024 1024
 #endif
1025
-	if (!cfg_get(core, core_cfg, use_dst_blacklist)){
1026
-		rpc->fault(ctx, 500, "dst blacklist support disabled");
1025
+	if (!cfg_get(core, core_cfg, use_dst_blocklist)){
1026
+		rpc->fault(ctx, 500, "dst blocklist support disabled");
1027 1027
 		return;
1028 1028
 	}
1029 1029
 		for(h=0; h<DST_BLST_HASH_SIZE; h++){
... ...
@@ -1038,7 +1038,7 @@ void dst_blst_hash_stats(rpc_t* rpc, void* ctx)
1038 1038
 		}
1039 1039
 }
1040 1040
 
1041
-/* dumps the content of the blacklist in a human-readable format */
1041
+/* dumps the content of the blocklist in a human-readable format */
1042 1042
 void dst_blst_view(rpc_t* rpc, void* ctx)
1043 1043
 {
1044 1044
 	int h;
... ...
@@ -1047,8 +1047,8 @@ void dst_blst_view(rpc_t* rpc, void* ctx)
1047 1047
 	ticks_t now;
1048 1048
 	struct ip_addr ip;
1049 1049
 
1050
-	if (!cfg_get(core, core_cfg, use_dst_blacklist)){
1051
-		rpc->fault(ctx, 500, "dst blacklist support disabled");
1050
+	if (!cfg_get(core, core_cfg, use_dst_blocklist)){
1051
+		rpc->fault(ctx, 500, "dst blocklist support disabled");
1052 1052
 		return;
1053 1053
 	}
1054 1054
 	now=get_ticks_raw();
... ...
@@ -1073,7 +1073,7 @@ void dst_blst_view(rpc_t* rpc, void* ctx)
1073 1073
 }
1074 1074
 
1075 1075
 
1076
-/* deletes all the entries from the blacklist except the permanent ones
1076
+/* deletes all the entries from the blocklist except the permanent ones
1077 1077
  * (which are marked with BLST_PERMANENT)
1078 1078
  */
1079 1079
 void dst_blst_flush(void)
... ...
@@ -1104,14 +1104,14 @@ void dst_blst_flush(void)
1104 1104
 /* rpc wrapper function for dst_blst_flush() */
1105 1105
 void dst_blst_delete_all(rpc_t* rpc, void* ctx)
1106 1106
 {
1107
-	if (!cfg_get(core, core_cfg, use_dst_blacklist)){
1108
-		rpc->fault(ctx, 500, "dst blacklist support disabled");
1107
+	if (!cfg_get(core, core_cfg, use_dst_blocklist)){
1108
+		rpc->fault(ctx, 500, "dst blocklist support disabled");
1109 1109
 		return;
1110 1110
 	}
1111 1111
 	dst_blst_flush();
1112 1112
 }
1113 1113
 
1114
-/* Adds a new entry to the blacklist */
1114
+/* Adds a new entry to the blocklist */
1115 1115
 void dst_blst_add(rpc_t* rpc, void* ctx)
1116 1116
 {
1117 1117
 	str ip;
... ...
@@ -1119,8 +1119,8 @@ void dst_blst_add(rpc_t* rpc, void* ctx)
1119 1119
 	unsigned char err_flags;
1120 1120
 	struct ip_addr *ip_addr;
1121 1121
 
1122
-	if (!cfg_get(core, core_cfg, use_dst_blacklist)){
1123
-		rpc->fault(ctx, 500, "dst blacklist support disabled");
1122
+	if (!cfg_get(core, core_cfg, use_dst_blocklist)){
1123
+		rpc->fault(ctx, 500, "dst blocklist support disabled");
1124 1124
 		return;
1125 1125
 	}
1126 1126
 	if (rpc->scan(ctx, "Sddd", &ip, &port, &proto, &flags) < 4)
... ...
@@ -1149,18 +1149,18 @@ void dst_blst_add(rpc_t* rpc, void* ctx)
1149 1149
 		return;
1150 1150
 	}
1151 1151
 
1152
-	if (dst_blacklist_add_ip(err_flags, proto, ip_addr, port, 
1152
+	if (dst_blocklist_add_ip(err_flags, proto, ip_addr, port, 
1153 1153
 				    S_TO_TICKS(cfg_get(core, core_cfg, blst_timeout))))
1154
-		rpc->fault(ctx, 400, "Failed to add the entry to the blacklist");
1154
+		rpc->fault(ctx, 400, "Failed to add the entry to the blocklist");
1155 1155
 }
1156 1156
 
1157
-/* fixup function for use_dst_blacklist
1158
- * verifies that dst_blacklist_init is set to 1
1157
+/* fixup function for use_dst_blocklist
1158
+ * verifies that dst_blocklist_init is set to 1
1159 1159
  */
1160
-int use_dst_blacklist_fixup(void *handle, str *gname, str *name, void **val)
1160
+int use_dst_blocklist_fixup(void *handle, str *gname, str *name, void **val)
1161 1161
 {
1162
-	if ((int)(long)(*val) && !dst_blacklist_init) {
1163
-		LM_ERR("dst blacklist is turned off by dst_blacklist_init=0, "
1162
+	if ((int)(long)(*val) && !dst_blocklist_init) {
1163
+		LM_ERR("dst blocklist is turned off by dst_blocklist_init=0, "
1164 1164
 			"it cannot be enabled runtime.\n");
1165 1165
 		return -1;
1166 1166
 	}
... ...
@@ -1186,5 +1186,5 @@ void blst_reinit_ign_masks(str* gname, str* name)
1186 1186
 }
1187 1187
 
1188 1188
 
1189
-#endif /* USE_DST_BLACKLIST */
1189
+#endif /* USE_DST_BLOCKLIST */
1190 1190
 
... ...
@@ -18,15 +18,15 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19 19
  */
20 20
 
21
-/** Kamailio core :: Destination blacklists.
21
+/** Kamailio core :: Destination blocklists.
22 22
  * @file
23 23
  * @author andrei, Gergo
24 24
  * @ingroup core
25 25
  * Module: @ref core
26 26
  */
27 27
 
28
-#ifndef dst_black_list_h
29
-#define dst_black_list_h
28
+#ifndef dst_block_list_h
29
+#define dst_block_list_h
30 30
 
31 31
 #include "ip_addr.h"
32 32
 #include "parser/msg_parser.h"
... ...
@@ -49,21 +49,21 @@
49 49
 #define BLST_PERMANENT		(1<<7)  /**< never deleted, never expires */
50 50
 /*@} */
51 51
 
52
-/* uncomment the define above to enable blacklist callbacks support */
53
-/*#define DST_BLACKLIST_HOOKS*/
52
+/* uncomment the define above to enable blocklist callbacks support */
53
+/*#define DST_BLOCKLIST_HOOKS*/
54 54
 
55
-#define DST_BLACKLIST_CONTINUE 0 /**< add: do nothing/ignore, search: ignore */
56
-#define DST_BLACKLIST_ACCEPT 1   /**< add: force accept, search: force match */
57
-#define DST_BLACKLIST_DENY  -1   /**< add: deny, search: force no match */
55
+#define DST_BLOCKLIST_CONTINUE 0 /**< add: do nothing/ignore, search: ignore */
56
+#define DST_BLOCKLIST_ACCEPT 1   /**< add: force accept, search: force match */
57
+#define DST_BLOCKLIST_DENY  -1   /**< add: deny, search: force no match */
58 58
 
59
-#define DST_BLACKLIST_ADD_CB 1
60
-#define DST_BLACKLIST_SEARCH_CB 2
59
+#define DST_BLOCKLIST_ADD_CB 1
60
+#define DST_BLOCKLIST_SEARCH_CB 2
61 61
 
62 62
 
63 63
 extern unsigned blst_proto_imask[PROTO_LAST+1];
64 64
 
65
-#ifdef DST_BLACKLIST_HOOKS
66
-struct blacklist_hook{
65
+#ifdef DST_BLOCKLIST_HOOKS
66
+struct blocklist_hook{
67 67
 	/* WARNING: msg might be NULL, and it might point to shared memory
68 68
 	 * without locking, do not modify it! msg can be used typically for checking
69 69
 	 * the message flags with isflagset() */
... ...
@@ -73,81 +73,81 @@ struct blacklist_hook{
73 73
 	void (*destroy)(void);
74 74
 };
75 75
 
76
-int register_blacklist_hook(struct blacklist_hook *h, int type);
77
-#endif /* DST_BLACKLIST_HOOKS */
76
+int register_blocklist_hook(struct blocklist_hook *h, int type);
77
+#endif /* DST_BLOCKLIST_HOOKS */
78 78
 
79
-int init_dst_blacklist(void);
80
-#ifdef USE_DST_BLACKLIST_STATS
81
-int init_dst_blacklist_stats(int iproc_num);
82
-#define DST_BLACKLIST_ALL_STATS "bkl_all_stats"
79
+int init_dst_blocklist(void);
80
+#ifdef USE_DST_BLOCKLIST_STATS
81
+int init_dst_blocklist_stats(int iproc_num);
82
+#define DST_BLOCKLIST_ALL_STATS "bkl_all_stats"
83 83
 #endif
84
-void destroy_dst_blacklist(void);
84
+void destroy_dst_blocklist(void);
85 85
 
86 86
 
87
-/** force add to the blacklist.
88
- * like function dst_blacklist_add_to, but no ignore mask or
89
- * blacklist enabled checks are made.
90
- * @see dst_blacklist_add_to for the parameters and return value.
87
+/** force add to the blocklist.
88
+ * like function dst_blocklist_add_to, but no ignore mask or
89
+ * blocklist enabled checks are made.
90
+ * @see dst_blocklist_add_to for the parameters and return value.
91 91
  */
92
-int dst_blacklist_force_add_to(unsigned char err_flags, struct dest_info* si,
92
+int dst_blocklist_force_add_to(unsigned char err_flags, struct dest_info* si,
93 93
 								struct sip_msg* msg, ticks_t timeout);
94 94
 
95
-/** force add to the blacklist, long version.
96
- * like function dst_blacklist_su_to, but no ignore mask or
97
- * blacklist enabled checks are made.
98
- * @see dst_blacklist_su_to for the parameters and return value.
95
+/** force add to the blocklist, long version.
96
+ * like function dst_blocklist_su_to, but no ignore mask or
97
+ * blocklist enabled checks are made.
98
+ * @see dst_blocklist_su_to for the parameters and return value.
99 99
  */
100
-int dst_blacklist_force_su_to(	unsigned char err_flags,
100
+int dst_blocklist_force_su_to(	unsigned char err_flags,
101 101
 								unsigned char proto,
102 102
 								union sockaddr_union* dst,
103 103
 								struct sip_msg* msg,
104 104
 								ticks_t timeout);
105 105
 
106 106
 
107
-/** checks if blacklist should be used.
108
-  * @param  err_flags - blacklist reason
107
+/** checks if blocklist should be used.
108
+  * @param  err_flags - blocklist reason
109 109
   * @param si - filled dest_info structure pointer.
110
-  * @return 1 if blacklist is enabled (core_cfg) and the event/error
110
+  * @return 1 if blocklist is enabled (core_cfg) and the event/error
111 111
   *           is not in the ignore list.
112 112
   *         0 otherwise
113 113
   */
114
-#define should_blacklist(err_flags, si) \
115
-	(cfg_get(core, core_cfg, use_dst_blacklist) && \
114
+#define should_blocklist(err_flags, si) \
115
+	(cfg_get(core, core_cfg, use_dst_blocklist) && \
116 116
 		((err_flags) & ~blst_proto_imask[(unsigned)((si)->proto)] & \
117 117
 		 			   ~(si)->send_flags.blst_imask ))
118 118
 
119 119
 
120
-/** checks if blacklist should be used, long version.
121
-  * @param err_flags - blacklist reason
120
+/** checks if blocklist should be used, long version.
121
+  * @param err_flags - blocklist reason
122 122
   * @param snd_flags - snd_flags pointer, can be 0.
123 123
   * @param proto - protocol, can be 0 (PROTO_NONE).
124 124
   * @param su  - sockaddr_union pointer, can be 0.
125
-  * @return 1 if blacklist is enabled (core_cfg) and the event/error
125
+  * @return 1 if blocklist is enabled (core_cfg) and the event/error
126 126
   *           is not in the ignore list. 0 otherwise
127 127
   */
128
-#define should_blacklist_su(err_flags, snd_flags, proto, su) \
129
-	(cfg_get(core, core_cfg, use_dst_blacklist) && \
128
+#define should_blocklist_su(err_flags, snd_flags, proto, su) \
129
+	(cfg_get(core, core_cfg, use_dst_blocklist) && \
130 130
 		((err_flags) & ~blst_proto_imask[(unsigned)(proto)] & \
131 131
 		 			~((snd_flags)?((snd_flags_t*)(snd_flags))->blst_imask:0)))
132 132
 
133 133
 
134
-/** adds a dst to the blacklist.
134
+/** adds a dst to the blocklist.
135 135
  *
136
- * @param  err_flags - blacklist reason
136
+ * @param  err_flags - blocklist reason
137 137
  * @param si  - dest_info structure (dst).
138 138
  * @param msg - sip msg struct. pointer if known, 0 otherwise.
139 139
  * @param timeout - timeout in ticks.
140 140
  * @return >=0 on success, -1 on error.
141 141
  */
142
-#define dst_blacklist_add_to(err_flags, si, msg, timeout) \
143
-	(should_blacklist(err_flags, si)? \
144
-		dst_blacklist_force_add_to((err_flags), (si), (msg), (timeout))\
142
+#define dst_blocklist_add_to(err_flags, si, msg, timeout) \
143
+	(should_blocklist(err_flags, si)? \
144
+		dst_blocklist_force_add_to((err_flags), (si), (msg), (timeout))\
145 145
 		: 0)
146 146
 
147 147
 
148
-/** adds a dst to the blacklist, long version.
149
- * Similar to dst_blacklist_add_to, but uses "unpacked" parameters.
150
- * @param  err_flags - blacklist reason
148
+/** adds a dst to the blocklist, long version.
149
+ * Similar to dst_blocklist_add_to, but uses "unpacked" parameters.
150
+ * @param  err_flags - blocklist reason
151 151
  * @param proto - protocol.
152 152
  * @param dst  - sockaddr_union pointer.
153 153
  * @param snd_flags - snd_flags pointer, can be 0.
... ...
@@ -155,51 +155,51 @@ int dst_blacklist_force_su_to(	unsigned char err_flags,
155 155
  * @param timeout - timeout in ticks.
156 156
  * @return >=0 on success, -1 on error.
157 157
  */
158
-#define dst_blacklist_su_to(err_flags, proto, dst, snd_flags, msg, timeout) \
159
-	(should_blacklist_su(err_flags, snd_flags, proto, dst) ? \
160
-		dst_blacklist_force_su_to((err_flags), (proto), (dst), (msg), \
158
+#define dst_blocklist_su_to(err_flags, proto, dst, snd_flags, msg, timeout) \
159
+	(should_blocklist_su(err_flags, snd_flags, proto, dst) ? \
160
+		dst_blocklist_force_su_to((err_flags), (proto), (dst), (msg), \
161 161
 									(timeout))\
162 162
 		: 0)
163 163
 
164 164
 
165
-/** adds a dst to the blacklist with default timeout.
165
+/** adds a dst to the blocklist with default timeout.
166 166
  *
167
- * @param  err_flags - blacklist reason
167
+ * @param  err_flags - blocklist reason
168 168
  * @param si  - dest_info structure (dst).
169 169
  * @param msg - sip msg struct. pointer if known, 0 otherwise.
170 170
  * @return >=0 on success, -1 on error.
171
- * @see dst_blacklist_add_to.
171
+ * @see dst_blocklist_add_to.
172 172
  */
173
-#define dst_blacklist_add(err_flags, si, msg) \
174
-	dst_blacklist_add_to(err_flags, si, msg, \
173
+#define dst_blocklist_add(err_flags, si, msg) \
174
+	dst_blocklist_add_to(err_flags, si, msg, \
175 175
 							S_TO_TICKS(cfg_get(core, core_cfg, blst_timeout)))
176 176
 
177 177
 
178
-/** adds a dst to the blacklist with default timeout, long version.
179
- * Similar to dst_blacklist_add_to, but uses "unpacked" parameters.
180
- * @param  err_flags - blacklist reason
178
+/** adds a dst to the blocklist with default timeout, long version.
179
+ * Similar to dst_blocklist_add_to, but uses "unpacked" parameters.
180
+ * @param  err_flags - blocklist reason
181 181
  * @param proto - protocol.
182 182
  * @param dst  - sockaddr_union pointer.
183 183
  * @param snd_flags - snd_flags pointer, can be 0.
184 184
  * @param msg - sip msg struct. pointer if known, 0 otherwise.
185 185
  * @return >=0 on success, -1 on error.
186
- * @see dst_blacklist_su_to.
186
+ * @see dst_blocklist_su_to.
187 187
  */
188
-#define dst_blacklist_su(err_flags, proto, dst, snd_flags, msg) \
189
-	dst_blacklist_su_to(err_flags, proto, dst, snd_flags, msg, \
188
+#define dst_blocklist_su(err_flags, proto, dst, snd_flags, msg) \
189
+	dst_blocklist_su_to(err_flags, proto, dst, snd_flags, msg, \
190 190
 							S_TO_TICKS(cfg_get(core, core_cfg, blst_timeout)))
191 191
 
192
-int dst_is_blacklisted(struct dest_info* si, struct sip_msg* msg);
192
+int dst_is_blocklisted(struct dest_info* si, struct sip_msg* msg);
193 193
 
194
-/** delete an entry from the blacklist. */
195
-int dst_blacklist_del(struct dest_info* si, struct sip_msg* msg);
194
+/** delete an entry from the blocklist. */
195
+int dst_blocklist_del(struct dest_info* si, struct sip_msg* msg);
196 196
 
197
-/** deletes all the entries from the blacklist except the permanent ones.
197
+/** deletes all the entries from the blocklist except the permanent ones.
198 198
  * (which are marked with BLST_PERMANENT)
199 199
  */
200 200
 void dst_blst_flush(void);
201 201
 
202
-int use_dst_blacklist_fixup(void *handle, str *gname, str *name, void **val);
202
+int use_dst_blocklist_fixup(void *handle, str *gname, str *name, void **val);
203 203
 
204 204
 /** KByte to Byte conversion. */
205 205
 int blst_max_mem_fixup(void *handle, str *gname, str *name, void **val);
... ...
@@ -67,7 +67,7 @@
67 67
 /* error in server */
68 68
 #define E_BAD_SERVER		-500
69 69
 #define E_ADM_PROHIBITED	-510
70
-#define E_BLACKLISTED		-520
70
+#define E_BLOCKLISTED		-520
71 71
 
72 72
 
73 73
 #define MAX_REASON_LEN	128
... ...
@@ -62,8 +62,8 @@
62 62
 #ifdef USE_DNS_FAILOVER
63 63
 #include "dns_cache.h"
64 64
 #endif
65
-#ifdef USE_DST_BLACKLIST
66
-#include "dst_blacklist.h"
65
+#ifdef USE_DST_BLOCKLIST
66
+#include "dst_blocklist.h"
67 67
 #endif
68 68
 #include "compiler_opt.h"
69 69
 #include "core_stats.h"
... ...
@@ -583,11 +583,11 @@ int forward_request(struct sip_msg* msg, str* dst, unsigned short port,
583 583
 			goto error; /* error ? */
584 584
 #endif
585 585
 		}
586
-#ifdef USE_DST_BLACKLIST
587
-		if (cfg_get(core, core_cfg, use_dst_blacklist)){
588
-			if (dst_is_blacklisted(send_info, msg)){
586
+#ifdef USE_DST_BLOCKLIST
587
+		if (cfg_get(core, core_cfg, use_dst_blocklist)){
588
+			if (dst_is_blocklisted(send_info, msg)){
589 589
 				su2ip_addr(&ip, &send_info->to);
590
-				LM_DBG("blacklisted destination:%s:%d (%d)\n",
590
+				LM_DBG("blocklisted destination:%s:%d (%d)\n",
591 591
 					ip_addr2a(&ip), su_getport(&send_info->to), send_info->proto);
592 592
 				ret=ser_error=E_SEND;
593 593
 #ifdef USE_DNS_FAILOVER
... ...
@@ -611,8 +611,8 @@ int forward_request(struct sip_msg* msg, str* dst, unsigned short port,
611 611
 		if (msg_send(send_info, buf, len)<0){
612 612
 			p_onsend=0;
613 613
 			ret=ser_error=E_SEND;
614
-#ifdef USE_DST_BLACKLIST
615
-			(void)dst_blacklist_add(BLST_ERR_SEND, send_info, msg);
614
+#ifdef USE_DST_BLOCKLIST
615
+			(void)dst_blocklist_add(BLST_ERR_SEND, send_info, msg);
616 616
 #endif
617 617
 #ifdef USE_DNS_FAILOVER
618 618
 			continue; /* try another ip */
... ...
@@ -238,17 +238,17 @@ struct t_dns_cache_stats{
238 238
 extern struct t_dns_cache_stats* dns_cache_stats;
239 239
 #endif /* USE_DNS_CACHE_STATS */
240 240
 #endif
241
-#ifdef USE_DST_BLACKLIST
242
-extern int dst_blacklist_init; /* if 0, the dst blacklist is not initialized at startup */
243
-extern unsigned int blst_timer_interval; /*blacklist gc timer interval (in s)*/
241
+#ifdef USE_DST_BLOCKLIST
242
+extern int dst_blocklist_init; /* if 0, the dst blocklist is not initialized at startup */
243
+extern unsigned int blst_timer_interval; /*blocklist gc timer interval (in s)*/
244 244
 
245
-#ifdef USE_DST_BLACKLIST_STATS
246
-struct t_dst_blacklist_stats{
245
+#ifdef USE_DST_BLOCKLIST_STATS
246
+struct t_dst_blocklist_stats{
247 247
 	unsigned long bkl_hit_cnt;
248 248
 	unsigned long bkl_lru_cnt;
249 249
 };
250
-extern struct t_dst_blacklist_stats* dst_blacklist_stats;
251
-#endif /* USE_DST_BLACKLIST_STATS */
250
+extern struct t_dst_blocklist_stats* dst_blocklist_stats;
251
+#endif /* USE_DST_BLOCKLIST_STATS */
252 252
 #endif
253 253
 
254 254
 #endif
... ...
@@ -142,7 +142,7 @@ typedef enum send_flags {
142 142
 
143 143
 typedef struct snd_flags {
144 144
 	unsigned short f;          /* snd flags */
145
-	unsigned short blst_imask; /* blacklist ignore mask */
145
+	unsigned short blst_imask; /* blocklist ignore mask */
146 146
 } snd_flags_t;
147 147
 
148 148
 
... ...
@@ -88,9 +88,9 @@
88 88
 #include "tls_hooks_init.h"
89 89
 #include "tls_hooks.h"
90 90
 #endif /* CORE_TLS*/
91
-#ifdef USE_DST_BLACKLIST
92
-#include "dst_blacklist.h"
93
-#endif /* USE_DST_BLACKLIST */
91
+#ifdef USE_DST_BLOCKLIST
92
+#include "dst_blocklist.h"
93
+#endif /* USE_DST_BLOCKLIST */
94 94
 
95 95
 #include "tcp_info.h"
96 96
 #include "tcp_options.h"
... ...
@@ -533,27 +533,27 @@ error_errno:
533 533
 	switch(errno){
534 534
 		case ENETUNREACH:
535 535
 		case EHOSTUNREACH:
536
-#ifdef USE_DST_BLACKLIST
537
-			dst_blacklist_su(BLST_ERR_CONNECT, type,
536
+#ifdef USE_DST_BLOCKLIST
537
+			dst_blocklist_su(BLST_ERR_CONNECT, type,
538 538
 							 (union sockaddr_union*)servaddr, send_flags, 0);
539
-#endif /* USE_DST_BLACKLIST */
539
+#endif /* USE_DST_BLOCKLIST */
540 540
 			TCP_EV_CONNECT_UNREACHABLE(errno, 0, 0,
541 541
 							(union sockaddr_union*)servaddr, type);
542 542
 			break;
543 543
 		case ETIMEDOUT:
544
-#ifdef USE_DST_BLACKLIST
545
-			dst_blacklist_su(BLST_ERR_CONNECT, type,
544
+#ifdef USE_DST_BLOCKLIST
545
+			dst_blocklist_su(BLST_ERR_CONNECT, type,
546 546
 							 (union sockaddr_union*)servaddr, send_flags, 0);
547
-#endif /* USE_DST_BLACKLIST */
547
+#endif /* USE_DST_BLOCKLIST */
548 548
 			TCP_EV_CONNECT_TIMEOUT(errno, 0, 0,
549 549
 							(union sockaddr_union*)servaddr, type);
550 550
 			break;
551 551
 		case ECONNREFUSED:
552 552
 		case ECONNRESET:
553
-#ifdef USE_DST_BLACKLIST
554
-			dst_blacklist_su(BLST_ERR_CONNECT, type,
553
+#ifdef USE_DST_BLOCKLIST
554
+			dst_blocklist_su(BLST_ERR_CONNECT, type,
555 555
 							 (union sockaddr_union*)servaddr, send_flags, 0);
556
-#endif /* USE_DST_BLACKLIST */
556
+#endif /* USE_DST_BLOCKLIST */
557 557
 			TCP_EV_CONNECT_RST(errno, 0, 0,
558 558
 							(union sockaddr_union*)servaddr, type);
559 559
 			break;
... ...
@@ -571,10 +571,10 @@ error_errno:
571 571
 	goto error;
572 572
 error_timeout:
573 573
 	/* timeout */
574
-#ifdef USE_DST_BLACKLIST
575
-	dst_blacklist_su(BLST_ERR_CONNECT, type,
574
+#ifdef USE_DST_BLOCKLIST
575
+	dst_blocklist_su(BLST_ERR_CONNECT, type,