Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / include / client.h
index 49b71e65af644c1910970bb32464554d9e9edbc0..3e1d998318a038d4e70ec385f0871b4acc3fe8ee 100644 (file)
  */
 #ifndef INCLUDED_client_h
 #define INCLUDED_client_h
-#ifndef INCLUDED_sys_types_h
-#include <sys/types.h>          /* time_t, size_t */
-#define INCLUDED_sys_types_h
+#ifndef INCLUDED_ircd_defs_h
+#include "ircd_defs.h"
 #endif
-#ifndef INCLUDED_netinet_in_h
-#include <netinet/in.h>         /* in_addr */
-#define INCLUDED_netinet_in_h
+#ifndef INCLUDED_config_h
+#include "config.h"
 #endif
 #ifndef INCLUDED_dbuf_h
 #include "dbuf.h"
 #endif
-#ifndef INCLUDED_ircd_defs_h
-#include "ircd_defs.h"
+#ifndef INCLUDED_msgq_h
+#include "msgq.h"
 #endif
 #ifndef INCLUDED_ircd_handler_h
 #include "ircd_handler.h"
 #endif
+#ifndef INCLUDED_sys_types_h
+#include <sys/types.h>          /* time_t, size_t */
+#define INCLUDED_sys_types_h
+#endif
+#ifndef INCLUDED_netinet_in_h
+#include <netinet/in.h>         /* in_addr */
+#define INCLUDED_netinet_in_h
+#endif
 
 struct ConfItem;
 struct Listener;
@@ -54,7 +60,7 @@ struct hostent;
  * Macros
  */
 #define CLIENT_LOCAL_SIZE sizeof(struct Client)
