ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/include/client.h
Revision: 101
Committed: Mon Oct 10 03:52:14 2005 UTC (20 years, 10 months ago) by db
Content type: text/x-chdr
File size: 24816 byte(s)
Log Message:
- First pass at s_conf.c cleanup for attach clients
- attach_conf() is gone replaced with attach_iline()
  Clients/servers have one single I line "attached", i.e. the confs
  list is gone.
- Add attach_leaf_hub()
  Add a leaf or hub mask to the given server, ->serv must exist
  since there can be a list of hub masks and leaf masks, this continues
  to be a dlink list
- Removed redundant find_conf_exact()
  This function can be replaced in all cases with find_exact_name_conf()
  notably because all find_conf_exact did differently was count whether
  an oper conf would cause an already connected client to exceed class limits.
- oper_up() now takes an extra conf pointer pointing to the found
  oper conf, the oper flags are set in the client->iline as necessary
  in oper_up()
- Cleaned up more prototypes that should have been moved from s_conf.h
  to parse_aline.h notably. find_kill() and find_gkill()
- m_stats.c needs more cleanup since memory in attached "confs" is now
  not counted. This should be replaced with iline memory count and
  hub/leaf confs memory count.
  

File Contents

# User Rev Content
1 adx 30 /*
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 knight 31 * $Id$
23 adx 30 */
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 db 101 dlink_list leafs_hubs; /* leafs and hubs masks for server */
56 adx 30 };
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 michael 98
118 adx 30 /*
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 db 101 struct Listener *listener; /* listener accepted from */
203     struct ConfItem *iline; /* Client's assigned iline */
204 adx 30 struct irc_ssaddr ip;
205     unsigned short port; /* and the remote port# too :-) */
206     int aftype; /* Makes life easier for DNS res in IPV6 */
207     struct DNSQuery *dns_query; /* result returned from resolver query */
208     unsigned long serverMask; /* Only used for Lazy Links */
209     time_t last; /* Last time we got a PRIVMSG */
210     time_t last_nick_change;
211     int number_of_nick_changes;
212    
213     char *passwd;
214     int caps; /* capabilities bit-field */
215     int enc_caps; /* cipher capabilities bit-field */
216    
217     #ifdef HAVE_LIBCRYPTO
218     struct EncCapability *in_cipher;
219     struct EncCapability *out_cipher;
220    
221     char in_key[CIPHERKEYLEN];
222     char out_key[CIPHERKEYLEN];
223     #endif
224    
225     fde_t fd;
226     fde_t ctrlfd; /* For servers: control fd used for sending commands
227     to servlink */
228    
229     struct SlinkRpl slinkrpl; /* slink reply being parsed */
230     char *slinkq; /* sendq for control data */
231     int slinkq_ofs; /* ofset into slinkq */
232     int slinkq_len; /* length remaining after slinkq_ofs */
233    
234     struct ZipStats zipstats;
235    
236     /* Anti-flood stuff. We track how many messages were parsed and how
237     * many we were allowed in the current second, and apply a simple
238     * decay to avoid flooding.
239     * -- adrian
240     */
241     int allow_read; /* how many we're allowed to read in this second */
242     int sent_parsed; /* how many messages we've parsed in this second */
243     time_t last_knock; /* time of last knock */
244     unsigned long random_ping;
245    
246     char* response; /* expected response from client */
247     char* auth_oper; /* Operator to become if they supply the response.*/
248 michael 98
249     /*
250     * llname is used to store the clients requested nick
251     * temporarily for new connections.
252     */
253     char llname[NICKLEN];
254 adx 30 };
255    
256     /*
257     * status macros.
258     */
259     #define STAT_CONNECTING 0x01
260     #define STAT_HANDSHAKE 0x02
261     #define STAT_ME 0x04
262     #define STAT_UNKNOWN 0x08
263     #define STAT_SERVER 0x10
264     #define STAT_CLIENT 0x20
265    
266     #define HasID(x) ((x)->id[0] != '\0')
267     #define ID(x) (HasID(x) ? (x)->id : (x)->name)
268     #define ID_or_name(x,client_p) ((IsCapable(client_p, CAP_TS6) && HasID(x)) ? (x)->id : (x)->name)
269    
270     #define IsRegistered(x) ((x)->status > STAT_UNKNOWN)
271     #define IsConnecting(x) ((x)->status == STAT_CONNECTING)
272     #define IsHandshake(x) ((x)->status == STAT_HANDSHAKE)
273     #define IsMe(x) ((x)->status == STAT_ME)
274     #define IsUnknown(x) ((x)->status == STAT_UNKNOWN)
275     #define IsServer(x) ((x)->status == STAT_SERVER)
276     #define IsClient(x) ((x)->status == STAT_CLIENT)
277    
278     #define IsOper(x) ((x)->umodes & UMODE_OPER)
279     #define IsAdmin(x) ((x)->umodes & UMODE_ADMIN)
280    
281     #define SetConnecting(x) {(x)->status = STAT_CONNECTING; \
282     (x)->handler = UNREGISTERED_HANDLER; }
283    
284     #define SetHandshake(x) {(x)->status = STAT_HANDSHAKE; \
285     (x)->handler = UNREGISTERED_HANDLER; }
286    
287     #define SetMe(x) {(x)->status = STAT_ME; \
288     (x)->handler = UNREGISTERED_HANDLER; }
289    
290     #define SetUnknown(x) {(x)->status = STAT_UNKNOWN; \
291     (x)->handler = UNREGISTERED_HANDLER; }
292    
293     #define SetServer(x) {(x)->status = STAT_SERVER; \
294     (x)->handler = SERVER_HANDLER; }
295    
296     #define SetClient(x) {(x)->status = STAT_CLIENT; \
297     (x)->handler = IsOper((x)) ? \
298     OPER_HANDLER : CLIENT_HANDLER; }
299    
300     #define SetEob(x) ((x)->flags |= FLAGS_EOB)
301     #define HasSentEob(x) ((x)->flags & FLAGS_EOB)
302    
303     /*
304     * ts stuff
305     */
306     #define TS_CURRENT 6 /* current TS protocol version */
307     #ifdef TS5_ONLY
308     #define TS_MIN 5
309     #else
310     #define TS_MIN 3 /* minimum supported TS protocol version */
311     #endif
312     #define TS_DOESTS 0x20000000
313     #define DoesTS(x) ((x)->tsinfo == TS_DOESTS)
314    
315    
316     /* housekeeping flags */
317     #define FLAGS_PINGSENT 0x00000001 /* Unreplied ping sent */
318     #define FLAGS_DEADSOCKET 0x00000002 /* Local socket is dead--Exiting soon */
319     #define FLAGS_KILLED 0x00000004 /* Prevents "QUIT" from being sent for this */
320     #define FLAGS_CLOSING 0x00000008 /* set when closing to suppress errors */
321     #define FLAGS_GOTID 0x00000010 /* successful ident lookup achieved */
322     #define FLAGS_NEEDID 0x00000020 /* I-lines say must use ident return */
323     #define FLAGS_SENDQEX 0x00000040 /* Sendq exceeded */
324     #define FLAGS_IPHASH 0x00000080 /* iphashed this client */
325     #define FLAGS_CRYPTIN 0x00000100 /* incoming data must be decrypted */
326     #define FLAGS_CRYPTOUT 0x00000200 /* outgoing data must be encrypted */
327     #define FLAGS_WAITAUTH 0x00000400 /* waiting for CRYPTLINK AUTH command */
328     #define FLAGS_SERVLINK 0x00000800 /* servlink has servlink process */
329     #define FLAGS_MARK 0x00001000 /* marked client */
330     #define FLAGS_CANFLOOD 0x00002000 /* client has the ability to flood */
331     #define FLAGS_EXEMPTGLINE 0x00004000 /* client can't be G-lined */
332     #define FLAGS_EXEMPTKLINE 0x00008000 /* client is exempt from kline */
333     #define FLAGS_NOLIMIT 0x00010000 /* client is exempt from limits */
334     #define FLAGS_RESTRICTED 0x00020000 /* client cannot op others */
335     #define FLAGS_PING_COOKIE 0x00040000 /* PING Cookie */
336     #define FLAGS_IDLE_LINED 0x00080000 /* client is exempt from idle-time limits */
337     #define FLAGS_IP_SPOOFING 0x00100000 /* client IP is spoofed */
338     #define FLAGS_FLOODDONE 0x00200000 /* Flood grace period has been ended. */
339     #define FLAGS_EOB 0x00400000 /* server has received EOB */
340     #define FLAGS_HIDDEN 0x00800000 /* a hidden server. not shown in /links */
341     #define FLAGS_BLOCKED 0x01000000 /* must wait for COMM_SELECT_WRITE */
342     #define FLAGS_SBLOCKED 0x02000000 /* slinkq is blocked */
343     #define FLAGS_USERHOST 0x04000000 /* client is in userhost hash */
344     #define FLAGS_BURSTED 0x08000000 /* user was already bursted */
345     #define FLAGS_EXEMPTRESV 0x10000000 /* client is exempt from RESV */
346     #define FLAGS_GOTUSER 0x20000000 /* if we received a USER command */
347     #define FLAGS_PINGWARNING 0x40000000 /* unreplied ping warning already sent */
348     /* 0x80000000 */
349    
350    
351     /* umodes, settable flags */
352     #define UMODE_SERVNOTICE 0x00001 /* server notices such as kill */
353     #define UMODE_CCONN 0x00002 /* Client Connections */
354     #define UMODE_REJ 0x00004 /* Bot Rejections */
355     #define UMODE_SKILL 0x00008 /* Server Killed */
356     #define UMODE_FULL 0x00010 /* Full messages */
357     #define UMODE_SPY 0x00020 /* see STATS / LINKS */
358     #define UMODE_DEBUG 0x00040 /* 'debugging' info */
359     #define UMODE_NCHANGE 0x00080 /* Nick change notice */
360     #define UMODE_WALLOP 0x00100 /* send wallops to them */
361     #define UMODE_OPERWALL 0x00200 /* Operwalls */
362     #define UMODE_INVISIBLE 0x00400 /* makes user invisible */
363     #define UMODE_BOTS 0x00800 /* shows bots */
364     #define UMODE_EXTERNAL 0x01000 /* show servers introduced and splitting */
365     #define UMODE_CALLERID 0x02000 /* block unless caller id's */
366     #define UMODE_SOFTCALLERID 0x04000 /* block unless on common channel */
367     #define UMODE_UNAUTH 0x08000 /* show unauth connects here */
368     #define UMODE_LOCOPS 0x10000 /* show locops */
369     #define UMODE_DEAF 0x20000 /* don't receive channel messages */
370    
371     /* user information flags, only settable by remote mode or local oper */
372     #define UMODE_OPER 0x40000 /* Operator */
373     #define UMODE_ADMIN 0x80000 /* Admin on server */
374     #define UMODE_ALL UMODE_SERVNOTICE
375    
376     #define SEND_UMODES (UMODE_INVISIBLE | UMODE_OPER | UMODE_WALLOP | \
377     UMODE_ADMIN)
378    
379    
380     /* oper priv flags */
381     #define OPER_FLAG_GLOBAL_KILL 0x00000001 /* oper can global kill */
382     #define OPER_FLAG_REMOTE 0x00000002 /* oper can do squits/connects */
383     #define OPER_FLAG_UNKLINE 0x00000004 /* oper can use unkline */
384     #define OPER_FLAG_GLINE 0x00000008 /* oper can use gline */
385     #define OPER_FLAG_N 0x00000010 /* oper can umode n */
386     #define OPER_FLAG_K 0x00000020 /* oper can kill/kline */
387     #define OPER_FLAG_X 0x00000040 /* oper can xline */
388     #define OPER_FLAG_DIE 0x00000080 /* oper can die */
389     #define OPER_FLAG_REHASH 0x00000100 /* oper can rehash */
390     #define OPER_FLAG_ADMIN 0x00000200 /* oper can set umode +a */
391     #define OPER_FLAG_HIDDEN_ADMIN 0x00000400 /* admin is hidden */
392     #define OPER_FLAG_OPERWALL 0x00000800 /* */
393     #define OPER_FLAG_OPER_SPY 0x00001000 /* */
394     #define OPER_FLAG_REMOTEBAN 0x00002000 /* */
395     #define OPER_FLAG_HIDDEN_OPER 0x00004000 /* */
396    
397     #define SetOFlag(x, y) ((x)->localClient->operflags |= (y))
398    
399    
400     /* flags macros. */
401     #define IsDead(x) ((x)->flags & FLAGS_DEADSOCKET)
402     #define SetDead(x) ((x)->flags |= FLAGS_DEADSOCKET)
403     #define IsClosing(x) ((x)->flags & FLAGS_CLOSING)
404     #define SetClosing(x) ((x)->flags |= FLAGS_CLOSING)
405     #define IsKilled(x) ((x)->flags & FLAGS_KILLED)
406     #define SetKilled(x) ((x)->flags |= FLAGS_KILLED)
407     #define IsCryptIn(x) ((x)->flags & FLAGS_CRYPTIN)
408     #define SetCryptIn(x) ((x)->flags |= FLAGS_CRYPTIN)
409     #define IsCryptOut(x) ((x)->flags & FLAGS_CRYPTOUT)
410     #define SetCryptOut(x) ((x)->flags |= FLAGS_CRYPTOUT)
411     #define IsWaitAuth(x) ((x)->flags & FLAGS_WAITAUTH)
412     #define SetWaitAuth(x) ((x)->flags |= FLAGS_WAITAUTH)
413     #define ClearWaitAuth(x) ((x)->flags &= ~FLAGS_WAITAUTH)
414     #define HasServlink(x) ((x)->flags & FLAGS_SERVLINK)
415     #define SetServlink(x) ((x)->flags |= FLAGS_SERVLINK)
416     #define MyConnect(x) ((x)->localClient != NULL)
417     #define MyClient(x) (MyConnect(x) && IsClient(x))
418     #define SetMark(x) ((x)->flags |= FLAGS_MARK)
419     #define ClearMark(x) ((x)->flags &= ~FLAGS_MARK)
420     #define IsMarked(x) ((x)->flags & FLAGS_MARK)
421     #define SetCanFlood(x) ((x)->flags |= FLAGS_CANFLOOD)
422     #define IsCanFlood(x) ((x)->flags & FLAGS_CANFLOOD)
423     #define IsDefunct(x) ((x)->flags & (FLAGS_DEADSOCKET|FLAGS_CLOSING| \
424     FLAGS_KILLED))
425    
426     /* oper flags */
427     #define MyOper(x) (MyConnect(x) && IsOper(x))
428    
429     #define SetOper(x) {(x)->umodes |= UMODE_OPER; \
430     if (!IsServer((x))) (x)->handler = OPER_HANDLER;}
431    
432     #define ClearOper(x) {(x)->umodes &= ~(UMODE_OPER|UMODE_ADMIN); \
433     if (!IsOper((x)) && !IsServer((x))) \
434     (x)->handler = CLIENT_HANDLER; }
435    
436     #define IsPrivileged(x) (IsOper(x) || IsServer(x))
437    
438     /* umode flags */
439     #define IsInvisible(x) ((x)->umodes & UMODE_INVISIBLE)
440     #define SendWallops(x) ((x)->umodes & UMODE_WALLOP)
441     #define IsSetCallerId(x) ((x)->umodes & \
442     (UMODE_CALLERID|UMODE_SOFTCALLERID))
443     #define IsSoftCallerId(x) ((x)->umodes & UMODE_SOFTCALLERID)
444     #define IsDeaf(x) ((x)->umodes & UMODE_DEAF)
445    
446     #define SetSendQExceeded(x) ((x)->flags |= FLAGS_SENDQEX)
447     #define IsSendQExceeded(x) ((x)->flags & FLAGS_SENDQEX)
448    
449     #define SetIpHash(x) ((x)->flags |= FLAGS_IPHASH)
450     #define ClearIpHash(x) ((x)->flags &= ~FLAGS_IPHASH)
451     #define IsIpHash(x) ((x)->flags & FLAGS_IPHASH)
452    
453     #define SetUserHost(x) ((x)->flags |= FLAGS_USERHOST)
454     #define ClearUserHost(x) ((x)->flags &= ~FLAGS_USERHOST)
455     #define IsUserHostIp(x) ((x)->flags & FLAGS_USERHOST)
456    
457     #define SetPingSent(x) ((x)->flags |= FLAGS_PINGSENT)
458     #define IsPingSent(x) ((x)->flags & FLAGS_PINGSENT)
459     #define ClearPingSent(x) ((x)->flags &= ~FLAGS_PINGSENT)
460    
461     #define SetPingWarning(x) ((x)->flags |= FLAGS_PINGWARNING)
462     #define IsPingWarning(x) ((x)->flags & FLAGS_PINGWARNING)
463     #define ClearPingWarning(x) ((x)->flags &= ~FLAGS_PINGWARNING)
464    
465     #define SetNeedId(x) ((x)->flags |= FLAGS_NEEDID)
466     #define IsNeedId(x) ((x)->flags & FLAGS_NEEDID)
467    
468     #define SetGotId(x) ((x)->flags |= FLAGS_GOTID)
469     #define IsGotId(x) ((x)->flags & FLAGS_GOTID)
470    
471     #define IsExemptKline(x) ((x)->flags & FLAGS_EXEMPTKLINE)
472     #define SetExemptKline(x) ((x)->flags |= FLAGS_EXEMPTKLINE)
473     #define IsExemptLimits(x) ((x)->flags & FLAGS_NOLIMIT)
474     #define SetExemptLimits(x) ((x)->flags |= FLAGS_NOLIMIT)
475     #define IsExemptGline(x) ((x)->flags & FLAGS_EXEMPTGLINE)
476     #define SetExemptGline(x) ((x)->flags |= FLAGS_EXEMPTGLINE)
477     #define IsExemptResv(x) ((x)->flags & FLAGS_EXEMPTRESV)
478     #define SetExemptResv(x) ((x)->flags |= FLAGS_EXEMPTRESV)
479     #define SetIPSpoof(x) ((x)->flags |= FLAGS_IP_SPOOFING)
480     #define IsIPSpoof(x) ((x)->flags & FLAGS_IP_SPOOFING)
481    
482     #define IsIdlelined(x) ((x)->flags & FLAGS_IDLE_LINED)
483     #define SetIdlelined(x) ((x)->flags |= FLAGS_IDLE_LINED)
484     #define IsRestricted(x) ((x)->flags & FLAGS_RESTRICTED)
485     #define SetRestricted(x) ((x)->flags |= FLAGS_RESTRICTED)
486    
487     #define IsFloodDone(x) ((x)->flags & FLAGS_FLOODDONE)
488     #define SetFloodDone(x) ((x)->flags |= FLAGS_FLOODDONE)
489     #define HasPingCookie(x) ((x)->flags & FLAGS_PING_COOKIE)
490     #define SetPingCookie(x) ((x)->flags |= FLAGS_PING_COOKIE)
491     #define IsHidden(x) ((x)->flags & FLAGS_HIDDEN)
492     #define SetHidden(x) ((x)->flags |= FLAGS_HIDDEN)
493    
494     #define IsSendqBlocked(x) ((x)->flags & FLAGS_BLOCKED)
495     #define SetSendqBlocked(x) ((x)->flags |= FLAGS_BLOCKED)
496     #define ClearSendqBlocked(x) ((x)->flags &= ~FLAGS_BLOCKED)
497     #define IsSlinkqBlocked(x) ((x)->flags & FLAGS_SBLOCKED)
498     #define SetSlinkqBlocked(x) ((x)->flags |= FLAGS_SBLOCKED)
499     #define ClearSlinkqBlocked(x) ((x)->flags &= ~FLAGS_SBLOCKED)
500    
501     #define IsBursted(x) ((x)->flags & FLAGS_BURSTED)
502     #define SetBursted(x) ((x)->flags |= FLAGS_BURSTED)
503     #define ClearBursted(x) ((x)->flags &= ~FLAGS_BURSTED)
504    
505     #define IsCaptured(x) ((x)->handler == DUMMY_HANDLER)
506     #define SetCaptured(x) ((x)->handler = DUMMY_HANDLER)
507     #define ClearCaptured(x) ((x)->handler = CLIENT_HANDLER)
508    
509     /* operflags macros */
510     #define ClearOperFlags(x) ((x)->localClient->operflags = 0)
511     #define IsOperGlobalKill(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_GLOBAL_KILL : 0)
512     #define IsOperRemote(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_REMOTE : 0)
513     #define IsOperUnkline(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_UNKLINE : 0)
514     #define IsOperGline(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_GLINE : 0)
515     #define IsOperN(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_N : 0)
516     #define IsOperK(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_K : 0)
517     #define IsOperDie(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_DIE : 0)
518     #define IsOperRehash(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_REHASH : 0)
519     #define IsOperAdmin(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_ADMIN : 0)
520     #define IsOperHiddenAdmin(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_HIDDEN_ADMIN : 0)
521     #define IsOperX(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_X : 0)
522     #define IsOperWall(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_OPERWALL : 0)
523     #define IsOperRemoteBan(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_REMOTEBAN : 0)
524     #define IsOperHidden(x) (MyConnect(x) ? (x)->localClient->operflags & OPER_FLAG_HIDDEN_OPER : 0)
525    
526     /*
527     * definitions for get_client_name
528     * TBD - make this an enum
529     */
530     #define HIDE_IP 0
531     #define SHOW_IP 1
532     #define MASK_IP 2
533    
534     extern struct Client me;
535     extern dlink_list listing_client_list;
536     extern dlink_list global_client_list;
537    
538     extern int accept_message(struct Client *, struct Client *);
539     extern void set_initial_nick(struct Client *, struct Client *, const char *);
540     extern void exit_client(struct Client *, struct Client *, const char *);
541     extern void check_conf_klines(void);
542     extern void init_client(void);
543     extern void del_from_accept(struct Client *, struct Client *);
544     extern void del_all_accepts(struct Client *);
545     extern void del_all_their_accepts(struct Client *);
546     extern void change_local_nick(struct Client *, struct Client *, const char *);
547 adx 68 extern void report_error(int, const char *, const char *, int);
548 adx 30 extern void dead_link_on_write(struct Client *, int);
549     extern void dead_link_on_read(struct Client *, int);
550     extern void exit_aborted_clients(void);
551     extern void free_exited_clients(void);
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 adx 65 extern void log_user_exit(struct Client *);
557     extern void log_oper_action(int type, const struct Client *, const char *, ...);
558 adx 30
559     #endif /* INCLUDED_client_h */

Properties

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