#include "services.h"
Go to the source code of this file.
Defines | |
| #define | HASH(nick) (((nick)[0]&31)<<5 | ((nick)[1]&31)) |
| #define | HASH2(nick) (((nick)[0]&31)<<5 | ((nick)[1]&31)) |
Functions | |
| static User * | new_user (const char *nick) |
| static void | change_user_nick (User *user, const char *nick) |
| void | update_host (User *user) |
| void | change_user_host (User *user, const char *host) |
| void | change_user_realname (User *user, const char *realname) |
| void | change_user_username (User *user, const char *username) |
| void | delete_user (User *user) |
| void | get_user_stats (long *nusers, long *memuse) |
| User * | finduser (const char *nick) |
| User * | firstuser (void) |
| User * | nextuser (void) |
| User * | find_byuid (const char *uid) |
| User * | first_uid (void) |
| User * | next_uid (void) |
| Uid * | new_uid (const char *nick, char *uid) |
| Uid * | find_uid (const char *nick) |
| Uid * | find_nickuid (const char *uid) |
| User * | do_nick (const char *source, char *nick, char *username, char *host, char *server, char *realname, time_t ts, uint32 svid, uint32 ip, char *vhost, char *uid) |
| void | do_umode (const char *source, int ac, char **av) |
| void | do_umode2 (const char *source, int ac, char **av) |
| void | do_quit (const char *source, int ac, char **av) |
| void | do_kill (char *nick, char *msg) |
| int | is_protected (User *user) |
| int | is_oper (User *user) |
| int | is_excepted (ChannelInfo *ci, User *user) |
| int | is_excepted_mask (ChannelInfo *ci, char *mask) |
| int | match_usermask (const char *mask, User *user) |
| int | match_userip (const char *mask, User *user, char *iphost) |
| void | split_usermask (const char *mask, char **nick, char **user, char **host) |
| char * | create_mask (User *u) |
Variables | |
| User * | userlist [1024] |
| Uid * | uidlist [1024] |
| int32 | usercnt = 0 |
| int32 | opcnt = 0 |
| uint32 | maxusercnt = 0 |
| time_t | maxusertime |
| static User * | current |
| static int | next_index |
| static User * | current_uid |
| static int | next_index_uid |
| void change_user_host | ( | User * | user, | |
| const char * | host | |||
| ) |
Definition at line 130 of file users.c.
References alog(), debug, user_::nick, sstrdup(), update_host(), and user_::vhost.
Referenced by anope_event_chghost(), anope_event_encap(), anope_event_newmask(), anope_event_sethost(), anope_event_vhost(), and anope_event_vs().
| static void change_user_nick | ( | User * | user, | |
| const char * | nick | |||
| ) | [static] |
Definition at line 66 of file users.c.
References findnick(), HASH, user_::na, user_::next, user_::nick, NICKMAX, user_::prev, stricmp(), strscpy(), and nickalias_::u.
Referenced by do_nick().
| void change_user_realname | ( | User * | user, | |
| const char * | realname | |||
| ) |
Definition at line 148 of file users.c.
References alog(), debug, nickcore_::flags, nickalias_::last_realname, user_::na, nickalias_::nc, NI_SECURE, user_::nick, nick_identified(), nick_recognized(), user_::realname, and sstrdup().
Referenced by anope_event_chgname(), and anope_event_setname().
| void change_user_username | ( | User * | user, | |
| const char * | username | |||
| ) |
Definition at line 171 of file users.c.
References alog(), common_get_vhost(), common_get_vident(), debug, nickcore_::flags, nickalias_::last_usermask, user_::na, nickalias_::nc, NI_SECURE, user_::nick, nick_identified(), nick_recognized(), smalloc(), sstrdup(), and user_::vident.
Referenced by anope_event_chgident(), anope_event_newmask(), and anope_event_setident().
| char* create_mask | ( | User * | u | ) |
Definition at line 1083 of file users.c.
References common_get_vhost(), common_get_vident(), smalloc(), sstrdup(), strspn(), and USERMAX.
Referenced by do_confirm(), and get_idealban().
| void delete_user | ( | User * | user | ) |
Definition at line 196 of file users.c.
References alog(), Anope_Free, c, cancel_user(), chan_deluser(), user_::chans, debug, EVENT_USER_LOGOFF, user_::founder_chans, HASH, user_::host, user_::hostip, ircd, is_oper(), LogUsers, moduleCleanStruct(), user_::moduleData, user_::na, server_::name, user_::next, user_::u_chaninfolist::next, user_::u_chanlist::next, user_::nick, user_::nickTrack, normalizeBuffer(), opcnt, user_::prev, user_::realname, send_event(), user_::server, nickalias_::u, user_::uid, usercnt, user_::username, user_::vhost, ircdvars_::vhost, and user_::vident.
Referenced by delete_server(), do_kill(), do_quit(), and services_shutdown().
| void do_kill | ( | char * | nick, | |
| char * | msg | |||
| ) |
Definition at line 861 of file users.c.
References alog(), debug, del_session(), delete_user(), finduser(), nickcore_::flags, user_::host, is_ulined(), nickalias_::last_quit, nickalias_::last_seen, LimitSessions, user_::na, server_::name, nickalias_::nc, NI_SUSPENDED, NS_IDENTIFIED, NS_RECOGNIZED, NS_VERBOTEN, user_::server, sstrdup(), and nickalias_::status.
Referenced by kill_user(), and m_kill().
| User* do_nick | ( | const char * | source, | |
| char * | nick, | |||
| char * | username, | |||
| char * | host, | |||
| char * | server, | |||
| char * | realname, | |||
| time_t | ts, | |||
| uint32 | svid, | |||
| uint32 | ip, | |||
| char * | vhost, | |||
| char * | uid | |||
| ) |
Ugly swap routine for Flop's bug :)
End of ugly swap
DefCon AKILL system, if we want to akill all connecting user's here's where to do it then force check_akill again on them...
Definition at line 487 of file users.c.
References add_akill(), add_session(), alog(), anope_cmd_nc_change(), anope_cmd_svid_umode(), anope_cmd_svid_umode2(), anope_cmd_svid_umode3(), Anope_Free, cancel_user(), change_user_nick(), check_akill(), check_memos(), ircdvars_::check_nick_id, check_sgline(), check_sqline(), check_szline(), checkDefCon(), common_get_vhost(), common_get_vident(), debug, DEFCON_AKILL_NEW_CLIENTS, DefConAKILL, DefConAkillReason, display_news(), dotime(), EVENT_CHANGE_NICK, EVENT_NEWNICK, find_byuid(), findserver(), finduser(), user_::host, user_::hostip, HOSTMAX, ircd, is_oper(), is_sync(), is_ulined(), user_::isSuperAdmin, nickalias_::last_seen, nickalias_::last_usermask, LimitSessions, LogUsers, user_::my_signon, user_::na, server_::name, nickalias_::nc, new_user(), NEWS_LOGON, NEWS_RANDOM, user_::nick, nick_identified(), nick_recognized(), ircdvars_::nickip, ircdvars_::nickvhost, normalizeBuffer(), NS_IDENTIFIED, NS_TRANSGROUP, nsCheckNickTracking(), NSNickTracking, nsStartNickTracking(), ntoa(), user_::realname, s_NickServ, s_OperServ, send_event(), user_::server, servlist, ircdvars_::sgline, smalloc(), snprintf(), ircdvars_::sqline, sstrdup(), nickalias_::status, stricmp(), user_::svid, ircdvars_::szline, user_::timestamp, user_::uid, USERMAX, user_::username, UseTS6, validate_user(), ircdvars_::vhost, user_::vhost, and user_::vident.
Referenced by anope_event_client(), anope_event_euid(), anope_event_nick(), anope_event_sanick(), and anope_event_snick().
| void do_quit | ( | const char * | source, | |
| int | ac, | |||
| char ** | av | |||
| ) |
Definition at line 826 of file users.c.
References alog(), debug, del_session(), delete_user(), finduser(), nickcore_::flags, user_::host, is_ulined(), nickalias_::last_quit, nickalias_::last_seen, LimitSessions, merge_args(), user_::na, server_::name, nickalias_::nc, NI_SUSPENDED, NS_IDENTIFIED, NS_RECOGNIZED, NS_VERBOTEN, user_::server, sstrdup(), and nickalias_::status.
Referenced by anope_event_quit().
| void do_umode | ( | const char * | source, | |
| int | ac, | |||
| char ** | av | |||
| ) |
Definition at line 788 of file users.c.
References alog(), anope_set_umode(), finduser(), and merge_args().
Referenced by anope_event_mode().
| void do_umode2 | ( | const char * | source, | |
| int | ac, | |||
| char ** | av | |||
| ) |
Definition at line 806 of file users.c.
References alog(), anope_set_umode(), finduser(), and merge_args().
Referenced by anope_event_mode(), and anope_event_umode2().
| User* find_byuid | ( | const char * | uid | ) |
Definition at line 377 of file users.c.
References alog(), debug, first_uid(), next_uid(), stricmp(), and user_::uid.
Referenced by anope_event_away(), anope_event_chghost(), anope_event_kill(), anope_event_mode(), anope_event_nick(), anope_event_part(), anope_event_privmsg(), anope_event_quit(), anope_event_topic(), chan_set_modes(), do_join(), do_kick(), do_nick(), do_part(), and do_sjoin().
| Uid* find_nickuid | ( | const char * | uid | ) |
Definition at line 467 of file users.c.
References uid_::next, stricmp(), and uid_::uid.
Referenced by anope_event_privmsg(), anope_event_whois(), and findbot().
| Uid* find_uid | ( | const char * | nick | ) |
Definition at line 452 of file users.c.
References uid_::next, uid_::nick, and stricmp().
Referenced by charybdis_cmd_akill(), charybdis_cmd_bot_chan_mode(), charybdis_cmd_global(), charybdis_cmd_global_legacy(), charybdis_cmd_invite(), charybdis_cmd_join(), charybdis_cmd_kick(), charybdis_cmd_mode(), charybdis_cmd_notice(), charybdis_cmd_notice2(), charybdis_cmd_notice_ops(), charybdis_cmd_part(), charybdis_cmd_privmsg(), charybdis_cmd_privmsg2(), charybdis_cmd_quit(), charybdis_cmd_remove_akill(), charybdis_cmd_sgline(), charybdis_cmd_sqline(), charybdis_cmd_svskill(), charybdis_cmd_topic(), charybdis_cmd_unsgline(), charybdis_cmd_unsqline(), ratbox_cmd_akill(), ratbox_cmd_bot_chan_mode(), ratbox_cmd_global(), ratbox_cmd_global_legacy(), ratbox_cmd_invite(), ratbox_cmd_join(), ratbox_cmd_kick(), ratbox_cmd_mode(), ratbox_cmd_notice(), ratbox_cmd_notice2(), ratbox_cmd_part(), ratbox_cmd_privmsg(), ratbox_cmd_privmsg2(), ratbox_cmd_quit(), ratbox_cmd_remove_akill(), ratbox_cmd_sgline(), ratbox_cmd_sqline(), ratbox_cmd_svskill(), ratbox_cmd_topic(), ratbox_cmd_unsgline(), ratbox_cmd_unsqline(), shadowircd_cmd_akill(), shadowircd_cmd_bot_chan_mode(), shadowircd_cmd_global(), shadowircd_cmd_global_legacy(), shadowircd_cmd_invite(), shadowircd_cmd_join(), shadowircd_cmd_kick(), shadowircd_cmd_mode(), shadowircd_cmd_notice(), shadowircd_cmd_notice2(), shadowircd_cmd_part(), shadowircd_cmd_privmsg(), shadowircd_cmd_privmsg2(), shadowircd_cmd_quit(), shadowircd_cmd_remove_akill(), shadowircd_cmd_svskill(), and shadowircd_cmd_topic().
| User* finduser | ( | const char * | nick | ) |
Definition at line 322 of file users.c.
References alog(), debug, HASH, user_::next, user_::nick, and stricmp().
Referenced by anope_event_chghost(), anope_event_chgident(), anope_event_chgname(), anope_event_encap(), anope_event_newmask(), anope_event_opertype(), anope_event_sethost(), anope_event_setident(), anope_event_setname(), anope_event_vhost(), anope_event_vs(), bot_raw_ban(), bot_raw_kick(), bot_raw_mode(), chan_set_modes(), charybdis_cmd_invite(), charybdis_cmd_kick(), charybdis_cmd_notice(), charybdis_cmd_notice2(), charybdis_cmd_svsnick(), collide(), common_unban(), do_ban(), do_chanlist(), do_confirm(), do_cs_kick(), do_fantasy(), do_ghost(), do_join(), do_kick(), do_kill(), do_logout(), do_nick(), do_operoline(), do_operumodes(), do_part(), do_quit(), do_recover(), do_sjoin(), do_status(), do_svsnick(), do_tban(), do_umode(), do_umode2(), do_util(), EnforceQlinedNick(), get_ignore(), kill_user(), m_away(), m_privmsg(), m_stats(), memo_send(), my_memo_lang(), my_privmsg(), opers_list(), plexus_cmd_svsnick(), plexus_cmd_vhost_on(), ptlink_cmd_vhost_on(), ratbox_cmd_invite(), ratbox_cmd_kick(), ratbox_cmd_notice(), ratbox_cmd_notice2(), shadowircd_cmd_invite(), shadowircd_cmd_kick(), shadowircd_cmd_notice(), and shadowircd_cmd_notice2().
| User* first_uid | ( | void | ) |
Definition at line 403 of file users.c.
References alog(), debug, next_index_uid, user_::nick, and user_::uid.
Referenced by find_byuid().
| User* firstuser | ( | void | ) |
Definition at line 351 of file users.c.
References alog(), debug, next_index, and user_::nick.
Referenced by add_sgline(), add_sqline(), delete_server(), do_noop(), and services_shutdown().
| void get_user_stats | ( | long * | nusers, | |
| long * | memuse | |||
| ) |
Definition at line 284 of file users.c.
References user_::chans, user_::founder_chans, user_::host, ircd, server_::name, user_::u_chaninfolist::next, user_::u_chanlist::next, user_::next, user_::realname, user_::server, user_::username, user_::vhost, and ircdvars_::vhost.
Referenced by do_stats().
| int is_excepted | ( | ChannelInfo * | ci, | |
| User * | user | |||
| ) |
Definition at line 922 of file users.c.
References chaninfo_::c, elist_match_user(), ircdvars_::except, channel_::excepts, and ircd.
Referenced by bot_raw_ban(), canBanUser(), check_kick(), and do_ban().
| int is_excepted_mask | ( | ChannelInfo * | ci, | |
| char * | mask | |||
| ) |
Definition at line 936 of file users.c.
References chaninfo_::c, elist_match_mask(), ircdvars_::except, channel_::excepts, and ircd.
Referenced by do_akick().
| int is_oper | ( | User * | user | ) |
Definition at line 909 of file users.c.
References anope_get_oper_mode(), and user_::mode.
Referenced by add_sgline(), add_sqline(), anope_event_opertype(), AnopeInit(), delete_user(), do_assign(), do_botlist(), do_chankill(), do_forbid(), do_help_limited(), do_list(), do_nick(), do_noop(), do_oper(), do_run_cmd(), do_set_mlock(), do_sjoin(), do_suspend(), get_ignore(), is_services_admin(), is_services_oper(), is_services_root(), m_privmsg(), m_stats(), mChanHelp(), mMainChanHelp(), mMainNickHelp(), mNickHelp(), myChanInfo(), myNickInfo(), and sqline().
| int is_protected | ( | User * | user | ) |
Definition at line 896 of file users.c.
References ircd, user_::mode, and ircdvars_::protectedumode.
Referenced by bot_raw_ban(), bot_raw_kick(), bot_raw_mode(), canBanUser(), do_ban(), do_cs_kick(), and do_util().
| int match_userip | ( | const char * | mask, | |
| User * | user, | |||
| char * | iphost | |||
| ) |
Definition at line 999 of file users.c.
References match_wild_nocase(), user_::nick, result, sstrdup(), user_::username, and user_::vhost.
| int match_usermask | ( | const char * | mask, | |
| User * | user | |||
| ) |
Definition at line 954 of file users.c.
References user_::host, match_wild_nocase(), user_::nick, result, sstrdup(), user_::username, and user_::vhost.
Referenced by check_kick(), do_akick(), and get_ignore().
| Uid* new_uid | ( | const char * | nick, | |
| char * | uid | |||
| ) |
Definition at line 434 of file users.c.
References HASH2, uid_::next, uid_::nick, NICKMAX, uid_::prev, scalloc(), sstrdup(), strscpy(), and uid_::uid.
Referenced by charybdis_cmd_bot_nick(), charybdis_cmd_nick(), ratbox_cmd_bot_nick(), ratbox_cmd_nick(), shadowircd_cmd_bot_nick(), and shadowircd_cmd_nick().
| static User* new_user | ( | const char * | nick | ) | [static] |
Definition at line 34 of file users.c.
References alog(), findnick(), HASH, user_::isSuperAdmin, LogMaxUsers, maxusercnt, maxusertime, user_::na, user_::next, user_::nick, NICKMAX, user_::nickTrack, user_::prev, scalloc(), strscpy(), nickalias_::u, and usercnt.
Referenced by do_nick().
| User* next_uid | ( | void | ) |
Definition at line 418 of file users.c.
References alog(), debug, user_::next, next_index_uid, user_::nick, and user_::uid.
Referenced by find_byuid().
| User* nextuser | ( | void | ) |
Definition at line 363 of file users.c.
References alog(), debug, user_::next, next_index, and user_::nick.
Referenced by add_sgline(), add_sqline(), delete_server(), do_noop(), and services_shutdown().
| void split_usermask | ( | const char * | mask, | |
| char ** | nick, | |||
| char ** | user, | |||
| char ** | host | |||
| ) |
| void update_host | ( | User * | user | ) |
Definition at line 105 of file users.c.
References alog(), common_get_vhost(), common_get_vident(), debug, nickcore_::flags, nickalias_::last_usermask, user_::na, nickalias_::nc, NI_SECURE, user_::nick, nick_identified(), nick_recognized(), and smalloc().
Referenced by change_user_host(), inspircd_set_umode(), plexus_set_umode(), rageircd_set_umode(), solidircd_set_umode(), ultiamte2_set_umode(), ultimate3_set_umode(), unreal_set_umode(), and viagra_set_umode().
User* current_uid [static] |
| uint32 maxusercnt = 0 |
| time_t maxusertime |
int next_index [static] |
int next_index_uid [static] |
1.5.7.1