summaryrefslogtreecommitdiff
path: root/include/services.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-11-20 21:45:30 -0500
committerAdam <Adam@anope.org>2010-12-12 19:35:27 -0500
commit246f44b9888161aecefc81f0ff17ddd893287e3c (patch)
treeb89607a9ad9c91914f292fc54cc32213a8d9f5c4 /include/services.h
parenta85112172d842aa74aa5531788d383328d153e74 (diff)
Added cs_mode, rewrote the old list mode code, and added CIDR support
Diffstat (limited to 'include/services.h')
-rw-r--r--include/services.h35
1 files changed, 21 insertions, 14 deletions
diff --git a/include/services.h b/include/services.h
index 38abf931f..4d2401883 100644
--- a/include/services.h
+++ b/include/services.h
@@ -453,9 +453,6 @@ struct IRCDVar
int svsmode_ucmode; /* Can remove User Channel Modes with SVSMODE */
int sglineenforce;
int ts6; /* ircd is TS6 */
- int cidrchanbei; /* channel bans/excepts/invites support CIDR (syntax: +b *!*@192.168.0.0/15)
- * 0 for no support, 1 for strict cidr support, anything else
- * for ircd specific support (nefarious only cares about first /mask) */
const char *globaltldprefix; /* TLD prefix used for Global */
unsigned maxmodes; /* Max modes to send per line */
};
@@ -636,7 +633,6 @@ enum ChannelAccess
CA_AUTOVOICE,
CA_OPDEOP, /* ChanServ commands OP and DEOP */
CA_ACCESS_LIST,
- CA_CLEAR,
CA_NOJOIN, /* Maximum */
CA_ACCESS_CHANGE,
CA_MEMO,
@@ -662,6 +658,7 @@ enum ChannelAccess
CA_BANME,
CA_BAN,
CA_TOPIC,
+ CA_MODE,
CA_INFO,
CA_AUTOOWNER,
CA_OWNER,
@@ -756,7 +753,7 @@ struct LevelInfo
enum EntryType
{
ENTRYTYPE_NONE,
- ENTRYTYPE_CIDR4,
+ ENTRYTYPE_CIDR,
ENTRYTYPE_NICK_WILD,
ENTRYTYPE_NICK,
ENTRYTYPE_USER_WILD,
@@ -767,17 +764,27 @@ enum EntryType
class Entry : public Flags<EntryType>
{
+ Anope::string mask;
+
public:
- Entry *next, *prev;
- uint32 cidr_ip; /* IP mask for CIDR matching */
- uint32 cidr_mask; /* Netmask for CIDR matching */
- Anope::string nick, user, host, mask;
-};
+ unsigned char cidr_len;
+ Anope::string nick, user, host;
-struct EList
-{
- Entry *entries;
- int32 count;
+ /** Constructor
+ * @param _host A full nick!ident@host/cidr mask
+ */
+ Entry(const Anope::string &_host);
+
+ /** Get the banned mask for this entry
+ * @return The mask
+ */
+ const Anope::string GetMask();
+
+ /** Check if this entry matches a user
+ * @param u The user
+ * @return true on match
+ */
+ bool Matches(User *u) const;
};
/*************************************************************************/