-#define CLIENT_REMOTE_SIZE offsetof(struct Client, count)
+#define CLIENT_REMOTE_SIZE offsetof(struct Client, cli_count)
 
 /*
  * Structures
@@ -65,33 +71,33 @@ struct hostent;
  */
 
 struct Client {
-  struct Client* next;          /* link in GlobalClientList */
-  struct Client* prev;          /* link in GlobalClientList */
-  struct Client* hnext;         /* link in hash table bucket or this */
-  struct Client* from;          /* == self, if Local Client, *NEVER* NULL! */
-  struct User*   user;          /* ...defined, if this is a User */
-  struct Server* serv;          /* ...defined, if this is a server */
-  struct Whowas* whowas;        /* Pointer to ww struct to be freed on quit */
-  char           yxx[4];        /* Numeric Nick: YMM if this is a server,
+  struct Client* cli_next;          /* link in GlobalClientList */
+  struct Client* cli_prev;          /* link in GlobalClientList */
+  struct Client* cli_hnext;         /* link in hash table bucket or this */
+  struct Client* cli_from;          /* == self, if Local Client, *NEVER* NULL! */
+  struct User*   cli_user;          /* ...defined, if this is a User */
+  struct Server* cli_serv;          /* ...defined, if this is a server */
+  struct Whowas* cli_whowas;        /* Pointer to ww struct to be freed on quit */
+  char           cli_yxx[4];        /* Numeric Nick: YMM if this is a server,
                                    XX0 if this is a user */
   /*
    * XXX - move these to local part for next release
    * (lasttime, since)
    */
-  time_t         lasttime;      /* last time data read from socket */
-  time_t         since;         /* last time we parsed something, flood control */
-
-  time_t         firsttime;     /* time client was created */
-  time_t         lastnick;      /* TimeStamp on nick */
-  int            marker;        /* /who processing marker */
-  unsigned int   flags;         /* client flags */
-  unsigned int   hopcount;      /* number of servers to this 0 = local */
-  struct in_addr ip;            /* Real ip# NOT defined for remote servers! */
-  short          status;        /* Client type */
-  unsigned char  local;         /* local or remote client */
-  char name[HOSTLEN + 1];       /* Unique name of the client, nick or host */
-  char username[USERLEN + 1];   /* username here now for auth stuff */
-  char info[REALLEN + 1];       /* Free form additional client information */
+  time_t         cli_lasttime;      /* last time data read from socket */
+  time_t         cli_since;         /* last time we parsed something, flood control */
+
+  time_t         cli_firsttime;     /* time client was created */
+  time_t         cli_lastnick;      /* TimeStamp on nick */
+  int            cli_marker;        /* /who processing marker */
+  unsigned int   cli_flags;         /* client flags */
+  unsigned int   cli_hopcount;      /* number of servers to this 0 = local */
+  struct in_addr cli_ip;            /* Real ip# NOT defined for remote servers! */
+  short          cli_status;        /* Client type */
+  unsigned char  cli_local;         /* local or remote client */
+  char cli_name[HOSTLEN + 1];       /* Unique name of the client, nick or host */
+  char cli_username[USERLEN + 1];   /* username here now for auth stuff */
+  char cli_info[REALLEN + 1];       /* Free form additional client information */
   /*
    *  The following fields are allocated only for local clients
    *  (directly connected to *this* server with a socket.
@@ -99,39 +105,91 @@ struct Client {
    *  to which the allocation is tied to! *Never* refer to
    *  these fields, if (from != self).
    */
-  unsigned int count;            /* Amount of data in buffer, DON'T PUT
+  unsigned int cli_count;            /* Amount of data in buffer, DON'T PUT
                                     variables ABOVE this one! */
-  int                 fd;        /* >= 0, for local clients */
-  int                 error;     /* last socket level error for client */
-  unsigned int        snomask;   /* mask for server messages */
-  time_t              nextnick;  /* Next time a nick change is allowed */
-  time_t              nexttarget; /* Next time a target change is allowed */
-  unsigned int        cookie;    /* Random number the user must PONG */
-  struct DBuf         sendQ;     /* Outgoing message queue--if socket full */
-  struct DBuf         recvQ;     /* Hold for data incoming yet to be parsed */
-  unsigned int        sendM;     /* Statistics: protocol messages send */
-  unsigned int        sendK;     /* Statistics: total k-bytes send */
-  unsigned int        receiveM;  /* Statistics: protocol messages received */
-  unsigned int        receiveK;  /* Statistics: total k-bytes received */
-  unsigned short      sendB;     /* counters to count upto 1-k lots of bytes */
-  unsigned short      receiveB;  /* sent and received. */
-  struct Listener*    listener;  /* listening client which we accepted from */
-  struct SLink*       confs;     /* Configuration record associated */
-  HandlerType         handler;   /* message index into command table for parsing */
-  struct DNSReply*    dns_reply; /* DNS reply used during client registration */
-  struct ListingArgs* listing;
-  unsigned int        max_sendq; /* cached max send queue for client */
-  unsigned short      lastsq;    /* # 2k blocks when sendqueued called last */
-  unsigned short      port;      /* and the remote port# too :-) */
-  unsigned char       targets[MAXTARGETS]; /* Hash values of current targets */
-  char sock_ip[SOCKIPLEN + 1];  /* this is the ip address as a string */
-  char sockhost[HOSTLEN + 1];   /* This is the host name from the socket and
+  int                 cli_fd;        /* >= 0, for local clients */
+  int                 cli_error;     /* last socket level error for client */
+  unsigned int        cli_snomask;   /* mask for server messages */
+  time_t              cli_nextnick;  /* Next time a nick change is allowed */
+  time_t              cli_nexttarget; /* Next time a target change is allowed */
+  unsigned int        cli_cookie;    /* Random number the user must PONG */
+  struct MsgQ         cli_sendQ;     /* Outgoing message queue--if socket full */
+  struct DBuf         cli_recvQ;     /* Hold for data incoming yet to be parsed */
+  unsigned int        cli_sendM;     /* Statistics: protocol messages send */
+  unsigned int        cli_sendK;     /* Statistics: total k-bytes send */
+  unsigned int        cli_receiveM;  /* Statistics: protocol messages received */
+  unsigned int        cli_receiveK;  /* Statistics: total k-bytes received */
+  unsigned short      cli_sendB;     /* counters to count upto 1-k lots of bytes */
+  unsigned short      cli_receiveB;  /* sent and received. */
+  struct Listener*    cli_listener;  /* listening client which we accepted from */
+  struct SLink*       cli_confs;     /* Configuration record associated */
+  HandlerType         cli_handler;   /* message index into command table for parsing */
+  struct DNSReply*    cli_dns_reply; /* DNS reply used during client registration */
+  struct ListingArgs* cli_listing;
+  unsigned int        cli_max_sendq; /* cached max send queue for client */
+  unsigned int        cli_ping_freq; /* cached ping freq from client conf class */
+  unsigned short      cli_lastsq;    /* # 2k blocks when sendqueued called last */
+  unsigned short      cli_port;      /* and the remote port# too :-) */
+  unsigned char       cli_targets[MAXTARGETS]; /* Hash values of current targets */
+  char cli_sock_ip[SOCKIPLEN + 1];  /* this is the ip address as a string */
+  char cli_sockhost[HOSTLEN + 1];   /* This is the host name from the socket and
                                    after which the connection was accepted. */
-  char passwd[PASSWDLEN + 1];
-  char buffer[BUFSIZE];         /* Incoming message buffer; or the error that
+  char cli_passwd[PASSWDLEN + 1];
+  char cli_buffer[BUFSIZE];         /* Incoming message buffer; or the error that
                                    caused this clients socket to be `dead' */
 };
 
