]> jfr.im git - irc/rqf/shadowircd.git/blame - doc/extban.txt
Don't suggest putting values in an enum that are not in the enum.
[irc/rqf/shadowircd.git] / doc / extban.txt
CommitLineData
212380e3 1Extended bans
2Jilles Tjoelker <jilles -at- stack.nl>
3--------------------------------------
4
5Extended bans (ban conditionals) allow different checks than the usual
6nick!user@host or nick!user@ip match to determine whether someone should
7be banned, quieted, exempted or invited.
8
9Extended bans are of the form $[~]<type>[:<data>]. The <type> is one
10character (case insensitive) and determines the type of match. Most types
11allow or require an extra field <data>. If the tilde (~) is present, the
12result of the comparison will be negated, unless the ban is invalid in which
13case it will never match. Invalid bans are ones where <data> is missing but
14required or where <data> is otherwise invalid as noted below.
15
16Unless noted below, all types can be used with +b, +q, +e and +I.
17
18If any extended ban types are loaded, they are listed in 005 (RPL_ISUPPORT)
19as EXTBAN=$:<types>.
20
21Local users cannot add extended bans of an unknown type or invalid bans. If a
22remote user adds an extended ban of an unknown type, the mode change is
23processed normally. Furthermore, extended bans of an unknown type can always be
24listed or removed.
25
26The ability to send to a channel is cached; this cache may not be updated
27if a condition for an extended ban changes. To work around this, part and
28rejoin the channel, or add or remove a +b, +q or +e entry.
29
30The extban types that come with charybdis are:
31
32extb_account.so
33 $a
34matches all logged in users
35 $a:<mask>
36matches users logged in with a username matching the mask (* and ? wildcards)
37
38extb_channel.so
39 $c:<channel>
40matches users who are on the given channel; this is only valid if the channel
41exists and is not +s or +p. (The ops of the channel the ban is on cannot
42necessarily see whether the user is in the target channel, so it should not
43influence whether they can join either.)
44
45extb_oper.so
46 $o
47matches opers (most useful with +I)
48
49extb_realname.so
50 $r:<mask>
51matches users with a realname (gecos) matching the mask (* and ? wildcards);
52this can only be used with +b and +q
53
54extb_server.so
55 $s:<mask>
56matches users connected to a server matching the mask (* and ? wildcards);
57this can only be used with +b and +q
58
59Comparisons:
60
61+b $~a is similar to +r but also prevents not logged in users talking or
62changing their nick while on channel.
63
64+iI $o is the same as +O in dreamforge-derived ircds.
65
66Creating extban types:
67
68extban_table, indexed by the extban character, contains function pointers
69of the following type:
70typedef int (*ExtbanFunc)(const char *data, struct Client *client_p,
71 struct Channel *chptr, long mode_type);
72
73The arguments are as follows:
74data: the text after the colon, NULL if there was no colon
75client_p: the client to check; this is always a local client, which may be
76on or off channel
77chptr: the channel
78mode_type: CHFL_BAN, CHFL_QUIET, CHFL_EXCEPTION or CHFL_INVEX
79
80The return value:
81EXTBAN_INVALID: the mask is invalid, it never matches even if negated and
82cannot be added; if this is returned for one client_p it must be returned
83for all
84EXTBAN_NOMATCH: the client_p does not match the mask
85EXTBAN_MATCH: the client_p matches the mask
86
87The function is called whenever a (local) client needs to be checked against
88a +bqeI entry of the given extban type, and whenever a local client tries to
89add such an entry. (Clients are allowed to add bans matching themselves.)
90
91--
92$Id: extban.txt 1639 2006-06-04 23:26:47Z jilles $