#define FlagClr(set,flag) ((set)->bits[FLAGSET_INDEX(flag)] &= ~FLAGSET_MASK(flag))
/** String containing valid user modes, in no particular order. */
#define FlagClr(set,flag) ((set)->bits[FLAGSET_INDEX(flag)] &= ~FLAGSET_MASK(flag))
/** String containing valid user modes, in no particular order. */
FLAG_BURST, /**< Server is receiving a net.burst */
FLAG_BURST_ACK, /**< Server is waiting for eob ack */
FLAG_IPCHECK, /**< Added or updated IPregistry data */
FLAG_BURST, /**< Server is receiving a net.burst */
FLAG_BURST_ACK, /**< Server is waiting for eob ack */
FLAG_IPCHECK, /**< Added or updated IPregistry data */
FLAG_LOCOP, /**< Local operator -- SRB */
FLAG_SERVNOTICE, /**< server notices such as kill */
FLAG_OPER, /**< Operator */
FLAG_LOCOP, /**< Local operator -- SRB */
FLAG_SERVNOTICE, /**< server notices such as kill */
FLAG_OPER, /**< Operator */
FLAG_DEBUG, /**< send global debug/anti-hack info */
FLAG_ACCOUNT, /**< account name has been set */
FLAG_HIDDENHOST, /**< user's host is hidden */
FLAG_DEBUG, /**< send global debug/anti-hack info */
FLAG_ACCOUNT, /**< account name has been set */
FLAG_HIDDENHOST, /**< user's host is hidden */
FLAG_LAST_FLAG, /**< number of flags */
FLAG_LOCAL_UMODES = FLAG_LOCOP, /**< First local mode flag */
FLAG_GLOBAL_UMODES = FLAG_OPER /**< First global mode flag */
FLAG_LAST_FLAG, /**< number of flags */
FLAG_LOCAL_UMODES = FLAG_LOCOP, /**< First local mode flag */
FLAG_GLOBAL_UMODES = FLAG_OPER /**< First global mode flag */
time_t con_nexttarget;/**< Next time a target change is allowed */
time_t con_lasttime; /**< Last time data read from socket */
time_t con_since; /**< Last time we accepted a command */
time_t con_nexttarget;/**< Next time a target change is allowed */
time_t con_lasttime; /**< Last time data read from socket */
time_t con_since; /**< Last time we accepted a command */
struct MsgQ con_sendQ; /**< Outgoing message queue */
struct DBuf con_recvQ; /**< Incoming data yet to be parsed */
unsigned int con_sendM; /**< Stats: protocol messages sent */
struct MsgQ con_sendQ; /**< Outgoing message queue */
struct DBuf con_recvQ; /**< Incoming data yet to be parsed */
unsigned int con_sendM; /**< Stats: protocol messages sent */
HandlerType con_handler; /**< Message index into command table
for parsing. */
struct ListingArgs* con_listing; /**< Current LIST status. */
HandlerType con_handler; /**< Message index into command table
for parsing. */
struct ListingArgs* con_listing; /**< Current LIST status. */
unsigned int con_max_sendq; /**< cached max send queue for client */
unsigned int con_ping_freq; /**< cached ping freq */
unsigned short con_lastsq; /**< # 2k blocks when sendqueued
unsigned int con_max_sendq; /**< cached max send queue for client */
unsigned int con_ping_freq; /**< cached ping freq */
unsigned short con_lastsq; /**< # 2k blocks when sendqueued
struct Privs con_privs; /**< Oper privileges */
struct CapSet con_capab; /**< Client capabilities (from us) */
struct CapSet con_active; /**< Active capabilities (to us) */
struct Privs con_privs; /**< Oper privileges */
struct CapSet con_capab; /**< Client capabilities (from us) */
struct CapSet con_active; /**< Active capabilities (to us) */
- struct AuthRequest* con_auth; /**< auth request for client */
- struct IAuthRequest* con_iauth; /**< iauth request for client */
+ struct AuthRequest* con_auth; /**< Auth request for client */
+ struct SSLConnection* con_ssl; /**< SSL connection for client */
-#define CLIREG_NICK 0x0001 /**< Client must set nickname */
-#define CLIREG_USER 0x0002 /**< Client must set username */
-#define CLIREG_COOKIE 0x0004 /**< Client must return cookie */
-#define CLIREG_CAP 0x0008 /**< Client in capability negotiation */
-
-#define CLIREG_INIT (CLIREG_NICK | CLIREG_USER | CLIREG_COOKIE)
-
#define cli_capab(cli) con_capab(cli_connect(cli))
/** Get active client capabilities for client */
#define cli_active(cli) con_active(cli_connect(cli))
#define cli_capab(cli) con_capab(cli_connect(cli))
/** Get active client capabilities for client */
#define cli_active(cli) con_active(cli_connect(cli))
/** Get client name. */
#define cli_name(cli) ((cli)->cli_name)
/** Get client username (ident). */
#define cli_username(cli) ((cli)->cli_username)
/** Get client realname (information field). */
#define cli_info(cli) ((cli)->cli_info)
/** Get client name. */
#define cli_name(cli) ((cli)->cli_name)
/** Get client username (ident). */
#define cli_username(cli) ((cli)->cli_username)
/** Get client realname (information field). */
#define cli_info(cli) ((cli)->cli_info)
/** Get number of incoming bytes queued for client. */
#define cli_count(cli) con_count(cli_connect(cli))
/** Get number of incoming bytes queued for client. */
#define cli_count(cli) con_count(cli_connect(cli))
#define cli_nextnick(cli) con_nextnick(cli_connect(cli))
/** Get next time a target change is allowed for the client. */
#define cli_nexttarget(cli) con_nexttarget(cli_connect(cli))
#define cli_nextnick(cli) con_nextnick(cli_connect(cli))
/** Get next time a target change is allowed for the client. */
#define cli_nexttarget(cli) con_nexttarget(cli_connect(cli))
/** Get SendQ for client. */
#define cli_sendQ(cli) con_sendQ(cli_connect(cli))
/** Get RecvQ for client. */
/** Get SendQ for client. */
#define cli_sendQ(cli) con_sendQ(cli_connect(cli))
/** Get RecvQ for client. */
#define cli_proc(cli) con_proc(cli_connect(cli))
/** Get auth request for client. */
#define cli_auth(cli) con_auth(cli_connect(cli))
#define cli_proc(cli) con_proc(cli_connect(cli))
/** Get auth request for client. */
#define cli_auth(cli) con_auth(cli_connect(cli))
#define con_lasttime(con) ((con)->con_lasttime)
/** Get last time we accepted a command from the connection. */
#define con_since(con) ((con)->con_since)
#define con_lasttime(con) ((con)->con_lasttime)
/** Get last time we accepted a command from the connection. */
#define con_since(con) ((con)->con_since)
/** Get SendQ for connection. */
#define con_sendQ(con) ((con)->con_sendQ)
/** Get RecvQ for connection. */
/** Get SendQ for connection. */
#define con_sendQ(con) ((con)->con_sendQ)
/** Get RecvQ for connection. */
#define con_handler(con) ((con)->con_handler)
/** Get the LIST status for the connection. */
#define con_listing(con) ((con)->con_listing)
#define con_handler(con) ((con)->con_handler)
/** Get the LIST status for the connection. */
#define con_listing(con) ((con)->con_listing)
/** Get the maximum permitted SendQ size for the connection. */
#define con_max_sendq(con) ((con)->con_max_sendq)
/** Get the ping frequency for the connection. */
/** Get the maximum permitted SendQ size for the connection. */
#define con_max_sendq(con) ((con)->con_max_sendq)
/** Get the ping frequency for the connection. */
#define con_active(con) (&(con)->con_active)
/** Get the auth request for the connection. */
#define con_auth(con) ((con)->con_auth)
#define con_active(con) (&(con)->con_active)
/** Get the auth request for the connection. */
#define con_auth(con) ((con)->con_auth)
#define STAT_CONNECTING 0x001 /**< connecting to another server */
#define STAT_HANDSHAKE 0x002 /**< pass - server sent */
#define STAT_CONNECTING 0x001 /**< connecting to another server */
#define STAT_HANDSHAKE 0x002 /**< pass - server sent */
#define HasFlag(cli, flag) FlagHas(&cli_flags(cli), flag)
/** Return non-zero if the client is an IRC operator (global or local). */
#define HasFlag(cli, flag) FlagHas(&cli_flags(cli), flag)
/** Return non-zero if the client is an IRC operator (global or local). */
/** Return non-zero if the client's connection is blocked. */
#define IsBlocked(x) HasFlag(x, FLAG_BLOCKED)
/** Return non-zero if the client's connection is still being burst. */
/** Return non-zero if the client's connection is blocked. */
#define IsBlocked(x) HasFlag(x, FLAG_BLOCKED)
/** Return non-zero if the client's connection is still being burst. */
#define IsDeaf(x) HasFlag(x, FLAG_DEAF)
/** Return non-zero if the client has been IP-checked for clones. */
#define IsIPChecked(x) HasFlag(x, FLAG_IPCHECK)
#define IsDeaf(x) HasFlag(x, FLAG_DEAF)
/** Return non-zero if the client has been IP-checked for clones. */
#define IsIPChecked(x) HasFlag(x, FLAG_IPCHECK)
/** Return non-zero if we have received an ident response for the client. */
#define IsIdented(x) HasFlag(x, FLAG_GOTID)
/** Return non-zero if the client has set mode +i (invisible). */
#define IsInvisible(x) HasFlag(x, FLAG_INVISIBLE)
/** Return non-zero if the client caused a net.burst. */
#define IsJunction(x) HasFlag(x, FLAG_JUNCTION)
/** Return non-zero if we have received an ident response for the client. */
#define IsIdented(x) HasFlag(x, FLAG_GOTID)
/** Return non-zero if the client has set mode +i (invisible). */
#define IsInvisible(x) HasFlag(x, FLAG_INVISIBLE)
/** Return non-zero if the client caused a net.burst. */
#define IsJunction(x) HasFlag(x, FLAG_JUNCTION)
-/** Return non-zero if the client has set mode +O (local operator). */
-#define IsLocOp(x) HasFlag(x, FLAG_LOCOP)
+/** Return non-zero if the client has set mode +O (local operator) locally. */
+#define IsLocOp(x) (MyConnect(x) && HasFlag(x, FLAG_LOCOP))
/** Return non-zero if the client has set mode +o (global operator). */
#define IsOper(x) HasFlag(x, FLAG_OPER)
/** Return non-zero if the client has an active UDP ping request. */
/** Return non-zero if the client has set mode +o (global operator). */
#define IsOper(x) HasFlag(x, FLAG_OPER)
/** Return non-zero if the client has an active UDP ping request. */
#define IsAccount(x) HasFlag(x, FLAG_ACCOUNT)
/** Return non-zero if the client has set mode +x (hidden host). */
#define IsHiddenHost(x) HasFlag(x, FLAG_HIDDENHOST)
#define IsAccount(x) HasFlag(x, FLAG_ACCOUNT)
/** Return non-zero if the client has set mode +x (hidden host). */
#define IsHiddenHost(x) HasFlag(x, FLAG_HIDDENHOST)
/** Return non-zero if the client has an active PING request. */
#define IsPingSent(x) HasFlag(x, FLAG_PINGSENT)
/** Return non-zero if the client has an active PING request. */
#define IsPingSent(x) HasFlag(x, FLAG_PINGSENT)
#define SetGotId(x) SetFlag(x, FLAG_GOTID)
/** Mark a client as being IP-checked. */
#define SetIPChecked(x) SetFlag(x, FLAG_IPCHECK)
#define SetGotId(x) SetFlag(x, FLAG_GOTID)
/** Mark a client as being IP-checked. */
#define SetIPChecked(x) SetFlag(x, FLAG_IPCHECK)
/** Mark a client as having mode +i (invisible). */
#define SetInvisible(x) SetFlag(x, FLAG_INVISIBLE)
/** Mark a client as causing a net.join. */
/** Mark a client as having mode +i (invisible). */
#define SetInvisible(x) SetFlag(x, FLAG_INVISIBLE)
/** Mark a client as causing a net.join. */
#define SetAccount(x) SetFlag(x, FLAG_ACCOUNT)
/** Mark a client as having mode +x (hidden host). */
#define SetHiddenHost(x) SetFlag(x, FLAG_HIDDENHOST)
#define SetAccount(x) SetFlag(x, FLAG_ACCOUNT)
/** Mark a client as having mode +x (hidden host). */
#define SetHiddenHost(x) SetFlag(x, FLAG_HIDDENHOST)
/** Mark a client as having a pending PING. */
#define SetPingSent(x) SetFlag(x, FLAG_PINGSENT)
/** Mark a client as having a pending PING. */
#define SetPingSent(x) SetFlag(x, FLAG_PINGSENT)
#define ClearServNotice(x) ClrFlag(x, FLAG_SERVNOTICE)
/** Remove mode +x (hidden host) from the client. */
#define ClearHiddenHost(x) ClrFlag(x, FLAG_HIDDENHOST)
#define ClearServNotice(x) ClrFlag(x, FLAG_SERVNOTICE)
/** Remove mode +x (hidden host) from the client. */
#define ClearHiddenHost(x) ClrFlag(x, FLAG_HIDDENHOST)
/** Clear the client's pending PING flag. */
#define ClearPingSent(x) ClrFlag(x, FLAG_PINGSENT)
/** Clear the client's pending PING flag. */
#define ClearPingSent(x) ClrFlag(x, FLAG_PINGSENT)
#define SNO_CONNEXIT 0x4000 /**< client connect/exit (ugh) */
#define SNO_AUTO 0x8000 /**< AUTO G-Lines */
#define SNO_DEBUG 0x10000 /**< debugging messages (DEBUGMODE only) */
#define SNO_CONNEXIT 0x4000 /**< client connect/exit (ugh) */
#define SNO_AUTO 0x8000 /**< AUTO G-Lines */
#define SNO_DEBUG 0x10000 /**< debugging messages (DEBUGMODE only) */
/** Server notice bits enabled by default for IRC operators. */
#define SNO_OPERDEFAULT (SNO_DEFAULT|SNO_HACK2|SNO_HACK4|SNO_THROTTLE|SNO_OLDSNO)
/** Server notice bits reserved to IRC operators. */
/** Server notice bits enabled by default for IRC operators. */
#define SNO_OPERDEFAULT (SNO_DEFAULT|SNO_HACK2|SNO_HACK4|SNO_THROTTLE|SNO_OLDSNO)
/** Server notice bits reserved to IRC operators. */
/** Noisy server notice bits that cause other bits to be cleared during connect. */
#define SNO_NOISY (SNO_SERVKILL|SNO_UNAUTH)
/** Noisy server notice bits that cause other bits to be cleared during connect. */
#define SNO_NOISY (SNO_SERVKILL|SNO_UNAUTH)