+#define cli_next(cli)          ((cli)->cli_next)
+#define cli_prev(cli)          ((cli)->cli_prev)
+#define cli_hnext(cli)         ((cli)->cli_hnext)
+#define cli_from(cli)          ((cli)->cli_from)
+#define cli_user(cli)          ((cli)->cli_user)
+#define cli_serv(cli)          ((cli)->cli_serv)
+#define cli_whowas(cli)                ((cli)->cli_whowas)
+#define cli_yxx(cli)           ((cli)->cli_yxx)
+#define cli_lasttime(cli)      ((cli)->cli_lasttime)
+#define cli_since(cli)         ((cli)->cli_since)
+#define cli_firsttime(cli)     ((cli)->cli_firsttime)
+#define cli_lastnick(cli)      ((cli)->cli_lastnick)
+#define cli_marker(cli)                ((cli)->cli_marker)
+#define cli_flags(cli)         ((cli)->cli_flags)
+#define cli_hopcount(cli)      ((cli)->cli_hopcount)
+#define cli_ip(cli)            ((cli)->cli_ip)
+#define cli_status(cli)                ((cli)->cli_status)
+#define cli_local(cli)         ((cli)->cli_local)
+#define cli_name(cli)          ((cli)->cli_name)
+#define cli_username(cli)      ((cli)->cli_username)
+#define cli_info(cli)          ((cli)->cli_info)
+
+#define cli_count(cli)         ((cli)->cli_count)
+#define cli_fd(cli)            ((cli)->cli_fd)
+#define cli_error(cli)         ((cli)->cli_error)
+#define cli_snomask(cli)       ((cli)->cli_snomask)
+#define cli_nextnick(cli)      ((cli)->cli_nextnick)
+#define cli_nexttarget(cli)    ((cli)->cli_nexttarget)
+#define cli_cookie(cli)                ((cli)->cli_cookie)
+#define cli_sendQ(cli)         ((cli)->cli_sendQ)
+#define cli_recvQ(cli)         ((cli)->cli_recvQ)
+#define cli_sendM(cli)         ((cli)->cli_sendM)
+#define cli_sendK(cli)         ((cli)->cli_sendK)
+#define cli_receiveM(cli)      ((cli)->cli_receiveM)
+#define cli_receiveK(cli)      ((cli)->cli_receiveK)
+#define cli_sendB(cli)         ((cli)->cli_sendB)
+#define cli_receiveB(cli)      ((cli)->cli_receiveB)
+#define cli_listener(cli)      ((cli)->cli_listener)
+#define cli_confs(cli)         ((cli)->cli_confs)
+#define cli_handler(cli)       ((cli)->cli_handler)
+#define cli_dns_reply(cli)     ((cli)->cli_dns_reply)
+#define cli_listing(cli)       ((cli)->cli_listing)
+#define cli_max_sendq(cli)     ((cli)->cli_max_sendq)
+#define cli_ping_freq(cli)     ((cli)->cli_ping_freq)
+#define cli_lastsq(cli)                ((cli)->cli_lastsq)
+#define cli_port(cli)          ((cli)->cli_port)
+#define cli_targets(cli)       ((cli)->cli_targets)
+#define cli_sock_ip(cli)       ((cli)->cli_sock_ip)
+#define cli_sockhost(cli)      ((cli)->cli_sockhost)
+#define cli_passwd(cli)                ((cli)->cli_passwd)
+#define cli_buffer(cli)                ((cli)->cli_buffer)
 
 #define STAT_CONNECTING         0x001 /* connecting to another server */
 #define STAT_HANDSHAKE          0x002 /* pass - server sent */
