105 |
|
time_t firsttime; /* time client was created */ |
106 |
|
time_t since; /* last time we parsed something */ |
107 |
|
time_t tsinfo; /* TS on the nick, SVINFO on server */ |
108 |
+ |
time_t servicestamp; |
109 |
|
uint64_t flags; /* client flags */ |
110 |
|
|
111 |
|
unsigned int umodes; /* opers, normal users subset */ |
112 |
|
unsigned int hopcount; /* number of servers to this 0 = local */ |
113 |
|
unsigned int status; /* Client type */ |
114 |
|
unsigned int handler; /* Handler index */ |
114 |
– |
unsigned int serial; /* used to enforce 1 send per nick */ |
115 |
|
|
116 |
|
dlink_list channel; /* chain of channel pointer blocks */ |
117 |
|
|
143 |
|
* gcos field in /etc/passwd but anything can go here. |
144 |
|
*/ |
145 |
|
char info[REALLEN + 1]; /* Free form additional client info */ |
146 |
– |
char client_host[HOSTLEN + 1]; |
147 |
– |
char client_server[HOSTLEN + 1]; |
146 |
|
|
147 |
< |
/* client->sockhost contains the ip address gotten from the socket as a |
147 |
> |
/* |
148 |
> |
* client->sockhost contains the ip address gotten from the socket as a |
149 |
|
* string, this field should be considered read-only once the connection |
150 |
|
* has been made. (set in s_bsd.c only) |
151 |
|
*/ |
159 |
|
* The following fields are allocated only for local clients |
160 |
|
* (directly connected to *this* server with a socket. |
161 |
|
*/ |
162 |
< |
dlink_node lclient_node; |
164 |
< |
|
162 |
> |
dlink_node lclient_node; |
163 |
|
|
164 |
+ |
char client_host[HOSTLEN + 1]; |
165 |
+ |
char client_server[HOSTLEN + 1]; |
166 |
|
|
167 |
|
unsigned int registration; |
168 |
|
unsigned int cap_client; /* Client capabilities (from us) */ |
171 |
|
unsigned int operflags; /* oper priv flags */ |
172 |
|
unsigned int random_ping; |
173 |
|
|
174 |
+ |
unsigned int serial; /* used to enforce 1 send per nick */ |
175 |
|
|
176 |
|
/* Anti flooding part, all because of lamers... */ |
177 |
|
time_t last_knock; /* time of last knock */ |
303 |
|
* ts stuff |
304 |
|
*/ |
305 |
|
#define TS_CURRENT 6 /* current TS protocol version */ |
306 |
< |
#ifdef TS5_ONLY |
306 |
< |
#define TS_MIN 5 |
307 |
< |
#else |
308 |
< |
#define TS_MIN 3 /* minimum supported TS protocol version */ |
309 |
< |
#endif |
306 |
> |
#define TS_MIN 5 /* minimum supported TS protocol version */ |
307 |
|
#define TS_DOESTS 0x20000000 |
308 |
|
#define DoesTS(x) ((x)->tsinfo == TS_DOESTS) |
309 |
|
|
311 |
|
|
312 |
|
#define CAP_MULTI_PREFIX 0x00000001 |
313 |
|
|
314 |
+ |
#define HasCap(x, y) ((x)->localClient->cap_active & (y)) |
315 |
+ |
|
316 |
|
/* housekeeping flags */ |
317 |
|
#define FLAGS_PINGSENT 0x0000000000000001 /* Unreplied ping sent */ |
318 |
|
#define FLAGS_DEADSOCKET 0x0000000000000002 /* Local socket is dead--Exiting soon */ |
347 |
|
#define FLAGS_PINGWARNING 0x0000000040000000 /* unreplied ping warning already sent */ |
348 |
|
#define FLAGS_FINISHED_AUTH 0x0000000080000000 /* Client has been released from auth */ |
349 |
|
#define FLAGS_FLOOD_NOTICED 0x0000000100000000 |
350 |
+ |
#define FLAGS_SERVICE 0x0000000200000000 /* Client/server is a network service */ |
351 |
|
|
352 |
|
|
353 |
|
/* umodes, settable flags */ |
370 |
|
#define UMODE_LOCOPS 0x00010000 /* show locops */ |
371 |
|
#define UMODE_DEAF 0x00020000 /* don't receive channel messages */ |
372 |
|
#define UMODE_CCONN_FULL 0x00040000 /* add unused fields to connection monitoring */ |
373 |
+ |
#define UMODE_REGISTERED 0x00080000 /* User has identified for that nick. */ |
374 |
|
|
375 |
|
/* user information flags, only settable by remote mode or local oper */ |
376 |
|
#define UMODE_OPER 0x40000000 /* Operator */ |
378 |
|
|
379 |
|
#define UMODE_ALL UMODE_SERVNOTICE |
380 |
|
|
381 |
+ |
#define HasUMode(x, y) ((x)->umodes & (y)) |
382 |
+ |
#define AddUMode(x, y) ((x)->umodes |= (y)) |
383 |
+ |
#define DelUMode(x, y) ((x)->umodes &= ~(y)) |
384 |
+ |
|
385 |
|
#define SEND_UMODES (UMODE_INVISIBLE | UMODE_OPER | UMODE_WALLOP | \ |
386 |
< |
UMODE_ADMIN) |
386 |
> |
UMODE_REGISTERED | UMODE_ADMIN) |
387 |
> |
|
388 |
> |
|
389 |
|
|
390 |
|
|
391 |
|
/* oper priv flags */ |
506 |
|
#define SetPingCookie(x) ((x)->flags |= FLAGS_PING_COOKIE) |
507 |
|
#define IsHidden(x) ((x)->flags & FLAGS_HIDDEN) |
508 |
|
#define SetHidden(x) ((x)->flags |= FLAGS_HIDDEN) |
509 |
+ |
#define IsService(x) ((x)->flags & FLAGS_SERVICE) |
510 |
+ |
#define SetService(x) ((x)->flags |= FLAGS_SERVICE) |
511 |
|
|
512 |
|
#define IsSendqBlocked(x) ((x)->flags & FLAGS_BLOCKED) |
513 |
|
#define SetSendqBlocked(x) ((x)->flags |= FLAGS_BLOCKED) |
569 |
|
extern struct Client *make_client(struct Client *); |
570 |
|
extern struct Client *find_chasing(struct Client *, struct Client *, const char *, int *); |
571 |
|
extern struct Client *find_person(const struct Client *const, const char *); |
572 |
< |
extern const char *get_client_name(struct Client *, int); |
572 |
> |
extern const char *get_client_name(const struct Client *, int); |
573 |
|
|
574 |
|
#endif /* INCLUDED_client_h */ |