unrealircd- supernets unrealircd source & configuration |
git clone git://git.acid.vegas/unrealircd.git |
Log | Files | Refs | Archive | README | LICENSE |
api-efunctions.c (24321B)
1 /************************************************************************ 2 * IRC - Internet Relay Chat, src/api-efunctions.c 3 * (C) 2003-2019 Bram Matthys (Syzop) and the UnrealIRCd Team 4 * 5 * See file AUTHORS in IRC package for additional names of 6 * the programmers. 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 1, or (at your option) 11 * any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 */ 22 23 #include "unrealircd.h" 24 25 /* Types */ 26 typedef struct { 27 char *name; 28 void **funcptr; 29 void *deffunc; 30 } EfunctionsList; 31 32 /* Variables */ 33 static Efunction *Efunctions[MAXEFUNCTIONS]; /* Efunction objects (used for rehashing) */ 34 static EfunctionsList efunction_table[MAXEFUNCTIONS]; 35 36 /* Efuncs */ 37 void (*do_join)(Client *client, int parc, const char *parv[]); 38 void (*join_channel)(Channel *channel, Client *client, MessageTag *mtags, const char *member_modes); 39 int (*can_join)(Client *client, Channel *channel, const char *key, char **errmsg); 40 void (*do_mode)(Channel *channel, Client *client, MessageTag *mtags, int parc, const char *parv[], time_t sendts, int samode); 41 MultiLineMode *(*set_mode)(Channel *channel, Client *client, int parc, const char *parv[], u_int *pcount, 42 char pvar[MAXMODEPARAMS][MODEBUFLEN + 3]); 43 void (*set_channel_mode)(Channel *channel, MessageTag *mtags, const char *modes, const char *parameters); 44 void (*set_channel_topic)(Client *client, Channel *channel, MessageTag *recv_mtags, const char *topic, const char *set_by, time_t set_at); 45 void (*cmd_umode)(Client *client, MessageTag *mtags, int parc, const char *parv[]); 46 int (*register_user)(Client *client); 47 int (*tkl_hash)(unsigned int c); 48 char (*tkl_typetochar)(int type); 49 int (*tkl_chartotype)(char c); 50 char (*tkl_configtypetochar)(const char *name); 51 const char *(*tkl_type_string)(TKL *tk); 52 const char *(*tkl_type_config_string)(TKL *tk); 53 char *(*tkl_uhost)(TKL *tkl, char *buf, size_t buflen, int options); 54 TKL *(*tkl_add_serverban)(int type, const char *usermask, const char *hostmask, const char *reason, const char *setby, 55 time_t expire_at, time_t set_at, int soft, int flags); 56 TKL *(*tkl_add_nameban)(int type, const char *name, int hold, const char *reason, const char *setby, 57 time_t expire_at, time_t set_at, int flags); 58 TKL *(*tkl_add_spamfilter)(int type, unsigned short target, unsigned short action, Match *match, const char *setby, 59 time_t expire_at, time_t set_at, 60 time_t spamf_tkl_duration, const char *spamf_tkl_reason, 61 int flags); 62 TKL *(*tkl_add_banexception)(int type, const char *usermask, const char *hostmask, SecurityGroup *match, 63 const char *reason, const char *set_by, 64 time_t expire_at, time_t set_at, int soft, const char *bantypes, int flags); 65 TKL *(*tkl_del_line)(TKL *tkl); 66 void (*tkl_check_local_remove_shun)(TKL *tmp); 67 int (*find_tkline_match)(Client *client, int skip_soft); 68 int (*find_shun)(Client *client); 69 int(*find_spamfilter_user)(Client *client, int flags); 70 TKL *(*find_qline)(Client *client, const char *nick, int *ishold); 71 TKL *(*find_tkline_match_zap)(Client *client); 72 void (*tkl_stats)(Client *client, int type, const char *para, int *cnt); 73 void (*tkl_sync)(Client *client); 74 void (*cmd_tkl)(Client *client, MessageTag *mtags, int parc, const char *parv[]); 75 int (*place_host_ban)(Client *client, BanAction action, const char *reason, long duration); 76 int (*match_spamfilter)(Client *client, const char *str_in, int type, const char *cmd, const char *target, int flags, TKL **rettk); 77 int (*match_spamfilter_mtags)(Client *client, MessageTag *mtags, const char *cmd); 78 int (*join_viruschan)(Client *client, TKL *tk, int type); 79 const char *(*StripColors)(const char *text); 80 void (*spamfilter_build_user_string)(char *buf, const char *nick, Client *client); 81 void (*send_protoctl_servers)(Client *client, int response); 82 ConfigItem_link *(*verify_link)(Client *client); 83 void (*introduce_user)(Client *to, Client *client); 84 void (*send_server_message)(Client *client); 85 void (*broadcast_md_client)(ModDataInfo *mdi, Client *client, ModData *md); 86 void (*broadcast_md_channel)(ModDataInfo *mdi, Channel *channel, ModData *md); 87 void (*broadcast_md_member)(ModDataInfo *mdi, Channel *channel, Member *m, ModData *md); 88 void (*broadcast_md_membership)(ModDataInfo *mdi, Client *client, Membership *m, ModData *md); 89 int (*check_deny_version)(Client *client, const char *software, int protocol, const char *flags); 90 void (*broadcast_md_client_cmd)(Client *except, Client *sender, Client *acptr, const char *varname, const char *value); 91 void (*broadcast_md_channel_cmd)(Client *except, Client *sender, Channel *channel, const char *varname, const char *value); 92 void (*broadcast_md_member_cmd)(Client *except, Client *sender, Channel *channel, Client *acptr, const char *varname, const char *value); 93 void (*broadcast_md_membership_cmd)(Client *except, Client *sender, Client *acptr, Channel *channel, const char *varname, const char *value); 94 void (*moddata_add_s2s_mtags)(Client *client, MessageTag **mtags); 95 void (*moddata_extract_s2s_mtags)(Client *client, MessageTag *mtags); 96 void (*send_moddata_client)(Client *srv, Client *client); 97 void (*send_moddata_channel)(Client *srv, Channel *channel); 98 void (*send_moddata_members)(Client *srv); 99 void (*broadcast_moddata_client)(Client *client); 100 int (*match_user)(const char *rmask, Client *client, int options); 101 void (*userhost_changed)(Client *client); 102 void (*userhost_save_current)(Client *client); 103 void (*send_join_to_local_users)(Client *client, Channel *channel, MessageTag *mtags); 104 int (*do_nick_name)(char *nick); 105 int (*do_remote_nick_name)(char *nick); 106 const char *(*charsys_get_current_languages)(void); 107 void (*broadcast_sinfo)(Client *client, Client *to, Client *except); 108 void (*connect_server)(ConfigItem_link *aconf, Client *by, struct hostent *hp); 109 int (*is_services_but_not_ulined)(Client *client); 110 void (*parse_message_tags)(Client *client, char **str, MessageTag **mtag_list); 111 const char *(*mtags_to_string)(MessageTag *m, Client *client); 112 int (*can_send_to_channel)(Client *client, Channel *channel, const char **msgtext, const char **errmsg, int notice); 113 void (*broadcast_md_globalvar)(ModDataInfo *mdi, ModData *md); 114 void (*broadcast_md_globalvar_cmd)(Client *except, Client *sender, const char *varname, const char *value); 115 int (*tkl_ip_hash)(const char *ip); 116 int (*tkl_ip_hash_type)(int type); 117 void (*sendnotice_tkl_del)(const char *removed_by, TKL *tkl); 118 void (*sendnotice_tkl_add)(TKL *tkl); 119 void (*free_tkl)(TKL *tkl); 120 TKL *(*find_tkl_serverban)(int type, const char *usermask, const char *hostmask, int softban); 121 TKL *(*find_tkl_banexception)(int type, const char *usermask, const char *hostmask, int softban); 122 TKL *(*find_tkl_nameban)(int type, const char *name, int hold); 123 TKL *(*find_tkl_spamfilter)(int type, const char *match_string, unsigned short action, unsigned short target); 124 int (*find_tkl_exception)(int ban_type, Client *client); 125 int (*server_ban_parse_mask)(Client *client, int add, char type, const char *str, char **usermask_out, char **hostmask_out, int *soft, const char **error); 126 int (*server_ban_exception_parse_mask)(Client *client, int add, const char *bantypes, const char *str, char **usermask_out, char **hostmask_out, int *soft, const char **error); 127 void (*tkl_added)(Client *client, TKL *tkl); 128 int (*is_silenced)(Client *client, Client *acptr); 129 int (*del_silence)(Client *client, const char *mask); 130 int (*add_silence)(Client *client, const char *mask, int senderr); 131 void *(*labeled_response_save_context)(void); 132 void (*labeled_response_set_context)(void *ctx); 133 void (*labeled_response_force_end)(void); 134 void (*kick_user)(MessageTag *mtags, Channel *channel, Client *client, Client *victim, const char *comment); 135 int (*watch_add)(const char *nick, Client *client, int flags); 136 int (*watch_del)(const char *nick, Client *client, int flags); 137 int (*watch_del_list)(Client *client, int flags); 138 Watch *(*watch_get)(const char *nick); 139 int (*watch_check)(Client *client, int reply, int (*watch_notify)(Client *client, Watch *watch, Link *lp, int event)); 140 void (*do_unreal_log_remote_deliver)(LogLevel loglevel, const char *subsystem, const char *event_id, MultiLine *msg, const char *json_serialized); 141 char *(*get_chmodes_for_user)(Client *client, const char *flags); 142 WhoisConfigDetails (*whois_get_policy)(Client *client, Client *target, const char *name); 143 int (*make_oper)(Client *client, const char *operblock_name, const char *operclass, ConfigItem_class *clientclass, long modes, const char *snomask, const char *vhost); 144 int (*unreal_match_iplist)(Client *client, NameList *l); 145 void (*webserver_send_response)(Client *client, int status, char *msg); 146 void (*webserver_close_client)(Client *client); 147 int (*webserver_handle_body)(Client *client, WebRequest *web, const char *readbuf, int length); 148 void (*rpc_response)(Client *client, json_t *request, json_t *result); 149 void (*rpc_error)(Client *client, json_t *request, JsonRpcError error_code, const char *error_message); 150 void (*rpc_error_fmt)(Client *client, json_t *request, JsonRpcError error_code, const char *fmt, ...); 151 void (*rpc_send_request_to_remote)(Client *source, Client *target, json_t *request); 152 void (*rpc_send_response_to_remote)(Client *source, Client *target, json_t *response); 153 int (*rrpc_supported_simple)(Client *target, char **problem_server); 154 int (*rrpc_supported)(Client *target, const char *module, const char *minimum_version, char **problem_server); 155 int (*websocket_handle_websocket)(Client *client, WebRequest *web, const char *readbuf2, int length2, int callback(Client *client, char *buf, int len)); 156 int (*websocket_create_packet)(int opcode, char **buf, int *len); 157 int (*websocket_create_packet_ex)(int opcode, char **buf, int *len, char *sendbuf, size_t sendbufsize); 158 int (*websocket_create_packet_simple)(int opcode, const char **buf, int *len); 159 const char *(*check_deny_link)(ConfigItem_link *link, int auto_connect); 160 void (*mtag_add_issued_by)(MessageTag **mtags, Client *client, MessageTag *recv_mtags); 161 162 Efunction *EfunctionAddMain(Module *module, EfunctionType eftype, int (*func)(), void (*vfunc)(), void *(*pvfunc)(), char *(*stringfunc)(), const char *(*conststringfunc)()) 163 { 164 Efunction *p; 165 166 if (!module || !(module->options & MOD_OPT_OFFICIAL)) 167 { 168 if (module) 169 module->errorcode = MODERR_INVALID; 170 return NULL; 171 } 172 173 p = safe_alloc(sizeof(Efunction)); 174 if (func) 175 p->func.intfunc = func; 176 if (vfunc) 177 p->func.voidfunc = vfunc; 178 if (pvfunc) 179 p->func.pvoidfunc = pvfunc; 180 if (stringfunc) 181 p->func.stringfunc = stringfunc; 182 if (conststringfunc) 183 p->func.conststringfunc = conststringfunc; 184 p->type = eftype; 185 p->owner = module; 186 AddListItem(p, Efunctions[eftype]); 187 if (module) 188 { 189 ModuleObject *cbobj = safe_alloc(sizeof(ModuleObject)); 190 cbobj->object.efunction = p; 191 cbobj->type = MOBJ_EFUNCTION; 192 AddListItem(cbobj, module->objects); 193 module->errorcode = MODERR_NOERROR; 194 } 195 return p; 196 } 197 198 Efunction *EfunctionDel(Efunction *cb) 199 { 200 Efunction *p, *q; 201 202 for (p = Efunctions[cb->type]; p; p = p->next) 203 { 204 if (p == cb) 205 { 206 q = p->next; 207 DelListItem(p, Efunctions[cb->type]); 208 if (*efunction_table[cb->type].funcptr == p) 209 *efunction_table[cb->type].funcptr = NULL; 210 if (p->owner) 211 { 212 ModuleObject *cbobj; 213 for (cbobj = p->owner->objects; cbobj; cbobj = cbobj->next) 214 { 215 if ((cbobj->type == MOBJ_EFUNCTION) && (cbobj->object.efunction == p)) 216 { 217 DelListItem(cbobj, cb->owner->objects); 218 safe_free(cbobj); 219 break; 220 } 221 } 222 } 223 safe_free(p); 224 return q; 225 } 226 } 227 return NULL; 228 } 229 230 static int num_efunctions(EfunctionType eftype) 231 { 232 Efunction *e; 233 int cnt = 0; 234 235 #ifdef DEBUGMODE 236 if ((eftype < 0) || (eftype >= MAXEFUNCTIONS)) 237 abort(); 238 #endif 239 240 for (e = Efunctions[eftype]; e; e = e->next) 241 if (!e->willberemoved) 242 cnt++; 243 244 return cnt; 245 } 246 247 248 /** Ensure that all efunctions are present. */ 249 int efunctions_check(void) 250 { 251 int i, n, errors=0; 252 253 for (i=0; i < MAXEFUNCTIONS; i++) 254 if (efunction_table[i].name) 255 { 256 n = num_efunctions(i); 257 if ((n != 1) && (errors > 10)) 258 { 259 config_error("[--efunction errors truncated to prevent flooding--]"); 260 break; 261 } 262 if ((n < 1) && !efunction_table[i].deffunc) 263 { 264 config_error("ERROR: efunction '%s' not found, you probably did not " 265 "load all required modules! (hint: see modules.default.conf)", 266 efunction_table[i].name); 267 errors++; 268 } else 269 if (n > 1) 270 { 271 config_error("ERROR: efunction '%s' was found %d times, perhaps you " 272 "loaded a module multiple times??", 273 efunction_table[i].name, n); 274 errors++; 275 } 276 } 277 return errors ? -1 : 0; 278 } 279 280 void efunctions_switchover(void) 281 { 282 Efunction *e; 283 int i; 284 285 /* Now set the real efunction, and tag the new one 286 * as 'willberemoved' if needed. 287 */ 288 289 for (i=0; i < MAXEFUNCTIONS; i++) 290 { 291 int found = 0; 292 for (e = Efunctions[i]; e; e = e->next) 293 { 294 if (e->willberemoved) 295 continue; 296 if (!efunction_table[i].funcptr) 297 { 298 unreal_log(ULOG_FATAL, "module", "BUG_EFUNCTIONS_SWITCHOVER", NULL, 299 "[BUG] efunctions_switchover(): someone forgot to initialize the function table for efunc $efunction_number", 300 log_data_integer("efunction_number", i)); 301 abort(); 302 } 303 *efunction_table[i].funcptr = e->func.voidfunc; /* This is the new one. */ 304 if (!(e->owner->options & MOD_OPT_PERM)) 305 e->willberemoved = 1; 306 found = 1; 307 break; 308 } 309 if (!found) 310 { 311 if (efunction_table[i].deffunc) 312 *efunction_table[i].funcptr = efunction_table[i].deffunc; 313 } 314 } 315 } 316 317 #define efunc_init_function(what, func, default_func) efunc_init_function_(what, #func, (void *)&func, (void *)default_func) 318 319 void efunc_init_function_(EfunctionType what, char *name, void *func, void *default_func) 320 { 321 if (what >= MAXEFUNCTIONS) 322 { 323 /* increase MAXEFUNCTIONS if you ever encounter that --k4be */ 324 unreal_log(ULOG_FATAL, "module", "BUG_EFUNC_INIT_FUNCTION_TOO_MANY", NULL, 325 "Too many efunctions! ($efunctions_request > $efunctions_max)", 326 log_data_integer("efunctions_request", what), 327 log_data_integer("efunctions_max", MAXEFUNCTIONS)); 328 abort(); 329 } 330 safe_strdup(efunction_table[what].name, name); 331 efunction_table[what].funcptr = func; 332 efunction_table[what].deffunc = default_func; 333 } 334 335 void efunctions_init(void) 336 { 337 memset(&efunction_table, 0, sizeof(efunction_table)); 338 efunc_init_function(EFUNC_DO_JOIN, do_join, NULL); 339 efunc_init_function(EFUNC_JOIN_CHANNEL, join_channel, NULL); 340 efunc_init_function(EFUNC_CAN_JOIN, can_join, NULL); 341 efunc_init_function(EFUNC_DO_MODE, do_mode, NULL); 342 efunc_init_function(EFUNC_SET_MODE, set_mode, NULL); 343 efunc_init_function(EFUNC_SET_CHANNEL_MODE, set_channel_mode, NULL); 344 efunc_init_function(EFUNC_SET_CHANNEL_TOPIC, set_channel_topic, NULL); 345 efunc_init_function(EFUNC_CMD_UMODE, cmd_umode, NULL); 346 efunc_init_function(EFUNC_REGISTER_USER, register_user, NULL); 347 efunc_init_function(EFUNC_TKL_HASH, tkl_hash, NULL); 348 efunc_init_function(EFUNC_TKL_TYPETOCHAR, tkl_typetochar, NULL); 349 efunc_init_function(EFUNC_TKL_ADD_SERVERBAN, tkl_add_serverban, NULL); 350 efunc_init_function(EFUNC_TKL_ADD_BANEXCEPTION, tkl_add_banexception, NULL); 351 efunc_init_function(EFUNC_TKL_DEL_LINE, tkl_del_line, NULL); 352 efunc_init_function(EFUNC_TKL_CHECK_LOCAL_REMOVE_SHUN, tkl_check_local_remove_shun, NULL); 353 efunc_init_function(EFUNC_FIND_TKLINE_MATCH, find_tkline_match, NULL); 354 efunc_init_function(EFUNC_FIND_SHUN, find_shun, NULL); 355 efunc_init_function(EFUNC_FIND_SPAMFILTER_USER, find_spamfilter_user, NULL); 356 efunc_init_function(EFUNC_FIND_QLINE, find_qline, NULL); 357 efunc_init_function(EFUNC_FIND_TKLINE_MATCH_ZAP, find_tkline_match_zap, NULL); 358 efunc_init_function(EFUNC_TKL_STATS, tkl_stats, NULL); 359 efunc_init_function(EFUNC_TKL_SYNCH, tkl_sync, NULL); 360 efunc_init_function(EFUNC_CMD_TKL, cmd_tkl, NULL); 361 efunc_init_function(EFUNC_PLACE_HOST_BAN, place_host_ban, NULL); 362 efunc_init_function(EFUNC_MATCH_SPAMFILTER, match_spamfilter, NULL); 363 efunc_init_function(EFUNC_MATCH_SPAMFILTER_MTAGS, match_spamfilter_mtags, NULL); 364 efunc_init_function(EFUNC_JOIN_VIRUSCHAN, join_viruschan, NULL); 365 efunc_init_function(EFUNC_STRIPCOLORS, StripColors, NULL); 366 efunc_init_function(EFUNC_SPAMFILTER_BUILD_USER_STRING, spamfilter_build_user_string, NULL); 367 efunc_init_function(EFUNC_SEND_PROTOCTL_SERVERS, send_protoctl_servers, NULL); 368 efunc_init_function(EFUNC_VERIFY_LINK, verify_link, NULL); 369 efunc_init_function(EFUNC_SEND_SERVER_MESSAGE, send_server_message, NULL); 370 efunc_init_function(EFUNC_BROADCAST_MD_CLIENT, broadcast_md_client, NULL); 371 efunc_init_function(EFUNC_BROADCAST_MD_CHANNEL, broadcast_md_channel, NULL); 372 efunc_init_function(EFUNC_BROADCAST_MD_MEMBER, broadcast_md_member, NULL); 373 efunc_init_function(EFUNC_BROADCAST_MD_MEMBERSHIP, broadcast_md_membership, NULL); 374 efunc_init_function(EFUNC_INTRODUCE_USER, introduce_user, NULL); 375 efunc_init_function(EFUNC_CHECK_DENY_VERSION, check_deny_version, NULL); 376 efunc_init_function(EFUNC_BROADCAST_MD_CLIENT_CMD, broadcast_md_client_cmd, NULL); 377 efunc_init_function(EFUNC_BROADCAST_MD_CHANNEL_CMD, broadcast_md_channel_cmd, NULL); 378 efunc_init_function(EFUNC_BROADCAST_MD_MEMBER_CMD, broadcast_md_member_cmd, NULL); 379 efunc_init_function(EFUNC_BROADCAST_MD_MEMBERSHIP_CMD, broadcast_md_membership_cmd, NULL); 380 efunc_init_function(EFUNC_MODDATA_ADD_S2S_MTAGS, moddata_add_s2s_mtags, NULL); 381 efunc_init_function(EFUNC_MODDATA_EXTRACT_S2S_MTAGS, moddata_extract_s2s_mtags, NULL); 382 efunc_init_function(EFUNC_SEND_MODDATA_CLIENT, send_moddata_client, NULL); 383 efunc_init_function(EFUNC_SEND_MODDATA_CHANNEL, send_moddata_channel, NULL); 384 efunc_init_function(EFUNC_SEND_MODDATA_MEMBERS, send_moddata_members, NULL); 385 efunc_init_function(EFUNC_BROADCAST_MODDATA_CLIENT, broadcast_moddata_client, NULL); 386 efunc_init_function(EFUNC_MATCH_USER, match_user, NULL); 387 efunc_init_function(EFUNC_USERHOST_SAVE_CURRENT, userhost_save_current, NULL); 388 efunc_init_function(EFUNC_USERHOST_CHANGED, userhost_changed, NULL); 389 efunc_init_function(EFUNC_SEND_JOIN_TO_LOCAL_USERS, send_join_to_local_users, NULL); 390 efunc_init_function(EFUNC_DO_NICK_NAME, do_nick_name, NULL); 391 efunc_init_function(EFUNC_DO_REMOTE_NICK_NAME, do_remote_nick_name, NULL); 392 efunc_init_function(EFUNC_CHARSYS_GET_CURRENT_LANGUAGES, charsys_get_current_languages, NULL); 393 efunc_init_function(EFUNC_BROADCAST_SINFO, broadcast_sinfo, NULL); 394 efunc_init_function(EFUNC_CONNECT_SERVER, connect_server, NULL); 395 efunc_init_function(EFUNC_IS_SERVICES_BUT_NOT_ULINED, is_services_but_not_ulined, NULL); 396 efunc_init_function(EFUNC_PARSE_MESSAGE_TAGS, parse_message_tags, &parse_message_tags_default_handler); 397 efunc_init_function(EFUNC_MTAGS_TO_STRING, mtags_to_string, &mtags_to_string_default_handler); 398 efunc_init_function(EFUNC_TKL_CHARTOTYPE, tkl_chartotype, NULL); 399 efunc_init_function(EFUNC_TKL_CONFIGTYPETOCHAR, tkl_configtypetochar, NULL); 400 efunc_init_function(EFUNC_TKL_TYPE_STRING, tkl_type_string, NULL); 401 efunc_init_function(EFUNC_TKL_TYPE_CONFIG_STRING, tkl_type_config_string, NULL); 402 efunc_init_function(EFUNC_CAN_SEND_TO_CHANNEL, can_send_to_channel, NULL); 403 efunc_init_function(EFUNC_BROADCAST_MD_GLOBALVAR, broadcast_md_globalvar, NULL); 404 efunc_init_function(EFUNC_BROADCAST_MD_GLOBALVAR_CMD, broadcast_md_globalvar_cmd, NULL); 405 efunc_init_function(EFUNC_TKL_IP_HASH, tkl_ip_hash, NULL); 406 efunc_init_function(EFUNC_TKL_IP_HASH_TYPE, tkl_ip_hash_type, NULL); 407 efunc_init_function(EFUNC_TKL_ADD_NAMEBAN, tkl_add_nameban, NULL); 408 efunc_init_function(EFUNC_TKL_ADD_SPAMFILTER, tkl_add_spamfilter, NULL); 409 efunc_init_function(EFUNC_SENDNOTICE_TKL_ADD, sendnotice_tkl_add, NULL); 410 efunc_init_function(EFUNC_SENDNOTICE_TKL_DEL, sendnotice_tkl_del, NULL); 411 efunc_init_function(EFUNC_FREE_TKL, free_tkl, NULL); 412 efunc_init_function(EFUNC_FIND_TKL_SERVERBAN, find_tkl_serverban, NULL); 413 efunc_init_function(EFUNC_FIND_TKL_BANEXCEPTION, find_tkl_banexception, NULL); 414 efunc_init_function(EFUNC_FIND_TKL_NAMEBAN, find_tkl_nameban, NULL); 415 efunc_init_function(EFUNC_FIND_TKL_SPAMFILTER, find_tkl_spamfilter, NULL); 416 efunc_init_function(EFUNC_FIND_TKL_EXCEPTION, find_tkl_exception, NULL); 417 efunc_init_function(EFUNC_SERVER_BAN_PARSE_MASK, server_ban_parse_mask, NULL); 418 efunc_init_function(EFUNC_SERVER_BAN_EXCEPTION_PARSE_MASK, server_ban_exception_parse_mask, NULL); 419 efunc_init_function(EFUNC_TKL_ADDED, tkl_added, NULL); 420 efunc_init_function(EFUNC_ADD_SILENCE, add_silence, add_silence_default_handler); 421 efunc_init_function(EFUNC_DEL_SILENCE, del_silence, del_silence_default_handler); 422 efunc_init_function(EFUNC_IS_SILENCED, is_silenced, is_silenced_default_handler); 423 efunc_init_function(EFUNC_LABELED_RESPONSE_SAVE_CONTEXT, labeled_response_save_context, labeled_response_save_context_default_handler); 424 efunc_init_function(EFUNC_LABELED_RESPONSE_SET_CONTEXT, labeled_response_set_context, labeled_response_set_context_default_handler); 425 efunc_init_function(EFUNC_LABELED_RESPONSE_FORCE_END, labeled_response_force_end, labeled_response_force_end_default_handler); 426 efunc_init_function(EFUNC_KICK_USER, kick_user, NULL); 427 efunc_init_function(EFUNC_WATCH_ADD, watch_add, NULL); 428 efunc_init_function(EFUNC_WATCH_DEL, watch_del, NULL); 429 efunc_init_function(EFUNC_WATCH_DEL_LIST, watch_del_list, NULL); 430 efunc_init_function(EFUNC_WATCH_GET, watch_get, NULL); 431 efunc_init_function(EFUNC_WATCH_CHECK, watch_check, NULL); 432 efunc_init_function(EFUNC_TKL_UHOST, tkl_uhost, NULL); 433 efunc_init_function(EFUNC_DO_UNREAL_LOG_REMOTE_DELIVER, do_unreal_log_remote_deliver, do_unreal_log_remote_deliver_default_handler); 434 efunc_init_function(EFUNC_GET_CHMODES_FOR_USER, get_chmodes_for_user, NULL); 435 efunc_init_function(EFUNC_WHOIS_GET_POLICY, whois_get_policy, NULL); 436 efunc_init_function(EFUNC_MAKE_OPER, make_oper, make_oper_default_handler); 437 efunc_init_function(EFUNC_UNREAL_MATCH_IPLIST, unreal_match_iplist, NULL); 438 efunc_init_function(EFUNC_WEBSERVER_SEND_RESPONSE, webserver_send_response, webserver_send_response_default_handler); 439 efunc_init_function(EFUNC_WEBSERVER_CLOSE_CLIENT, webserver_close_client, webserver_close_client_default_handler); 440 efunc_init_function(EFUNC_WEBSERVER_HANDLE_BODY, webserver_handle_body, webserver_handle_body_default_handler); 441 efunc_init_function(EFUNC_RPC_RESPONSE, rpc_response, rpc_response_default_handler); 442 efunc_init_function(EFUNC_RPC_ERROR, rpc_error, rpc_error_default_handler); 443 efunc_init_function(EFUNC_RPC_ERROR_FMT, rpc_error_fmt, rpc_error_fmt_default_handler); 444 efunc_init_function(EFUNC_RPC_SEND_REQUEST_TO_REMOTE, rpc_send_request_to_remote, rpc_send_request_to_remote_default_handler); 445 efunc_init_function(EFUNC_RPC_SEND_RESPONSE_TO_REMOTE, rpc_send_response_to_remote, rpc_send_response_to_remote_default_handler); 446 efunc_init_function(EFUNC_RRPC_SUPPORTED, rrpc_supported, rrpc_supported_default_handler); 447 efunc_init_function(EFUNC_RRPC_SUPPORTED_SIMPLE, rrpc_supported_simple, rrpc_supported_simple_default_handler); 448 efunc_init_function(EFUNC_WEBSOCKET_HANDLE_WEBSOCKET, websocket_handle_websocket, websocket_handle_websocket_default_handler); 449 efunc_init_function(EFUNC_WEBSOCKET_CREATE_PACKET, websocket_create_packet, websocket_create_packet_default_handler); 450 efunc_init_function(EFUNC_WEBSOCKET_CREATE_PACKET_EX, websocket_create_packet_ex, websocket_create_packet_ex_default_handler); 451 efunc_init_function(EFUNC_WEBSOCKET_CREATE_PACKET_SIMPLE, websocket_create_packet_simple, websocket_create_packet_simple_default_handler); 452 efunc_init_function(EFUNC_CHECK_DENY_LINK, check_deny_link, NULL); 453 efunc_init_function(EFUNC_MTAG_GENERATE_ISSUED_BY_IRC, mtag_add_issued_by, mtag_add_issued_by_default_handler); 454 }