@@ -145,38 +203,38 @@ struct Client {
 /*
  * status macros.
  */
-#define IsRegistered(x)         ((x)->status & (STAT_SERVER | STAT_USER))
-#define IsConnecting(x)         ((x)->status == STAT_CONNECTING)
-#define IsHandshake(x)          ((x)->status == STAT_HANDSHAKE)
-#define IsMe(x)                 ((x)->status == STAT_ME)
-#define IsUnknown(x)            ((x)->status & \
+#define IsRegistered(x)         (cli_status(x) & (STAT_SERVER | STAT_USER))
+#define IsConnecting(x)         (cli_status(x) == STAT_CONNECTING)
+#define IsHandshake(x)          (cli_status(x) == STAT_HANDSHAKE)
+#define IsMe(x)                 (cli_status(x) == STAT_ME)
+#define IsUnknown(x)            (cli_status(x) & \
         (STAT_UNKNOWN | STAT_UNKNOWN_USER | STAT_UNKNOWN_SERVER))
 
-#define IsServerPort(x)         ((x)->status == STAT_UNKNOWN_SERVER )
-#define IsUserPort(x)           ((x)->status == STAT_UNKNOWN_USER )
-#define IsClient(x)             ((x)->status & \
+#define IsServerPort(x)         (cli_status(x) == STAT_UNKNOWN_SERVER )
+#define IsUserPort(x)           (cli_status(x) == STAT_UNKNOWN_USER )
+#define IsClient(x)             (cli_status(x) & \
         (STAT_HANDSHAKE | STAT_ME | STAT_UNKNOWN |\
          STAT_UNKNOWN_USER | STAT_UNKNOWN_SERVER | STAT_SERVER | STAT_USER))
 
-#define IsTrusted(x)            ((x)->status & \
+#define IsTrusted(x)            (cli_status(x) & \
         (STAT_CONNECTING | STAT_HANDSHAKE | STAT_ME | STAT_SERVER))
 
-#define IsServer(x)             ((x)->status == STAT_SERVER)
-#define IsUser(x)               ((x)->status == STAT_USER)
+#define IsServer(x)             (cli_status(x) == STAT_SERVER)
+#define IsUser(x)               (cli_status(x) == STAT_USER)
 
 
-#define SetConnecting(x)        ((x)->status = STAT_CONNECTING)
-#define SetHandshake(x)         ((x)->status = STAT_HANDSHAKE)
-#define SetServer(x)            ((x)->status = STAT_SERVER)
-#define SetMe(x)                ((x)->status = STAT_ME)
-#define SetUser(x)              ((x)->status = STAT_USER)
+#define SetConnecting(x)        (cli_status(x) = STAT_CONNECTING)
+#define SetHandshake(x)         (cli_status(x) = STAT_HANDSHAKE)
+#define SetServer(x)            (cli_status(x) = STAT_SERVER)
+#define SetMe(x)                (cli_status(x) = STAT_ME)
+#define SetUser(x)              (cli_status(x) = STAT_USER)
 
-#define MyConnect(x)    ((x)->from == (x))
+#define MyConnect(x)    (cli_from(x) == (x))
 #define MyUser(x)       (MyConnect(x) && IsUser(x))
 #define MyOper(x)       (MyConnect(x) && IsOper(x))
-#define Protocol(x)     ((x)->serv->prot)
+#define Protocol(x)     ((cli_serv(x))->prot)
 
-#define PARSE_AS_SERVER(x) ((x)->status & \
+#define PARSE_AS_SERVER(x) (cli_status(x) & \
             (STAT_SERVER | STAT_CONNECTING | STAT_HANDSHAKE))
 
 /*
@@ -217,57 +275,57 @@ struct Client {
 /*
  * flags macros.
  */
