ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/include/client.h
Revision: 190
Committed: Sun Oct 23 22:06:17 2005 UTC (18 years, 5 months ago) by adx
Content type: text/x-chdr
File size: 24707 byte(s)
Log Message:
* prototypes are now prefixed with either nothing or EXTERN
  (meaning it's an ircd.dll API)
* dynamic modules now work on win32.

File Contents

# Content
1 /*
2 * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3 * client.h: The ircd client header.
4 *
5 * Copyright (C) 2002 by the past and present ircd coders, and others.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 * USA
21 *
22 * $Id$
23 */
24
25 #ifndef INCLUDED_client_h
26 #define INCLUDED_client_h
27
28 #include "setup.h"
29 #include "ircd_handler.h"
30 #include "channel.h"
31
32 #define PASSWDLEN 20
33 #define CIPHERKEYLEN 64 /* 512bit */
34 #define IDLEN 12 /* this is the maximum length, not the actual
35 generated length; DO NOT CHANGE! */
36
37 /*
38 * pre declare structs
39 */
40 struct AccessItem;
41 struct Whowas;
42 struct DNSReply;
43 struct Listener;
44 struct Client;
45 struct LocalUser;
46
47 struct Server
48 {
49 char by[NICKLEN]; /* who activated this connection */
50 struct ConfItem *sconf; /* ConfItem connect{} pointer for this server */
51 dlink_list servers; /* Servers on this server */
52 dlink_list users; /* Users on this server */
53 int dep_servers; /* Total number of dependent servers on all levels */
54 int dep_users; /* Total number of dependent users on all levels */
55 dlink_list leafs_hubs; /* leafs and hubs masks for server */
56 };
57
58 struct SlinkRpl
59 {
60 int command;
61 int datalen;
62 int gotdatalen;
63 int readdata;
64 unsigned char *data;
65 };
66
67 struct ZipStats
68 {
69 unsigned long in;
70 unsigned long in_wire;
71 unsigned long out;
72 unsigned long out_wire;
73 double in_ratio;
74 double out_ratio;
75 };
76
77 struct ListTask
78 {
79 int hash_index; /* the bucket we are currently in */
80 dlink_list show_mask; /* show these channels.. */
81 dlink_list hide_mask; /* ..and hide these ones */
82 unsigned int users_min, users_max;
83 unsigned int created_min, created_max;
84 unsigned int topicts_min, topicts_max;
85 };
86
87 struct Client
88 {
89 dlink_node node;
90 dlink_node lnode; /* Used for Server->servers/users */
91
92 struct Client *hnext; /* For client hash table lookups by name */
93 struct Client *idhnext; /* For SID hash table lookups by sid */
94
95 struct Server* serv; /* ...defined, if this is a server */
96 struct Client* servptr; /* Points to server this Client is on */
97 struct Client* from; /* == self, if Local Client, *NEVER* NULL! */
98
99 struct Whowas* whowas; /* Pointers to whowas structs */
100 time_t lasttime; /* ...should be only LOCAL clients? --msa */
101 time_t firsttime; /* time client was created */
102 time_t since; /* last time we parsed something */
103 time_t tsinfo; /* TS on the nick, SVINFO on server */
104 unsigned long connect_id; /* unique connection ID */
105 unsigned int umodes; /* opers, normal users subset */
106 unsigned int flags; /* client flags */
107
108 unsigned short hopcount; /* number of servers to this 0 = local */
109 unsigned short status; /* Client type */
110 unsigned char handler; /* Handler index */
111 unsigned long serial; /* used to enforce 1 send per nick */
112 unsigned long lazyLinkClientExists; /* This client exists on the
113 * bit mapped lazylink servers
114 * mapped here
115 */
116 char *away;
117
118 /*
119 * client->name is the unique name for a client nick or host
120 */
121 char name[HOSTLEN + 1];
122 char id[IDLEN + 1]; /* client ID, unique ID per client */
123
124 /*
125 * client->username is the username from ident or the USER message,
126 * If the client is idented the USER message is ignored, otherwise
127 * the username part of the USER message is put here prefixed with a
128 * tilde depending on the I:line, Once a client has registered, this
129 * field should be considered read-only.
130 */
131 char username[USERLEN + 1]; /* client's username */
132
133 /*
134 * client->host contains the resolved name or ip address
135 * as a string for the user, it may be fiddled with for oper spoofing etc.
136 * once it's changed the *real* address goes away. This should be
137 * considered a read-only field after the client has registered.
138 */
139 char host[HOSTLEN + 1]; /* client's hostname */
140
141 /*
142 * client->info for unix clients will normally contain the info from the
143 * gcos field in /etc/passwd but anything can go here.
144 */
145 char info[REALLEN + 1]; /* Free form additional client info */
146
147 /* client->sockhost contains the ip address gotten from the socket as a
148 * string, this field should be considered read-only once the connection
149 * has been made. (set in s_bsd.c only)
150 */
151 char sockhost[HOSTIPLEN + 1]; /* This is the host name from the
152 socket ip address as string */
153 /* caller ID allow list */
154 /* This has to be here, since a client on an on_allow_list could
155 * be a remote client. simpler to keep both here.
156 */
157 dlink_list allow_list; /* clients I'll allow to talk to me */
158 dlink_list on_allow_list; /* clients that have =me= on their allow list*/
159
160 dlink_list channel; /* chain of channel pointer blocks */
161 dlink_list invited; /* chain of invite pointer blocks */
162
163 struct LocalUser *localClient;
164 };
165
166 struct LocalUser
167 {
168 /*
169 * The following fields are allocated only for local clients
170 * (directly connected to *this* server with a socket.
171 */
172 /* Anti flooding part, all because of lamers... */
173 time_t last_away; /* Away since... */
174 time_t last_join_time; /* when this client last
175 joined a channel */
176 time_t last_leave_time; /* when this client last
177 * left a channel */
178 int join_leave_count; /* count of JOIN/LEAVE in less than
179 MIN_JOIN_LEAVE_TIME seconds */
180 int oper_warn_count_down; /* warn opers of this possible
181 spambot every time this gets to 0 */
182 time_t reject_delay;
183 time_t last_caller_id_time;
184 time_t first_received_message_time;
185 int received_number_of_privmsgs;
186 int flood_noticed;
187
188 dlink_node lclient_node;
189
190 unsigned int operflags; /* oper priv flags */
191
192 struct ListTask *list_task;
193 /* Send and receive dbufs .. */
194 struct dbuf_queue buf_sendq;
195 struct dbuf_queue buf_recvq;
196
197 struct {
198 unsigned int messages; /* Statistics: protocol messages sent/received */
199 uint64_t bytes; /* Statistics: total bytes sent/received */
200 } recv, send;
201
202 struct Listener *listener; /* listener accepted from */
203 struct ClassItem *class; /* Client's class */
204 struct irc_ssaddr ip;
205 int aftype; /* Makes life easier for DNS res in IPV6 */
206 struct DNSQuery *dns_query; /* result returned from resolver query */
207 unsigned long serverMask; /* Only used for Lazy Links */
208 time_t last; /* Last time we got a PRIVMSG */
209 time_t last_nick_change;
210 int number_of_nick_changes;
211
212 char *passwd;
213 int caps; /* capabilities bit-field */
214 int enc_caps; /* cipher capabilities bit-field */
215
216 #ifdef HAVE_LIBCRYPTO
217 struct EncCapability *in_cipher;
218 struct EncCapability *out_cipher;
219
220 char in_key[CIPHERKEYLEN];
221 char out_key[CIPHERKEYLEN];
222 #endif
223
224 fde_t fd;
225 fde_t ctrlfd; /* For servers: control fd used for sending commands
226 to servlink */
227
228 struct SlinkRpl slinkrpl; /* slink reply being parsed */
229 char *slinkq; /* sendq for control data */
230 int slinkq_ofs; /* ofset into slinkq */
231 int slinkq_len; /* length remaining after slinkq_ofs */
232
233 struct ZipStats zipstats;
234
235 /* Anti-flood stuff. We track how many messages were parsed and how
236 * many we were allowed in the current second, and apply a simple
237 * decay to avoid flooding.
238 * -- adrian
239 */
240 int allow_read; /* how many we're allowed to read in this second */
241 int sent_parsed; /* how many messages we've parsed in this second */
242 time_t last_knock; /* time of last knock */
243 unsigned long random_ping;
244
245 char* response; /* expected response from client */
246 char* auth_oper; /* Operator to become if they supply the response.*/
247
248 /*
249 * llname is used to store the clients requested nick
250 * temporarily for new connections.
251 */
252 char llname[NICKLEN];
253 };
254
255 /*
256 * status macros.
257 */
258 #define STAT_CONNECTING 0x01
259 #define STAT_HANDSHAKE 0x02
260 #define STAT_ME 0x04
261 #define STAT_UNKNOWN 0x08
262 #define STAT_SERVER 0x10
263 #define STAT_CLIENT 0x20
264
265 #define HasID(x) ((x)->id[0] != '\0')
266 #define ID(x) (HasID(x) ? (x)->id : (x)->name)
267 #define ID_or_name(x,client_p) ((IsCapable(client_p, CAP_TS6) && HasID(x)) ? (x)->id : (x)->name)
268
269 #define IsRegistered(x) ((x)->status > STAT_UNKNOWN)
270 #define IsConnecting(x) ((x)->status == STAT_CONNECTING)
271 #define IsHandshake(x) ((x)->status == STAT_HANDSHAKE)
272 #define IsMe(x) ((x)->status == STAT_ME)
273 #define IsUnknown(x) ((x)->status == STAT_UNKNOWN)
274 #define IsServer(x) ((x)->status == STAT_SERVER)
275 #define IsClient(x) ((x)->status == STAT_CLIENT)
276
277 #define IsOper(x) ((x)->umodes & UMODE_OPER)
278 #define IsAdmin(x) ((x)->umodes & UMODE_ADMIN)
279
280 #define SetConnecting(x) {(x)->status = STAT_CONNECTING; \
281 (x)->handler = UNREGISTERED_HANDLER; }
282
283 #define SetHandshake(x) {(x)->status = STAT_HANDSHAKE; \
284 (x)->handler = UNREGISTERED_HANDLER; }
285
286 #define SetMe(x) {(x)->status = STAT_ME; \
287 (x)->handler = UNREGISTERED_HANDLER; }
288
289 #define SetUnknown(x) {(x)->status = STAT_UNKNOWN; \
290 (x)->handler = UNREGISTERED_HANDLER; }
291
292 #define SetServer(x) {(x)->status = STAT_SERVER; \
293 (x)->handler = SERVER_HANDLER; }
294
295 #define SetClient(x) {(x)->status = STAT_CLIENT; \
296 (x)->handler = IsOper((x)) ? \
297 OPER_HANDLER : CLIENT_HANDLER; }
298
299 #define SetEob(x) ((x)->flags |= FLAGS_EOB)
300 #define HasSentEob(x) ((x)->flags & FLAGS_EOB)
301
302 /*
303 * ts stuff
304 */
305 #define TS_CURRENT 6 /* current TS protocol version */
306 #ifdef TS5_ONLY
307 #define TS_MIN 5
308 #else
309 #define TS_MIN 3 /* minimum supported TS protocol version */
310 #endif
311 #define TS_DOESTS 0x20000000
312 #define DoesTS(x) ((x)->tsinfo == TS_DOESTS)
313
314
315 /* housekeeping flags */
316 #define FLAGS_PINGSENT 0x00000001 /* Unreplied ping sent */
317 #define FLAGS_DEADSOCKET 0x00000002 /* Local socket is dead--Exiting soon */
318 #define FLAGS_KILLED 0x00000004 /* Prevents "QUIT" from being sent for this */
319 #define FLAGS_CLOSING 0x00000008 /* set when closing to suppress errors */
320 #define FLAGS_GOTID 0x00000010 /* successful ident lookup achieved */
321 #define FLAGS_NEEDID 0x00000020 /* I-lines say must use ident return */
322 #define FLAGS_SENDQEX 0x00000040 /* Sendq exceeded */
323 #define FLAGS_IPHASH 0x00000080 /* iphashed this client */
324 #define FLAGS_CRYPTIN 0x00000100 /* incoming data must be decrypted */
325 #define FLAGS_CRYPTOUT 0x00000200 /* outgoing data must be encrypted */
326 #define FLAGS_WAITAUTH 0x00000400 /* waiting for CRYPTLINK AUTH command */
327 #define FLAGS_SERVLINK 0x00000800 /* servlink has servlink process */
328 #define FLAGS_MARK 0x00001000 /* marked client */
329 #define FLAGS_CANFLOOD 0x00002000 /* client has the ability to flood */
330 #define FLAGS_EXEMPTGLINE 0x00004000 /* client can't be G-lined */
331 #define FLAGS_EXEMPTKLINE 0x00008000 /* client is exempt from kline */
332 #define FLAGS_NOLIMIT 0x00010000 /* client is exempt from limits */
333 #define FLAGS_RESTRICTED 0x00020000 /* client cannot op others */
334 #define FLAGS_PING_COOKIE 0x00040000 /* PING Cookie */
335 #define FLAGS_IDLE_LINED 0x00080000 /* client is exempt from idle-time limits */
336 #define FLAGS_IP_SPOOFING 0x00100000 /* client IP is spoofed */
337 #define FLAGS_FLOODDONE 0x00200000 /* Flood grace period has been ended. */
338 #define FLAGS_EOB 0x00400000 /* server has received EOB */
339 #define FLAGS_HIDDEN 0x00800000 /* a hidden server. not shown in /links */
340 #define FLAGS_BLOCKED 0x01000000 /* must wait for COMM_SELECT_WRITE */
341 #define FLAGS_SBLOCKED 0x02000000 /* slinkq is blocked */
342 #define FLAGS_USERHOST 0x04000000 /* client is in userhost hash */
343 #define FLAGS_BURSTED 0x08000000 /* user was already bursted */
344 #define FLAGS_EXEMPTRESV 0x10000000 /* client is exempt from RESV */
345 #define FLAGS_GOTUSER 0x20000000 /* if we received a USER command */
346 #define FLAGS_PINGWARNING 0x40000000 /* unreplied ping warning already sent */
347 /* 0x80000000 */
348
349
350 /* umodes, settable flags */
351 #define UMODE_SERVNOTICE 0x00001 /* server notices such as kill */
352 #define UMODE_CCONN 0x00002 /* Client Connections */
353 #define UMODE_REJ 0x00004 /* Bot Rejections */
354 #define UMODE_SKILL 0x00008 /* Server Killed */
355 #define UMODE_FULL 0x00010 /* Full messages */
356 #define UMODE_SPY 0x00020 /* see STATS / LINKS */
357 #define UMODE_DEBUG 0x00040 /* 'debugging' info */
358 #define UMODE_NCHANGE 0x00080 /* Nick change notice */
359 #define UMODE_WALLOP 0x00100 /* send wallops to them */
360 #define UMODE_OPERWALL 0x00200 /* Operwalls */
361 #define UMODE_INVISIBLE 0x00400 /* makes user invisible */
362 #define UMODE_BOTS 0x00800 /* shows bots */
363 #define UMODE_EXTERNAL 0x01000 /* show servers introduced and splitting */
364 #define UMODE_CALLERID 0x02000 /* block unless caller id's */
365 #define UMODE_SOFTCALLERID 0x04000 /* block unless on common channel */
366 #define UMODE_UNAUTH 0x08000 /* show unauth connects here */
367 #define UMODE_LOCOPS 0x10000 /* show locops */
368 #define UMODE_DEAF 0x20000 /* don't receive channel messages */
369
370 /* user information flags, only settable by remote mode or local oper */
371 #define UMODE_OPER 0x40000 /* Operator */
372 #define UMODE_ADMIN 0x80000 /* Admin on server */
373 #define UMODE_ALL UMODE_SERVNOTICE
374
375 #define SEND_UMODES (UMODE_INVISIBLE | UMODE_OPER | UMODE_WALLOP | \
376 UMODE_ADMIN)
377
378
379 /* oper priv flags */
380 #define OPER_FLAG_GLOBAL_KILL 0x00000001 /* oper can global kill */
381 #define OPER_FLAG_REMOTE 0x00000002 /* oper can do squits/connects */
382 #define OPER_FLAG_UNKLINE 0x00000004 /* oper can use unkline */
383 #define OPER_FLAG_GLINE 0x00000008 /* oper can use gline */
384 #define OPER_FLAG_N 0x00000010 /* oper can umode n */
385 #define OPER_FLAG_K 0x00000020 /* oper can kill/kline */
386 #define OPER_FLAG_X 0x00000040 /* oper can xline */
387 #define OPER_FLAG_DIE 0x00000080 /* oper can die */
388 #define OPER_FLAG_REHASH 0x00000100 /* oper can rehash */
389 #define OPER_FLAG_ADMIN 0x00000200 /* oper can set umode +a */
390 #define OPER_FLAG_HIDDEN_ADMIN 0x00000400 /* admin is hidden */
391 #define OPER_FLAG_OPERWALL 0x00000800 /* */
392 #define OPER_FLAG_OPER_SPY 0x00001000 /* */
393 #define OPER_FLAG_REMOTEBAN 0x00002000 /* */
394 #define OPER_FLAG_HIDDEN_OPER 0x00004000 /* */
395
396 #define SetOFlag(x, y) ((x)->localClient->operflags |= (y))
397
398
399 /* flags macros. */
400 #define IsDead(x) ((x)->flags & FLAGS_DEADSOCKET)
401 #define SetDead(x) ((x)->flags |= FLAGS_DEADSOCKET)
402 #define IsClosing(x) ((x)->flags & FLAGS_CLOSING)
403 #define SetClosing(x) ((x)->flags |= FLAGS_CLOSING)
404 #define IsKilled(x) ((x)->flags & FLAGS_KILLED)
405 #define SetKilled(x) ((x)->flags |= FLAGS_KILLED)
406 #define IsCryptIn(x) ((x)->flags & FLAGS_CRYPTIN)
407 #define SetCryptIn(x) ((x)->flags |= FLAGS_CRYPTIN)
408 #define IsCryptOut(x) ((x)->flags & FLAGS_CRYPTOUT)
409 #define SetCryptOut(x) ((x)->flags |= FLAGS_CRYPTOUT)
410 #define IsWaitAuth(x) ((x)->flags & FLAGS_WAITAUTH)
411 #define SetWaitAuth(x) ((x)->flags |= FLAGS_WAITAUTH)
412 #define ClearWaitAuth(x) ((x)->flags &= ~FLAGS_WAITAUTH)
413 #define HasServlink(x) ((x)->flags & FLAGS_SERVLINK)
414 #define SetServlink(x) ((x)->flags |= FLAGS_SERVLINK)
415 #define MyConnect(x) ((x)->localClient != NULL)
416 #define MyClient(x) (MyConnect(x) && IsClient(x))
417 #define SetMark(x) ((x)->flags |= FLAGS_MARK)
418 #define ClearMark(x) ((x)->flags &= ~FLAGS_MARK)
419 #define IsMarked(x) ((x)->flags & FLAGS_MARK)
420 #define SetCanFlood(x) ((x)->flags |= FLAGS_CANFLOOD)
421 #define IsCanFlood(x) ((x)->flags & FLAGS_CANFLOOD)
422 #define IsDefunct(x) ((x)->flags & (FLAGS_DEADSOCKET|FLAGS_CLOSING| \
423 FLAGS_KILLED))
424
425 /* oper flags */
426 #define MyOper(x) (MyConnect(x) && IsOper(x))
427
428 #define SetOper(x) {(x)->umodes |= UMODE_OPER; \
429 if (!IsServer((x))) (x)->handler = OPER_HANDLER;}
430
431 #define ClearOper(x) {(x)->umodes &= ~(UMODE_OPER|UMODE_ADMIN); \
432 if (!IsOper((x)) && !IsServer((x))) \
433 (x)->handler = CLIENT_HANDLER; }
434
435 #define IsPrivileged(x) (IsOper(x) || IsServer(x))
436
437 /* umode flags */
438 #define IsInvisible(x) ((x)->umodes & UMODE_INVISIBLE)
439 #define SendWallops(x) ((x)->umodes & UMODE_WALLOP)
440 #define IsSetCallerId(x) ((x)->umodes & \
441 (UMODE_CALLERID|UMODE_SOFTCALLERID))
442 #define IsSoftCallerId(x) ((x)->umodes & UMODE_SOFTCALLERID)
443 #define IsDeaf(x) ((x)->umodes & UMODE_DEAF)
444
445 #define SetSendQExceeded(x) ((x)->flags |= FLAGS_SENDQEX)
446 #define IsSendQExceeded(x) ((x)->flags & FLAGS_SENDQEX)
447
448 #define SetIpHash(x) ((x)->flags |= FLAGS_IPHASH)
449 #define ClearIpHash(x) ((x)->flags &= ~FLAGS_IPHASH)
450 #define IsIpHash(x) ((x)->flags & FLAGS_IPHASH)
451
452 #define SetUserHost(x) ((x)->flags |= FLAGS_USERHOST)
453 #define ClearUserHost(x) ((x)->flags &= ~FLAGS_USERHOST)
454 #define IsUserHostIp(x) ((x)->flags & FLAGS_USERHOST)
455
456 #define SetPingSent(x) ((x)->flags |= FLAGS_PINGSENT)
457 #define IsPingSent(x) ((x)->flags & FLAGS_PINGSENT)
458 #define ClearPingSent(x) ((x)->flags &= ~FLAGS_PINGSENT)
459
460 #define SetPingWarning(x) ((x)->flags |= FLAGS_PINGWARNING)
461 #define IsPingWarning(x) ((x)->flags & FLAGS_PINGWARNING)
462 #define ClearPingWarning(x) ((x)->flags &= ~FLAGS_PINGWARNING)
463
464 #define SetNeedId(x) ((x)->flags |= FLAGS_NEEDID)
465 #define IsNeedId(x) ((x)->flags & FLAGS_NEEDID)
466
467 #define SetGotId(x) ((x)->flags |= FLAGS_GOTID)
468 #define IsGotId(x) ((x)->flags & FLAGS_GOTID)
469
470 #define IsExemptKline(x) ((x)->flags & FLAGS_EXEMPTKLINE)
471 #define SetExemptKline(x) ((x)->flags |= FLAGS_EXEMPTKLINE)
472 #define IsExemptLimits(x) ((x)->flags & FLAGS_NOLIMIT)
473 #define SetExemptLimits(x) ((x)->flags |= FLAGS_NOLIMIT)
474 #define IsExemptGline(x) ((x)->flags & FLAGS_EXEMPTGLINE)
475 #define SetExemptGline(x) ((x)->flags |= FLAGS_EXEMPTGLINE)
476 #define IsExemptResv(x) ((x)->flags & FLAGS_EXEMPTRESV)
477 #define SetExemptResv(x) ((x)->flags |= FLAGS_EXEMPTRESV)
478 #define SetIPSpoof(x) ((x)->flags |= FLAGS_IP_SPOOFING)
479 #define IsIPSpoof(x) ((x)->flags & FLAGS_IP_SPOOFING)
480
481 #define IsIdlelined(x) ((x)->flags & FLAGS_IDLE_LINED)
482 #define SetIdlelined(x) ((x)->flags |= FLAGS_IDLE_LINED)
483 #define IsRestricted(x) ((x)->flags & FLAGS_RESTRICTED)
484 #define SetRestricted(x) ((x)->flags |= FLAGS_RESTRICTED)
485
486 #define IsFloodDone(x) ((x)->flags & FLAGS_FLOODDONE)
487 #define SetFloodDone(x) ((x)->flags |= FLAGS_FLOODDONE)
488 #define HasPingCookie(x) ((x)->flags & FLAGS_PING_COOKIE)
489 #define SetPingCookie(x) ((x)->flags |= FLAGS_PING_COOKIE)
490 #define IsHidden(x) ((x)->flags & FLAGS_HIDDEN)
491 #define SetHidden(x) ((x)->flags |= FLAGS_HIDDEN)
492
493 #define IsSendqBlocked(x) ((x)->flags & FLAGS_BLOCKED)
494 #define SetSendqBlocked(x) ((x)->flags |= FLAGS_BLOCKED)
495 #define ClearSendqBlocked(x) ((x)->flags &= ~FLAGS_BLOCKED)
496 #define IsSlinkqBlocked(x) ((x)->flags & FLAGS_SBLOCKED)
497 #define SetSlinkqBlocked(x) ((x)->flags |= FLAGS_SBLOCKED)
498 #define ClearSlinkqBlocked(x) ((x)->flags &= ~FLAGS_SBLOCKED)
499
500 #define IsBursted(x) ((x)->flags & FLAGS_BURSTED)
501 #define SetBursted(x) ((x)->flags |= FLAGS_BURSTED)
502 #define ClearBursted(x) ((x)->flags &= ~FLAGS_BURSTED)
503
504 #define IsCaptured(x) ((x)->handler == DUMMY_HANDLER)
505 #define SetCaptured(x) ((x)->handler = DUMMY_HANDLER)
506 #define ClearCaptured(x) ((x)->handler = CLIENT_HANDLER)
507
508 /* operflags macros */
509 #define ClearOperFlags(x) ((x)->localClient->operflags = 0)
510 #define IsOperGlobalKill(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_GLOBAL_KILL : 0)
511 #define IsOperRemote(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_REMOTE : 0)
512 #define IsOperUnkline(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_UNKLINE : 0)
513 #define IsOperGline(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_GLINE : 0)
514 #define IsOperN(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_N : 0)
515 #define IsOperK(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_K : 0)
516 #define IsOperDie(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_DIE : 0)
517 #define IsOperRehash(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_REHASH : 0)
518 #define IsOperAdmin(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_ADMIN : 0)
519 #define IsOperHiddenAdmin(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_HIDDEN_ADMIN : 0)
520 #define IsOperX(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_X : 0)
521 #define IsOperWall(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_OPERWALL : 0)
522 #define IsOperRemoteBan(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_REMOTEBAN : 0)
523 #define IsOperHidden(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_HIDDEN_OPER : 0)
524
525 /*
526 * definitions for get_client_name
527 * TBD - make this an enum
528 */
529 #define HIDE_IP 0
530 #define SHOW_IP 1
531 #define MASK_IP 2
532
533 EXTERN struct Client me;
534 EXTERN dlink_list listing_client_list;
535 EXTERN dlink_list global_client_list;
536
537 void init_client(void);
538 void dead_link_on_write(struct Client *, int);
539 void dead_link_on_read(struct Client *, int);
540 void exit_aborted_clients(void);
541 void free_exited_clients(void);
542
543 EXTERN int accept_message(struct Client *, struct Client *);
544 EXTERN void set_initial_nick(struct Client *, struct Client *, const char *);
545 EXTERN void exit_client(struct Client *, struct Client *, const char *);
546 EXTERN void check_conf_klines(void);
547 EXTERN void del_from_accept(struct Client *, struct Client *);
548 EXTERN void del_all_accepts(struct Client *);
549 EXTERN void del_all_their_accepts(struct Client *);
550 EXTERN void change_local_nick(struct Client *, struct Client *, const char *);
551 EXTERN void report_error(int, const char *, const char *, int);
552 EXTERN struct Client *make_client(struct Client *);
553 EXTERN struct Client *find_chasing(struct Client *, struct Client *, const char *, int *);
554 EXTERN struct Client *find_person(const struct Client *const, const char *);
555 EXTERN const char *get_client_name(struct Client *, int);
556 EXTERN void log_user_exit(struct Client *);
557 EXTERN void log_oper_action(int type, const struct Client *, const char *, ...);
558
559 #endif /* INCLUDED_client_h */

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision