]> jfr.im git - solanum.git/blobdiff - include/client.h
Remove unused kline_delay config option
[solanum.git] / include / client.h
index a7ebc6960fb8b10fc2f82afccd4b092b44f584b3..9ded2c87df29ac5e0259485a6117759e0a23e784 100644 (file)
@@ -41,9 +41,8 @@ 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
-#define CIPHERKEYLEN    64     /* 512bit */
-#define CLIENT_BUFSIZE 512     /* must be at least 512 bytes */
+#define PASSWDLEN      128
+#define CIPHERKEYLEN   64      /* 512bit */
 
 #define IDLEN          10
 
@@ -68,6 +67,8 @@ struct ListClient;
 struct scache_entry;
 struct ws_ctl;
 
+typedef int SSL_OPEN_CB(struct Client *, int status);
+
 /*
  * Client structures
  */
@@ -125,7 +126,7 @@ struct Client
        unsigned long serial;   /* used to enforce 1 send per nick */
 
        /* client->name is the unique name for a client nick or host */
-       char name[HOSTLEN + 1];
+       char name[NAMELEN + 1];
 
        /*
         * client->username is the username from ident or the USER message,
@@ -252,7 +253,7 @@ struct LocalUser
         */
        int sent_parsed;        /* how many messages we've parsed in this second */
        time_t last_knock;      /* time of last knock */
-       unsigned long random_ping;
+       uint32_t random_ping;
 
        /* target change stuff */
        /* targets we're aware of (fnv32(use_id(target_p))):
@@ -275,6 +276,7 @@ struct LocalUser
        struct _ssl_ctl *ssl_ctl;               /* which ssl daemon we're associate with */
        struct _ssl_ctl *z_ctl;                 /* second ctl for ssl+zlib */
        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 */
@@ -285,6 +287,24 @@ struct LocalUser
        char sasl_agent[IDLEN];
        unsigned char sasl_out;
        unsigned char sasl_complete;
+
+       unsigned int sasl_messages;
+       unsigned int sasl_failures;
+       time_t sasl_next_retry;
+};
+
+#define AUTHC_F_DEFERRED 0x01
+#define AUTHC_F_COMPLETE 0x02
+
+struct AuthClient
+{
+       uint32_t cid;   /* authd id */
+       time_t timeout; /* When to terminate authd query */
+       bool accepted;  /* did authd accept us? */
+       char cause;     /* rejection cause */
+       char *data;     /* reason data */
+       char *reason;   /* reason we were rejected */
+       int flags;
 };
 
 struct PreClient
@@ -293,14 +313,11 @@ struct PreClient
        char spoofuser[USERLEN + 1];
        char spoofhost[HOSTLEN + 1];
 
-       uint32_t authd_cid;             /* authd id */
-       time_t authd_timeout;           /* When to terminate authd query */
-       bool authd_accepted;            /* did authd accept us? */
-       char authd_cause;               /* rejection cause */
-       char *authd_data;               /* reason data */
-       char *authd_reason;             /* reason we were rejected */
+       struct AuthClient auth;
 
        struct rb_sockaddr_storage lip; /* address of our side of the connection */
+
+       char id[IDLEN]; /* UID/SID, unique on the network (unverified) */
 };
 
 struct ListClient
@@ -421,6 +438,7 @@ struct ListClient
 #define LFLAGS_SSL             0x00000001
 #define LFLAGS_FLUSH           0x00000002
 #define LFLAGS_CORK            0x00000004
+#define LFLAGS_SCTP            0x00000008
 
 /* umodes, settable flags */
 /* lots of this moved to snomask -- jilles */
@@ -491,6 +509,10 @@ struct ListClient
 #define SetFlush(x)            ((x)->localClient->localflags |= LFLAGS_FLUSH)
 #define ClearFlush(x)          ((x)->localClient->localflags &= ~LFLAGS_FLUSH)
 
+#define IsSCTP(x)              ((x)->localClient->localflags & LFLAGS_SCTP)
+#define SetSCTP(x)             ((x)->localClient->localflags |= LFLAGS_SCTP)
+#define ClearSCTP(x)           ((x)->localClient->localflags &= ~LFLAGS_SCTP)
+
 /* oper flags */
 #define MyOper(x)               (MyConnect(x) && IsOper(x))
 
@@ -556,9 +578,15 @@ struct ListClient
 #define SHOW_IP 1
 #define MASK_IP 2
 
+enum
+{
+       D_LINED,
+       K_LINED
+};
+
 extern void check_banned_lines(void);
-extern void check_klines_event(void *unused);
 extern void check_klines(void);
+extern void check_one_kline(struct ConfItem *kline);
 extern void check_dlines(void);
 extern void check_xlines(void);
 extern void resv_nick_fnc(const char *mask, const char *reason, int temp_time);
@@ -569,8 +597,8 @@ extern int is_remote_connect(struct Client *);
 extern void init_client(void);
 extern struct Client *make_client(struct Client *from);
 extern void free_pre_client(struct Client *client);
-extern void free_client(struct Client *client);
 
+extern void notify_banned_client(struct Client *, struct ConfItem *, int ban);
 extern int exit_client(struct Client *, struct Client *, struct Client *, const char *);
 
 extern void error_exit_client(struct Client *, int);