-#define DoAccess(x)             ((x)->flags & FLAGS_CHKACCESS)
-#define IsAnOper(x)             ((x)->flags & (FLAGS_OPER|FLAGS_LOCOP))
-#define IsBlocked(x)            ((x)->flags & FLAGS_BLOCKED)
-#define IsBurst(x)              ((x)->flags & FLAGS_BURST)
-#define IsBurstAck(x)           ((x)->flags & FLAGS_BURST_ACK)
-#define IsBurstOrBurstAck(x)    ((x)->flags & (FLAGS_BURST|FLAGS_BURST_ACK))
-#define IsChannelService(x)     ((x)->flags & FLAGS_CHSERV)
-#define IsDead(x)               ((x)->flags & FLAGS_DEADSOCKET)
-#define IsDeaf(x)               ((x)->flags & FLAGS_DEAF)
-#define IsIPChecked(x)          ((x)->flags & FLAGS_IPCHECK)
-#define IsIdented(x)            ((x)->flags & FLAGS_GOTID)
-#define IsInvisible(x)          ((x)->flags & FLAGS_INVISIBLE)
-#define IsJunction(x)           ((x)->flags & FLAGS_JUNCTION)
-#define IsLocOp(x)              ((x)->flags & FLAGS_LOCOP)
-#define IsLocal(x)              ((x)->flags & FLAGS_LOCAL)
-#define IsOper(x)               ((x)->flags & FLAGS_OPER)
-#define IsUPing(x)              ((x)->flags & FLAGS_UPING)
-#define NoNewLine(x)            ((x)->flags & FLAGS_NONL)
-#define SendDebug(x)            ((x)->flags & FLAGS_DEBUG)
-#define SendServNotice(x)       ((x)->flags & FLAGS_SERVNOTICE)
-#define SendWallops(x)          ((x)->flags & FLAGS_WALLOP)
+#define DoAccess(x)             (cli_flags(x) & FLAGS_CHKACCESS)
+#define IsAnOper(x)             (cli_flags(x) & (FLAGS_OPER|FLAGS_LOCOP))
+#define IsBlocked(x)            (cli_flags(x) & FLAGS_BLOCKED)
+#define IsBurst(x)              (cli_flags(x) & FLAGS_BURST)
+#define IsBurstAck(x)           (cli_flags(x) & FLAGS_BURST_ACK)
+#define IsBurstOrBurstAck(x)    (cli_flags(x) & (FLAGS_BURST|FLAGS_BURST_ACK))
+#define IsChannelService(x)     (cli_flags(x) & FLAGS_CHSERV)
+#define IsDead(x)               (cli_flags(x) & FLAGS_DEADSOCKET)
+#define IsDeaf(x)               (cli_flags(x) & FLAGS_DEAF)
+#define IsIPChecked(x)          (cli_flags(x) & FLAGS_IPCHECK)
+#define IsIdented(x)            (cli_flags(x) & FLAGS_GOTID)
+#define IsInvisible(x)          (cli_flags(x) & FLAGS_INVISIBLE)
+#define IsJunction(x)           (cli_flags(x) & FLAGS_JUNCTION)
+#define IsLocOp(x)              (cli_flags(x) & FLAGS_LOCOP)
+#define IsLocal(x)              (cli_flags(x) & FLAGS_LOCAL)
+#define IsOper(x)               (cli_flags(x) & FLAGS_OPER)
+#define IsUPing(x)              (cli_flags(x) & FLAGS_UPING)
+#define NoNewLine(x)            (cli_flags(x) & FLAGS_NONL)
+#define SendDebug(x)            (cli_flags(x) & FLAGS_DEBUG)
+#define SendServNotice(x)       (cli_flags(x) & FLAGS_SERVNOTICE)
+#define SendWallops(x)          (cli_flags(x) & FLAGS_WALLOP)
 
 #define IsPrivileged(x)         (IsAnOper(x) || IsServer(x))
 
