]> jfr.im git - solanum.git/blame - doc/features/extban.txt
modules/m_challenge.c: log correct mechanism
[solanum.git] / doc / features / extban.txt
CommitLineData
212380e3
AC
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)
4229cef3 19as EXTBAN=$,<types>.
212380e3
AC
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
c57762ed
DS
45extb_canjoin.so
46 $j:<channel>
47matches users who are or are not banned from a specified channel
48
212380e3
AC
49extb_oper.so
50 $o
51matches opers (most useful with +I)
52
53extb_realname.so
54 $r:<mask>
55matches users with a realname (gecos) matching the mask (* and ? wildcards);
56this can only be used with +b and +q
57
58extb_server.so
59 $s:<mask>
60matches users connected to a server matching the mask (* and ? wildcards);
61this can only be used with +b and +q
62
c57762ed
DS
63extb_extgecos.so
64 $x:<mask>
65bans all users with matching nick!user@host#gecos
66
67extb_ssl.so
68 $z
69matches all SSL users
70
212380e3
AC
71Comparisons:
72
73+b $~a is similar to +r but also prevents not logged in users talking or
74changing their nick while on channel.
75
76+iI $o is the same as +O in dreamforge-derived ircds.
77
78Creating extban types:
79
80extban_table, indexed by the extban character, contains function pointers
81of the following type:
82typedef int (*ExtbanFunc)(const char *data, struct Client *client_p,
83 struct Channel *chptr, long mode_type);
84
85The arguments are as follows:
86data: the text after the colon, NULL if there was no colon
87client_p: the client to check; this is always a local client, which may be
88on or off channel
89chptr: the channel
90mode_type: CHFL_BAN, CHFL_QUIET, CHFL_EXCEPTION or CHFL_INVEX
91
92The return value:
93EXTBAN_INVALID: the mask is invalid, it never matches even if negated and
94cannot be added; if this is returned for one client_p it must be returned
95for all
96EXTBAN_NOMATCH: the client_p does not match the mask
97EXTBAN_MATCH: the client_p matches the mask
98
99The function is called whenever a (local) client needs to be checked against
100a +bqeI entry of the given extban type, and whenever a local client tries to
101add such an entry. (Clients are allowed to add bans matching themselves.)
102