X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/860d2381cf16667b639bfdef25a2a13e010a2485..e02cc991bb9a7b9aac65b70d167002cea12bad46:/include/client.h diff --git a/include/client.h b/include/client.h index d3ff6a57..7dfc8f14 100644 --- a/include/client.h +++ b/include/client.h @@ -1,11 +1,11 @@ /* - * charybdis: A useful ircd. + * Solanum: a slightly advanced ircd * client.h: The ircd client header. * * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center * Copyright (C) 1996-2002 Hybrid Development Team * Copyright (C) 2002-2004 ircd-ratbox development team - * Copyright (C) 2005 William Pitcock and Jilles Tjoelker + * Copyright (C) 2005 Ariadne Conill and Jilles Tjoelker * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,9 +36,6 @@ #include "ircd.h" #include "privilege.h" -/* other structs */ -struct Blacklist; - /* we store ipv6 ips for remote clients, so this needs to be v6 always */ #define HOSTIPLEN 53 /* sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255.ipv6") */ #define PASSWDLEN 128 @@ -96,16 +93,6 @@ struct Server struct scache_entry *nameinfo; }; -struct ZipStats -{ - unsigned long long in; - unsigned long long in_wire; - unsigned long long out; - unsigned long long out_wire; - double in_ratio; - double out_ratio; -}; - struct Client { rb_dlink_node node; @@ -228,7 +215,7 @@ struct LocalUser */ char *passwd; char *auth_user; - char *challenge; + unsigned char *challenge; char *fullcaps; char *cipher_string; @@ -280,7 +267,6 @@ struct LocalUser struct ws_ctl *ws_ctl; /* ctl for wsockd */ SSL_OPEN_CB *ssl_callback; /* ssl connection is now open */ uint32_t localflags; - struct ZipStats *zipstats; /* zipstats */ uint16_t cork_count; /* used for corking/uncorking connections */ struct ev_entry *event; /* used for associated events */ @@ -322,7 +308,7 @@ struct PreClient struct ListClient { - char *chname; + char *chname, *mask, *nomask; unsigned int users_min, users_max; time_t created_min, created_max, topic_min, topic_max; int operspy; @@ -374,7 +360,7 @@ struct ListClient (x)->handler = SERVER_HANDLER; } #define SetClient(x) {(x)->status = STAT_CLIENT; \ - (x)->handler = IsOper((x)) ? \ + (x)->handler = IsOperGeneral((x)) ? \ OPER_HANDLER : CLIENT_HANDLER; } #define SetRemoteClient(x) {(x)->status = STAT_CLIENT; \ (x)->handler = RCLIENT_HANDLER; } @@ -432,6 +418,7 @@ struct ListClient #define FLAGS_EXEMPTSPAMBOT 0x02000000 #define FLAGS_EXEMPTSHIDE 0x04000000 #define FLAGS_EXEMPTJUPE 0x08000000 +#define FLAGS_IDENTIFIED 0x10000000 /* owns their current nick */ /* flags for local clients, this needs stuff moved from above to here at some point */ @@ -439,7 +426,9 @@ struct ListClient #define LFLAGS_FLUSH 0x00000002 #define LFLAGS_CORK 0x00000004 #define LFLAGS_SCTP 0x00000008 -#define LFLAGS_INSECURE 0x00000010 /* for marking SSL clients as insecure before registration */ +#define LFLAGS_SECURE 0x00000010 /* for marking SSL clients as secure before registration */ +/* LFLAGS_FAKE: client may not have the usually expected machinery plugged in; don't assert on it. For tests only. */ +#define LFLAGS_FAKE 0x00000020 /* umodes, settable flags */ /* lots of this moved to snomask -- jilles */ @@ -447,7 +436,6 @@ struct ListClient #define UMODE_WALLOP 0x0002 /* send wallops to them */ #define UMODE_OPERWALL 0x0004 /* Operwalls */ #define UMODE_INVISIBLE 0x0008 /* makes user invisible */ -#define UMODE_CALLERID 0x0010 /* block unless caller id's */ #define UMODE_LOCOPS 0x0020 /* show locops */ #define UMODE_SERVICE 0x0040 #define UMODE_DEAF 0x0080 @@ -456,7 +444,7 @@ struct ListClient /* user information flags, only settable by remote mode or local oper */ #define UMODE_OPER 0x1000 /* Operator */ #define UMODE_ADMIN 0x2000 /* Admin on server */ -#define UMODE_SSLCLIENT 0x4000 /* using SSL */ +#define UMODE_SECURE 0x4000 /* has a secure connection */ #define DEFAULT_OPER_UMODES (UMODE_SERVNOTICE | UMODE_OPERWALL | \ UMODE_WALLOP | UMODE_LOCOPS) @@ -498,6 +486,9 @@ struct ListClient #define IsTGExcessive(x) ((x)->flags & FLAGS_TGEXCESSIVE) #define SetTGExcessive(x) ((x)->flags |= FLAGS_TGEXCESSIVE) #define ClearTGExcessive(x) ((x)->flags &= ~FLAGS_TGEXCESSIVE) +#define IsIdentified(x) ((x)->flags & FLAGS_IDENTIFIED) +#define SetIdentified(x) ((x)->flags |= FLAGS_IDENTIFIED) +#define ClearIdentified(x) ((x)->flags &= ~FLAGS_IDENTIFIED) /* local flags */ @@ -513,37 +504,31 @@ struct ListClient #define SetSCTP(x) ((x)->localClient->localflags |= LFLAGS_SCTP) #define ClearSCTP(x) ((x)->localClient->localflags &= ~LFLAGS_SCTP) -#define IsInsecure(x) ((x)->localClient->localflags & LFLAGS_INSECURE) -#define SetInsecure(x) ((x)->localClient->localflags |= LFLAGS_INSECURE) -#define ClearInsecure(x) ((x)->localClient->localflags &= ~LFLAGS_INSECURE) +#define IsSecure(x) ((x)->localClient->localflags & LFLAGS_SECURE) +#define SetSecure(x) ((x)->localClient->localflags |= LFLAGS_SECURE) +#define ClearSecure(x) ((x)->localClient->localflags &= ~LFLAGS_SECURE) /* oper flags */ #define MyOper(x) (MyConnect(x) && IsOper(x)) -#define SetOper(x) {(x)->umodes |= UMODE_OPER; \ - if (MyClient((x))) (x)->handler = OPER_HANDLER;} - -#define ClearOper(x) {(x)->umodes &= ~(UMODE_OPER|UMODE_ADMIN); \ - if (MyClient((x)) && !IsOper((x)) && !IsServer((x))) \ - (x)->handler = CLIENT_HANDLER; } +#define SetOper(x) ((x)->umodes |= UMODE_OPER) +#define ClearOper(x) ((x)->umodes &= ~(UMODE_OPER|UMODE_ADMIN)) /* umode flags */ #define IsInvisible(x) ((x)->umodes & UMODE_INVISIBLE) #define SetInvisible(x) ((x)->umodes |= UMODE_INVISIBLE) #define ClearInvisible(x) ((x)->umodes &= ~UMODE_INVISIBLE) -#define IsSSLClient(x) ((x)->umodes & UMODE_SSLCLIENT) -#define SetSSLClient(x) ((x)->umodes |= UMODE_SSLCLIENT) -#define ClearSSLClient(x) ((x)->umodes &= ~UMODE_SSLCLIENT) +#define IsSecureClient(x) ((x)->umodes & UMODE_SECURE) #define SendWallops(x) ((x)->umodes & UMODE_WALLOP) #define SendLocops(x) ((x)->umodes & UMODE_LOCOPS) #define SendServNotice(x) ((x)->umodes & UMODE_SERVNOTICE) #define SendOperwall(x) ((x)->umodes & UMODE_OPERWALL) -#define IsSetCallerId(x) ((x)->umodes & UMODE_CALLERID) -#define IsService(x) ((x)->umodes & UMODE_SERVICE) -#define IsDeaf(x) ((x)->umodes & UMODE_DEAF) -#define IsNoForward(x) ((x)->umodes & UMODE_NOFORWARD) +#define IsService(x) ((x)->umodes & UMODE_SERVICE) +#define IsDeaf(x) ((x)->umodes & UMODE_DEAF) +#define IsNoForward(x) ((x)->umodes & UMODE_NOFORWARD) #define SetGotId(x) ((x)->flags |= FLAGS_GOTID) +#define ClearGotId(x) ((x)->flags &= ~FLAGS_GOTID) #define IsGotId(x) (((x)->flags & FLAGS_GOTID) != 0) #define IsExemptKline(x) ((x)->flags & FLAGS_EXEMPTKLINE)