-#define SetAccess(x)            ((x)->flags |= FLAGS_CHKACCESS)
-#define SetBurst(x)             ((x)->flags |= FLAGS_BURST)
-#define SetBurstAck(x)          ((x)->flags |= FLAGS_BURST_ACK)
-#define SetChannelService(x)    ((x)->flags |= FLAGS_CHSERV)
-#define SetDeaf(x)              ((x)->flags |= FLAGS_DEAF)
-#define SetDebug(x)             ((x)->flags |= FLAGS_DEBUG)
-#define SetGotId(x)             ((x)->flags |= FLAGS_GOTID)
-#define SetIPChecked(x)         ((x)->flags |= FLAGS_IPCHECK)
-#define SetInvisible(x)         ((x)->flags |= FLAGS_INVISIBLE)
-#define SetJunction(x)          ((x)->flags |= FLAGS_JUNCTION)
-#define SetLocOp(x)             ((x)->flags |= FLAGS_LOCOP)
-#define SetOper(x)              ((x)->flags |= FLAGS_OPER)
-#define SetUPing(x)             ((x)->flags |= FLAGS_UPING)
-#define SetWallops(x)           ((x)->flags |= FLAGS_WALLOP)
-
-#define ClearAccess(x)          ((x)->flags &= ~FLAGS_CHKACCESS)
-#define ClearBurst(x)           ((x)->flags &= ~FLAGS_BURST)
-#define ClearBurstAck(x)        ((x)->flags &= ~FLAGS_BURST_ACK)
-#define ClearChannelService(x)  ((x)->flags &= ~FLAGS_CHSERV)
-#define ClearDeaf(x)            ((x)->flags &= ~FLAGS_DEAF)
-#define ClearDebug(x)           ((x)->flags &= ~FLAGS_DEBUG)
-#define ClearIPChecked(x)       ((x)->flags &= ~FLAGS_IPCHECK)
-#define ClearInvisible(x)       ((x)->flags &= ~FLAGS_INVISIBLE)
-#define ClearLocOp(x)           ((x)->flags &= ~FLAGS_LOCOP)
-#define ClearOper(x)            ((x)->flags &= ~FLAGS_OPER)
-#define ClearUPing(x)           ((x)->flags &= ~FLAGS_UPING)
-#define ClearWallops(x)         ((x)->flags &= ~FLAGS_WALLOP)
+#define SetAccess(x)            (cli_flags(x) |= FLAGS_CHKACCESS)
+#define SetBurst(x)             (cli_flags(x) |= FLAGS_BURST)
+#define SetBurstAck(x)          (cli_flags(x) |= FLAGS_BURST_ACK)
+#define SetChannelService(x)    (cli_flags(x) |= FLAGS_CHSERV)
+#define SetDeaf(x)              (cli_flags(x) |= FLAGS_DEAF)
+#define SetDebug(x)             (cli_flags(x) |= FLAGS_DEBUG)
+#define SetGotId(x)             (cli_flags(x) |= FLAGS_GOTID)
+#define SetIPChecked(x)         (cli_flags(x) |= FLAGS_IPCHECK)
+#define SetInvisible(x)         (cli_flags(x) |= FLAGS_INVISIBLE)
+#define SetJunction(x)          (cli_flags(x) |= FLAGS_JUNCTION)
+#define SetLocOp(x)             (cli_flags(x) |= FLAGS_LOCOP)
+#define SetOper(x)              (cli_flags(x) |= FLAGS_OPER)
+#define SetUPing(x)             (cli_flags(x) |= FLAGS_UPING)
+#define SetWallops(x)           (cli_flags(x) |= FLAGS_WALLOP)
+
+#define ClearAccess(x)          (cli_flags(x) &= ~FLAGS_CHKACCESS)
+#define ClearBurst(x)           (cli_flags(x) &= ~FLAGS_BURST)
+#define ClearBurstAck(x)        (cli_flags(x) &= ~FLAGS_BURST_ACK)
+#define ClearChannelService(x)  (cli_flags(x) &= ~FLAGS_CHSERV)
+#define ClearDeaf(x)            (cli_flags(x) &= ~FLAGS_DEAF)
+#define ClearDebug(x)           (cli_flags(x) &= ~FLAGS_DEBUG)
+#define ClearIPChecked(x)       (cli_flags(x) &= ~FLAGS_IPCHECK)
+#define ClearInvisible(x)       (cli_flags(x) &= ~FLAGS_INVISIBLE)
+#define ClearLocOp(x)           (cli_flags(x) &= ~FLAGS_LOCOP)
+#define ClearOper(x)            (cli_flags(x) &= ~FLAGS_OPER)
+#define ClearUPing(x)           (cli_flags(x) &= ~FLAGS_UPING)
+#define ClearWallops(x)         (cli_flags(x) &= ~FLAGS_WALLOP)
 
 /* server notice stuff */
 
@@ -291,9 +349,14 @@ struct Client {
 #define SNO_THROTTLE    0x1000  /* host throttle add/remove notices */
 #define SNO_OLDREALOP   0x2000  /* old oper-only messages */
 #define SNO_CONNEXIT    0x4000  /* client connect/exit (ugh) */
+#define SNO_DEBUG       0x8000  /* debugging messages (DEBUGMODE only) */
 
-#define SNO_ALL         0x7fff  /* Don't make it larger then significant,
+#ifdef DEBUGMODE
+# define SNO_ALL        0xffff  /* Don't make it larger then significant,
                                  * that looks nicer */
+#else
+# define SNO_ALL        0x7fff
+#endif
 
 #define SNO_USER        (SNO_ALL & ~SNO_OPER)
 
@@ -309,6 +372,7 @@ typedef enum ShowIPType {
 } ShowIPType;
 
 extern const char* get_client_name(const struct Client* sptr, int showip);
+extern int client_get_ping(const struct Client* local_client);
 
 
 #endif /* INCLUDED_client_h */