| 117 |
|
unsigned short status; /* Client type */ |
| 118 |
|
unsigned char handler; /* Handler index */ |
| 119 |
|
unsigned long serial; /* used to enforce 1 send per nick */ |
| 120 |
– |
unsigned long lazyLinkClientExists; /* This client exists on the |
| 121 |
– |
* bit mapped lazylink servers |
| 122 |
– |
* mapped here |
| 123 |
– |
*/ |
| 120 |
|
char *away; |
| 121 |
|
/* |
| 122 |
|
* client->name is the unique name for a client nick or host |
| 124 |
|
char name[HOSTLEN + 1]; |
| 125 |
|
char id[IDLEN + 1]; /* client ID, unique ID per client */ |
| 126 |
|
|
| 131 |
– |
/* |
| 132 |
– |
* client->llname is used to store the clients requested nick |
| 133 |
– |
* temporarily for new connections. |
| 134 |
– |
*/ |
| 135 |
– |
char llname[NICKLEN]; |
| 136 |
– |
|
| 127 |
|
/* |
| 128 |
|
* client->username is the username from ident or the USER message, |
| 129 |
|
* If the client is idented the USER message is ignored, otherwise |
| 146 |
|
* gcos field in /etc/passwd but anything can go here. |
| 147 |
|
*/ |
| 148 |
|
char info[REALLEN + 1]; /* Free form additional client info */ |
| 149 |
+ |
char client_host[HOSTLEN + 1]; |
| 150 |
+ |
char client_server[HOSTLEN + 1]; |
| 151 |
|
|
| 152 |
|
/* client->sockhost contains the ip address gotten from the socket as a |
| 153 |
|
* string, this field should be considered read-only once the connection |
| 163 |
|
dlink_list on_allow_list; /* clients that have =me= on their allow list*/ |
| 164 |
|
|
| 165 |
|
dlink_list channel; /* chain of channel pointer blocks */ |
| 174 |
– |
dlink_list invited; /* chain of invite pointer blocks */ |
| 166 |
|
|
| 167 |
|
struct LocalUser *localClient; |
| 168 |
|
}; |
| 173 |
|
* The following fields are allocated only for local clients |
| 174 |
|
* (directly connected to *this* server with a socket. |
| 175 |
|
*/ |
| 176 |
+ |
unsigned int registration; |
| 177 |
+ |
unsigned int cap_client; /* Client capabilities (from us) */ |
| 178 |
+ |
unsigned int cap_active; /* Active capabilities (to us) */ |
| 179 |
+ |
|
| 180 |
|
/* Anti flooding part, all because of lamers... */ |
| 181 |
|
time_t last_away; /* Away since... */ |
| 182 |
|
time_t last_join_time; /* when this client last |
| 208 |
|
} recv, send; |
| 209 |
|
|
| 210 |
|
struct Listener *listener; /* listener accepted from */ |
| 211 |
< |
dlink_list confs; /* Configuration record associated */ |
| 212 |
< |
|
| 211 |
> |
dlink_list acceptlist; /* clients I'll allow to talk to me */ |
| 212 |
> |
dlink_list watches; /* chain of Watch pointer blocks */ |
| 213 |
> |
dlink_list confs; /* Configuration record associated */ |
| 214 |
> |
dlink_list invited; /* chain of invite pointer blocks */ |
| 215 |
|
struct irc_ssaddr ip; |
| 219 |
– |
unsigned short port; /* and the remote port# too :-) */ |
| 216 |
|
int aftype; /* Makes life easier for DNS res in IPV6 */ |
| 217 |
< |
struct DNSQuery *dns_query; /* result returned from resolver query */ |
| 222 |
< |
unsigned long serverMask; /* Only used for Lazy Links */ |
| 217 |
> |
struct DNSQuery *dns_query; /* result returned from resolver query */ |
| 218 |
|
time_t last; /* Last time we got a PRIVMSG */ |
| 219 |
|
time_t last_nick_change; |
| 220 |
|
int number_of_nick_changes; |
| 266 |
|
#define STAT_SERVER 0x10 |
| 267 |
|
#define STAT_CLIENT 0x20 |
| 268 |
|
|
| 269 |
+ |
#define REG_NEED_USER 0x1 |
| 270 |
+ |
#define REG_NEED_NICK 0x2 |
| 271 |
+ |
#define REG_NEED_CAP 0x4 |
| 272 |
+ |
#define REG_INIT (REG_NEED_USER|REG_NEED_NICK) |
| 273 |
+ |
|
| 274 |
|
#define HasID(x) ((x)->id[0] != '\0') |
| 275 |
|
#define ID(x) (HasID(x) ? (x)->id : (x)->name) |
| 276 |
|
#define ID_or_name(x,client_p) ((IsCapable(client_p, CAP_TS6) && HasID(x)) ? (x)->id : (x)->name) |
| 321 |
|
#define DoesTS(x) ((x)->tsinfo == TS_DOESTS) |
| 322 |
|
|
| 323 |
|
|
| 324 |
+ |
|
| 325 |
+ |
#define CAP_MULTI_PREFIX 0x00000001 |
| 326 |
+ |
|
| 327 |
|
/* housekeeping flags */ |
| 328 |
< |
#define FLAGS_PINGSENT 0x00000001 /* Unreplied ping sent */ |
| 329 |
< |
#define FLAGS_DEADSOCKET 0x00000002 /* Local socket is dead--Exiting soon */ |
| 330 |
< |
#define FLAGS_KILLED 0x00000004 /* Prevents "QUIT" from being sent for this */ |
| 331 |
< |
#define FLAGS_CLOSING 0x00000008 /* set when closing to suppress errors */ |
| 332 |
< |
#define FLAGS_GOTID 0x00000010 /* successful ident lookup achieved */ |
| 333 |
< |
#define FLAGS_NEEDID 0x00000020 /* I-lines say must use ident return */ |
| 334 |
< |
#define FLAGS_SENDQEX 0x00000040 /* Sendq exceeded */ |
| 335 |
< |
#define FLAGS_IPHASH 0x00000080 /* iphashed this client */ |
| 336 |
< |
#define FLAGS_CRYPTIN 0x00000100 /* incoming data must be decrypted */ |
| 337 |
< |
#define FLAGS_CRYPTOUT 0x00000200 /* outgoing data must be encrypted */ |
| 338 |
< |
#define FLAGS_WAITAUTH 0x00000400 /* waiting for CRYPTLINK AUTH command */ |
| 339 |
< |
#define FLAGS_SERVLINK 0x00000800 /* servlink has servlink process */ |
| 340 |
< |
#define FLAGS_MARK 0x00001000 /* marked client */ |
| 341 |
< |
#define FLAGS_CANFLOOD 0x00002000 /* client has the ability to flood */ |
| 342 |
< |
#define FLAGS_EXEMPTGLINE 0x00004000 /* client can't be G-lined */ |
| 343 |
< |
#define FLAGS_EXEMPTKLINE 0x00008000 /* client is exempt from kline */ |
| 344 |
< |
#define FLAGS_NOLIMIT 0x00010000 /* client is exempt from limits */ |
| 345 |
< |
#define FLAGS_RESTRICTED 0x00020000 /* client cannot op others */ |
| 346 |
< |
#define FLAGS_PING_COOKIE 0x00040000 /* PING Cookie */ |
| 347 |
< |
#define FLAGS_IDLE_LINED 0x00080000 /* client is exempt from idle-time limits */ |
| 348 |
< |
#define FLAGS_IP_SPOOFING 0x00100000 /* client IP is spoofed */ |
| 349 |
< |
#define FLAGS_FLOODDONE 0x00200000 /* Flood grace period has been ended. */ |
| 350 |
< |
#define FLAGS_EOB 0x00400000 /* server has received EOB */ |
| 351 |
< |
#define FLAGS_HIDDEN 0x00800000 /* a hidden server. not shown in /links */ |
| 352 |
< |
#define FLAGS_BLOCKED 0x01000000 /* must wait for COMM_SELECT_WRITE */ |
| 353 |
< |
#define FLAGS_SBLOCKED 0x02000000 /* slinkq is blocked */ |
| 354 |
< |
#define FLAGS_USERHOST 0x04000000 /* client is in userhost hash */ |
| 355 |
< |
#define FLAGS_BURSTED 0x08000000 /* user was already bursted */ |
| 356 |
< |
#define FLAGS_EXEMPTRESV 0x10000000 /* client is exempt from RESV */ |
| 357 |
< |
#define FLAGS_GOTUSER 0x20000000 /* if we received a USER command */ |
| 358 |
< |
#define FLAGS_PINGWARNING 0x40000000 /* unreplied ping warning already sent */ |
| 359 |
< |
/* 0x80000000 */ |
| 328 |
> |
#define FLAGS_PINGSENT 0x00000001 /* Unreplied ping sent */ |
| 329 |
> |
#define FLAGS_DEADSOCKET 0x00000002 /* Local socket is dead--Exiting soon */ |
| 330 |
> |
#define FLAGS_KILLED 0x00000004 /* Prevents "QUIT" from being sent for this */ |
| 331 |
> |
#define FLAGS_CLOSING 0x00000008 /* set when closing to suppress errors */ |
| 332 |
> |
#define FLAGS_GOTID 0x00000010 /* successful ident lookup achieved */ |
| 333 |
> |
#define FLAGS_NEEDID 0x00000020 /* I-lines say must use ident return */ |
| 334 |
> |
#define FLAGS_SENDQEX 0x00000040 /* Sendq exceeded */ |
| 335 |
> |
#define FLAGS_IPHASH 0x00000080 /* iphashed this client */ |
| 336 |
> |
#define FLAGS_CRYPTIN 0x00000100 /* incoming data must be decrypted */ |
| 337 |
> |
#define FLAGS_CRYPTOUT 0x00000200 /* outgoing data must be encrypted */ |
| 338 |
> |
#define FLAGS_WAITAUTH 0x00000400 /* waiting for CRYPTLINK AUTH command */ |
| 339 |
> |
#define FLAGS_SERVLINK 0x00000800 /* servlink has servlink process */ |
| 340 |
> |
#define FLAGS_MARK 0x00001000 /* marked client */ |
| 341 |
> |
#define FLAGS_CANFLOOD 0x00002000 /* client has the ability to flood */ |
| 342 |
> |
#define FLAGS_EXEMPTGLINE 0x00004000 /* client can't be G-lined */ |
| 343 |
> |
#define FLAGS_EXEMPTKLINE 0x00008000 /* client is exempt from kline */ |
| 344 |
> |
#define FLAGS_NOLIMIT 0x00010000 /* client is exempt from limits */ |
| 345 |
> |
#define FLAGS_RESTRICTED 0x00020000 /* client cannot op others */ |
| 346 |
> |
#define FLAGS_PING_COOKIE 0x00040000 /* PING Cookie */ |
| 347 |
> |
#define FLAGS_IDLE_LINED 0x00080000 /* client is exempt from idle-time limits */ |
| 348 |
> |
#define FLAGS_IP_SPOOFING 0x00100000 /* client IP is spoofed */ |
| 349 |
> |
#define FLAGS_FLOODDONE 0x00200000 /* Flood grace period has been ended. */ |
| 350 |
> |
#define FLAGS_EOB 0x00400000 /* server has received EOB */ |
| 351 |
> |
#define FLAGS_HIDDEN 0x00800000 /* a hidden server. not shown in /links */ |
| 352 |
> |
#define FLAGS_BLOCKED 0x01000000 /* must wait for COMM_SELECT_WRITE */ |
| 353 |
> |
#define FLAGS_SBLOCKED 0x02000000 /* slinkq is blocked */ |
| 354 |
> |
#define FLAGS_USERHOST 0x04000000 /* client is in userhost hash */ |
| 355 |
> |
#define FLAGS_BURSTED 0x08000000 /* user was already bursted */ |
| 356 |
> |
#define FLAGS_EXEMPTRESV 0x10000000 /* client is exempt from RESV */ |
| 357 |
> |
#define FLAGS_GOTUSER 0x20000000 /* if we received a USER command */ |
| 358 |
> |
#define FLAGS_PINGWARNING 0x40000000 /* unreplied ping warning already sent */ |
| 359 |
> |
#define FLAGS_FINISHED_AUTH 0x80000000 /* Client has been released from auth */ |
| 360 |
|
|
| 361 |
|
|
| 362 |
|
/* umodes, settable flags */ |
| 363 |
< |
#define UMODE_SERVNOTICE 0x00001 /* server notices such as kill */ |
| 364 |
< |
#define UMODE_CCONN 0x00002 /* Client Connections */ |
| 365 |
< |
#define UMODE_REJ 0x00004 /* Bot Rejections */ |
| 366 |
< |
#define UMODE_SKILL 0x00008 /* Server Killed */ |
| 367 |
< |
#define UMODE_FULL 0x00010 /* Full messages */ |
| 368 |
< |
#define UMODE_SPY 0x00020 /* see STATS / LINKS */ |
| 369 |
< |
#define UMODE_DEBUG 0x00040 /* 'debugging' info */ |
| 370 |
< |
#define UMODE_NCHANGE 0x00080 /* Nick change notice */ |
| 371 |
< |
#define UMODE_WALLOP 0x00100 /* send wallops to them */ |
| 372 |
< |
#define UMODE_OPERWALL 0x00200 /* Operwalls */ |
| 373 |
< |
#define UMODE_INVISIBLE 0x00400 /* makes user invisible */ |
| 374 |
< |
#define UMODE_BOTS 0x00800 /* shows bots */ |
| 375 |
< |
#define UMODE_EXTERNAL 0x01000 /* show servers introduced and splitting */ |
| 376 |
< |
#define UMODE_CALLERID 0x02000 /* block unless caller id's */ |
| 377 |
< |
#define UMODE_SOFTCALLERID 0x04000 /* block unless on common channel */ |
| 378 |
< |
#define UMODE_UNAUTH 0x08000 /* show unauth connects here */ |
| 379 |
< |
#define UMODE_LOCOPS 0x10000 /* show locops */ |
| 380 |
< |
#define UMODE_DEAF 0x20000 /* don't receive channel messages */ |
| 363 |
> |
#define UMODE_SERVNOTICE 0x00000001 /* server notices such as kill */ |
| 364 |
> |
#define UMODE_CCONN 0x00000002 /* Client Connections */ |
| 365 |
> |
#define UMODE_REJ 0x00000004 /* Bot Rejections */ |
| 366 |
> |
#define UMODE_SKILL 0x00000008 /* Server Killed */ |
| 367 |
> |
#define UMODE_FULL 0x00000010 /* Full messages */ |
| 368 |
> |
#define UMODE_SPY 0x00000020 /* see STATS / LINKS */ |
| 369 |
> |
#define UMODE_DEBUG 0x00000040 /* 'debugging' info */ |
| 370 |
> |
#define UMODE_NCHANGE 0x00000080 /* Nick change notice */ |
| 371 |
> |
#define UMODE_WALLOP 0x00000100 /* send wallops to them */ |
| 372 |
> |
#define UMODE_OPERWALL 0x00000200 /* Operwalls */ |
| 373 |
> |
#define UMODE_INVISIBLE 0x00000400 /* makes user invisible */ |
| 374 |
> |
#define UMODE_BOTS 0x00000800 /* shows bots */ |
| 375 |
> |
#define UMODE_EXTERNAL 0x00001000 /* show servers introduced and splitting */ |
| 376 |
> |
#define UMODE_CALLERID 0x00002000 /* block unless caller id's */ |
| 377 |
> |
#define UMODE_SOFTCALLERID 0x00004000 /* block unless on common channel */ |
| 378 |
> |
#define UMODE_UNAUTH 0x00008000 /* show unauth connects here */ |
| 379 |
> |
#define UMODE_LOCOPS 0x00010000 /* show locops */ |
| 380 |
> |
#define UMODE_DEAF 0x00020000 /* don't receive channel messages */ |
| 381 |
> |
#define UMODE_CCONN_FULL 0x00040000 /* add unused fields to connection monitoring */ |
| 382 |
|
|
| 383 |
|
/* user information flags, only settable by remote mode or local oper */ |
| 384 |
< |
#define UMODE_OPER 0x40000 /* Operator */ |
| 385 |
< |
#define UMODE_ADMIN 0x80000 /* Admin on server */ |
| 384 |
> |
#define UMODE_OPER 0x40000000 /* Operator */ |
| 385 |
> |
#define UMODE_ADMIN 0x80000000 /* Admin on server */ |
| 386 |
> |
|
| 387 |
|
#define UMODE_ALL UMODE_SERVNOTICE |
| 388 |
|
|
| 389 |
|
#define SEND_UMODES (UMODE_INVISIBLE | UMODE_OPER | UMODE_WALLOP | \ |
| 411 |
|
|
| 412 |
|
|
| 413 |
|
/* flags macros. */ |
| 414 |
+ |
#define IsAuthFinished(x) ((x)->flags & FLAGS_FINISHED_AUTH) |
| 415 |
|
#define IsDead(x) ((x)->flags & FLAGS_DEADSOCKET) |
| 416 |
|
#define SetDead(x) ((x)->flags |= FLAGS_DEADSOCKET) |
| 417 |
|
#define IsClosing(x) ((x)->flags & FLAGS_CLOSING) |
| 456 |
|
(UMODE_CALLERID|UMODE_SOFTCALLERID)) |
| 457 |
|
#define IsSoftCallerId(x) ((x)->umodes & UMODE_SOFTCALLERID) |
| 458 |
|
#define IsDeaf(x) ((x)->umodes & UMODE_DEAF) |
| 459 |
+ |
#define IsFull(x) ((x)->umodes & UMODE_CCONN_FULL) |
| 460 |
|
|
| 461 |
|
#define SetSendQExceeded(x) ((x)->flags |= FLAGS_SENDQEX) |
| 462 |
|
#define IsSendQExceeded(x) ((x)->flags & FLAGS_SENDQEX) |
| 551 |
|
extern dlink_list global_client_list; |
| 552 |
|
|
| 553 |
|
extern int accept_message(struct Client *, struct Client *); |
| 554 |
+ |
extern struct split_nuh_item *find_accept(const char *, const char *, |
| 555 |
+ |
const char *, struct Client *, int); |
| 556 |
+ |
extern void del_accept(struct split_nuh_item *, struct Client *); |
| 557 |
+ |
extern void del_all_accepts(struct Client *); |
| 558 |
|
extern void set_initial_nick(struct Client *, struct Client *, const char *); |
| 559 |
|
extern void exit_client(struct Client *, struct Client *, const char *); |
| 560 |
|
extern void check_conf_klines(void); |
| 561 |
|
extern void init_client(void); |
| 551 |
– |
extern void del_from_accept(struct Client *, struct Client *); |
| 552 |
– |
extern void del_all_accepts(struct Client *); |
| 553 |
– |
extern void del_all_their_accepts(struct Client *); |
| 562 |
|
extern void change_local_nick(struct Client *, struct Client *, const char *); |
| 563 |
|
extern void dead_link_on_write(struct Client *, int); |
| 564 |
|
extern void dead_link_on_read(struct Client *, int); |