41 |
|
/* |
42 |
|
* status macros. |
43 |
|
*/ |
44 |
< |
#define STAT_CONNECTING 0x00000001U |
45 |
< |
#define STAT_HANDSHAKE 0x00000002U |
46 |
< |
#define STAT_ME 0x00000004U |
47 |
< |
#define STAT_UNKNOWN 0x00000008U |
48 |
< |
#define STAT_SERVER 0x00000010U |
49 |
< |
#define STAT_CLIENT 0x00000020U |
50 |
< |
|
51 |
< |
#define REG_NEED_USER 0x00000001U /**< User must send USER command */ |
52 |
< |
#define REG_NEED_NICK 0x00000002U /**< User must send NICK command */ |
53 |
< |
#define REG_NEED_CAP 0x00000004U /**< In middle of CAP negotiations */ |
54 |
< |
#define REG_INIT (REG_NEED_USER|REG_NEED_NICK) |
44 |
> |
enum |
45 |
> |
{ |
46 |
> |
STAT_CONNECTING = 0x00000001U, |
47 |
> |
STAT_HANDSHAKE = 0x00000002U, |
48 |
> |
STAT_ME = 0x00000004U, |
49 |
> |
STAT_UNKNOWN = 0x00000008U, |
50 |
> |
STAT_SERVER = 0x00000010U, |
51 |
> |
STAT_CLIENT = 0x00000020U |
52 |
> |
}; |
53 |
> |
|
54 |
> |
enum |
55 |
> |
{ |
56 |
> |
REG_NEED_USER = 0x00000001U, /**< User must send USER command */ |
57 |
> |
REG_NEED_NICK = 0x00000002U, /**< User must send NICK command */ |
58 |
> |
REG_NEED_CAP = 0x00000004U, /**< In middle of CAP negotiations */ |
59 |
> |
REG_INIT = REG_NEED_USER | REG_NEED_NICK |
60 |
> |
}; |
61 |
|
|
62 |
|
#define ID_or_name(x,client_p) ((IsServer(client_p->from) && (x)->id[0]) ? (x)->id : (x)->name) |
63 |
|
|
94 |
|
/* |
95 |
|
* ts stuff |
96 |
|
*/ |
97 |
< |
#define TS_CURRENT 6 /**< Current TS protocol version */ |
98 |
< |
#define TS_MIN 6 /**< Minimum supported TS protocol version */ |
99 |
< |
|
100 |
< |
|
101 |
< |
#define CAP_MULTI_PREFIX 0x00000001U |
102 |
< |
#define CAP_AWAY_NOTIFY 0x00000002U |
103 |
< |
#define CAP_UHNAMES 0x00000004U |
104 |
< |
#define CAP_EXTENDED_JOIN 0x00000008U |
97 |
> |
enum |
98 |
> |
{ |
99 |
> |
TS_CURRENT = 6, /**< Current TS protocol version */ |
100 |
> |
TS_MIN = 6 /**< Minimum supported TS protocol version */ |
101 |
> |
}; |
102 |
> |
|
103 |
> |
enum |
104 |
> |
{ |
105 |
> |
CAP_MULTI_PREFIX = 0x00000001U, |
106 |
> |
CAP_AWAY_NOTIFY = 0x00000002U, |
107 |
> |
CAP_UHNAMES = 0x00000004U, |
108 |
> |
CAP_EXTENDED_JOIN = 0x00000008U |
109 |
> |
}; |
110 |
|
|
111 |
|
#define HasCap(x, y) ((x)->connection->cap_active & (y)) |
112 |
|
|
113 |
|
|
114 |
|
/* housekeeping flags */ |
115 |
< |
#define FLAGS_PINGSENT 0x00000001U /**< Unreplied ping sent */ |
116 |
< |
#define FLAGS_DEADSOCKET 0x00000002U /**< Local socket is dead--Exiting soon */ |
117 |
< |
#define FLAGS_KILLED 0x00000004U /**< Prevents "QUIT" from being sent for this */ |
118 |
< |
#define FLAGS_CLOSING 0x00000008U /**< Set when closing to suppress errors */ |
119 |
< |
#define FLAGS_GOTID 0x00000010U /**< Successful ident lookup achieved */ |
120 |
< |
#define FLAGS_SENDQEX 0x00000020U /**< Sendq exceeded */ |
121 |
< |
#define FLAGS_IPHASH 0x00000040U /**< Iphashed this client */ |
122 |
< |
#define FLAGS_MARK 0x00000080U /**< Marked client */ |
123 |
< |
#define FLAGS_CANFLOOD 0x00000100U /**< Client has the ability to flood */ |
124 |
< |
#define FLAGS_EXEMPTKLINE 0x00000200U /**< Client is exempt from k-lines */ |
125 |
< |
#define FLAGS_NOLIMIT 0x00000400U /**< Client is exempt from limits */ |
126 |
< |
#define FLAGS_PING_COOKIE 0x00000800U /**< PING Cookie */ |
127 |
< |
#define FLAGS_FLOODDONE 0x00001000U /**< Flood grace period has been ended. */ |
128 |
< |
#define FLAGS_EOB 0x00002000U /**< Server has sent us an EOB */ |
129 |
< |
#define FLAGS_HIDDEN 0x00004000U /**< A hidden server. Not shown in /links */ |
130 |
< |
#define FLAGS_BLOCKED 0x00008000U /**< Must wait for COMM_SELECT_WRITE */ |
131 |
< |
#define FLAGS_USERHOST 0x00010000U /**< Client is in userhost hash */ |
132 |
< |
#define FLAGS_BURSTED 0x00020000U /**< User was already bursted */ |
133 |
< |
#define FLAGS_EXEMPTRESV 0x00040000U /**< Client is exempt from RESV */ |
134 |
< |
#define FLAGS_GOTUSER 0x00080000U /**< If we received a USER command */ |
135 |
< |
#define FLAGS_FINISHED_AUTH 0x00100000U /**< Client has been released from auth */ |
136 |
< |
#define FLAGS_FLOOD_NOTICED 0x00200000U /**< Notice to opers about this flooder has been sent */ |
137 |
< |
#define FLAGS_SERVICE 0x00400000U /**< Client/server is a network service */ |
138 |
< |
#define FLAGS_SSL 0x00800000U /**< User is connected via TLS/SSL */ |
139 |
< |
#define FLAGS_SQUIT 0x01000000U |
140 |
< |
#define FLAGS_EXEMPTXLINE 0x02000000U /**< Client is exempt from x-lines */ |
115 |
> |
enum |
116 |
> |
{ |
117 |
> |
FLAGS_PINGSENT = 0x00000001U, /**< Unreplied ping sent */ |
118 |
> |
FLAGS_DEADSOCKET = 0x00000002U, /**< Local socket is dead--Exiting soon */ |
119 |
> |
FLAGS_KILLED = 0x00000004U, /**< Prevents "QUIT" from being sent for this */ |
120 |
> |
FLAGS_CLOSING = 0x00000008U, /**< Set when closing to suppress errors */ |
121 |
> |
FLAGS_GOTID = 0x00000010U, /**< Successful ident lookup achieved */ |
122 |
> |
FLAGS_SENDQEX = 0x00000020U, /**< Sendq exceeded */ |
123 |
> |
FLAGS_IPHASH = 0x00000040U, /**< Iphashed this client */ |
124 |
> |
FLAGS_MARK = 0x00000080U, /**< Marked client */ |
125 |
> |
FLAGS_CANFLOOD = 0x00000100U, /**< Client has the ability to flood */ |
126 |
> |
FLAGS_EXEMPTKLINE = 0x00000200U, /**< Client is exempt from k-lines */ |
127 |
> |
FLAGS_NOLIMIT = 0x00000400U, /**< Client is exempt from limits */ |
128 |
> |
FLAGS_PING_COOKIE = 0x00000800U, /**< PING Cookie */ |
129 |
> |
FLAGS_FLOODDONE = 0x00001000U, /**< Flood grace period has been ended. */ |
130 |
> |
FLAGS_EOB = 0x00002000U, /**< Server has sent us an EOB */ |
131 |
> |
FLAGS_HIDDEN = 0x00004000U, /**< A hidden server. Not shown in /links */ |
132 |
> |
FLAGS_BLOCKED = 0x00008000U, /**< Must wait for COMM_SELECT_WRITE */ |
133 |
> |
FLAGS_USERHOST = 0x00010000U, /**< Client is in userhost hash */ |
134 |
> |
FLAGS_BURSTED = 0x00020000U, /**< User was already bursted */ |
135 |
> |
FLAGS_EXEMPTRESV = 0x00040000U, /**< Client is exempt from RESV */ |
136 |
> |
FLAGS_GOTUSER = 0x00080000U, /**< If we received a USER command */ |
137 |
> |
FLAGS_FINISHED_AUTH = 0x00100000U, /**< Client has been released from auth */ |
138 |
> |
FLAGS_FLOOD_NOTICED = 0x00200000U, /**< Notice to opers about this flooder has been sent */ |
139 |
> |
FLAGS_SERVICE = 0x00400000U, /**< Client/server is a network service */ |
140 |
> |
FLAGS_SSL = 0x00800000U, /**< User is connected via TLS/SSL */ |
141 |
> |
FLAGS_SQUIT = 0x01000000U, |
142 |
> |
FLAGS_EXEMPTXLINE = 0x02000000U /**< Client is exempt from x-lines */ |
143 |
> |
}; |
144 |
|
|
145 |
|
#define HasFlag(x, y) ((x)->flags & (y)) |
146 |
|
#define AddFlag(x, y) ((x)->flags |= (y)) |
147 |
|
#define DelFlag(x, y) ((x)->flags &= ~(y)) |
148 |
|
|
149 |
|
|
136 |
– |
|
150 |
|
/* umodes, settable flags */ |
151 |
< |
#define UMODE_SERVNOTICE 0x00000001U /**< Server notices such as kill */ |
152 |
< |
#define UMODE_CCONN 0x00000002U /**< Can see client connection notices */ |
153 |
< |
#define UMODE_REJ 0x00000004U /**< Bot Rejections */ |
154 |
< |
#define UMODE_SKILL 0x00000008U /**< Server Killed */ |
155 |
< |
#define UMODE_FULL 0x00000010U /**< Full messages */ |
156 |
< |
#define UMODE_SPY 0x00000020U /**< See STATS / LINKS */ |
157 |
< |
#define UMODE_DEBUG 0x00000040U /**< 'debugging' info */ |
158 |
< |
#define UMODE_NCHANGE 0x00000080U /**< Nick change notice */ |
159 |
< |
#define UMODE_WALLOP 0x00000100U /**< Send wallops to them */ |
160 |
< |
#define UMODE_INVISIBLE 0x00000200U /**< Makes user invisible */ |
161 |
< |
#define UMODE_BOTS 0x00000400U /**< Shows bots */ |
162 |
< |
#define UMODE_EXTERNAL 0x00000800U /**< Show servers introduced and splitting */ |
163 |
< |
#define UMODE_CALLERID 0x00001000U /**< Block unless caller id's */ |
164 |
< |
#define UMODE_SOFTCALLERID 0x00002000U /**< Block unless on common channel */ |
165 |
< |
#define UMODE_UNAUTH 0x00004000U /**< Show unauth connects here */ |
166 |
< |
#define UMODE_LOCOPS 0x00008000U /**< Can see LOCOPS messages */ |
167 |
< |
#define UMODE_DEAF 0x00010000U /**< Don't receive channel messages */ |
168 |
< |
#define UMODE_REGISTERED 0x00020000U /**< User has identified for that nick. */ |
169 |
< |
#define UMODE_REGONLY 0x00040000U /**< Only registered nicks may PM */ |
170 |
< |
#define UMODE_HIDDEN 0x00080000U /**< IRC operator status is hidden */ |
171 |
< |
#define UMODE_OPER 0x00100000U /**< IRC operator */ |
172 |
< |
#define UMODE_ADMIN 0x00200000U /**< Admin on server */ |
173 |
< |
#define UMODE_FARCONNECT 0x00400000U /**< Can see remote client connects/exits */ |
174 |
< |
#define UMODE_HIDDENHOST 0x00800000U /**< User's host is hidden */ |
175 |
< |
#define UMODE_SSL 0x01000000U /**< User is connected via TLS/SSL */ |
176 |
< |
#define UMODE_WEBIRC 0x02000000U /**< User connected via a webirc gateway */ |
177 |
< |
#define UMODE_HIDEIDLE 0x04000000U /**< Hides idle and signon time in WHOIS */ |
178 |
< |
#define UMODE_HIDECHANS 0x08000000U /**< Hides channel list in WHOIS */ |
151 |
> |
enum |
152 |
> |
{ |
153 |
> |
UMODE_SERVNOTICE = 0x00000001U, /**< Server notices such as kill */ |
154 |
> |
UMODE_CCONN = 0x00000002U, /**< Can see client connection notices */ |
155 |
> |
UMODE_REJ = 0x00000004U, /**< Bot Rejections */ |
156 |
> |
UMODE_SKILL = 0x00000008U, /**< Server Killed */ |
157 |
> |
UMODE_FULL = 0x00000010U, /**< Full messages */ |
158 |
> |
UMODE_SPY = 0x00000020U, /**< See STATS / LINKS */ |
159 |
> |
UMODE_DEBUG = 0x00000040U, /**< 'debugging' info */ |
160 |
> |
UMODE_NCHANGE = 0x00000080U, /**< Nick change notice */ |
161 |
> |
UMODE_WALLOP = 0x00000100U, /**< Send wallops to them */ |
162 |
> |
UMODE_INVISIBLE = 0x00000200U, /**< Makes user invisible */ |
163 |
> |
UMODE_BOTS = 0x00000400U, /**< Shows bots */ |
164 |
> |
UMODE_EXTERNAL = 0x00000800U, /**< Show servers introduced and splitting */ |
165 |
> |
UMODE_CALLERID = 0x00001000U, /**< Block unless caller id's */ |
166 |
> |
UMODE_SOFTCALLERID = 0x00002000U, /**< Block unless on common channel */ |
167 |
> |
UMODE_UNAUTH = 0x00004000U, /**< Show unauth connects here */ |
168 |
> |
UMODE_LOCOPS = 0x00008000U, /**< Can see LOCOPS messages */ |
169 |
> |
UMODE_DEAF = 0x00010000U, /**< Don't receive channel messages */ |
170 |
> |
UMODE_REGISTERED = 0x00020000U, /**< User has identified for that nick. */ |
171 |
> |
UMODE_REGONLY = 0x00040000U, /**< Only registered nicks may PM */ |
172 |
> |
UMODE_HIDDEN = 0x00080000U, /**< IRC operator status is hidden */ |
173 |
> |
UMODE_OPER = 0x00100000U, /**< IRC operator */ |
174 |
> |
UMODE_ADMIN = 0x00200000U, /**< Admin on server */ |
175 |
> |
UMODE_FARCONNECT = 0x00400000U, /**< Can see remote client connects/exits */ |
176 |
> |
UMODE_HIDDENHOST = 0x00800000U, /**< User's host is hidden */ |
177 |
> |
UMODE_SSL = 0x01000000U, /**< User is connected via TLS/SSL */ |
178 |
> |
UMODE_WEBIRC = 0x02000000U, /**< User connected via a webirc gateway */ |
179 |
> |
UMODE_HIDEIDLE = 0x04000000U, /**< Hides idle and signon time in WHOIS */ |
180 |
> |
UMODE_HIDECHANS = 0x08000000U /**< Hides channel list in WHOIS */ |
181 |
> |
}; |
182 |
|
|
183 |
|
#define UMODE_ALL UMODE_SERVNOTICE |
184 |
|
|
188 |
|
|
189 |
|
|
190 |
|
/* oper priv flags */ |
191 |
< |
#define OPER_FLAG_KILL_REMOTE 0x00000001U /**< Oper can KILL remote users */ |
192 |
< |
#define OPER_FLAG_KILL 0x00000002U /**< Oper can KILL local users */ |
193 |
< |
#define OPER_FLAG_UNKLINE 0x00000004U /**< Oper can use UNKLINE command */ |
194 |
< |
#define OPER_FLAG_KLINE 0x00000008U /**< Oper can use KLINE command */ |
195 |
< |
#define OPER_FLAG_XLINE 0x00000010U /**< Oper can use XLINE command */ |
196 |
< |
#define OPER_FLAG_DIE 0x00000020U /**< Oper can use DIE command */ |
197 |
< |
#define OPER_FLAG_REHASH 0x00000040U /**< Oper can use REHASH command */ |
198 |
< |
#define OPER_FLAG_ADMIN 0x00000080U /**< Oper can set user mode +a */ |
199 |
< |
#define OPER_FLAG_REMOTEBAN 0x00000100U /**< Oper can set remote bans */ |
200 |
< |
#define OPER_FLAG_GLOBOPS 0x00000200U /**< Oper can use GLOBOPS command */ |
201 |
< |
#define OPER_FLAG_MODULE 0x00000400U /**< Oper can use MODULE command */ |
202 |
< |
#define OPER_FLAG_RESTART 0x00000800U /**< Oper can use RESTART command */ |
203 |
< |
#define OPER_FLAG_DLINE 0x00001000U /**< Oper can use DLINE command */ |
204 |
< |
#define OPER_FLAG_UNDLINE 0x00002000U /**< Oper can use UNDLINE command */ |
205 |
< |
#define OPER_FLAG_SET 0x00004000U /**< Oper can use SET command */ |
206 |
< |
#define OPER_FLAG_SQUIT 0x00008000U /**< Oper can do local SQUIT */ |
207 |
< |
#define OPER_FLAG_SQUIT_REMOTE 0x00010000U /**< Oper can do remote SQUIT */ |
208 |
< |
#define OPER_FLAG_CONNECT 0x00020000U /**< Oper can do local CONNECT */ |
209 |
< |
#define OPER_FLAG_CONNECT_REMOTE 0x00040000U /**< Oper can do remote CONNECT */ |
210 |
< |
#define OPER_FLAG_WALLOPS 0x00080000U /**< Oper can use WALLOPS command */ |
211 |
< |
#define OPER_FLAG_LOCOPS 0x00100000U /**< Oper can use LOCOPS command */ |
212 |
< |
#define OPER_FLAG_UNXLINE 0x00200000U /**< Oper can use UNXLINE command */ |
213 |
< |
#define OPER_FLAG_OPME 0x00400000U /**< Oper can use OPME command */ |
214 |
< |
|
191 |
> |
enum |
192 |
> |
{ |
193 |
> |
OPER_FLAG_KILL_REMOTE = 0x00000001U, /**< Oper can KILL remote users */ |
194 |
> |
OPER_FLAG_KILL = 0x00000002U, /**< Oper can KILL local users */ |
195 |
> |
OPER_FLAG_UNKLINE = 0x00000004U, /**< Oper can use UNKLINE command */ |
196 |
> |
OPER_FLAG_KLINE = 0x00000008U, /**< Oper can use KLINE command */ |
197 |
> |
OPER_FLAG_XLINE = 0x00000010U, /**< Oper can use XLINE command */ |
198 |
> |
OPER_FLAG_DIE = 0x00000020U, /**< Oper can use DIE command */ |
199 |
> |
OPER_FLAG_REHASH = 0x00000040U, /**< Oper can use REHASH command */ |
200 |
> |
OPER_FLAG_ADMIN = 0x00000080U, /**< Oper can set user mode +a */ |
201 |
> |
OPER_FLAG_REMOTEBAN = 0x00000100U, /**< Oper can set remote bans */ |
202 |
> |
OPER_FLAG_GLOBOPS = 0x00000200U, /**< Oper can use GLOBOPS command */ |
203 |
> |
OPER_FLAG_MODULE = 0x00000400U, /**< Oper can use MODULE command */ |
204 |
> |
OPER_FLAG_RESTART = 0x00000800U, /**< Oper can use RESTART command */ |
205 |
> |
OPER_FLAG_DLINE = 0x00001000U, /**< Oper can use DLINE command */ |
206 |
> |
OPER_FLAG_UNDLINE = 0x00002000U, /**< Oper can use UNDLINE command */ |
207 |
> |
OPER_FLAG_SET = 0x00004000U, /**< Oper can use SET command */ |
208 |
> |
OPER_FLAG_SQUIT = 0x00008000U, /**< Oper can do local SQUIT */ |
209 |
> |
OPER_FLAG_SQUIT_REMOTE = 0x00010000U, /**< Oper can do remote SQUIT */ |
210 |
> |
OPER_FLAG_CONNECT = 0x00020000U, /**< Oper can do local CONNECT */ |
211 |
> |
OPER_FLAG_CONNECT_REMOTE = 0x00040000U, /**< Oper can do remote CONNECT */ |
212 |
> |
OPER_FLAG_WALLOPS = 0x00080000U, /**< Oper can use WALLOPS command */ |
213 |
> |
OPER_FLAG_LOCOPS = 0x00100000U, /**< Oper can use LOCOPS command */ |
214 |
> |
OPER_FLAG_UNXLINE = 0x00200000U, /**< Oper can use UNXLINE command */ |
215 |
> |
OPER_FLAG_OPME = 0x00400000U /**< Oper can use OPME command */ |
216 |
> |
}; |
217 |
|
|
218 |
|
#define HasOFlag(x, y) (MyConnect(x) ? (x)->connection->operflags & (y) : 0) |
219 |
|
#define AddOFlag(x, y) ((x)->connection->operflags |= (y)) |