#include "stdinc.h"
#include "tools.h"
#include "channel.h"
#include "channel_mode.h"
#include "client.h"
#include "common.h"
#include "hash.h"
#include "hostmask.h"
#include "irc_string.h"
#include "sprintf_irc.h"
#include "ircd.h"
#include "list.h"
#include "numeric.h"
#include "s_serv.h"
#include "s_user.h"
#include "send.h"
#include "whowas.h"
#include "s_conf.h"
#include "event.h"
#include "memory.h"
#include "balloc.h"
#include "s_log.h"
#include "msg.h"
Vai al codice sorgente di questo file.
Strutture dati | |
struct | mode_letter |
struct | ChannelMode |
Definizioni | |
#define | BAN_FUDGE 10 |
#define | NCHCAPS (sizeof(channel_capabs)/sizeof(int)) |
#define | NCHCAP_COMBOS (1 << NCHCAPS) |
#define | SM_ERR_NOTS 0x00000001 |
#define | SM_ERR_NOOPS 0x00000002 |
#define | SM_ERR_UNKNOWN 0x00000004 |
#define | SM_ERR_RPL_B 0x00000008 |
#define | SM_ERR_RPL_E 0x00000010 |
#define | SM_ERR_NOTONCHANNEL 0x00000020 |
#define | SM_ERR_RPL_I 0x00000040 |
Funzioni | |
static char * | check_string (char *) |
static char * | fix_key (char *) |
static char * | fix_key_old (char *) |
static void | chm_nosuch (struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *) |
static void | chm_simple (struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *) |
static void | chm_limit (struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *) |
static void | chm_key (struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *) |
static void | chm_op (struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *) |
static void | chm_voice (struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *) |
static void | chm_ban (struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *) |
static void | chm_except (struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *) |
static void | chm_invex (struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *) |
static void | send_cap_mode_changes (struct Client *, struct Client *, struct Channel *, int, int) |
static void | send_mode_changes (struct Client *, struct Client *, struct Channel *, char *) |
int | add_id (struct Client *client_p, struct Channel *chptr, char *banid, int type) |
static int | del_id (struct Channel *chptr, char *banid, int type) |
void | channel_modes (struct Channel *chptr, struct Client *client_p, char *mbuf, char *pbuf) |
void | init_chcap_usage_counts (void) |
void | set_chcap_usage_counts (struct Client *serv_p) |
void | unset_chcap_usage_counts (struct Client *serv_p) |
void | clear_ban_cache (struct Channel *chptr) |
void | clear_ban_cache_client (struct Client *client_p) |
static int | get_channel_access (struct Client *source_p, struct Membership *member) |
void | set_channel_mode (struct Client *client_p, struct Client *source_p, struct Channel *chptr, struct Membership *member, int parc, char *parv[], char *chname) |
Variabili | |
static char | nuh_mask [MAXPARA][IRCD_BUFSIZE] |
static char | modebuf [IRCD_BUFSIZE] |
static char | parabuf [MODEBUFLEN] |
static struct ChModeChange | mode_changes [IRCD_BUFSIZE] |
static int | mode_count |
static int | mode_limit |
static int | simple_modes_mask |
static int | channel_capabs [] = { CAP_EX, CAP_IE, CAP_TS6 } |
static struct ChCapCombo | chcap_combos [NCHCAP_COMBOS] |
BlockHeap * | ban_heap |
static struct mode_letter | flags [] |
static struct ChannelMode | ModeTable [255] |
#define BAN_FUDGE 10 |
Definizione alla linea 93 del file channel_mode.c.
Referenziato da send_cap_mode_changes(), e send_mode_changes().
#define NCHCAP_COMBOS (1 << NCHCAPS) |
Definizione alla linea 95 del file channel_mode.c.
Referenziato da init_chcap_usage_counts(), send_mode_changes(), set_chcap_usage_counts(), e unset_chcap_usage_counts().
#define NCHCAPS (sizeof(channel_capabs)/sizeof(int)) |
#define SM_ERR_NOOPS 0x00000002 |
Definizione alla linea 441 del file channel_mode.c.
Referenziato da chm_ban(), chm_except(), chm_invex(), chm_op(), e chm_simple().
#define SM_ERR_NOTONCHANNEL 0x00000020 |
#define SM_ERR_NOTS 0x00000001 |
Definizione alla linea 440 del file channel_mode.c.
#define SM_ERR_RPL_B 0x00000008 |
#define SM_ERR_RPL_E 0x00000010 |
#define SM_ERR_RPL_I 0x00000040 |
#define SM_ERR_UNKNOWN 0x00000004 |
Definizione alla linea 153 del file channel_mode.c.
Riferimenti Ban::addr, ban_heap, Channel::banlist, Ban::bits, BlockHeapAlloc(), check_string(), CHFL_BAN, CHFL_EXCEPTION, CHFL_INVEX, Channel::chname, clear_ban_cache(), collapse(), ConfigChannel, CurrentTime, _dlink_node::data, DLINK_FOREACH, dlink_list_length, dlinkAdd(), DupString, ERR_BANLISTFULL, Channel::exceptlist, form_str(), _dlink_list::head, Client::host, Ban::host, HOSTLEN, split_nuh_item::hostptr, split_nuh_item::hostsize, Channel::invexlist, irccmp(), ircsprintf(), IsClient, Ban::len, config_channel_entry::max_bans, me, MyClient, MyMalloc(), Client::name, Ban::name, NICKLEN, split_nuh_item::nickptr, split_nuh_item::nicksize, Ban::node, split_nuh_item::nuhmask, parse_netmask(), sendto_one(), split_nuh(), Ban::type, USERLEN, Client::username, Ban::username, split_nuh_item::userptr, split_nuh_item::usersize, Ban::when, e Ban::who.
Referenziato da chm_ban(), chm_except(), chm_invex(), e ms_bmask().
Definizione alla linea 356 del file channel_mode.c.
Riferimenti flags, ircsprintf(), IsMember, IsServer, Mode::key, mode_letter::letter, Mode::limit, Mode::mode, Channel::mode, e mode_letter::mode.
Referenziato da m_mode(), ms_sjoin(), operspy_mode(), e send_channel_modes().
static char * check_string | ( | char * | s | ) | [static] |
static void chm_ban | ( | struct Client * | client_p, | |
struct Client * | source_p, | |||
struct Channel * | chptr, | |||
int | parc, | |||
int * | parn, | |||
char ** | parv, | |||
int * | errors, | |||
int | alev, | |||
int | dir, | |||
char | c, | |||
void * | d, | |||
const char * | chname | |||
) | [static] |
Definizione alla linea 622 del file channel_mode.c.
Riferimenti add_id(), ALL_MEMBERS, ChModeChange::arg, Channel::banlist, ChModeChange::caps, CHACCESS_HALFOP, CHACCESS_NOTONCHAN, CHFL_BAN, _dlink_node::data, del_id(), ChModeChange::dir, DLINK_FOREACH, ERR_CHANOPRIVSNEEDED, ERR_NOTONCHANNEL, form_str(), _dlink_list::head, Ban::host, ChModeChange::id, IsServer, ChModeChange::letter, MAXMODEPARAMS, me, ChModeChange::mems, MODE_ADD, mode_changes, mode_count, MODE_DEL, mode_limit, MODE_QUERY, MyClient, Ban::name, Client::name, ChModeChange::nocaps, nuh_mask, RPL_BANLIST, RPL_ENDOFBANLIST, sendto_one(), SM_ERR_NOOPS, SM_ERR_RPL_B, Ban::username, Ban::when, e Ban::who.
static void chm_except | ( | struct Client * | client_p, | |
struct Client * | source_p, | |||
struct Channel * | chptr, | |||
int | parc, | |||
int * | parn, | |||
char ** | parv, | |||
int * | errors, | |||
int | alev, | |||
int | dir, | |||
char | c, | |||
void * | d, | |||
const char * | chname | |||
) | [static] |
Definizione alla linea 705 del file channel_mode.c.
Riferimenti add_id(), ChModeChange::arg, CAP_EX, ChModeChange::caps, CHACCESS_HALFOP, CHACCESS_NOTONCHAN, CHFL_EXCEPTION, ConfigChannel, _dlink_node::data, del_id(), ChModeChange::dir, DLINK_FOREACH, ERR_CHANOPRIVSNEEDED, ERR_NOTONCHANNEL, Channel::exceptlist, form_str(), _dlink_list::head, Ban::host, ChModeChange::id, IsServer, ChModeChange::letter, MAXMODEPARAMS, me, ChModeChange::mems, MODE_ADD, mode_changes, mode_count, MODE_DEL, mode_limit, MODE_QUERY, MyClient, Ban::name, Client::name, ChModeChange::nocaps, nuh_mask, ONLY_CHANOPS, ONLY_SERVERS, RPL_ENDOFEXCEPTLIST, RPL_EXCEPTLIST, sendto_one(), SM_ERR_NOOPS, SM_ERR_RPL_E, config_channel_entry::use_except, Ban::username, Ban::when, e Ban::who.
static void chm_invex | ( | struct Client * | client_p, | |
struct Client * | source_p, | |||
struct Channel * | chptr, | |||
int | parc, | |||
int * | parn, | |||
char ** | parv, | |||
int * | errors, | |||
int | alev, | |||
int | dir, | |||
char | c, | |||
void * | d, | |||
const char * | chname | |||
) | [static] |
Definizione alla linea 799 del file channel_mode.c.
Riferimenti add_id(), ChModeChange::arg, CAP_IE, ChModeChange::caps, CHACCESS_HALFOP, CHACCESS_NOTONCHAN, CHFL_INVEX, ConfigChannel, _dlink_node::data, del_id(), ChModeChange::dir, DLINK_FOREACH, ERR_CHANOPRIVSNEEDED, ERR_NOTONCHANNEL, form_str(), _dlink_list::head, Ban::host, ChModeChange::id, Channel::invexlist, IsServer, ChModeChange::letter, MAXMODEPARAMS, me, ChModeChange::mems, MODE_ADD, mode_changes, mode_count, MODE_DEL, mode_limit, MODE_QUERY, MyClient, Ban::name, Client::name, ChModeChange::nocaps, nuh_mask, ONLY_CHANOPS, ONLY_SERVERS, RPL_ENDOFINVITELIST, RPL_INVITELIST, sendto_one(), SM_ERR_NOOPS, SM_ERR_RPL_I, config_channel_entry::use_invex, Ban::username, Ban::when, e Ban::who.
static void chm_key | ( | struct Client * | client_p, | |
struct Client * | source_p, | |||
struct Channel * | chptr, | |||
int | parc, | |||
int * | parn, | |||
char ** | parv, | |||
int * | errors, | |||
int | alev, | |||
int | dir, | |||
char | c, | |||
void * | d, | |||
const char * | chname | |||
) | [static] |
Definizione alla linea 1232 del file channel_mode.c.
Riferimenti ALL_MEMBERS, ChModeChange::arg, ChModeChange::caps, CHACCESS_NOTONCHAN, ChModeChange::dir, ERR_CHANOPRIVSNEEDED, ERR_NOTONCHANNEL, fix_key(), fix_key_old(), form_str(), ChModeChange::id, Mode::key, ChModeChange::letter, me, ChModeChange::mems, Channel::mode, MODE_ADD, mode_changes, mode_count, MODE_DEL, MODE_QUERY, MyClient, Client::name, ChModeChange::nocaps, sendto_one(), e strlcpy().
static void chm_limit | ( | struct Client * | client_p, | |
struct Client * | source_p, | |||
struct Channel * | chptr, | |||
int | parc, | |||
int * | parn, | |||
char ** | parv, | |||
int * | errors, | |||
int | alev, | |||
int | dir, | |||
char | c, | |||
void * | d, | |||
const char * | chname | |||
) | [static] |
Definizione alla linea 1167 del file channel_mode.c.
Riferimenti ALL_MEMBERS, ChModeChange::arg, ChModeChange::caps, CHACCESS_NOTONCHAN, ChModeChange::dir, ERR_CHANOPRIVSNEEDED, ERR_NOTONCHANNEL, form_str(), ChModeChange::id, ircsprintf(), ChModeChange::letter, Mode::limit, me, ChModeChange::mems, Channel::mode, MODE_ADD, mode_changes, mode_count, MODE_DEL, MODE_QUERY, Client::name, ChModeChange::nocaps, e sendto_one().
static void chm_nosuch | ( | struct Client * | client_p, | |
struct Client * | source_p, | |||
struct Channel * | chptr, | |||
int | parc, | |||
int * | parn, | |||
char ** | parv, | |||
int * | errors, | |||
int | alev, | |||
int | dir, | |||
char | c, | |||
void * | d, | |||
const char * | chname | |||
) | [static] |
Definizione alla linea 546 del file channel_mode.c.
Riferimenti ERR_UNKNOWNMODE, form_str(), me, Client::name, sendto_one(), e SM_ERR_UNKNOWN.
static void chm_op | ( | struct Client * | client_p, | |
struct Client * | source_p, | |||
struct Channel * | chptr, | |||
int | parc, | |||
int * | parn, | |||
char ** | parv, | |||
int * | errors, | |||
int | alev, | |||
int | dir, | |||
char | c, | |||
void * | d, | |||
const char * | chname | |||
) | [static] |
Definizione alla linea 924 del file channel_mode.c.
Riferimenti AddMemberFlag, ALL_MEMBERS, ChModeChange::arg, CAP_HOPS, ChModeChange::caps, CHACCESS_CHANOP, CHACCESS_NOTONCHAN, CHFL_CHANOP, CHFL_DEOPPED, CHFL_HALFOP, ChModeChange::client, DelMemberFlag, ChModeChange::dir, ERR_CHANOPRIVSNEEDED, ERR_NOTONCHANNEL, ERR_USERNOTINCHANNEL, find_channel_link(), find_chasing(), form_str(), has_member_flags(), Client::id, ChModeChange::id, IsClient, ChModeChange::letter, MAXMODEPARAMS, me, ChModeChange::mems, MODE_ADD, mode_changes, mode_count, MODE_DEL, mode_limit, MODE_QUERY, MyClient, Client::name, ChModeChange::nocaps, sendto_one(), SM_ERR_NOOPS, e SM_ERR_NOTONCHANNEL.
static void chm_simple | ( | struct Client * | client_p, | |
struct Client * | source_p, | |||
struct Channel * | chptr, | |||
int | parc, | |||
int * | parn, | |||
char ** | parv, | |||
int * | errors, | |||
int | alev, | |||
int | dir, | |||
char | c, | |||
void * | d, | |||
const char * | chname | |||
) | [static] |
Definizione alla linea 560 del file channel_mode.c.
Riferimenti ALL_MEMBERS, ChModeChange::arg, ChModeChange::caps, CHACCESS_CHANOP, CHACCESS_HALFOP, CHACCESS_NOTONCHAN, ChModeChange::dir, ERR_CHANOPRIVSNEEDED, ERR_NOTONCHANNEL, form_str(), ChModeChange::id, ChModeChange::letter, me, ChModeChange::mems, Mode::mode, Channel::mode, MODE_ADD, mode_changes, mode_count, MODE_DEL, MODE_PRIVATE, Client::name, ChModeChange::nocaps, sendto_one(), simple_modes_mask, e SM_ERR_NOOPS.
static void chm_voice | ( | struct Client * | client_p, | |
struct Client * | source_p, | |||
struct Channel * | chptr, | |||
int | parc, | |||
int * | parn, | |||
char ** | parv, | |||
int * | errors, | |||
int | alev, | |||
int | dir, | |||
char | c, | |||
void * | d, | |||
const char * | chname | |||
) | [static] |
Definizione alla linea 1104 del file channel_mode.c.
Riferimenti AddMemberFlag, ALL_MEMBERS, ChModeChange::arg, ChModeChange::caps, CHACCESS_NOTONCHAN, CHFL_VOICE, ChModeChange::client, DelMemberFlag, ChModeChange::dir, ERR_CHANOPRIVSNEEDED, ERR_NOTONCHANNEL, ERR_USERNOTINCHANNEL, find_channel_link(), find_chasing(), form_str(), has_member_flags(), Client::id, ChModeChange::id, IsClient, ChModeChange::letter, MAXMODEPARAMS, me, ChModeChange::mems, MODE_ADD, mode_changes, mode_count, MODE_DEL, mode_limit, MODE_QUERY, MyClient, Client::name, ChModeChange::nocaps, e sendto_one().
void clear_ban_cache | ( | struct Channel * | chptr | ) |
Definizione alla linea 898 del file channel_mode.c.
Riferimenti CHFL_BAN_CHECKED, CHFL_BAN_SILENCED, Membership::client_p, _dlink_node::data, DLINK_FOREACH, Membership::flags, _dlink_list::head, Channel::members, e MyConnect.
Referenziato da add_id(), del_id(), e ms_sjoin().
void clear_ban_cache_client | ( | struct Client * | client_p | ) |
Definizione alla linea 912 del file channel_mode.c.
Riferimenti Client::channel, CHFL_BAN_CHECKED, CHFL_BAN_SILENCED, _dlink_node::data, DLINK_FOREACH, Membership::flags, e _dlink_list::head.
Referenziato da change_local_nick().
static int del_id | ( | struct Channel * | chptr, | |
char * | banid, | |||
int | type | |||
) | [static] |
Definizione alla linea 262 del file channel_mode.c.
Riferimenti Channel::banlist, check_string(), CHFL_BAN, CHFL_EXCEPTION, CHFL_INVEX, clear_ban_cache(), _dlink_node::data, DLINK_FOREACH, Channel::exceptlist, _dlink_list::head, Ban::host, HOSTLEN, split_nuh_item::hostptr, split_nuh_item::hostsize, Channel::invexlist, irccmp(), ircsprintf(), L_ALL, Ban::name, NICKLEN, split_nuh_item::nickptr, split_nuh_item::nicksize, split_nuh_item::nuhmask, remove_ban(), sendto_realops_flags(), split_nuh(), UMODE_ALL, USERLEN, Ban::username, split_nuh_item::userptr, e split_nuh_item::usersize.
Referenziato da chm_ban(), chm_except(), e chm_invex().
static char * fix_key | ( | char * | arg | ) | [static] |
static char * fix_key_old | ( | char * | arg | ) | [static] |
static int get_channel_access | ( | struct Client * | source_p, | |
struct Membership * | member | |||
) | [static] |
Definizione alla linea 1390 del file channel_mode.c.
Riferimenti CHACCESS_CHANOP, CHACCESS_NOTONCHAN, CHACCESS_PEON, CHFL_CHANOP, CHFL_HALFOP, Membership::client_p, has_member_flags(), e MyClient.
Referenziato da set_channel_mode().
void init_chcap_usage_counts | ( | void | ) |
Definizione alla linea 467 del file channel_mode.c.
Riferimenti ChCapCombo::cap_no, ChCapCombo::cap_yes, channel_capabs, chcap_combos, NCHCAP_COMBOS, e NCHCAPS.
Referenziato da main().
static void send_cap_mode_changes | ( | struct Client * | client_p, | |
struct Client * | source_p, | |||
struct Channel * | chptr, | |||
int | cap, | |||
int | nocap | |||
) | [static] |
Definizione alla linea 1435 del file channel_mode.c.
Riferimenti ChModeChange::arg, BAN_FUDGE, CAP_TS6, Channel::channelts, Channel::chname, ChModeChange::dir, ChModeChange::id, Client::id, IRCD_BUFSIZE, ircsprintf(), ChModeChange::letter, LL_ICHAN, LL_ICLIENT, MAXMODEPARAMS, MODE_ADD, mode_changes, mode_count, MODE_QUERY, modebuf, MODEBUFLEN, Client::name, parabuf, e sendto_server().
Referenziato da send_mode_changes().
static void send_mode_changes | ( | struct Client * | client_p, | |
struct Client * | source_p, | |||
struct Channel * | chptr, | |||
char * | chname | |||
) | [static] |
Definizione alla linea 1552 del file channel_mode.c.
Riferimenti ALL_MEMBERS, ChModeChange::arg, BAN_FUDGE, chcap_combos, ConfigServerHide, ChModeChange::dir, config_server_hide::hide_servers, Client::host, IRCD_BUFSIZE, ircsprintf(), IsHidden, IsServer, ChModeChange::letter, MAXMODEPARAMS, me, MODE_ADD, mode_changes, mode_count, MODE_QUERY, modebuf, MODEBUFLEN, Client::name, NCHCAP_COMBOS, NO, NON_CHANOPS, ONLY_SERVERS, parabuf, send_cap_mode_changes(), sendto_channel_local(), e Client::username.
Referenziato da set_channel_mode().
void set_channel_mode | ( | struct Client * | client_p, | |
struct Client * | source_p, | |||
struct Channel * | chptr, | |||
struct Membership * | member, | |||
int | parc, | |||
char * | parv[], | |||
char * | chname | |||
) |
Definizione alla linea 1666 del file channel_mode.c.
Riferimenti ChannelMode::func, get_channel_access(), MODE_ADD, mode_count, MODE_DEL, mode_limit, MODE_QUERY, send_mode_changes(), e simple_modes_mask.
void set_chcap_usage_counts | ( | struct Client * | serv_p | ) |
Definizione alla linea 496 del file channel_mode.c.
Riferimenti ChCapCombo::cap_no, ChCapCombo::cap_yes, LocalUser::caps, chcap_combos, ChCapCombo::count, Client::localClient, e NCHCAP_COMBOS.
Referenziato da server_estab().
void unset_chcap_usage_counts | ( | struct Client * | serv_p | ) |
Definizione alla linea 523 del file channel_mode.c.
Riferimenti ChCapCombo::cap_no, ChCapCombo::cap_yes, LocalUser::caps, chcap_combos, ChCapCombo::count, Client::localClient, e NCHCAP_COMBOS.
Referenziato da exit_client().
int channel_capabs[] = { CAP_EX, CAP_IE, CAP_TS6 } [static] |
struct ChCapCombo chcap_combos[NCHCAP_COMBOS] [static] |
Definizione alla linea 110 del file channel_mode.c.
Referenziato da init_chcap_usage_counts(), send_mode_changes(), set_chcap_usage_counts(), e unset_chcap_usage_counts().
struct mode_letter flags[] [static] |
struct ChModeChange mode_changes[IRCD_BUFSIZE] [static] |
Definizione alla linea 101 del file channel_mode.c.
Referenziato da chm_ban(), chm_except(), chm_invex(), chm_key(), chm_limit(), chm_op(), chm_simple(), chm_voice(), send_cap_mode_changes(), e send_mode_changes().
int mode_count [static] |
Definizione alla linea 102 del file channel_mode.c.
Referenziato da chm_ban(), chm_except(), chm_invex(), chm_key(), chm_limit(), chm_op(), chm_simple(), chm_voice(), send_cap_mode_changes(), send_mode_changes(), e set_channel_mode().
int mode_limit [static] |
Definizione alla linea 103 del file channel_mode.c.
Referenziato da chm_ban(), chm_except(), chm_invex(), chm_op(), chm_voice(), e set_channel_mode().
char modebuf[IRCD_BUFSIZE] [static] |
Definizione alla linea 99 del file channel_mode.c.
struct ChannelMode ModeTable[255] [static] |
Definizione alla linea 1313 del file channel_mode.c.
char nuh_mask[MAXPARA][IRCD_BUFSIZE] [static] |
Definizione alla linea 97 del file channel_mode.c.
Referenziato da chm_ban(), chm_except(), e chm_invex().
char parabuf[MODEBUFLEN] [static] |
Definizione alla linea 100 del file channel_mode.c.
int simple_modes_mask [static] |
Definizione alla linea 104 del file channel_mode.c.
Referenziato da chm_simple(), e set_channel_mode().