Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Wed, 13 Dec 2000 19:14:26 +0000 (19:14 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Wed, 13 Dec 2000 19:14:26 +0000 (19:14 +0000)
Log message:

This finishes phase one of the struct Client/struct Connection divorce.
Everybody is now using the accessor macros.  IT IS VERY IMPORTANT THAT
ANY NEW CODE USE THESE MACROS!  Phase two will be much smaller, involving
only a new structure and changes to some accessor macros in client.h, and
some code moving from list.c to client.c with addition of struct Connection
allocation.

It somehow seems appropriate that MIT's mascot is the beaver.

Testing:

I've compiled and run the server and can't see any differences in behavior.
This is, however, a huge change, so something may very well be messed up.
Brute-force is the order of the day.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@336 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

64 files changed:
ChangeLog
include/client.h
include/querycmds.h
ircd/IPcheck.c
ircd/channel.c
ircd/class.c
ircd/crule.c
ircd/gline.c
ircd/hash.c
ircd/m_admin.c
ircd/m_away.c
ircd/m_burst.c
ircd/m_connect.c
ircd/m_create.c
ircd/m_error.c
ircd/m_gline.c
ircd/m_info.c
ircd/m_invite.c
ircd/m_ison.c
ircd/m_join.c
ircd/m_kick.c
ircd/m_kill.c
ircd/m_links.c
ircd/m_list.c
ircd/m_map.c
ircd/m_mode.c
ircd/m_names.c
ircd/m_nick.c
ircd/m_notice.c
ircd/m_oper.c
ircd/m_part.c
ircd/m_pass.c
ircd/m_ping.c
ircd/m_pong.c
ircd/m_privmsg.c
ircd/m_quit.c
ircd/m_rping.c
ircd/m_rpong.c
ircd/m_server.c
ircd/m_settime.c
ircd/m_silence.c
ircd/m_squit.c
ircd/m_stats.c
ircd/m_time.c
ircd/m_topic.c
ircd/m_trace.c
ircd/m_uping.c
ircd/m_user.c
ircd/m_userhost.c
ircd/m_userip.c
ircd/m_version.c
ircd/m_wallchops.c
ircd/m_who.c
ircd/m_whois.c
ircd/parse.c
ircd/res.c
ircd/s_auth.c
ircd/s_bsd.c
ircd/s_conf.c
ircd/s_misc.c
ircd/s_user.c
ircd/send.c
ircd/uping.c
ircd/whowas.c

index 79e9a38544c1fc2e438031dbc10a2995b9cdb932..e9ed9b206987e3c409ffb52053d22c8734e932df 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,137 @@
+2000-12-13  Kevin L. Mitchell  <klmitch@mit.edu>
+
+       * ircd/whowas.c: missed a couple of accesses to a struct Client
+
+       * ircd/uping.c: missed a couple of accesses to a struct Client
+
+       * ircd/send.c: missed a couple of accesses to a struct Client
+
+       * ircd/s_user.c: missed a couple of accesses to a struct Client
+
+       * ircd/s_misc.c: missed a couple of accesses to a struct Client
+
+       * ircd/s_conf.c: missed a couple of accesses to a struct Client
+
+       * ircd/s_bsd.c: missed a couple of accesses to a struct Client
+
+       * ircd/s_auth.c: missed a couple of accesses to a struct Client
+
+       * ircd/res.c: missed a couple of accesses to a struct Client
+
+       * ircd/parse.c: missed a couple of accesses to a struct Client
+
+       * ircd/m_whois.c: use new accessor macros for struct Client
+
+       * ircd/m_who.c: use new accessor macros for struct Client
+
+       * ircd/m_wallchops.c: use new accessor macros for struct Client
+
+       * ircd/m_version.c: use new accessor macros for struct Client
+
+       * ircd/m_userip.c: use new accessor macros for struct Client
+
+       * ircd/m_userhost.c: use new accessor macros for struct Client
+
+       * ircd/m_user.c: use new accessor macros for struct Client
+
+       * ircd/m_uping.c: use new accessor macros for struct Client
+
+       * ircd/m_trace.c: use new accessor macros for struct Client
+
+       * ircd/m_topic.c: use new accessor macros for struct Client
+
+       * ircd/m_time.c: use new accessor macros for struct Client
+
+       * ircd/m_stats.c: use new accessor macros for struct Client
+
+       * ircd/m_squit.c: use new accessor macros for struct Client
+
+       * ircd/m_silence.c: use new accessor macros for struct Client
+
+       * ircd/m_server.c: use new accessor macros for struct Client;
+       remove dead code
+
+       * ircd/m_rpong.c: use new accessor macros for struct Client
+
+       * ircd/m_rping.c: use new accessor macros for struct Client
+
+       * ircd/m_quit.c: use new accessor macros for struct Client
+
+       * ircd/m_privmsg.c: use new accessor macros for struct Client
+
+       * ircd/m_pong.c: use new accessor macros for struct Client; remove
+       dead code
+
+       * ircd/m_ping.c: use new accessor macros for struct Client
+
+       * ircd/m_pass.c: use new accessor macros for struct Client
+
+       * ircd/m_part.c: use new accessor macros for struct Client
+
+       * ircd/m_oper.c: use new accessor macros for struct Client
+
+       * ircd/m_notice.c: use new accessor macros for struct Client
+
+       * ircd/m_nick.c: use new accessor macros for struct Client
+
+       * ircd/m_names.c: use new accessor macros for struct Client
+
+       * ircd/m_mode.c: use new accessor macros for struct Client
+
+       * ircd/m_map.c: use new accessor macros for struct Client
+
+       * ircd/m_list.c: use new accessor macros for struct Client
+
+       * ircd/m_links.c: use new accessor macros for struct Client;
+       remove some dead code
+
+       * ircd/m_kill.c: use new accessor macros for struct Client; remove
+       some dead code
+
+       * ircd/m_kick.c: use new accessor macros for struct Client
+
+       * ircd/m_join.c: use new accessor macros for struct Client; remove
+       some dead code
+
+       * ircd/m_ison.c: use new accessor macros for struct Client
+
+       * ircd/m_invite.c: use new accessor macros for struct Client
+
+       * ircd/m_info.c: use new accessor macros for struct Client
+
+       * ircd/m_gline.c: use new accessor macros for struct Client
+
+       * ircd/m_error.c: use new accessor macros for struct Client
+
+       * ircd/m_create.c: use new accessor macros for struct Client
+
+       * ircd/m_connect.c: use new accessor macros for struct Client;
+       removed some dead code
+
+       * ircd/m_burst.c: use new accessor macros for struct Client
+
+       * ircd/m_away.c: use new accessor macros for struct Client
+
+       * ircd/m_admin.c: use new accessor macros for struct Client
+
+       * ircd/hash.c: missed a couple of accesses to a struct Client
+
+       * ircd/gline.c: missed a couple of accesses to a struct Client
+
+       * ircd/crule.c: missed a couple of accesses to a struct Client
+
+       * ircd/class.c: missed an access to a struct Client
+
+       * ircd/channel.c: missed a couple of accesses to a struct Client
+
+       * ircd/IPcheck.c: missed an access to a struct Client
+
+       * include/querycmds.h: fix a couple of stats macros to use
+       structure accessor macros
+
+       * include/client.h: change structure member names to highlight any
+       places in the code I've missed
+
 2000-12-12  Kevin L. Mitchell  <klmitch@mit.edu>
 
        * ircd/whowas.c: use new struct Client accessor macros
index af04046b7c15124f02583783682374734c71d90f..3e1d998318a038d4e70ec385f0871b4acc3fe8ee 100644 (file)
@@ -60,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
@@ -71,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.
@@ -105,91 +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 MsgQ         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 int        ping_freq; /* cached ping freq from client conf class */
-  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)->next)
-#define cli_prev(cli)          ((cli)->prev)
-#define cli_hnext(cli)         ((cli)->hnext)
-#define cli_from(cli)          ((cli)->from)
-#define cli_user(cli)          ((cli)->user)
-#define cli_serv(cli)          ((cli)->serv)
-#define cli_whowas(cli)                ((cli)->whowas)
-#define cli_yxx(cli)           ((cli)->yxx)
-#define cli_lasttime(cli)      ((cli)->lasttime)
-#define cli_since(cli)         ((cli)->since)
-#define cli_firsttime(cli)     ((cli)->firsttime)
-#define cli_lastnick(cli)      ((cli)->lastnick)
-#define cli_marker(cli)                ((cli)->marker)
-#define cli_flags(cli)         ((cli)->flags)
-#define cli_hopcount(cli)      ((cli)->hopcount)
-#define cli_ip(cli)            ((cli)->ip)
-#define cli_status(cli)                ((cli)->status)
-#define cli_local(cli)         ((cli)->local)
-#define cli_name(cli)          ((cli)->name)
-#define cli_username(cli)      ((cli)->username)
-#define cli_info(cli)          ((cli)->info)
-
-#define cli_count(cli)         ((cli)->count)
-#define cli_fd(cli)            ((cli)->fd)
-#define cli_error(cli)         ((cli)->error)
-#define cli_snomask(cli)       ((cli)->snomask)
-#define cli_nextnick(cli)      ((cli)->nextnick)
-#define cli_nexttarget(cli)    ((cli)->nexttarget)
-#define cli_cookie(cli)                ((cli)->cookie)
-#define cli_sendQ(cli)         ((cli)->sendQ)
-#define cli_recvQ(cli)         ((cli)->recvQ)
-#define cli_sendM(cli)         ((cli)->sendM)
-#define cli_sendK(cli)         ((cli)->sendK)
-#define cli_receiveM(cli)      ((cli)->receiveM)
-#define cli_receiveK(cli)      ((cli)->receiveK)
-#define cli_sendB(cli)         ((cli)->sendB)
-#define cli_receiveB(cli)      ((cli)->receiveB)
-#define cli_listener(cli)      ((cli)->listener)
-#define cli_confs(cli)         ((cli)->confs)
-#define cli_handler(cli)       ((cli)->handler)
-#define cli_dns_reply(cli)     ((cli)->dns_reply)
-#define cli_listing(cli)       ((cli)->listing)
-#define cli_max_sendq(cli)     ((cli)->max_sendq)
-#define cli_ping_freq(cli)     ((cli)->ping_freq)
-#define cli_lastsq(cli)                ((cli)->lastsq)
-#define cli_port(cli)          ((cli)->port)
-#define cli_targets(cli)       ((cli)->targets)
-#define cli_sock_ip(cli)       ((cli)->sock_ip)
-#define cli_sockhost(cli)      ((cli)->sockhost)
-#define cli_passwd(cli)                ((cli)->passwd)
-#define cli_buffer(cli)                ((cli)->buffer)
+#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 */
index 3052c1f85ccf1d296a7a1a4fd7a94c6a9e7eacf2..d982463eb34e132e292117a009a6878db7960e19 100644 (file)
@@ -37,7 +37,7 @@ extern struct UserStatistics UserStats;
  */
 
 /* Macros for remote connections: */
-#define Count_newremoteclient(UserStats, cptr)  (++UserStats.clients, ++cptr->serv->clients)
+#define Count_newremoteclient(UserStats, cptr)  (++UserStats.clients, ++(cli_serv(cptr)->clients))
 #define Count_newremoteserver(UserStats)  (++UserStats.servers)
 #if 0
 #define Count_remoteclientquits(UserStats)      (--UserStats.clients)
@@ -47,7 +47,7 @@ extern struct UserStatistics UserStats;
   do { \
     --UserStats.clients; \
     if (!IsServer(cptr)) \
-      --cptr->user->server->serv->clients; \
+      --(cli_serv(cli_user(cptr)->server)->clients); \
   } while (0)
 
 #define Count_remoteserverquits(UserStats)      (--UserStats.servers)
@@ -57,7 +57,7 @@ extern struct UserStatistics UserStats;
 #define Count_unknownbecomesclient(cptr, UserStats) \
   do { \
     --UserStats.unknowns; ++UserStats.local_clients; ++UserStats.clients; \
-    if (match("*" DOMAINNAME, cptr->sockhost) == 0) \
+    if (match("*" DOMAINNAME, cli_sockhost(cptr)) == 0) \
       ++current_load.local_count; \
     if (UserStats.local_clients > max_client_count) \
       max_client_count = UserStats.local_clients; \
@@ -74,7 +74,7 @@ extern struct UserStatistics UserStats;
   do \
   { \
     --UserStats.local_clients; --UserStats.clients; \
-    if (match("*" DOMAINNAME, cptr->sockhost) == 0) \
+    if (match("*" DOMAINNAME, cli_sockhost(cptr)) == 0) \
       --current_load.local_count; \
   } while(0)
 #define Count_serverdisconnects(UserStats)              do { --UserStats.local_servers; --UserStats.servers; } while(0)
index 439d60e51fe151cac49c21a1c5929f83a3d620c7..0fc2cac65d1bf073c243f930167869604ddeffcb 100644 (file)
@@ -550,7 +550,7 @@ void IPcheck_disconnect(struct Client *cptr)
 unsigned short IPcheck_nr(struct Client *cptr)
 {
   assert(0 != cptr);
-  return ip_registry_count(cptr->ip.s_addr);
+  return ip_registry_count(cli_ip(cptr).s_addr);
 }
 
 void IPcheck_expire()
index bbedf15202793ed4787dfda1cf54132d62f9544f..68d7a86cd677f6e9a32f84125f00bc4b8ccae438 100644 (file)
@@ -611,7 +611,7 @@ void remove_user_from_all_channels(struct Client* cptr)
 {
   struct Membership* chan;
   assert(0 != cptr);
-  assert(0 != cptr->user);
+  assert(0 != cli_user(cptr));
 
   while ((chan = (cli_user(cptr))->channel))
     remove_user_from_channel(cptr, chan->channel);
@@ -2127,7 +2127,7 @@ mode_parse_ban(struct ParseState *state, int *flag_p)
     newban->next = 0;
 
     DupString(newban->value.ban.banstr, t_str);
-    newban->value.ban.who = state->sptr->name;
+    newban->value.ban.who = cli_name(state->sptr);
     newban->value.ban.when = TStime();
 
     newban->flags = CHFL_BAN | MODE_ADD;
index 32c1febffef804a3abcfc52b78dbfc7bb0d44fad..a3f855f905408d568c2e89c1607a723e32277a53 100644 (file)
@@ -260,7 +260,7 @@ void report_classes(struct Client *sptr)
 unsigned int get_sendq(struct Client *cptr)
 {
   assert(0 != cptr);
-  assert(0 != cptr->local);
+  assert(0 != cli_local(cptr));
 
   if (cli_max_sendq(cptr))
     return cli_max_sendq(cptr);
index d956ede0edd247d5a58ae21fdd63c654cfac0883..460710779afbd47acaeed5d0cb2c1885b99983aa 100644 (file)
@@ -176,7 +176,7 @@ static int crule_connected(int numargs, void *crulearg[])
   struct Client *acptr;
 
   /* taken from m_links */
-  for (acptr = GlobalClientList; acptr; acptr = acptr->next)
+  for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr))
   {
     if (!IsServer(acptr) && !IsMe(acptr))
       continue;
@@ -223,14 +223,14 @@ static int crule_via(int numargs, void *crulearg[])
   struct Client *acptr;
 
   /* adapted from m_links */
-  for (acptr = GlobalClientList; acptr; acptr = acptr->next)
+  for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr))
   {
     if (!IsServer(acptr) && !IsMe(acptr))
       continue;
     if (match((char *)crulearg[1], cli_name(acptr)))
       continue;
     if (match((char *)crulearg[0],
-             cli_name(LocalClientArray[(cli_from(acptr))->fd])))
+             cli_name(LocalClientArray[cli_fd(cli_from(acptr))])))
       continue;
     return (1);
   }
index faa65476fb2b00c188c5ab91aaa0edfb33c1a5de..565d7113af8e4dd467ca405bd1d7a3b3ad713042 100644 (file)
@@ -168,7 +168,7 @@ do_gline(struct Client *cptr, struct Client *sptr, struct Gline *gline)
       if (!cli_user(acptr))
        continue;
        
-      if (acptr->user->username && 
+      if (cli_user(acptr)->username && 
           match (gline->gl_user, (cli_user(acptr))->username) != 0)
                continue;
           
@@ -178,7 +178,7 @@ do_gline(struct Client *cptr, struct Client *sptr, struct Gline *gline)
           continue;
       }
       else {
-        if (match(gline->gl_host, acptr->sockhost) != 0)
+        if (match(gline->gl_host, cli_sockhost(acptr)) != 0)
           continue;
       }
 
index c3b58b5a973ef571f468ef73c01d8db2d842873c..8061a4522948868117289aa9a3b2b617132953fa 100644 (file)
@@ -355,7 +355,7 @@ int hChangeClient(struct Client *cptr, const char *newname)
   assert(0 != cptr);
   hRemClient(cptr);
 
-  cptr->hnext = clientTable[newhash];
+  cli_hnext(cptr) = clientTable[newhash];
   clientTable[newhash] = cptr;
   return 0;
 }
@@ -402,7 +402,7 @@ struct Client* hSeekClient(const char *name, int TMask)
   if (cptr) {
     if (0 == (cli_status(cptr) & TMask) || 0 != ircd_strcmp(name, cli_name(cptr))) {
       struct Client* prev;
-      while (prev = cptr, cptr = cptr->hnext) {
+      while (prev = cptr, cptr = cli_hnext(cptr)) {
         if ((cli_status(cptr) & TMask) && (0 == ircd_strcmp(name, cli_name(cptr)))) {
           cli_hnext(prev) = cli_hnext(cptr);
           cli_hnext(cptr) = clientTable[hashv];
index eb578161e90ee2f9f2e3482dfe5d0e7a559d0240..839d7148846249972cf44916e401e9eea62c0c10 100644 (file)
@@ -113,7 +113,7 @@ int m_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if (!(acptr = find_match_server(parv[1])))
       return send_reply(sptr, ERR_NOSUCHSERVER, parv[1]);
 
-    parv[1] = acptr->name;
+    parv[1] = cli_name(acptr);
     if (hunt_server_cmd(sptr, CMD_ADMIN, cptr, 0, ":%C", 1, parc, parv) != HUNTED_ISME)
       return 0;
   }
index 959508429cc80424f917605a9e254793285ab563..787e570bd32087b2853e2ee4592b6e63517dae1f 100644 (file)
@@ -113,7 +113,7 @@ int m_away(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   assert(0 != cptr);
   assert(cptr == sptr);
 
-  if (user_set_away(sptr->user, away_message)) {
+  if (user_set_away(cli_user(sptr), away_message)) {
     sendcmdto_serv_butone(sptr, CMD_AWAY, cptr, ":%s", away_message);
     send_reply(sptr, RPL_NOWAWAY);
   }
@@ -143,7 +143,7 @@ int ms_away(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (IsServer(sptr))
     return protocol_violation(sptr,"Server trying to set itself away");
 
-  if (user_set_away(sptr->user, away_message))
+  if (user_set_away(cli_user(sptr), away_message))
     sendcmdto_serv_butone(sptr, CMD_AWAY, cptr, ":%s", away_message);
   else
     sendcmdto_serv_butone(sptr, CMD_AWAY, cptr, "");
index faf51d34463a98d511323bc5e2fb2d2e3a8112aa..f9a59693bbc5d84dff111355c89ac1be866cbdef 100644 (file)
@@ -155,7 +155,7 @@ int ms_burst(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
 
   if (!IsBurst(sptr)) /* don't allow BURST outside of burst */
     return exit_client_msg(cptr, cptr, &me, "HACK: BURST message outside "
-                          "net.burst from %s", sptr->name);
+                          "net.burst from %s", cli_name(sptr));
 
   if (!(chptr = get_channel(sptr, parv[1], CGT_CREATE)))
     return 0; /* can't create the channel? */
@@ -245,7 +245,7 @@ int ms_burst(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
            newban = make_link(); /* create new ban */
 
            DupString(newban->value.ban.banstr, ban);
-           DupString(newban->value.ban.who, sptr->name);
+           DupString(newban->value.ban.who, cli_name(sptr));
            newban->value.ban.when = TStime();
 
            newban->flags = CHFL_BAN | CHFL_BURST_BAN; /* set flags */
@@ -289,7 +289,7 @@ int ms_burst(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
            }
          }
 
-         if (!(acptr = findNUser(nick)) || acptr->from != cptr)
+         if (!(acptr = findNUser(nick)) || cli_from(acptr) != cptr)
            continue; /* ignore this client */
 
          /* Build nick buffer */
index 094253e02b4ac8faa80fe6b2c08eb9fe86f9e195..0330e4fa6a267024f5b3a432a902194a57a84610 100644 (file)
@@ -159,7 +159,7 @@ int ms_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    */
   if ((acptr = FindServer(aconf->name))) {
     sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Connect: Server %s already "
-                 "exists from %s", sptr, parv[1], acptr->from->name);
+                 "exists from %s", sptr, parv[1], cli_name(cli_from(acptr)));
     return 0;
   }
   /*
@@ -185,17 +185,6 @@ int ms_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    * Allow opers to /connect foo.* 0 bah.* to connect foo and bah
    * using the conf's configured port
    */
-#if 0
-  /*
-   * Get port number from params, port must be non-zero if it comes from a
-   * server.
-   */
-  if ((port = atoi(parv[2])) == 0) {
-    sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Connect: Invalid port number",
-                 sptr);
-    return 0;
-  }
-#endif
   port = atoi(parv[2]);
   /*
    * save the old port
@@ -278,11 +267,11 @@ int mo_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
        * Look for closest matching server 
        * needed for "/connect blah 4400 *"?
        */
-      for (acptr2 = acptr3; acptr2 != &me; acptr2 = acptr2->serv->up) {
-        if (!match(parv[3], acptr2->name))
+      for (acptr2 = acptr3; acptr2 != &me; acptr2 = cli_serv(acptr2)->up) {
+        if (!match(parv[3], cli_name(acptr2)))
           acptr3 = acptr2;
       }
-      parv[3] = acptr3->name;
+      parv[3] = cli_name(acptr3);
       if (hunt_server_cmd(sptr, CMD_CONNECT, cptr, 1, "%s %s :%C", 3, parc,
                          parv) != HUNTED_ISME)
         return 0;
@@ -303,7 +292,7 @@ int mo_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    */
   if ((acptr = FindServer(aconf->name))) {
     sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Connect: Server %s already "
-                 "exists from %s", sptr, parv[1], acptr->from->name);
+                 "exists from %s", sptr, parv[1], cli_name(cli_from(acptr)));
     return 0;
   }
   /*
@@ -358,179 +347,3 @@ int mo_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   aconf->port = tmpport;
   return 0;
 }
-
-  
-#if 0
-/*
- * XXX - remove when regression testing complete
- *
- *  m_connect                           - Added by Jto 11 Feb 1989
- *
- *    parv[0] = sender prefix
- *    parv[1] = servername
- *    parv[2] = port number
- *    parv[3] = remote server
- */
-int m_connect(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  unsigned short   port;
-  unsigned short   tmpport;
-  struct ConfItem* aconf;
-  struct ConfItem* cconf;
-  struct Client*   acptr;
-  struct Jupe*     ajupe;
-  const char*      rule;
-
-  if (!IsPrivileged(sptr)) {
-    sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); /* XXX DEAD */
-    return -1;
-  }
-
-  if (IsLocOp(sptr) && parc > 3)        /* Only allow LocOps to make */
-    return 0;                   /* local CONNECTS --SRB      */
-
-  if (parc > 3 && MyUser(sptr)) {
-    struct Client* acptr2;
-    struct Client* acptr3;
-    if (!(acptr3 = find_match_server(parv[3]))) {
-      sendto_one(sptr, err_str(ERR_NOSUCHSERVER), me.name, parv[0], parv[3]); /* XXX DEAD */
-      return 0;
-    }
-
-    /* Look for closest matching server */
-    for (acptr2 = acptr3; acptr2 != &me; acptr2 = acptr2->serv->up)
-      if (!match(parv[3], acptr2->name))
-        acptr3 = acptr2;
-
-    parv[3] = acptr3->name;
-  }
-
-  if (hunt_server(1, cptr, sptr, /* XXX DEAD */
-                  "%s%s " TOK_CONNECT " %s %s :%s", 3, parc, parv) != HUNTED_ISME)
-    return 0;
-
-  if (parc < 2 || *parv[1] == '\0') {
-    return need_more_params(sptr, "CONNECT");
-#if 0
-    return -1;
-#endif
-  }
-
-  if ((acptr = FindServer(parv[1]))) {
-    if (MyUser(sptr))
-      sendto_one(sptr, ":%s NOTICE %s :Connect: Server %s %s %s.", /* XXX DEAD */
-          me.name, parv[0], parv[1], "already exists from", acptr->from->name);
-    else
-      sendto_one(sptr, "%s NOTICE %s%s :Connect: Server %s %s %s.", /* XXX DEAD */
-          NumServ(&me), NumNick(sptr), parv[1], "already exists from",
-          acptr->from->name);
-    return 0;
-  }
-
-  for (aconf = GlobalConfList; aconf; aconf = aconf->next) {
-    if (CONF_SERVER == aconf->status && 0 == match(parv[1], aconf->name))
-      break;
-  }
-#if 0
-  /*
-   * Checked first servernames, then try hostnames.
-   */
-  if (!aconf) {
-    for (aconf = GlobalConfList; aconf; aconf = aconf->next) {
-      if (CONF_SERVER == aconf->status && 0 == match(parv[1], aconf->host))
-        break;
-    }
-  }
-#endif
-  if (!aconf) {
-    if (MyUser(sptr))
-      sendto_one(sptr, ":%s NOTICE %s :Connect: Host %s not listed in ircd.conf", /* XXX DEAD */
-                 me.name, parv[0], parv[1]);
-    else
-      sendto_one(sptr, "%s NOTICE %s%s :Connect: Host %s not listed in ircd.conf", /* XXX DEAD */
-                 NumServ(&me), NumNick(sptr), parv[1]);
-    return 0;
-  }
-  /*
-   *  Get port number from user, if given. If not specified,
-   *  use the default from configuration structure. If missing
-   *  from there, then use the precompiled default.
-   */
-  tmpport = port = aconf->port;
-  if (parc > 2 && !BadPtr(parv[2])) {
-    if ((port = atoi(parv[2])) == 0) {
-      if (MyUser(sptr))
-        sendto_one(sptr, ":%s NOTICE %s :Connect: Invalid port number", me.name, parv[0]); /* XXX DEAD */
-      else
-        sendto_one(sptr, "%s NOTICE %s%s :Connect: Invalid port number", /* XXX DEAD */
-                   NumServ(&me), NumNick(sptr));
-      return 0;
-    }
-  }
-  else if (port == 0 && (port = PORTNUM) == 0) {
-    if (MyUser(sptr))
-      sendto_one(sptr, ":%s NOTICE %s :Connect: missing port number", /* XXX DEAD */
-                 me.name, parv[0]);
-    else
-      sendto_one(sptr, "%s NOTICE %s%s :Connect: missing port number", /* XXX DEAD */
-                 NumServ(&me), NumNick(sptr));
-    return 0;
-  }
-
-  /*
-   * Evaluate connection rules...  If no rules found, allow the
-   * connect.   Otherwise stop with the first true rule (ie: rules
-   * are ored together.  Oper connects are effected only by D
-   * lines (CRULEALL) not d lines (CRULEAUTO).
-   */
-  if ((rule = conf_eval_crule(aconf->name, CRULE_ALL))) {
-    if (MyUser(sptr))
-       sendto_one(sptr, ":%s NOTICE %s :Connect: Disallowed by rule: %s", /* XXX DEAD */
-                   me.name, parv[0], cconf->name);
-    else
-      sendto_one(sptr, "%s NOTICE %s%s :Connect: Disallowed by rule: %s", /* XXX DEAD */
-                   NumServ(&me), NumNick(sptr), cconf->name);
-    return 0;
-  }
-  /*
-   * Check to see if the server is juped; if it is, disallow the connect
-   */
-  if ((ajupe = jupe_find(aconf->name)) && JupeIsActive(ajupe)) {
-    sendto_one(sptr, "%s NOTICE %s%s :Connect: Server %s is juped: %s", /* XXX DEAD */
-              NumServ(&me), NumNick(sptr), JupeServer(ajupe),
-              JupeReason(ajupe));
-    return 0;
-  }
-
-  /*
-   * Notify all operators about remote connect requests
-   */
-  if (!IsAnOper(cptr)) {
-    sendto_ops_butone(0, &me, ":%s WALLOPS :Remote CONNECT %s %s from %s", /* XXX DEAD */
-                      me.name, parv[1], parv[2] ? parv[2] : "",
-                      get_client_name(sptr, HIDE_IP));
-    ircd_log(L_INFO, "CONNECT From %s : %s %d", /* XXX DEAD */
-             parv[0], parv[1], parv[2] ? parv[2] : "");
-  }
-  aconf->port = port;
-  if (connect_server(aconf, sptr, 0)) {
-    if (MyUser(sptr))
-      sendto_one(sptr, ":%s NOTICE %s :*** Connecting to %s.", /* XXX DEAD */
-                 me.name, parv[0], aconf->name);
-    else
-      sendto_one(sptr, "%s NOTICE %s%s :*** Connecting to %s.", /* XXX DEAD */
-                 NumServ(&me), NumNick(sptr), aconf->name);
-  }
-  else {
-    if (MyUser(sptr))
-      sendto_one(sptr, ":%s NOTICE %s :*** Connection to %s failed", /* XXX DEAD */
-                 me.name, parv[0], aconf->name);
-    else
-      sendto_one(sptr, "%s NOTICE %s%s :*** Connection to %s failed", /* XXX DEAD */
-                 NumServ(&me), NumNick(sptr), aconf->name);
-  }
-  aconf->port = tmpport;
-  return 0;
-}
-#endif /* 0 */
-
index 5313c2b475f41e9c09dc3ba901e268efb2b60d0e..f413c29ba4881f867f0fea770b9cb813a1207cb4 100644 (file)
@@ -120,7 +120,7 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   int badop; /* a flag */
 
   if (IsServer(sptr))
-    return protocol_violation(sptr,"%s tried to CREATE a channel", sptr->name);
+    return protocol_violation(sptr,"%s tried to CREATE a channel", cli_name(sptr));
 
   /* sanity checks: Only accept CREATE messages from servers */
   if (parc < 3 || *parv[2] == '\0')
@@ -136,7 +136,7 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    */
   if (!IsBurstOrBurstAck(sptr) && 0 != chanTS &&
       MAGIC_REMOTE_JOIN_TS != chanTS)
-    sptr->user->server->serv->lag = TStime() - chanTS;
+    cli_serv(cli_user(sptr)->server)->lag = TStime() - chanTS;
 
 #if 1
   /* If this server is >5 minutes fast, squit it */
@@ -147,7 +147,7 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   /* If we recieve a CREATE for a channel from a server before that server
    * was linked, then it's a HACK
    */
-  if (MyConnect(sptr) && chanTS<sptr->timestamp+5*60*60)
+  if (MyConnect(sptr) && chanTS<cli_timestamp(sptr)+5*60*60)
        return exit_client(sptr,sptr,"HACK: Bogus TS on CREATE before server link");
 #endif
 
index f7ad566a465e16f166f99dd3b463fc258430c674..907f31e7fadcf8120c680bb7b4e8a83270590fde 100644 (file)
@@ -114,7 +114,7 @@ int ms_error(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   para = (parc > 1 && *parv[parc - 1] != '\0') ? parv[parc - 1] : "<>";
 
-  Debug((DEBUG_ERROR, "Received ERROR message from %s: %s", sptr->name, para));
+  Debug((DEBUG_ERROR, "Received ERROR message from %s: %s", cli_name(sptr), para));
 
   if (cptr == sptr)
     sendto_opmask_butone(0, SNO_OLDSNO, "ERROR :from %C -- %s", cptr, para);
@@ -122,10 +122,10 @@ int ms_error(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     sendto_opmask_butone(0, SNO_OLDSNO, "ERROR :from %C via %C -- %s", sptr,
                         cptr, para);
 
-  if (sptr->serv)
+  if (cli_serv(sptr))
   {
-    MyFree(sptr->serv->last_error_msg);
-    DupString(sptr->serv->last_error_msg, para);
+    MyFree(cli_serv(sptr)->last_error_msg);
+    DupString(cli_serv(sptr)->last_error_msg, para);
   }
 
   return 0;
index bddf451c6d8e645bbe5c2c92cbb04698918ff937..7f01f9b846cea3591194a9e79e3e6fe1ecf363fc 100644 (file)
@@ -134,7 +134,7 @@ ms_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   char *mask = parv[2], *target = parv[1], *reason;
 
   if ((parc == 3 && *mask == '-') || parc == 5) {
-    if (!find_conf_byhost(cptr->confs, sptr->name, CONF_UWORLD))
+    if (!find_conf_byhost(cli_confs(cptr), cli_name(sptr), CONF_UWORLD))
       return need_more_params(sptr, "GLINE");
 
     reason = parv[4];
index 3fe6a26b24f0af2cfe560ebd00fe8ef64eb6608b..ea3db75dd231dd1d3f2d9519e30ccc3aeae1861d 100644 (file)
@@ -129,7 +129,7 @@ int m_info(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     send_reply(sptr, SND_EXPLICIT | RPL_INFO, ":Birth Date: %s, compile # %s",
               creation, generation);
     send_reply(sptr, SND_EXPLICIT | RPL_INFO, ":On-line since %s",
-              myctime(me.firsttime));
+              myctime(cli_firsttime(&me)));
     send_reply(sptr, RPL_ENDOFINFO);
   }
   return 0;
@@ -166,7 +166,7 @@ int ms_info(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     send_reply(sptr, SND_EXPLICIT | RPL_INFO, ":Birth Date: %s, compile # %s",
               creation, generation);
     send_reply(sptr, SND_EXPLICIT | RPL_INFO, ":On-line since %s",
-              myctime(me.firsttime));
+              myctime(cli_firsttime(&me)));
     send_reply(sptr, RPL_ENDOFINFO);
   }
   return 0;
@@ -200,7 +200,7 @@ int mo_info(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     send_reply(sptr, SND_EXPLICIT | RPL_INFO, ":Birth Date: %s, compile # %s",
               creation, generation);
     send_reply(sptr, SND_EXPLICIT | RPL_INFO, ":On-line since %s",
-              myctime(me.firsttime));
+              myctime(cli_firsttime(&me)));
     send_reply(sptr, RPL_ENDOFINFO);
   }
   return 0;
index af90a34953f95a72665ad0bf73020b2cbacebdd5..69505520fd9a0c1b037e0443080af32c5b5f3b08 100644 (file)
@@ -129,7 +129,7 @@ int m_invite(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      * list the channels you have an invite to.
      */
     struct SLink *lp;
-    for (lp = sptr->user->invited; lp; lp = lp->next)
+    for (lp = cli_user(sptr)->invited; lp; lp = lp->next)
       send_reply(cptr, RPL_INVITELIST, lp->value.chptr->chname);
     send_reply(cptr, RPL_ENDOFINVITELIST);
     return 0;
@@ -160,15 +160,15 @@ int m_invite(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /* Do not disallow to invite to non-existant #channels, otherwise they
        would simply first be created, causing only MORE bandwidth usage. */
 
-    if (check_target_limit(sptr, acptr, acptr->name, 0))
+    if (check_target_limit(sptr, acptr, cli_name(acptr), 0))
       return 0;
 
-    send_reply(sptr, RPL_INVITING, acptr->name, parv[2]);
+    send_reply(sptr, RPL_INVITING, cli_name(acptr), parv[2]);
 
-    if (acptr->user->away)
-      send_reply(sptr, RPL_AWAY, acptr->name, acptr->user->away);
+    if (cli_user(acptr)->away)
+      send_reply(sptr, RPL_AWAY, cli_name(acptr), cli_user(acptr)->away);
 
-    sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%s", acptr->name, parv[2]);
+    sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%s", cli_name(acptr), parv[2]);
 
     return 0;
   }
@@ -179,7 +179,7 @@ int m_invite(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
 
   if (find_channel_member(acptr, chptr)) {
-    send_reply(sptr, ERR_USERONCHANNEL, acptr->name, chptr->chname);
+    send_reply(sptr, ERR_USERONCHANNEL, cli_name(acptr), chptr->chname);
     return 0;
   }
 
@@ -190,18 +190,18 @@ int m_invite(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   /* If we get here, it was a VALID and meaningful INVITE */
 
-  if (check_target_limit(sptr, acptr, acptr->name, 0))
+  if (check_target_limit(sptr, acptr, cli_name(acptr), 0))
     return 0;
 
-  send_reply(sptr, RPL_INVITING, acptr->name, chptr->chname);
+  send_reply(sptr, RPL_INVITING, cli_name(acptr), chptr->chname);
 
-  if (acptr->user->away)
-    send_reply(sptr, RPL_AWAY, acptr->name, acptr->user->away);
+  if (cli_user(acptr)->away)
+    send_reply(sptr, RPL_AWAY, cli_name(acptr), cli_user(acptr)->away);
 
   if (MyConnect(acptr))
     add_invite(acptr, chptr);
 
-  sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", acptr->name, chptr);
+  sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr);
 
   return 0;
 }
@@ -254,7 +254,7 @@ int ms_invite(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /*
      * just relay the message
      */
-    sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%s", acptr->name, parv[2]);
+    sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%s", cli_name(acptr), parv[2]);
     return 0;
   }
 
@@ -275,11 +275,11 @@ int ms_invite(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     return 0;
   }
   if (find_channel_member(acptr, chptr)) {
-    send_reply(sptr, ERR_USERONCHANNEL, acptr->name, chptr->chname);
+    send_reply(sptr, ERR_USERONCHANNEL, cli_name(acptr), chptr->chname);
     return 0;
   }
   add_invite(acptr, chptr);
-  sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", acptr->name, chptr);
+  sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr);
   return 0;
 }
 
index 2b6852bfd60d8920eae05947250bcdb2a0da05b0..bf9779f890ed54e49b0073516298b49553c24b05 100644 (file)
@@ -124,17 +124,17 @@ int m_ison(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   if (parc < 2)
     return need_more_params(sptr, "ISON");
 
-  mb = msgq_make(sptr, rpl_str(RPL_ISON), me.name, sptr->name);
+  mb = msgq_make(sptr, rpl_str(RPL_ISON), cli_name(&me), cli_name(sptr));
 
   for (name = ircd_strtok(&p, parv[1], " "); name;
        name = ircd_strtok(&p, 0, " ")) {
     if ((acptr = FindUser(name))) {
-      if (msgq_bufleft(mb) < strlen(acptr->name) + 1) {
+      if (msgq_bufleft(mb) < strlen(cli_name(acptr)) + 1) {
        send_buffer(sptr, mb, 0); /* send partial response */
        msgq_clean(mb); /* then do another round */
-       mb = msgq_make(sptr, rpl_str(RPL_ISON), me.name, sptr->name);
+       mb = msgq_make(sptr, rpl_str(RPL_ISON), cli_name(&me), cli_name(sptr));
       }
-      msgq_append(0, mb, "%s ", acptr->name); /* append nickname */
+      msgq_append(0, mb, "%s ", cli_name(acptr)); /* append nickname */
     }
   }
 
@@ -143,5 +143,3 @@ int m_ison(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
 
   return 0;
 }
-
-
index 8908bdf7dff199b2fcaff2530d4daf68eaf5894a..051216ee1d4db9ddca98fff28ea783df073b657e 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#if !defined(XXX_BOGUS_TEMP_HACK)
-#include "handlers.h"      /* m_names */
-#endif
-
 /*
  * Helper function to find last 0 in a comma-separated list of
  * channel names.
@@ -159,7 +155,7 @@ join0(struct JoinBuf *join, struct Client *cptr, struct Client *sptr,
   joinbuf_init(&part, sptr, cptr, JOINBUF_TYPE_PARTALL,
               "Left all channels", 0);
 
-  while ((member = sptr->user->channel))
+  while ((member = cli_user(sptr)->channel))
     joinbuf_join(&part, member->channel,
                 IsZombie(member) ? CHFL_ZOMBIE : 0);
 
@@ -196,8 +192,6 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
 
   keys = parv[2]; /* remember where keys are */
 
-  parv[2] = 0; /* for call to m_names below */
-
   for (name = ircd_strtok(&p, chanlist, ","); name;
        name = ircd_strtok(&p, 0, ",")) {
     clean_channelname(name);
@@ -227,7 +221,7 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
     } else
       flags = IsModelessChannel(name) ? CHFL_DEOPPED : CHFL_CHANOP;
 
-    if (sptr->user->joined >= MAXCHANNELSPERUSER
+    if (cli_user(sptr)->joined >= MAXCHANNELSPERUSER
 #ifdef OPER_NO_CHAN_LIMIT
        /* Opers are allowed to join any number of channels */
        && !IsAnOper(sptr)
@@ -316,7 +310,7 @@ int ms_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   char *name;
 
   if (IsServer(sptr)) {
-    return protocol_violation(sptr,"%s tried to JOIN a channel, duh!", sptr->name);
+    return protocol_violation(sptr,"%s tried to JOIN a channel, duh!", cli_name(sptr));
   }
 
   if (parc < 2 || *parv[1] == '\0')
@@ -348,9 +342,9 @@ int ms_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
        remove_user_from_channel(sptr, chptr);
        chptr = FindChannel(name);
       } else
-       flags = CHFL_DEOPPED | ((sptr->flags & FLAGS_TS8) ? CHFL_SERVOPOK : 0);
+       flags = CHFL_DEOPPED | ((cli_flags(sptr) & FLAGS_TS8) ? CHFL_SERVOPOK : 0);
     } else {
-      flags = CHFL_DEOPPED | ((sptr->flags & FLAGS_TS8) ? CHFL_SERVOPOK : 0);
+      flags = CHFL_DEOPPED | ((cli_flags(sptr) & FLAGS_TS8) ? CHFL_SERVOPOK : 0);
 
       if ((chptr = get_channel(sptr, name, CGT_CREATE)))
        chptr->creationtime = creation ? creation : MAGIC_REMOTE_JOIN_TS;
index f5a488a933d770e9333a27be74cec793b7547dcc..4703216fd25b302775c27496d4c10e32bb4dcaba 100644 (file)
@@ -115,7 +115,7 @@ int m_kick(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   struct Membership *member = 0;
   char *name, *comment;
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (parc < 3 || *parv[1] == '\0')
     return need_more_params(sptr, "KICK");
@@ -134,17 +134,17 @@ int m_kick(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
 
   /* Don't allow the channel service to be kicked */
   if (IsChannelService(who))
-    return send_reply(sptr, ERR_ISCHANSERVICE, who->name, chptr->chname);
+    return send_reply(sptr, ERR_ISCHANSERVICE, cli_name(who), chptr->chname);
 
 #ifdef NO_OPER_DEOP_LCHAN
   /* Prevent kicking opers from local channels -DM- */
   if (IsOperOnLocalChannel(who, chptr->chname))
-    return send_reply(sptr, ERR_ISOPERLCHAN, who->name, chptr->chname);
+    return send_reply(sptr, ERR_ISOPERLCHAN, cli_name(who), chptr->chname);
 #endif
 
   /* check if kicked user is actually on the channel */
   if (!(member = find_member_link(chptr, who)) || IsZombie(member))
-    return send_reply(sptr, ERR_USERNOTINCHANNEL, who->name, chptr->chname);
+    return send_reply(sptr, ERR_USERNOTINCHANNEL, cli_name(who), chptr->chname);
 
   /* We rely on ircd_snprintf to truncate the comment */
   comment = EmptyString(parv[parc - 1]) ? parv[0] : parv[parc - 1];
@@ -176,7 +176,7 @@ int ms_kick(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   struct Membership *member = 0, *sptr_link = 0;
   char *name, *comment;
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (parc < 3 || *parv[1] == '\0')
     return need_more_params(sptr, "KICK");
@@ -203,7 +203,7 @@ int ms_kick(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
    * here), if kicker is not on channel, or if kicker is not a channel
    * operator, bounce the kick
    */
-  if (!IsServer(sptr) && member && who->from != cptr &&
+  if (!IsServer(sptr) && member && cli_from(who) != cptr &&
       (!(sptr_link = find_member_link(chptr, sptr)) || !IsChanOp(sptr_link))) {
     sendto_opmask_butone(0, SNO_HACK2, "HACK: %C KICK %H %C %s", sptr, chptr,
                         who, comment);
index 49fc718adc3b45129b6e0581f67db8b7b1bcd730..dd5b36ad6da8e1e5e89155811e8190e085ffb7a1 100644 (file)
@@ -141,26 +141,7 @@ int ms_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
                    "before I got him :(", sptr);
     return 0;
   }
-#if 0
-  /*
-   * XXX - strictly speaking, the next 2 checks shouldn't be needed
-   * this function only handles kills from servers, and the check
-   * is done before the message is propagated --Bleep
-   */
-  if (IsServer(victim) || IsMe(victim)) {
-    return send_error_to_client(sptr, ERR_CANTKILLSERVER); /* XXX DEAD */
-    return 0;
-  }
-  if (IsLocOp(sptr) && !MyConnect(victim)) {
-    return send_error_to_client(sptr, ERR_NOPRIVILEGES); /* XXX DEAD */
-    return 0;
-  }
-  /*
-   * XXX - this is guaranteed by the parser not to happen
-   */
-  if (EmptyString(path))
-    path = "*no-path*";                /* Bogus server sending??? */
-#endif
+
   /*
    * Notify all *local* opers about the KILL (this includes the one
    * originating the kill, if from this server--the special numeric
@@ -169,19 +150,19 @@ int ms_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    * Note: "victim->name" is used instead of "user" because we may
    *       have changed the target because of the nickname change.
    */
-  inpath = cptr->name;
+  inpath = cli_name(cptr);
 
   sendto_opmask_butone(0, IsServer(sptr) ? SNO_SERVKILL : SNO_OPERKILL,
                       "Received KILL message for %s. From %s Path: %C!%s",
                       get_client_name(victim,SHOW_IP), parv[0], cptr, path);
 
-  log_write_kill(victim, sptr, cptr->name, path);
+  log_write_kill(victim, sptr, cli_name(cptr), path);
   /*
    * And pass on the message to other servers. Note, that if KILL
    * was changed, the message has to be sent to all links, also
    * back.
    */
-  sendcmdto_serv_butone(sptr, CMD_KILL, cptr, "%C :%s!%s", victim, cptr->name,
+  sendcmdto_serv_butone(sptr, CMD_KILL, cptr, "%C :%s!%s", victim, cli_name(cptr),
                        path);
   /*
    * We *can* have crossed a NICK with this numeric... --Run
@@ -201,13 +182,13 @@ int ms_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    */
   if (MyConnect(victim))
     sendcmdto_one(&me, CMD_KILL, cptr, "%C :%s!%s (Ghost 5 Numeric Collided)",
-                 victim, cptr->name, path);
+                 victim, cli_name(cptr), path);
   /*
    * Set FLAGS_KILLED. This prevents exit_one_client from sending
    * the unnecessary QUIT for this. (This flag should never be
    * set in any other place)
    */
-  victim->flags |= FLAGS_KILLED;
+  cli_flags(victim) |= FLAGS_KILLED;
 
   /*
    * Tell the victim she/he has been zapped, but *only* if
@@ -279,7 +260,7 @@ int mo_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       return send_reply(sptr, ERR_NOSUCHNICK, user);
 
     sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Changed KILL %s into %s", sptr,
-                 user, victim->name);
+                 user, cli_name(victim));
   }
   if (!MyConnect(victim) && IsLocOp(cptr))
     return send_reply(sptr, ERR_NOPRIVILEGES);
@@ -291,13 +272,13 @@ int mo_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    * if the user is +k, prevent a kill from local user
    */
   if (IsChannelService(victim))
-    return send_reply(sptr, ERR_ISCHANSERVICE, "KILL", victim->name);
+    return send_reply(sptr, ERR_ISCHANSERVICE, "KILL", cli_name(victim));
 
 
 #ifdef LOCAL_KILL_ONLY
   if (!MyConnect(victim)) {
     sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Nick %s isnt on your server", sptr,
-              victim->name);
+              cli_name(victim));
     return 0;
   }
 #endif
@@ -315,10 +296,10 @@ int mo_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (strlen(comment) > TOPICLEN)
     comment[TOPICLEN] = '\0';
 
-  inpath = sptr->user->host;
+  inpath = cli_user(sptr)->host;
 
   sprintf_irc(buf,
-              "%s%s (%s)", cptr->name, IsOper(sptr) ? "" : "(L)", comment);
+              "%s%s (%s)", cli_name(cptr), IsOper(sptr) ? "" : "(L)", comment);
   path = buf;
 
   /*
@@ -349,9 +330,9 @@ int mo_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     * the unnecessary QUIT for this. (This flag should never be
     * set in any other place)
     */
-    victim->flags |= FLAGS_KILLED;
+    cli_flags(victim) |= FLAGS_KILLED;
 
-    sprintf_irc(buf, "Killed by %s (%s)", sptr->name, comment);
+    sprintf_irc(buf, "Killed by %s (%s)", cli_name(sptr), comment);
   }
   else {
   /*
@@ -361,7 +342,7 @@ int mo_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    * anyway (as this user don't exist there any more either)
    */
     sendcmdto_one(sptr, CMD_KILL, victim, "%C :%s!%s", victim, inpath, path);
-    sprintf_irc(buf, "Local kill by %s (%s)", sptr->name, comment);
+    sprintf_irc(buf, "Local kill by %s (%s)", cli_name(sptr), comment);
   }
 
   return exit_client(cptr, victim, sptr, buf);
index 60b3d049ef2cc1af5b49085a4790d006a4ba917c..cea4270c6af71d04fdccc3ff7b7b3383f274be07 100644 (file)
@@ -128,20 +128,15 @@ int m_links(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   else
     mask = parc < 2 ? 0 : parv[1];
 
-  for (acptr = GlobalClientList, collapse(mask); acptr; acptr = acptr->next)
+  for (acptr = GlobalClientList, collapse(mask); acptr; acptr = cli_next(acptr))
   {
     if (!IsServer(acptr) && !IsMe(acptr))
       continue;
-    if (!BadPtr(mask) && match(mask, acptr->name))
+    if (!BadPtr(mask) && match(mask, cli_name(acptr)))
       continue;
-    send_reply(sptr, RPL_LINKS, acptr->name, acptr->serv->up->name,
-#ifndef GODMODE
-        acptr->hopcount, acptr->serv->prot,
-#else /* GODMODE */
-        acptr->hopcount, acptr->serv->prot, acptr->serv->timestamp,
-        NumServ(acptr),
-#endif /* GODMODE */
-        (acptr->info[0] ? acptr->info : "(Unknown Location)"));
+    send_reply(sptr, RPL_LINKS, cli_name(acptr), cli_name(cli_serv(acptr)->up),
+        cli_hopcount(acptr), cli_serv(acptr)->prot,
+        ((cli_info(acptr))[0] ? cli_info(acptr) : "(Unknown Location)"));
   }
 
   send_reply(sptr, RPL_ENDOFLINKS, BadPtr(mask) ? "*" : mask);
@@ -175,20 +170,15 @@ int ms_links(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   else
     mask = parc < 2 ? 0 : parv[1];
 
-  for (acptr = GlobalClientList, collapse(mask); acptr; acptr = acptr->next)
+  for (acptr = GlobalClientList, collapse(mask); acptr; acptr = cli_next(acptr))
   {
     if (!IsServer(acptr) && !IsMe(acptr))
       continue;
-    if (!BadPtr(mask) && match(mask, acptr->name))
+    if (!BadPtr(mask) && match(mask, cli_name(acptr)))
       continue;
-    send_reply(sptr, RPL_LINKS, acptr->name, acptr->serv->up->name,
-#ifndef GODMODE
-        acptr->hopcount, acptr->serv->prot,
-#else /* GODMODE */
-        acptr->hopcount, acptr->serv->prot, acptr->serv->timestamp,
-        NumServ(acptr),
-#endif /* GODMODE */
-        (acptr->info[0] ? acptr->info : "(Unknown Location)"));
+    send_reply(sptr, RPL_LINKS, cli_name(acptr), cli_name(cli_serv(acptr)->up),
+        cli_hopcount(acptr), cli_serv(acptr)->prot,
+        ((cli_info(acptr))[0] ? cli_info(acptr) : "(Unknown Location)"));
   }
 
   send_reply(sptr, RPL_ENDOFLINKS, BadPtr(mask) ? "*" : mask);
index 92145e2c62f7047fbbb99fe7ead0207d7f13a295..1a7db906baeee95fc61688b02a8200fc4c87cfaf 100644 (file)
@@ -127,11 +127,11 @@ int m_list(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     0                        /* chptr */
   };
 
-  if (sptr->listing)            /* Already listing ? */
+  if (cli_listing(sptr))            /* Already listing ? */
   {
-    sptr->listing->chptr->mode.mode &= ~MODE_LISTED;
-    MyFree(sptr->listing);
-    sptr->listing = 0;
+    cli_listing(sptr)->chptr->mode.mode &= ~MODE_LISTED;
+    MyFree(cli_listing(sptr));
+    cli_listing(sptr) = 0;
     send_reply(sptr, RPL_LISTEND);
     if (parc < 2)
       return 0;                 /* Let LIST abort a listing. */
@@ -297,17 +297,17 @@ int m_list(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if (args.max_users > args.min_users + 1 && args.max_time > args.min_time &&
         args.max_topic_time > args.min_topic_time)      /* Sanity check */
     {
-      sptr->listing = (struct ListingArgs*) MyMalloc(sizeof(struct ListingArgs));
-      assert(0 != sptr->listing);
-      memcpy(sptr->listing, &args, sizeof(struct ListingArgs));
-      if ((sptr->listing->chptr = GlobalChannelList)) {
+      cli_listing(sptr) = (struct ListingArgs*) MyMalloc(sizeof(struct ListingArgs));
+      assert(0 != cli_listing(sptr));
+      memcpy(cli_listing(sptr), &args, sizeof(struct ListingArgs));
+      if ((cli_listing(sptr)->chptr = GlobalChannelList)) {
         int m = GlobalChannelList->mode.mode & MODE_LISTED;
         list_next_channels(sptr, 64);
         GlobalChannelList->mode.mode |= m;
         return 0;
       }
-      MyFree(sptr->listing);
-      sptr->listing = 0;
+      MyFree(cli_listing(sptr));
+      cli_listing(sptr) = 0;
     }
     send_reply(sptr, RPL_LISTEND);
     return 0;
@@ -316,7 +316,7 @@ int m_list(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   for (; (name = ircd_strtok(&p, parv[1], ",")); parv[1] = 0)
   {
     chptr = FindChannel(name);
-    if (chptr && ShowChannel(sptr, chptr) && sptr->user)
+    if (chptr && ShowChannel(sptr, chptr) && cli_user(sptr))
       send_reply(sptr, RPL_LIST, chptr->chname,
                 chptr->users - number_of_zombies(chptr), chptr->topic);
   }
index 77192e939892103bcb75746639002e8eddf7e2f2..f7d76cea498ed4d88941b8ee197f3db4a0eaf1f0 100644 (file)
@@ -112,19 +112,19 @@ static void dump_map(struct Client *cptr, struct Client *server, char *mask, int
 
   *p = '\0';
   if (prompt_length > 60)
-    send_reply(cptr, RPL_MAPMORE, prompt, server->name);
+    send_reply(cptr, RPL_MAPMORE, prompt, cli_name(server));
   else {
     char lag[512];
-    if (server->serv->lag>10000)
+    if (cli_serv(server)->lag>10000)
        lag[0]=0;
-    else if (server->serv->lag<0)
+    else if (cli_serv(server)->lag<0)
        strcpy(lag,"(0s)");
     else
-       sprintf(lag,"(%is)",server->serv->lag);
+       sprintf(lag,"(%is)",cli_serv(server)->lag);
     send_reply(cptr, RPL_MAP, prompt, (
                (IsBurst(server)) ? "*" : (IsBurstAck(server) ? "!" : "")),
-              server->name, lag, (server == &me) ? UserStats.local_clients :
-              server->serv->clients);
+              cli_name(server), lag, (server == &me) ? UserStats.local_clients :
+              cli_serv(server)->clients);
   }
   if (prompt_length > 0)
   {
@@ -135,17 +135,17 @@ static void dump_map(struct Client *cptr, struct Client *server, char *mask, int
   if (prompt_length > 60)
     return;
   strcpy(p, "|-");
-  for (lp = server->serv->down; lp; lp = lp->next)
-    if (match(mask, lp->value.cptr->name))
-      lp->value.cptr->flags &= ~FLAGS_MAP;
+  for (lp = cli_serv(server)->down; lp; lp = lp->next)
+    if (match(mask, cli_name(lp->value.cptr)))
+      cli_flags(lp->value.cptr) &= ~FLAGS_MAP;
     else
     {
-      lp->value.cptr->flags |= FLAGS_MAP;
+      cli_flags(lp->value.cptr) |= FLAGS_MAP;
       cnt++;
     }
-  for (lp = server->serv->down; lp; lp = lp->next)
+  for (lp = cli_serv(server)->down; lp; lp = lp->next)
   {
-    if ((lp->value.cptr->flags & FLAGS_MAP) == 0)
+    if ((cli_flags(lp->value.cptr) & FLAGS_MAP) == 0)
       continue;
     if (--cnt == 0)
       *p = '`';
index eaa5f19ebf27c1b0f4dfcd9608d5924c01b0cb14..54abb04587ea7c8ddef28bb0da7c6ff74bfa02f4 100644 (file)
@@ -114,7 +114,7 @@ m_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
       !(chptr = FindChannel(parv[1])))
     return set_user_mode(cptr, sptr, parc, parv);
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (parc < 3) {
     char modebuf[MODEBUFLEN];
@@ -168,10 +168,10 @@ ms_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   if (('#' != *parv[1] && '+' != *parv[1])|| !(chptr = FindChannel(parv[1])))
     return set_user_mode(cptr, sptr, parc, parv);
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (IsServer(sptr)) {
-    if (find_conf_byhost(cptr->confs, sptr->name, CONF_UWORLD))
+    if (find_conf_byhost(cli_confs(cptr), cli_name(sptr), CONF_UWORLD))
       modebuf_init(&mbuf, sptr, cptr, chptr,
                   (MODEBUF_DEST_CHANNEL | /* Send mode to clients */
                    MODEBUF_DEST_SERVER  | /* Send mode to servers */
index c04cf5c11069340e9d1f8ff48d9a1621b23ed459..f36a7672c39793cf14a8f1645d71763f4a69efef 100644 (file)
@@ -149,7 +149,7 @@ void do_names(struct Client* sptr, struct Channel* chptr, int filter)
 
   /* Iterate over all channel members, and build up the list. */
 
-  mlen = strlen(me.name) + 10 + strlen(sptr->name);
+  mlen = strlen(cli_name(&me)) + 10 + strlen(cli_name(sptr));
   
   for (member = chptr->members; member; member = member->next_member)
   {
@@ -181,8 +181,8 @@ void do_names(struct Client* sptr, struct Channel* chptr, int filter)
       strcat(buf, "+");
       idx++;
     }
-    strcat(buf, c2ptr->name);
-    idx += strlen(c2ptr->name) + 1;
+    strcat(buf, cli_name(c2ptr));
+    idx += strlen(cli_name(c2ptr)) + 1;
     flag = 1;
     if (mlen + idx + NICKLEN + 5 > BUFSIZE)
       /* space, modifier, nick, \r \n \0 */
@@ -251,7 +251,7 @@ int m_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     struct Channel *ch3ptr;
     char buf[BUFSIZE]; 
 
-    mlen = strlen(me.name) + 10 + strlen(sptr->name);
+    mlen = strlen(cli_name(&me)) + 10 + strlen(cli_name(sptr));
 
     /* List all visible channels/visible members */ 
 
@@ -274,14 +274,14 @@ int m_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     idx = 5;
     flag = 0;
 
-    for (c2ptr = GlobalClientList; c2ptr; c2ptr = c2ptr->next)
+    for (c2ptr = GlobalClientList; c2ptr; c2ptr = cli_next(c2ptr))
     {
       int showflag = 0;
 
       if (!IsUser(c2ptr) || (sptr != c2ptr && IsInvisible(c2ptr)))
         continue;
 
-      member = c2ptr->user->channel; 
+      member = cli_user(c2ptr)->channel;
 
       while (member)
       {
@@ -296,9 +296,9 @@ int m_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       if (showflag)               /* Have we already shown them? */
         continue;
  
-      strcat(buf, c2ptr->name);
+      strcat(buf, cli_name(c2ptr));
       strcat(buf, " ");
-      idx += strlen(c2ptr->name) + 1;
+      idx += strlen(cli_name(c2ptr)) + 1;
       flag = 1;
 
       if (mlen + idx + NICKLEN + 3 > BUFSIZE)     /* space, \r\n\0 */
@@ -392,7 +392,7 @@ int ms_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     struct Channel *ch3ptr;
     char buf[BUFSIZE]; 
 
-    mlen = strlen(me.name) + 10 + strlen(sptr->name);
+    mlen = strlen(cli_name(&me)) + 10 + strlen(cli_name(sptr));
 
     /* List all visible channels/visible members */ 
 
@@ -415,14 +415,14 @@ int ms_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     idx = 5;
     flag = 0;
 
-    for (c2ptr = GlobalClientList; c2ptr; c2ptr = c2ptr->next)
+    for (c2ptr = GlobalClientList; c2ptr; c2ptr = cli_next(c2ptr))
     {
       int showflag = 0;
 
       if (!IsUser(c2ptr) || (sptr != c2ptr && IsInvisible(c2ptr)))
         continue;
 
-      member = c2ptr->user->channel; 
+      member = cli_user(c2ptr)->channel; 
 
       while (member)
       {
@@ -437,9 +437,9 @@ int ms_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       if (showflag)               /* Have we already shown them? */
         continue;
  
-      strcat(buf, c2ptr->name);
+      strcat(buf, cli_name(c2ptr));
       strcat(buf, " ");
-      idx += strlen(c2ptr->name) + 1;
+      idx += strlen(cli_name(c2ptr)) + 1;
       flag = 1;
 
       if (mlen + idx + NICKLEN + 3 > BUFSIZE)     /* space, \r\n\0 */
index 2f5eda737ea66d081d9888676ec708e218633077..3f3770839db1893cbc999852344dcbc93fe0cfca 100644 (file)
@@ -125,7 +125,7 @@ int m_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   /*
    * parv[0] will be empty for clients connecting for the first time
    */
-  client_name = (*sptr->name) ? sptr->name : "*";
+  client_name = (*(cli_name(sptr))) ? cli_name(sptr) : "*";
 
   if (parc < 2) {
     send_reply(sptr, ERR_NONICKNAMEGIVEN);
@@ -187,7 +187,7 @@ int m_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      * is concerned (user is changing the case of his/her
      * nickname or somesuch)
      */
-    if (0 != strcmp(acptr->name, nick)) {
+    if (0 != strcmp(cli_name(acptr), nick)) {
       /*
        * Allows change of case in his/her nick
        */
@@ -217,7 +217,7 @@ int m_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    */
   if (IsUnknown(acptr) && MyConnect(acptr)) {
     ++ServerStats->is_ref;
-    IPcheck_connect_fail(acptr->ip);
+    IPcheck_connect_fail(cli_ip(acptr));
     exit_client(cptr, acptr, &me, "Overridden by other sign on");
     return set_nick_name(cptr, sptr, nick, parc, parv);
   }
@@ -273,12 +273,12 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (IsServer(sptr)) {
     lastnick = atoi(parv[3]);
     if (lastnick > OLDEST_TS && !IsBurstOrBurstAck(sptr)) 
-      sptr->serv->lag = TStime() - lastnick;
+      cli_serv(sptr)->lag = TStime() - lastnick;
   }
   else {
     lastnick = atoi(parv[2]); 
     if (lastnick > OLDEST_TS && !IsBurstOrBurstAck(sptr))
-      sptr->user->server->serv->lag = TStime() - lastnick;
+      cli_serv(cli_user(sptr)->server)->lag = TStime() - lastnick;
   }
   /*
    * If do_nick_name() returns a null name OR if the server sent a nick
@@ -293,17 +293,17 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     sendto_opmask_butone(0, SNO_OLDSNO, "Bad Nick: %s From: %s %C", parv[1],
                         parv[0], cptr);
     sendcmdto_one(&me, CMD_KILL, cptr, "%s :%s (%s <- %s[%s])",
-                 IsServer(sptr) ? parv[parc - 2] : parv[0], me.name, parv[1],
-                 nick, cptr->name);
+                 IsServer(sptr) ? parv[parc - 2] : parv[0], cli_name(&me), parv[1],
+                 nick, cli_name(cptr));
     if (!IsServer(sptr)) {
       /*
        * bad nick _change_
        */
       sendcmdto_serv_butone(&me, CMD_KILL, 0, "%s :%s (%s <- %s!%s@%s)",
-                           parv[0], me.name, cptr->name, parv[0],
-                           sptr->user ? sptr->username : "",
-                           sptr->user ? sptr->user->server->name :
-                           cptr->name);
+                           parv[0], cli_name(&me), cli_name(cptr), parv[0],
+                           cli_user(sptr) ? cli_username(sptr) : "",
+                           cli_user(sptr) ? cli_name(cli_user(sptr)->server) :
+                           cli_name(cptr));
     }
     return 0;
   }
@@ -334,13 +334,13 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      * Ultimate way to jupiter a nick ? >;-). -avalon
      */
     sendto_opmask_butone(0, SNO_OLDSNO, "Nick collision on %C(%C <- %C)", sptr,
-                        acptr->from, cptr);
+                        cli_from(acptr), cptr);
     ++ServerStats->is_kill;
 
-    sendcmdto_one(&me, CMD_KILL, cptr, "%C :%s (%s <- %s)", sptr, me.name,
-                 acptr->from->name, cptr->name);
+    sendcmdto_one(&me, CMD_KILL, cptr, "%C :%s (%s <- %s)", sptr, cli_name(&me),
+                 cli_name(cli_from(acptr)), cli_name(cptr));
 
-    sptr->flags |= FLAGS_KILLED;
+    cli_flags(sptr) |= FLAGS_KILLED;
     /*
      * if sptr is a server it is exited here, nothing else to do
      */
@@ -354,7 +354,7 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    * nickname or somesuch)
    */
   if (acptr == sptr) {
-    if (strcmp(acptr->name, nick) != 0)
+    if (strcmp(cli_name(acptr), nick) != 0)
       /*
        * Allows change of case in his/her nick
        */
@@ -383,7 +383,7 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    */
   if (IsUnknown(acptr) && MyConnect(acptr)) {
     ++ServerStats->is_ref;
-    IPcheck_connect_fail(acptr->ip);
+    IPcheck_connect_fail(cli_ip(acptr));
     exit_client(cptr, acptr, &me, "Overridden by other sign on");
     return set_nick_name(cptr, sptr, nick, parc, parv);
   }
@@ -412,11 +412,11 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      *
      * compare IP address and username
      */
-    differ =  (acptr->ip.s_addr != htonl(base64toint(parv[parc - 3]))) ||
-              (0 != ircd_strcmp(acptr->user->username, parv[4]));
+    differ =  (cli_ip(acptr).s_addr != htonl(base64toint(parv[parc - 3]))) ||
+              (0 != ircd_strcmp(cli_user(acptr)->username, parv[4]));
     sendto_opmask_butone(0, SNO_OLDSNO, "Nick collision on %C (%C %Tu <- "
-                        "%C %Tu (%s user@host))", acptr, acptr->from,
-                        acptr->lastnick, cptr, lastnick,
+                        "%C %Tu (%s user@host))", acptr, cli_from(acptr),
+                        cli_lastnick(acptr), cptr, lastnick,
                         differ ? "Different" : "Same");
   }
   else {
@@ -425,11 +425,11 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      *
      * compare IP address and username
      */
-    differ =  (acptr->ip.s_addr != sptr->ip.s_addr) ||
-              (0 != ircd_strcmp(acptr->user->username, sptr->user->username));              
+    differ =  (cli_ip(acptr).s_addr != cli_ip(sptr).s_addr) ||
+              (0 != ircd_strcmp(cli_user(acptr)->username, cli_user(sptr)->username));              
     sendto_opmask_butone(0, SNO_OLDSNO, "Nick change collision from %C to "
-                        "%C (%C %Tu <- %C %Tu)", sptr, acptr, acptr->from,
-                        acptr->lastnick, cptr, lastnick);
+                        "%C (%C %Tu <- %C %Tu)", sptr, acptr, cli_from(acptr),
+                        cli_lastnick(acptr), cptr, lastnick);
   }
   /*
    * Now remove (kill) the nick on our side if it is the youngest.
@@ -440,23 +440,17 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    *
    * This exits the client sending the NICK message
    */
-  if (acptr->from != cptr) {
-    if ((differ && lastnick >= acptr->lastnick) || (!differ && lastnick <= acptr->lastnick)) {
+  if (cli_from(acptr) != cptr) {
+    if ((differ && lastnick >= cli_lastnick(acptr)) ||
+       (!differ && lastnick <= cli_lastnick(acptr))) {
       if (!IsServer(sptr)) {
         ++ServerStats->is_kill;
        sendcmdto_serv_butone(&me, CMD_KILL, sptr, "%C :%s (%s <- %s (Nick "
-                             "collision))", sptr, me.name, acptr->from->name,
-                             cptr->name);
+                             "collision))", sptr, cli_name(&me), cli_name(cli_from(acptr)),
+                             cli_name(cptr));
         assert(!MyConnect(sptr));
-#if 0
-        /*
-         * XXX - impossible
-         */
-        if (MyConnect(sptr))
-          sendto_one(cptr, "%s " TOK_KILL " %s%s :%s (Ghost 2)", /* XXX DEAD */
-                     NumServ(&me), NumNick(sptr), me.name);
-#endif
-        sptr->flags |= FLAGS_KILLED;
+
+        cli_flags(sptr) |= FLAGS_KILLED;
         exit_client(cptr, sptr, &me, "Nick collision (you're a ghost)");
         /*
          * we have killed sptr off, zero out it's pointer so if it's used
@@ -464,36 +458,36 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
          */
         sptr = 0;
       }
-      if (lastnick != acptr->lastnick)
+      if (lastnick != cli_lastnick(acptr))
         return 0;                /* Ignore the NICK */
     }
     send_reply(acptr, ERR_NICKCOLLISION, nick);
   }
 
   ++ServerStats->is_kill;
-  acptr->flags |= FLAGS_KILLED;
+  cli_flags(acptr) |= FLAGS_KILLED;
   /*
    * This exits the client we had before getting the NICK message
    */
   if (differ) {
     sendcmdto_serv_butone(&me, CMD_KILL, acptr, "%C :%s (%s <- %s (older "
-                         "nick overruled))", acptr, me.name,
-                         acptr->from->name, cptr->name);
+                         "nick overruled))", acptr, cli_name(&me),
+                         cli_name(cli_from(acptr)), cli_name(cptr));
     if (MyConnect(acptr))
       sendcmdto_one(acptr, CMD_QUIT, cptr, ":Local kill by %s (Ghost)",
-                   me.name);
+                   cli_name(&me));
     exit_client(cptr, acptr, &me, "Nick collision (older nick overruled)");
   }
   else {
     sendcmdto_serv_butone(&me, CMD_KILL, acptr, "%C :%s (%s <- %s (nick "
-                         "collision from same user@host))", acptr, me.name,
-                         acptr->from->name, cptr->name);
+                         "collision from same user@host))", acptr, cli_name(&me),
+                         cli_name(cli_from(acptr)), cli_name(cptr));
     if (MyConnect(acptr))
       sendcmdto_one(acptr, CMD_QUIT, cptr, ":Local kill by %s (Ghost: ",
-                   "switched servers too fast)", me.name);
+                   "switched servers too fast)", cli_name(&me));
     exit_client(cptr, acptr, &me, "Nick collision (You collided yourself)");
   }
-  if (lastnick == acptr->lastnick)
+  if (lastnick == cli_lastnick(acptr))
     return 0;
 
   assert(0 != sptr);
index 1ecc8858c54e8974b308806a86920c035f09b635..caff3d0757cce13532aedc8dedc8eefa57e8ad38 100644 (file)
@@ -118,7 +118,7 @@ int m_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   assert(0 != cptr);
   assert(cptr == sptr);
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (parc < 2 || EmptyString(parv[1]))
     return send_reply(sptr, ERR_NORECIPIENT, MSG_NOTICE);
@@ -161,7 +161,7 @@ int ms_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   char* name;
   char* server;
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (parc < 3) {
     /*
@@ -208,7 +208,7 @@ int mo_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   assert(0 != cptr);
   assert(cptr == sptr);
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (parc < 2 || EmptyString(parv[1]))
     return send_reply(sptr, ERR_NORECIPIENT, MSG_NOTICE);
index 8dda34842c12f1a0b2eeeb86533613453573b84b..3681506e15385512b8cb1cacaefc6af848f526ee 100644 (file)
@@ -148,27 +148,27 @@ int m_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (EmptyString(name) || EmptyString(password))
     return need_more_params(sptr, "OPER");
 
-  aconf = find_conf_exact(name, sptr->username, sptr->sockhost, CONF_OPS);
+  aconf = find_conf_exact(name, cli_username(sptr), cli_sockhost(sptr), CONF_OPS);
   if (!aconf) 
-    aconf = find_conf_exact(name, sptr->username,
-                            ircd_ntoa((const char*) &cptr->ip), CONF_OPS);
+    aconf = find_conf_exact(name, cli_username(sptr),
+                            ircd_ntoa((const char*) &(cli_ip(cptr))), CONF_OPS);
 
   if (!aconf || IsIllegal(aconf)) {
     send_reply(sptr, ERR_NOOPERHOST);
     sendto_opmask_butone(0, SNO_OLDREALOP, "Failed OPER attempt by %s (%s@%s)",
-                        parv[0], sptr->user->username, sptr->sockhost);
+                        parv[0], cli_user(sptr)->username, cli_sockhost(sptr));
     return 0;
   }
   assert(0 != (aconf->status & CONF_OPS));
 
   if (oper_password_match(password, aconf->passwd)) {
-    unsigned int old_mode = (sptr->flags & ALL_UMODES);
+    unsigned int old_mode = (cli_flags(sptr) & ALL_UMODES);
 
     if (ACR_OK != attach_conf(sptr, aconf)) {
       send_reply(sptr, ERR_NOOPERHOST);
       sendto_opmask_butone(0, SNO_OLDREALOP, "Failed OPER attempt by %s "
-                          "(%s@%s)", parv[0], sptr->user->username,
-                          sptr->sockhost);
+                          "(%s@%s)", parv[0], cli_user(sptr)->username,
+                          cli_sockhost(sptr));
       return 0;
     }
     if (CONF_LOCOP == aconf->status) {
@@ -183,17 +183,17 @@ int m_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       SetOper(sptr);
       ++UserStats.opers;
     }
-    cptr->handler = OPER_HANDLER;
+    cli_handler(cptr) = OPER_HANDLER;
 
     
-    sptr->flags |= (FLAGS_WALLOP | FLAGS_SERVNOTICE | FLAGS_DEBUG);
+    cli_flags(sptr) |= (FLAGS_WALLOP | FLAGS_SERVNOTICE | FLAGS_DEBUG);
 
     set_snomask(sptr, SNO_OPERDEFAULT, SNO_ADD);
     send_umode_out(cptr, sptr, old_mode);
     send_reply(sptr, RPL_YOUREOPER);
 
     sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is now operator (%c)",
-                        parv[0], sptr->user->username, sptr->sockhost,
+                        parv[0], cli_user(sptr)->username, cli_sockhost(sptr),
                         IsOper(sptr) ? 'O' : 'o');
 
     log_write(LS_OPER, L_INFO, 0, "OPER (%s) by (%#C)", name, sptr);
@@ -201,7 +201,7 @@ int m_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   else {
     send_reply(sptr, ERR_PASSWDMISMATCH);
     sendto_opmask_butone(0, SNO_OLDREALOP, "Failed OPER attempt by %s (%s@%s)",
-                        parv[0], sptr->user->username, sptr->sockhost);
+                        parv[0], cli_user(sptr)->username, cli_sockhost(sptr));
   }
   return 0;
 }
@@ -218,7 +218,7 @@ int ms_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    */
   if (!IsServer(sptr) && !IsOper(sptr)) {
     ++UserStats.opers;
-    sptr->flags |= FLAGS_OPER;
+    cli_flags(sptr) |= FLAGS_OPER;
     sendcmdto_serv_butone(sptr, CMD_MODE, cptr, "%s :+o", parv[0]);
   }
   return 0;
index 4cf098adfa75c49f31d5fb6f80a6ccfd79baac75..19ea1f02532f3e5fd8f1ab9d72e95100520c0b80 100644 (file)
@@ -115,7 +115,7 @@ int m_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   char *p = 0;
   char *name;
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   /* check number of arguments */
   if (parc < 2 || parv[1][0] == '\0')
@@ -167,7 +167,7 @@ int ms_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   char *p = 0;
   char *name;
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   /* check number of arguments */
   if (parc < 2 || parv[1][0] == '\0')
index c436ec8c2ff90fb2ea52b963c17832bf2400c3bd..31a9046c4912486a62c9370a884ac7245e6d54fa 100644 (file)
@@ -114,7 +114,7 @@ int mr_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
        /* Do something here */
   }
 #endif
-  ircd_strncpy(cptr->passwd, password, PASSWDLEN);
+  ircd_strncpy(cli_passwd(cptr), password, PASSWDLEN);
   return 0;
 }
 
index 6453ac77e568e969cafdd9f48f914769d9a87e6c..60e223218e61dd140610ab54ebc5ad3806eab69b 100644 (file)
@@ -171,7 +171,7 @@ int m_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   destination = parv[2];        /* Will get NULL or pointer (parc >= 2!!) */
 
-  if (!EmptyString(destination) && 0 != ircd_strcmp(destination, me.name)) {
+  if (!EmptyString(destination) && 0 != ircd_strcmp(destination, cli_name(&me))) {
     if ((acptr = FindServer(destination)))
       sendcmdto_one(sptr, CMD_PING, acptr, "%C :%s", sptr, destination);
     else
@@ -187,7 +187,7 @@ int m_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /* Is this supposed to be here? */
     acptr = FindClient(origin);
     if (acptr && acptr != sptr)
-      origin = cptr->name;
+      origin = cli_name(cptr);
     
     if (strlen(origin) > 64)
       origin[64] = '\0';
@@ -222,15 +222,12 @@ int ms_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /*
      * don't bother sending the error back
      */
-#if 0
-    sendto_one(sptr, err_str(ERR_NOORIGIN), me.name, parv[0]); /* XXX DEAD */
-#endif
     return 0;
   }
   origin      = parv[1];
   destination = parv[2];        /* Will get NULL or pointer (parc >= 2!!) */
 
-  if (!EmptyString(destination) && 0 != ircd_strcmp(destination, me.name)) {
+  if (!EmptyString(destination) && 0 != ircd_strcmp(destination, cli_name(&me))) {
     if ((acptr = FindServer(destination))) {
       /*
        * Servers can just forward the origin
index 64a4e81f45cf98964473a45f70c6f651349084b2..a6b9967445021b8b956ede392faaf77c94fc6663 100644 (file)
@@ -118,21 +118,15 @@ int ms_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   assert(IsServer(cptr));
 
   if (parc < 2 || EmptyString(parv[1])) {
-#if 0
-    /*
-     * ignore there is nothing the server sending it can do about it
-     */
-    sendto_one(sptr, err_str(ERR_NOORIGIN), me.name, parv[0]); /* XXX DEAD */
-#endif
     return protocol_violation(sptr,"No Origin on PONG");
   }
   origin      = parv[1];
   destination = parv[2];
-  cptr->flags &= ~FLAGS_PINGSENT;
-  sptr->flags &= ~FLAGS_PINGSENT;
-  cptr->lasttime = CurrentTime;
+  cli_flags(cptr) &= ~FLAGS_PINGSENT;
+  cli_flags(sptr) &= ~FLAGS_PINGSENT;
+  cli_lasttime(cptr) = CurrentTime;
 
-  if (!EmptyString(destination) && 0 != ircd_strcmp(destination, me.name)) {
+  if (!EmptyString(destination) && 0 != ircd_strcmp(destination, cli_name(&me))) {
     struct Client* acptr;
     if ((acptr = FindClient(destination))) {
       sendcmdto_one(sptr, CMD_PONG, acptr, "%s %s", origin, destination);
@@ -154,24 +148,24 @@ int mr_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   assert(cptr == sptr);
   assert(!IsRegistered(sptr));
 
-  cptr->flags &= ~FLAGS_PINGSENT;
-  cptr->lasttime = CurrentTime;
+  cli_flags(cptr) &= ~FLAGS_PINGSENT;
+  cli_lasttime(cptr) = CurrentTime;
   /*
    * Check to see if this is a PONG :cookie reply from an
    * unregistered user.  If so, process it. -record
    */
-  if (0 != sptr->cookie && COOKIE_VERIFIED != sptr->cookie) {
-    if (parc > 1 && sptr->cookie == atol(parv[parc - 1])) {
-      sptr->cookie = COOKIE_VERIFIED;
-      if (sptr->user && *sptr->user->host && sptr->name[0])
+  if (0 != cli_cookie(sptr) && COOKIE_VERIFIED != cli_cookie(sptr)) {
+    if (parc > 1 && cli_cookie(sptr) == atol(parv[parc - 1])) {
+      cli_cookie(sptr) = COOKIE_VERIFIED;
+      if (cli_user(sptr) && *(cli_user(sptr))->host && (cli_name(sptr))[0])
         /*
          * NICK and USER OK
          */
-        return register_user(cptr, sptr, sptr->name, sptr->user->username, 0);
+        return register_user(cptr, sptr, cli_name(sptr), cli_user(sptr)->username, 0);
     }
     else  
       send_reply(sptr, SND_EXPLICIT | ERR_BADPING,
-                ":To connect, type /QUOTE PONG %u", sptr->cookie);
+                ":To connect, type /QUOTE PONG %u", cli_cookie(sptr));
   }
   return 0;
 }
@@ -187,8 +181,8 @@ int m_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 {
   assert(0 != cptr);
   assert(cptr == sptr);
-  cptr->flags &= ~FLAGS_PINGSENT;
-  cptr->lasttime = CurrentTime;
+  cli_flags(cptr) &= ~FLAGS_PINGSENT;
+  cli_lasttime(cptr) = CurrentTime;
   return 0;
 }
 
index fd4162389eb0c348e926b458e27bbd7b9289314b..a3a396c0e197fe1d098c20be9334b52efa8ff139 100644 (file)
@@ -114,12 +114,12 @@ int m_privmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   assert(0 != cptr);
   assert(cptr == sptr);
-  assert(0 != sptr->user);
+  assert(0 != cli_user(sptr));
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
 #ifdef IDLE_FROM_MSG
-  sptr->user->last = CurrentTime;
+  cli_user(sptr)->last = CurrentTime;
 #endif
 
   if (parc < 2 || EmptyString(parv[1]))
@@ -158,7 +158,7 @@ int ms_privmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   char* name;
   char* server;
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (parc < 3) {
     /*
@@ -205,12 +205,12 @@ int mo_privmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   char*           vector[MAXTARGETS];
   assert(0 != cptr);
   assert(cptr == sptr);
-  assert(0 != sptr->user);
+  assert(0 != cli_user(sptr));
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
 #ifdef IDLE_FROM_MSG
-  sptr->user->last = CurrentTime;
+  cli_user(sptr)->last = CurrentTime;
 #endif
 
   if (parc < 2 || EmptyString(parv[1]))
index 3c45f887fd322f5e087e989d5e0c5ae4851fc9ba..45a3a95c73e46c1c5067c0490d24b3523f19abee 100644 (file)
@@ -110,20 +110,20 @@ int m_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   assert(0 != sptr);
   assert(cptr == sptr);
 
-  if (sptr->user) {
+  if (cli_user(sptr)) {
     struct Membership* chan;
-    for (chan = sptr->user->channel; chan; chan = chan->next_channel) {
+    for (chan = cli_user(sptr)->channel; chan; chan = chan->next_channel) {
       if (!IsZombie(chan) && !member_can_send_to_channel(chan))
         return exit_client(cptr, sptr, sptr, "Signed off");
     }
   }
-  comment = cptr->name;
+  comment = cli_name(cptr);
 
   if (parc > 1) {
     comment = parv[parc - 1];
 
     if (0 == strncmp("Local kill", comment, 10) || 0 == strncmp(comment, "Killed", 6))
-       comment = cptr->name;
+       comment = cli_name(cptr);
     else if (strlen(comment) > TOPICLEN)
       comment[TOPICLEN] = '\0';
   }
index 4fdabd6d2f0e51d603c4519269156bd3b914743e..70f21b766e679116cf82879ea0a020b59efa4aca 100644 (file)
@@ -151,7 +151,7 @@ int ms_rping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
        * if it's not for me, pass it on
        */
       if (IsMe(destination))
-       sendcmdto_one(&me, CMD_RPONG, sptr, "%s %s %s %s :%s", sptr->name,
+       sendcmdto_one(&me, CMD_RPONG, sptr, "%s %s %s %s :%s", cli_name(sptr),
                      parv[2], parv[3], parv[4], parv[5]);
       else
        sendcmdto_one(sptr, CMD_RPING, destination, "%C %s %s %s :%s",
@@ -216,7 +216,7 @@ int mo_rping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   if (parc > 2) {
     if ((acptr = find_match_server(parv[2])) && !IsMe(acptr)) {
-      parv[2] = acptr->name;
+      parv[2] = cli_name(acptr);
       if (3 == parc) {
         /*
          * const_cast<char*>(start_time);
index 877c7a647291896ac50dd74d5dc0827c37ac2381..a3255682da6d5f7a784c124880ba36b6166cc3f6 100644 (file)
@@ -134,7 +134,7 @@ int ms_rpong(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       if (!(acptr = findNUser(parv[2])))
         return 0;
 
-      sendcmdto_one(&me, CMD_RPONG, acptr, "%C %s %s :%s", acptr, sptr->name,
+      sendcmdto_one(&me, CMD_RPONG, acptr, "%C %s %s :%s", acptr, cli_name(sptr),
                    militime(parv[3], parv[4]), parv[5]);
     } else
       sendcmdto_one(sptr, CMD_RPONG, acptr, "%s %s %s %s :%s", parv[1],
index 1d792295346bdbd330367931555abf6e3a17694f..69f24a83ba9c51606759169e4ce9d4b6140349b3 100644 (file)
@@ -166,7 +166,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     return exit_client_msg(cptr, sptr, &me, "Juped: %s", JupeReason(ajupe));
 
   log_write(LS_NETWORK, L_NOTICE, LOG_NOSNOTICE, "SERVER: %s %s[%s]", parv[1],
-           cptr->sockhost, cptr->sock_ip);
+           cli_sockhost(cptr), cli_sock_ip(cptr));
 
   /*
    * Detect protocol
@@ -190,7 +190,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   start_timestamp = atoi(parv[3]);
   timestamp = atoi(parv[4]);
   Debug((DEBUG_INFO, "Got SERVER %s with timestamp [%s] age " TIME_T_FMT " ("
-        TIME_T_FMT ")", host, parv[4], start_timestamp, me.serv->timestamp));
+        TIME_T_FMT ")", host, parv[4], start_timestamp, cli_serv(&me)->timestamp));
 
   if ((timestamp < OLDEST_TS || (hop == 1 && start_timestamp < OLDEST_TS)))
   {
@@ -201,7 +201,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   info[REALLEN] = '\0';
   if (prot < atoi(MINOR_PROTOCOL)) {
     sendto_opmask_butone(0, SNO_OLDSNO, "Got incompatible protocol version "
-                        "(%s) from %s", parv[5], cptr->name);
+                        "(%s) from %s", parv[5], cli_name(cptr));
     return exit_new_server(cptr, sptr, host, timestamp,
                            "Incompatible protocol: %s", parv[5]);
   }
@@ -222,7 +222,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
   if (*ch || !strchr(host, '.')) {
     sendto_opmask_butone(0, SNO_OLDSNO, "Bogus server name (%s) from %s",
-                        host, cptr->name);
+                        host, cli_name(cptr));
     return exit_client_msg(cptr, cptr, &me, "Bogus server name (%s)", host);
   }
 
@@ -239,7 +239,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      * See if the newly found server is behind a guaranteed
      * leaf (L-line). If so, close the link.
      */
-    if ((lhconf = find_conf_byhost(cptr->confs, cptr->name, CONF_LEAF)) &&
+    if ((lhconf = find_conf_byhost(cli_confs(cptr), cli_name(cptr), CONF_LEAF)) &&
         (!lhconf->port || (hop > lhconf->port)))
     {
       /*
@@ -248,12 +248,12 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
        * both.
        */
       active_lh_line = 1;
-      if (timestamp <= cptr->serv->timestamp)
+      if (timestamp <= cli_serv(cptr)->timestamp)
         LHcptr = 0;          /* Kill incoming server */
       else
         LHcptr = cptr;          /* Squit ourselfs */
     }
-    else if (!(lhconf = find_conf_byname(cptr->confs, cptr->name, CONF_HUB)) ||
+    else if (!(lhconf = find_conf_byname(cli_confs(cptr), cli_name(cptr), CONF_HUB)) ||
              (lhconf->port && (hop > lhconf->port)))
     {
       struct Client *ac3ptr;
@@ -261,7 +261,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       /* Look for net junction causing this: */
       LHcptr = 0;            /* incoming server */
       if (*parv[5] != 'J') {
-        for (ac3ptr = sptr; ac3ptr != &me; ac3ptr = ac3ptr->serv->up) {
+        for (ac3ptr = sptr; ac3ptr != &me; ac3ptr = cli_serv(ac3ptr)->up) {
           if (IsJunction(ac3ptr)) {
             LHcptr = ac3ptr;
             break;
@@ -291,70 +291,59 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      * and not mess with hash internals. 
      *                          --Nemesi
      */
-    if (!EmptyString(cptr->name) && 
+    if (!EmptyString(cli_name(cptr)) && 
         (IsUnknown(cptr) || IsHandshake(cptr)) &&
-        0 != ircd_strcmp(cptr->name, host))
+        0 != ircd_strcmp(cli_name(cptr), host))
       hChangeClient(cptr, host);
-    ircd_strncpy(cptr->name, host, HOSTLEN);
-    ircd_strncpy(cptr->info, info[0] ? info : me.name, REALLEN);
-    cptr->hopcount = hop;
+    ircd_strncpy(cli_name(cptr), host, HOSTLEN);
+    ircd_strncpy(cli_info(cptr), info[0] ? info : cli_name(&me), REALLEN);
+    cli_hopcount(cptr) = hop;
 
     /* check connection rules */
     if (0 != conf_eval_crule(host, CRULE_ALL)) {
       ServerStats->is_ref++;
-      sendto_opmask_butone(0, SNO_OLDSNO, "Refused connection from %s.", cptr->name);
+      sendto_opmask_butone(0, SNO_OLDSNO, "Refused connection from %s.", cli_name(cptr));
       return exit_client(cptr, cptr, &me, "Disallowed by connection rule");
     }
 
     if (conf_check_server(cptr)) {
       ++ServerStats->is_ref;
       sendto_opmask_butone(0, SNO_OLDSNO, "Received unauthorized connection "
-                          "from %s.", cptr->name);
+                          "from %s.", cli_name(cptr));
       return exit_client(cptr, cptr, &me, "No C:line");
     }
 
-    host = cptr->name;
+    host = cli_name(cptr);
 
     update_load();
 
-    if (!(aconf = find_conf_byname(cptr->confs, host, CONF_SERVER))) {
+    if (!(aconf = find_conf_byname(cli_confs(cptr), host, CONF_SERVER))) {
       ++ServerStats->is_ref;
-#ifndef GODMODE
       sendto_opmask_butone(0, SNO_OLDSNO, "Access denied. No conf line for "
-                          "server %s", cptr->name);
+                          "server %s", cli_name(cptr));
       return exit_client_msg(cptr, cptr, &me,
-          "Access denied. No conf line for server %s", cptr->name);
-#else /* GODMODE */
-      sendto_opmask_butone(0, SNO_OLDSNO, "General C: line active: No line "
-                          "for server %s", cptr->name);
-      aconf = find_conf_byname(cptr->confs, "general.undernet.org", CONF_SERVER);
-      if (!aconf) {
-        sendto_opmask_butone(0, SNO_OLDSNO, "Neither C lines for server %s "
-                            "nor \"general.undernet.org\"", cptr->name);
-        return exit_client_msg(cptr, cptr, &me, "No C lines for server %s", cptr->name);
-      }
-#endif /* GODMODE */
+          "Access denied. No conf line for server %s", cli_name(cptr));
     }
 #ifdef CRYPT_LINK_PASSWORD
     /* passwd may be NULL. Head it off at the pass... */
-    if (*cptr->passwd) {
-      encr = ircd_crypt(cptr->passwd, aconf->passed);
+    if (*(cli_passwd(cptr))) {
+      encr = ircd_crypt(cli_passwd(cptr), aconf->passed);
     }
     else
       encr = "";
 #else
-    encr = cptr->passwd;
+    encr = cli_passwd(cptr);
 #endif /* CRYPT_LINK_PASSWORD */
-#ifndef GODMODE
+
     if (*aconf->passwd && !!strcmp(aconf->passwd, encr)) {
       ++ServerStats->is_ref;
       sendto_opmask_butone(0, SNO_OLDSNO, "Access denied (passwd mismatch) %s",
-                          cptr->name);
+                          cli_name(cptr));
       return exit_client_msg(cptr, cptr, &me,
-          "No Access (passwd mismatch) %s", cptr->name);
+          "No Access (passwd mismatch) %s", cli_name(cptr));
     }
-#endif /* not GODMODE */
-    memset(cptr->passwd, 0, sizeof(cptr->passwd));
+
+    memset(cli_passwd(cptr), 0, sizeof(cli_passwd(cptr)));
 
 #ifndef HUB
     for (i = 0; i <= HighestFd; i++)
@@ -394,13 +383,13 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /*
      * Detect wrong numeric.
      */
-    if (0 != ircd_strcmp(acptr->name, host)) {
+    if (0 != ircd_strcmp(cli_name(acptr), host)) {
       sendcmdto_serv_butone(&me, CMD_WALLOPS, cptr,
                            ":SERVER Numeric Collision: %s != %s",
-                           acptr->name, host);
+                           cli_name(acptr), host);
       return exit_client_msg(cptr, cptr, &me,
           "NUMERIC collision between %s and %s."
-          " Is your server numeric correct ?", host, acptr->name);
+          " Is your server numeric correct ?", host, cli_name(acptr));
     }
     /*
      *  Kill our try, if we had one.
@@ -429,15 +418,15 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      * Our new server might be a juped server,
      * or someone trying abuse a second Uworld:
      */
-    else if (IsServer(acptr) && (0 == ircd_strncmp(acptr->info, "JUPE", 4) ||
-        find_conf_byhost(cptr->confs, acptr->name, CONF_UWORLD)))
+    else if (IsServer(acptr) && (0 == ircd_strncmp(cli_info(acptr), "JUPE", 4) ||
+        find_conf_byhost(cli_confs(cptr), cli_name(acptr), CONF_UWORLD)))
     {
       if (!IsServer(sptr))
-        return exit_client(cptr, sptr, &me, acptr->info);
+        return exit_client(cptr, sptr, &me, cli_info(acptr));
       sendcmdto_serv_butone(&me, CMD_WALLOPS, cptr,
                            ":Received :%s SERVER %s from %s !?!", parv[0],
-                           parv[1], cptr->name);
-      return exit_new_server(cptr, sptr, host, timestamp, "%s", acptr->info);
+                           parv[1], cli_name(cptr));
+      return exit_new_server(cptr, sptr, host, timestamp, "%s", cli_info(acptr));
     }
     /*
      * Of course we find the handshake this link was before :)
@@ -458,41 +447,41 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       struct Client* ac3ptr;
 
       /* Search youngest link: */
-      for (ac3ptr = acptr; ac3ptr != &me; ac3ptr = ac3ptr->serv->up)
-        if (ac3ptr->serv->timestamp > c3ptr->serv->timestamp)
+      for (ac3ptr = acptr; ac3ptr != &me; ac3ptr = cli_serv(ac3ptr)->up)
+        if (cli_serv(ac3ptr)->timestamp > cli_serv(c3ptr)->timestamp)
           c3ptr = ac3ptr;
       if (IsServer(sptr))
       {
-        for (ac3ptr = sptr; ac3ptr != &me; ac3ptr = ac3ptr->serv->up)
-          if (ac3ptr->serv->timestamp > c3ptr->serv->timestamp)
+        for (ac3ptr = sptr; ac3ptr != &me; ac3ptr = cli_serv(ac3ptr)->up)
+          if (cli_serv(ac3ptr)->timestamp > cli_serv(c3ptr)->timestamp)
             c3ptr = ac3ptr;
       }
-      if (timestamp > c3ptr->serv->timestamp)
+      if (timestamp > cli_serv(c3ptr)->timestamp)
       {
         c3ptr = 0;
         c2ptr = acptr;          /* Make sure they differ */
       }
       /* Search second youngest link: */
-      for (ac2ptr = acptr; ac2ptr != &me; ac2ptr = ac2ptr->serv->up)
+      for (ac2ptr = acptr; ac2ptr != &me; ac2ptr = cli_serv(ac2ptr)->up)
         if (ac2ptr != c3ptr &&
-            ac2ptr->serv->timestamp >
-            (c2ptr ? c2ptr->serv->timestamp : timestamp))
+            cli_serv(ac2ptr)->timestamp >
+            (c2ptr ? cli_serv(c2ptr)->timestamp : timestamp))
           c2ptr = ac2ptr;
       if (IsServer(sptr))
       {
-        for (ac2ptr = sptr; ac2ptr != &me; ac2ptr = ac2ptr->serv->up)
+        for (ac2ptr = sptr; ac2ptr != &me; ac2ptr = cli_serv(ac2ptr)->up)
           if (ac2ptr != c3ptr &&
-              ac2ptr->serv->timestamp >
-              (c2ptr ? c2ptr->serv->timestamp : timestamp))
+              cli_serv(ac2ptr)->timestamp >
+              (c2ptr ? cli_serv(c2ptr)->timestamp : timestamp))
             c2ptr = ac2ptr;
       }
-      if (c3ptr && timestamp > (c2ptr ? c2ptr->serv->timestamp : timestamp))
+      if (c3ptr && timestamp > (c2ptr ? cli_serv(c2ptr)->timestamp : timestamp))
         c2ptr = 0;
       /* If timestamps are equal, decide which link to break
        *  by name.
        */
-      if ((c2ptr ? c2ptr->serv->timestamp : timestamp) ==
-          (c3ptr ? c3ptr->serv->timestamp : timestamp))
+      if ((c2ptr ? cli_serv(c2ptr)->timestamp : timestamp) ==
+          (c3ptr ? cli_serv(c3ptr)->timestamp : timestamp))
       {
         char* n2;
         char* n2up;
@@ -500,23 +489,23 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         char* n3up;
         if (c2ptr)
         {
-          n2 = c2ptr->name;
-          n2up = MyConnect(c2ptr) ? me.name : c2ptr->serv->up->name;
+          n2 = cli_name(c2ptr);
+          n2up = MyConnect(c2ptr) ? cli_name(&me) : cli_name(cli_serv(c2ptr)->up);
         }
         else
         {
           n2 = host;
-          n2up = IsServer(sptr) ? sptr->name : me.name;
+          n2up = IsServer(sptr) ? cli_name(sptr) : cli_name(&me);
         }
         if (c3ptr)
         {
-          n3 = c3ptr->name;
-          n3up = MyConnect(c3ptr) ? me.name : c3ptr->serv->up->name;
+          n3 = cli_name(c3ptr);
+          n3up = MyConnect(c3ptr) ? cli_name(&me) : cli_name(cli_serv(c3ptr)->up);
         }
         else
         {
           n3 = host;
-          n3up = IsServer(sptr) ? sptr->name : me.name;
+          n3up = IsServer(sptr) ? cli_name(sptr) : cli_name(&me);
         }
         if (strcmp(n2, n2up) > 0)
           n2 = n2up;
@@ -533,10 +522,10 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       if (!c2ptr)
         return exit_new_server(cptr, sptr, host, timestamp,
                                "server %s already exists and is %ld seconds younger.",
-                               host, (long)acptr->serv->timestamp - (long)timestamp);
-      else if (c2ptr->from == cptr || IsServer(sptr))
+                               host, (long)cli_serv(acptr)->timestamp - (long)timestamp);
+      else if (cli_from(c2ptr) == cptr || IsServer(sptr))
       {
-        struct Client *killedptrfrom = c2ptr->from;
+        struct Client *killedptrfrom = cli_from(c2ptr);
         if (active_lh_line)
         {
           /*
@@ -549,7 +538,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
            * If breaking the loop here solves the L: or H:
            * line problem, we don't squit that.
            */
-          if (c2ptr->from == cptr || (LHcptr && a_kills_b_too(c2ptr, LHcptr)))
+          if (cli_from(c2ptr) == cptr || (LHcptr && a_kills_b_too(c2ptr, LHcptr)))
             active_lh_line = 0;
           else
           {
@@ -568,16 +557,16 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
          * a Ghost... (20 seconds is more then enough because all
          * SERVER messages are at the beginning of a net.burst). --Run
          */
-        if (CurrentTime - cptr->serv->ghost < 20)
+        if (CurrentTime - cli_serv(cptr)->ghost < 20)
         {
-          killedptrfrom = acptr->from;
+          killedptrfrom = cli_from(acptr);
           if (exit_client(cptr, acptr, &me, "Ghost loop") == CPTR_KILLED)
             return CPTR_KILLED;
         }
         else if (exit_client_msg(cptr, c2ptr, &me,
             "Loop <-- %s (new link is %ld seconds younger)", host,
-            (c3ptr ? (long)c3ptr->serv->timestamp : timestamp) -
-            (long)c2ptr->serv->timestamp) == CPTR_KILLED)
+            (c3ptr ? (long)cli_serv(c3ptr)->timestamp : timestamp) -
+            (long)cli_serv(c2ptr)->timestamp) == CPTR_KILLED)
           return CPTR_KILLED;
         /*
          * Did we kill the incoming server off already ?
@@ -591,7 +580,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         {
           if (LHcptr && a_kills_b_too(LHcptr, acptr))
             break;
-          if (acptr->from == cptr || (LHcptr && a_kills_b_too(acptr, LHcptr)))
+          if (cli_from(acptr) == cptr || (LHcptr && a_kills_b_too(acptr, LHcptr)))
             active_lh_line = 0;
           else
           {
@@ -620,7 +609,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       return exit_new_server(cptr, sptr, host, timestamp,
           (active_lh_line == 2) ?  "Non-Hub link %s <- %s(%s), check H:" : 
                                    "Leaf-only link %s <- %s(%s), check L:",
-          cptr->name, host, 
+          cli_name(cptr), host, 
           lhconf ? (lhconf->name ? lhconf->name : "*") : "!");
     }
     else
@@ -631,7 +620,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         if (exit_client_msg(cptr, LHcptr, &me,
             (active_lh_line == 2) ?  "Non-Hub link %s <- %s(%s), check H:" : 
                                      "Leaf-only link %s <- %s(%s), check L:",
-            cptr->name, host,
+            cli_name(cptr), host,
             lhconf ? (lhconf->name ? lhconf->name : "*") : "!") == CPTR_KILLED)
           return CPTR_KILLED;
       }
@@ -660,27 +649,27 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
     acptr = make_client(cptr, STAT_SERVER);
     make_server(acptr);
-    acptr->serv->prot = prot;
-    acptr->serv->timestamp = timestamp;
-    acptr->hopcount = hop;
-    ircd_strncpy(acptr->name, host, HOSTLEN);
-    ircd_strncpy(acptr->info, info, REALLEN);
-    acptr->serv->up = sptr;
-    acptr->serv->updown = add_dlink(&sptr->serv->down, acptr);
+    cli_serv(acptr)->prot = prot;
+    cli_serv(acptr)->timestamp = timestamp;
+    cli_hopcount(acptr) = hop;
+    ircd_strncpy(cli_name(acptr), host, HOSTLEN);
+    ircd_strncpy(cli_info(acptr), info, REALLEN);
+    cli_serv(acptr)->up = sptr;
+    cli_serv(acptr)->updown = add_dlink(&(cli_serv(sptr))->down, acptr);
     /* Use cptr, because we do protocol 9 -> 10 translation
        for numeric nicks ! */
     SetServerYXX(cptr, acptr, parv[6]);
 
     Count_newremoteserver(UserStats);
     if (Protocol(acptr) < 10)
-      acptr->flags |= FLAGS_TS8;
+      cli_flags(acptr) |= FLAGS_TS8;
     add_client_to_list(acptr);
     hAddClient(acptr);
     if (*parv[5] == 'J')
     {
       SetBurst(acptr);
       sendto_opmask_butone(0, SNO_NETWORK, "Net junction: %s %s",
-          sptr->name, acptr->name);
+          cli_name(sptr), cli_name(acptr));
       SetJunction(acptr);
     }
     /*
@@ -695,11 +684,11 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       if (!(bcptr = LocalClientArray[i]) || !IsServer(bcptr) ||
           bcptr == cptr || IsMe(bcptr))
         continue;
-      if (0 == match(me.name, acptr->name))
+      if (0 == match(cli_name(&me), cli_name(acptr)))
         continue;
       sendcmdto_one(sptr, CMD_SERVER, bcptr, "%s %d 0 %s %s %s%s 0 :%s",
-                   acptr->name, hop + 1, parv[4], parv[5], NumServCap(acptr),
-                   acptr->info);
+                   cli_name(acptr), hop + 1, parv[4], parv[5], NumServCap(acptr),
+                   cli_info(acptr));
     }
     return 0;
   }
@@ -707,32 +696,32 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (IsUnknown(cptr) || IsHandshake(cptr))
   {
     make_server(cptr);
-    cptr->serv->timestamp = timestamp;
-    cptr->serv->prot = prot;
-    cptr->serv->ghost = ghost;
+    cli_serv(cptr)->timestamp = timestamp;
+    cli_serv(cptr)->prot = prot;
+    cli_serv(cptr)->ghost = ghost;
     SetServerYXX(cptr, cptr, parv[6]);
     if (start_timestamp > OLDEST_TS)
     {
 #ifndef RELIABLE_CLOCK
 #ifdef TESTNET
       sendto_opmask_butone(0, SNO_OLDSNO, "Debug: my start time: %Tu ; "
-                          "others start time: %Tu", me.serv->timestamp,
+                          "others start time: %Tu", cli_serv(&me)->timestamp,
                           start_timestamp);
       sendto_opmask_butone(0, SNO_OLDSNO, "Debug: receive time: %Tu ; "
                           "received timestamp: %Tu ; difference %ld",
                           recv_time, timestamp, timestamp - recv_time);
 #endif
-      if (start_timestamp < me.serv->timestamp)
+      if (start_timestamp < cli_serv(&me)->timestamp)
       {
         sendto_opmask_butone(0, SNO_OLDSNO, "got earlier start time: "
-                            "%Tu < %Tu", start_timestamp, me.serv->timestamp);
-        me.serv->timestamp = start_timestamp;
+                            "%Tu < %Tu", start_timestamp, cli_serv(&me)->timestamp);
+        cli_serv(&me)->timestamp = start_timestamp;
         TSoffset += timestamp - recv_time;
         sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
                             (int)(timestamp - recv_time));
       }
-      else if ((start_timestamp > me.serv->timestamp) && IsUnknown(cptr))
-        cptr->serv->timestamp = TStime();
+      else if ((start_timestamp > cli_serv(&me)->timestamp) && IsUnknown(cptr))
+        cli_serv(cptr)->timestamp = TStime();
 
       else if (timestamp != recv_time)
       {
@@ -742,7 +731,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
          * attempts.
          */
         if (IsUnknown(cptr))
-          cptr->serv->timestamp = TStime();
+          cli_serv(cptr)->timestamp = TStime();
         else if (IsHandshake(cptr))
         {
           sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
@@ -751,10 +740,10 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         }
       }
 #else /* RELIABLE CLOCK IS TRUE, we _always_ use our own clock */
-      if (start_timestamp < me.serv->timestamp)
-        me.serv->timestamp = start_timestamp;
+      if (start_timestamp < cli_serv(&me)->timestamp)
+        cli_serv(&me)->timestamp = start_timestamp;
       if (IsUnknown(cptr))
-        cptr->serv->timestamp = TStime();
+        cli_serv(cptr)->timestamp = TStime();
 #endif
     }
 
@@ -763,13 +752,13 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   else
     ret = 0;
 #ifdef RELIABLE_CLOCK
-  if (abs(cptr->serv->timestamp - recv_time) > 30)
+  if (abs(cli_serv(cptr)->timestamp - recv_time) > 30)
   {
     sendto_opmask_butone(0, SNO_OLDSNO, "Connected to a net with a "
                         "timestamp-clock difference of %Td seconds! "
                         "Used SETTIME to correct this.",
                         timestamp - recv_time);
-    sendcmdto_one(&me, CMD_SETTIME, cptr, "%Tu :%s", TStime(), me.name);
+    sendcmdto_one(&me, CMD_SETTIME, cptr, "%Tu :%s", TStime(), cli_name(&me));
   }
 #endif
 
@@ -850,7 +839,7 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   start_timestamp = atoi(parv[3]);
   timestamp = atoi(parv[4]);
   Debug((DEBUG_INFO, "Got SERVER %s with timestamp [%s] age " TIME_T_FMT " ("
-      TIME_T_FMT ")", host, parv[4], start_timestamp, me.serv->timestamp));
+      TIME_T_FMT ")", host, parv[4], start_timestamp, cli_serv(&me)->timestamp));
   if ((timestamp < OLDEST_TS || (hop == 1 && start_timestamp < OLDEST_TS)))
   {
     return exit_client_msg(cptr, sptr, &me,
@@ -860,7 +849,7 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   info[REALLEN] = '\0';
   if (prot < atoi(MINOR_PROTOCOL)) {
     sendto_opmask_butone(0, SNO_OLDSNO, "Got incompatible protocol version "
-                        "(%s) from %s", parv[5], cptr->name);
+                        "(%s) from %s", parv[5], cli_name(cptr));
     return exit_new_server(cptr, sptr, host, timestamp,
                            "Incompatible protocol: %s", parv[5]);
   }
@@ -889,7 +878,7 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       break;
   if (*ch || !strchr(host, '.')) {
     sendto_opmask_butone(0, SNO_OLDSNO, "Bogus server name (%s) from %s",
-                        host, cptr->name);
+                        host, cli_name(cptr));
     return exit_client_msg(cptr, cptr, &me, "Bogus server name (%s)", host);
   }
 
@@ -906,7 +895,7 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      * See if the newly found server is behind a guaranteed
      * leaf (L-line). If so, close the link.
      */
-    if ((lhconf = find_conf_byhost(cptr->confs, cptr->name, CONF_LEAF)) &&
+    if ((lhconf = find_conf_byhost(cli_confs(cptr), cli_name(cptr), CONF_LEAF)) &&
         (!lhconf->port || (hop > lhconf->port)))
     {
       /*
@@ -915,12 +904,12 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
        * both.
        */
       active_lh_line = 1;
-      if (timestamp <= cptr->serv->timestamp)
+      if (timestamp <= cli_serv(cptr)->timestamp)
         LHcptr = 0;          /* Kill incoming server */
       else
         LHcptr = cptr;          /* Squit ourselfs */
     }
-    else if (!(lhconf = find_conf_byname(cptr->confs, cptr->name, CONF_HUB)) ||
+    else if (!(lhconf = find_conf_byname(cli_confs(cptr), cli_name(cptr), CONF_HUB)) ||
              (lhconf->port && (hop > lhconf->port)))
     {
       struct Client *ac3ptr;
@@ -928,7 +917,7 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       /* Look for net junction causing this: */
       LHcptr = 0;            /* incoming server */
       if (*parv[5] != 'J') {
-        for (ac3ptr = sptr; ac3ptr != &me; ac3ptr = ac3ptr->serv->up) {
+        for (ac3ptr = sptr; ac3ptr != &me; ac3ptr = cli_serv(ac3ptr)->up) {
           if (IsJunction(ac3ptr)) {
             LHcptr = ac3ptr;
             break;
@@ -958,72 +947,58 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      * and not mess with hash internals. 
      *                          --Nemesi
      */
-    if ((!(EmptyString(cptr->name)))
+    if ((!(EmptyString(cli_name(cptr))))
         && (IsUnknown(cptr) || IsHandshake(cptr))
-        && 0 != ircd_strcmp(cptr->name, host))
+        && 0 != ircd_strcmp(cli_name(cptr), host))
       hChangeClient(cptr, host);
-    ircd_strncpy(cptr->name, host, HOSTLEN);
-    ircd_strncpy(cptr->info, info[0] ? info : me.name, REALLEN);
-    cptr->hopcount = hop;
+    ircd_strncpy(cli_name(cptr), host, HOSTLEN);
+    ircd_strncpy(cli_info(cptr), info[0] ? info : cli_name(&me), REALLEN);
+    cli_hopcount(cptr) = hop;
 
     /* check connection rules */
     if (0 != conf_eval_crule(host, CRULE_ALL)) {
       ServerStats->is_ref++;
-      sendto_opmask_butone(0, SNO_OLDSNO, "Refused connection from %s.", cptr->name);
+      sendto_opmask_butone(0, SNO_OLDSNO, "Refused connection from %s.", cli_name(cptr));
       return exit_client(cptr, cptr, &me, "Disallowed by connection rule");
     }
     if (conf_check_server(cptr)) {
       ++ServerStats->is_ref;
       sendto_opmask_butone(0, SNO_OLDSNO, "Received unauthorized connection "
-                          "from %s.", cptr->name);
+                          "from %s.", cli_name(cptr));
       return exit_client(cptr, cptr, &me, "No C conf lines");
     }
 
-    host = cptr->name;
+    host = cli_name(cptr);
 
     update_load();
 
-    if (!(aconf = find_conf_byname(cptr->confs, host, CONF_SERVER))) {
+    if (!(aconf = find_conf_byname(cli_confs(cptr), host, CONF_SERVER))) {
       ++ServerStats->is_ref;
-#ifndef GODMODE
       sendto_opmask_butone(0, SNO_OLDSNO, "Access denied. No conf line for "
-                          "server %s", cptr->name);
+                          "server %s", cli_name(cptr));
       return exit_client_msg(cptr, cptr, &me,
-                             "Access denied. No conf line for server %s", cptr->name);
-#else /* GODMODE */
-      sendto_opmask_butone(0, SNO_OLDSNO, "General C line active: No line "
-                          "for server %s", cptr->name);
-      aconf =
-          find_conf_byname(cptr->confs, "general.undernet.org", CONF_SERVER);
-      if (!aconf) {
-        sendto_opmask_butone(0, SNO_OLDSNO, "Neither C lines for server %s "
-                            "nor \"general.undernet.org\"", cptr->name);
-        return exit_client_msg(cptr, cptr, &me,
-            "No C lines for server %s", cptr->name);
-      }
-#endif /* GODMODE */
+                             "Access denied. No conf line for server %s", cli_name(cptr));
     }
 #ifdef CRYPT_LINK_PASSWORD
     /* passwd may be NULL. Head it off at the pass... */
-    if (*cptr->passwd)
+    if (*(cli_passwd(cptr)))
     {
-      encr = ircd_crypt(cptr->passwd, aconf->passwd);
+      encr = ircd_crypt(cli_passwd(cptr), cli_passwd(aconf));
     }
     else
       encr = "";
 #else
-    encr = cptr->passwd;
+    encr = cli_passwd(cptr);
 #endif /* CRYPT_LINK_PASSWORD */
-#ifndef GODMODE
-    if (*aconf->passwd && !!strcmp(aconf->passwd, encr)) {
+
+    if (*(aconf->passwd) && !!strcmp(aconf->passwd, encr)) {
       ++ServerStats->is_ref;
       sendto_opmask_butone(0, SNO_OLDSNO, "Access denied (passwd mismatch) %s",
-                          cptr->name);
+                          cli_name(cptr));
       return exit_client_msg(cptr, cptr, &me,
-                             "No Access (passwd mismatch) %s", cptr->name);
+                             "No Access (passwd mismatch) %s", cli_name(cptr));
     }
-#endif /* not GODMODE */
-    memset(cptr->passwd, 0, sizeof(cptr->passwd));
+    memset(cli_passwd(cptr), 0, sizeof(cli_passwd(cptr)));
 
 #ifndef HUB
     for (i = 0; i <= HighestFd; i++)
@@ -1064,14 +1039,14 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /*
      * Detect wrong numeric.
      */
-    if (0 != ircd_strcmp(acptr->name, host))
+    if (0 != ircd_strcmp(cli_name(acptr), host))
     {
       sendcmdto_serv_butone(&me, CMD_WALLOPS, cptr,
-                           ":SERVER Numeric Collision: %s != %s", acptr->name,
+                           ":SERVER Numeric Collision: %s != %s", cli_name(acptr),
                            host);
       return exit_client_msg(cptr, cptr, &me,
           "NUMERIC collision between %s and %s."
-          " Is your server numeric correct ?", host, acptr->name);
+          " Is your server numeric correct ?", host, cli_name(acptr));
     }
     /*
      *  Kill our try, if we had one.
@@ -1100,14 +1075,14 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      * Our new server might be a juped server,
      * or someone trying abuse a second Uworld:
      */
-    else if (IsServer(acptr) && (0 == ircd_strncmp(acptr->info, "JUPE", 4) ||
-        find_conf_byhost(cptr->confs, acptr->name, CONF_UWORLD)))
+    else if (IsServer(acptr) && (0 == ircd_strncmp(cli_info(acptr), "JUPE", 4) ||
+        find_conf_byhost(cli_confs(cptr), cli_name(acptr), CONF_UWORLD)))
     {
       if (!IsServer(sptr))
-        return exit_client(cptr, sptr, &me, acptr->info);
+        return exit_client(cptr, sptr, &me, cli_info(acptr));
       sendcmdto_one(&me, CMD_WALLOPS, cptr, ":Received :%s SERVER %s "
-                   "from %s !?!", parv[0], parv[1], cptr->name);
-      return exit_new_server(cptr, sptr, host, timestamp, "%s", acptr->info);
+                   "from %s !?!", parv[0], parv[1], cli_name(cptr));
+      return exit_new_server(cptr, sptr, host, timestamp, "%s", cli_info(acptr));
     }
     /*
      * Of course we find the handshake this link was before :)
@@ -1128,41 +1103,41 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       struct Client* ac3ptr;
 
       /* Search youngest link: */
-      for (ac3ptr = acptr; ac3ptr != &me; ac3ptr = ac3ptr->serv->up)
-        if (ac3ptr->serv->timestamp > c3ptr->serv->timestamp)
+      for (ac3ptr = acptr; ac3ptr != &me; ac3ptr = cli_serv(ac3ptr)->up)
+        if (cli_serv(ac3ptr)->timestamp > cli_serv(c3ptr)->timestamp)
           c3ptr = ac3ptr;
       if (IsServer(sptr))
       {
-        for (ac3ptr = sptr; ac3ptr != &me; ac3ptr = ac3ptr->serv->up)
-          if (ac3ptr->serv->timestamp > c3ptr->serv->timestamp)
+        for (ac3ptr = sptr; ac3ptr != &me; ac3ptr = cli_serv(ac3ptr)->up)
+          if (cli_serv(ac3ptr)->timestamp > cli_serv(c3ptr)->timestamp)
             c3ptr = ac3ptr;
       }
-      if (timestamp > c3ptr->serv->timestamp)
+      if (timestamp > cli_serv(c3ptr)->timestamp)
       {
         c3ptr = 0;
         c2ptr = acptr;          /* Make sure they differ */
       }
       /* Search second youngest link: */
-      for (ac2ptr = acptr; ac2ptr != &me; ac2ptr = ac2ptr->serv->up)
+      for (ac2ptr = acptr; ac2ptr != &me; ac2ptr = cli_serv(ac2ptr)->up)
         if (ac2ptr != c3ptr &&
-            ac2ptr->serv->timestamp >
-            (c2ptr ? c2ptr->serv->timestamp : timestamp))
+            cli_serv(ac2ptr)->timestamp >
+            (c2ptr ? cli_serv(c2ptr)->timestamp : timestamp))
           c2ptr = ac2ptr;
       if (IsServer(sptr))
       {
-        for (ac2ptr = sptr; ac2ptr != &me; ac2ptr = ac2ptr->serv->up)
+        for (ac2ptr = sptr; ac2ptr != &me; ac2ptr = cli_serv(ac2ptr)->up)
           if (ac2ptr != c3ptr &&
-              ac2ptr->serv->timestamp >
-              (c2ptr ? c2ptr->serv->timestamp : timestamp))
+              cli_serv(ac2ptr)->timestamp >
+              (c2ptr ? cli_serv(c2ptr)->timestamp : timestamp))
             c2ptr = ac2ptr;
       }
-      if (c3ptr && timestamp > (c2ptr ? c2ptr->serv->timestamp : timestamp))
+      if (c3ptr && timestamp > (c2ptr ? cli_serv(c2ptr)->timestamp : timestamp))
         c2ptr = 0;
       /* If timestamps are equal, decide which link to break
        *  by name.
        */
-      if ((c2ptr ? c2ptr->serv->timestamp : timestamp) ==
-          (c3ptr ? c3ptr->serv->timestamp : timestamp))
+      if ((c2ptr ? cli_serv(c2ptr)->timestamp : timestamp) ==
+          (c3ptr ? cli_serv(c3ptr)->timestamp : timestamp))
       {
         char* n2;
         char* n2up;
@@ -1170,23 +1145,23 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         char* n3up;
         if (c2ptr)
         {
-          n2 = c2ptr->name;
-          n2up = MyConnect(c2ptr) ? me.name : c2ptr->serv->up->name;
+          n2 = cli_name(c2ptr);
+          n2up = MyConnect(c2ptr) ? cli_name(&me) : cli_name(cli_serv(c2ptr)->up);
         }
         else
         {
           n2 = host;
-          n2up = IsServer(sptr) ? sptr->name : me.name;
+          n2up = IsServer(sptr) ? cli_name(sptr) : cli_name(&me);
         }
         if (c3ptr)
         {
-          n3 = c3ptr->name;
-          n3up = MyConnect(c3ptr) ? me.name : c3ptr->serv->up->name;
+          n3 = cli_name(c3ptr);
+          n3up = MyConnect(c3ptr) ? cli_name(&me) : cli_name(cli_serv(c3ptr)->up);
         }
         else
         {
           n3 = host;
-          n3up = IsServer(sptr) ? sptr->name : me.name;
+          n3up = IsServer(sptr) ? cli_name(sptr) : cli_name(&me);
         }
         if (strcmp(n2, n2up) > 0)
           n2 = n2up;
@@ -1203,10 +1178,10 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       if (!c2ptr)
         return exit_new_server(cptr, sptr, host, timestamp,
             "server %s already exists and is %ld seconds younger.",
-            host, (long)acptr->serv->timestamp - (long)timestamp);
-      else if (c2ptr->from == cptr || IsServer(sptr))
+            host, (long)cli_serv(acptr)->timestamp - (long)timestamp);
+      else if (cli_from(c2ptr) == cptr || IsServer(sptr))
       {
-        struct Client *killedptrfrom = c2ptr->from;
+        struct Client *killedptrfrom = cli_from(c2ptr);
         if (active_lh_line)
         {
           /*
@@ -1219,7 +1194,7 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
            * If breaking the loop here solves the L: or H:
            * line problem, we don't squit that.
            */
-          if (c2ptr->from == cptr || (LHcptr && a_kills_b_too(c2ptr, LHcptr)))
+          if (cli_from(c2ptr) == cptr || (LHcptr && a_kills_b_too(c2ptr, LHcptr)))
             active_lh_line = 0;
           else
           {
@@ -1238,16 +1213,16 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
          * a Ghost... (20 seconds is more then enough because all
          * SERVER messages are at the beginning of a net.burst). --Run
          */
-        if (CurrentTime - cptr->serv->ghost < 20)
+        if (CurrentTime - cli_serv(cptr)->ghost < 20)
         {
-          killedptrfrom = acptr->from;
+          killedptrfrom = cli_from(acptr);
           if (exit_client(cptr, acptr, &me, "Ghost loop") == CPTR_KILLED)
             return CPTR_KILLED;
         }
         else if (exit_client_msg(cptr, c2ptr, &me,
             "Loop <-- %s (new link is %ld seconds younger)", host,
-            (c3ptr ? (long)c3ptr->serv->timestamp : timestamp) -
-            (long)c2ptr->serv->timestamp) == CPTR_KILLED)
+            (c3ptr ? (long)cli_serv(c3ptr)->timestamp : timestamp) -
+            (long)cli_serv(c2ptr)->timestamp) == CPTR_KILLED)
           return CPTR_KILLED;
         /*
          * Did we kill the incoming server off already ?
@@ -1261,7 +1236,7 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         {
           if (LHcptr && a_kills_b_too(LHcptr, acptr))
             break;
-          if (acptr->from == cptr || (LHcptr && a_kills_b_too(acptr, LHcptr)))
+          if (cli_from(acptr) == cptr || (LHcptr && a_kills_b_too(acptr, LHcptr)))
             active_lh_line = 0;
           else
           {
@@ -1289,7 +1264,7 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if (LHcptr == 0) {
       return exit_new_server(cptr, sptr, host, timestamp,
           (active_lh_line == 2) ?  "Non-Hub link %s <- %s(%s)" : "Leaf-only link %s <- %s(%s)",
-          cptr->name, host,
+          cli_name(cptr), host,
           lhconf ? (lhconf->name ? lhconf->name : "*") : "!");
     }
     else
@@ -1299,7 +1274,7 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       {
         if (exit_client_msg(cptr, LHcptr, &me,
             (active_lh_line == 2) ?  "Non-Hub link %s <- %s(%s)" : "Leaf-only link %s <- %s(%s)",
-            cptr->name, host,
+            cli_name(cptr), host,
             lhconf ? (lhconf->name ? lhconf->name : "*") : "!") == CPTR_KILLED)
           return CPTR_KILLED;
       }
@@ -1328,27 +1303,27 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
     acptr = make_client(cptr, STAT_SERVER);
     make_server(acptr);
-    acptr->serv->prot = prot;
-    acptr->serv->timestamp = timestamp;
-    acptr->hopcount = hop;
-    ircd_strncpy(acptr->name, host, HOSTLEN);
-    ircd_strncpy(acptr->info, info, REALLEN);
-    acptr->serv->up = sptr;
-    acptr->serv->updown = add_dlink(&sptr->serv->down, acptr);
+    cli_serv(acptr)->prot = prot;
+    cli_serv(acptr)->timestamp = timestamp;
+    cli_hopcount(acptr) = hop;
+    ircd_strncpy(cli_name(acptr), host, HOSTLEN);
+    ircd_strncpy(cli_info(acptr), info, REALLEN);
+    cli_serv(acptr)->up = sptr;
+    cli_serv(acptr)->updown = add_dlink(&(cli_serv(sptr))->down, acptr);
     /* Use cptr, because we do protocol 9 -> 10 translation
        for numeric nicks ! */
     SetServerYXX(cptr, acptr, parv[6]);
 
     Count_newremoteserver(UserStats);
     if (Protocol(acptr) < 10)
-      acptr->flags |= FLAGS_TS8;
+      cli_flags(acptr) |= FLAGS_TS8;
     add_client_to_list(acptr);
     hAddClient(acptr);
     if (*parv[5] == 'J')
     {
       SetBurst(acptr);
       sendto_opmask_butone(0, SNO_NETWORK, "Net junction: %s %s",
-                          sptr->name, acptr->name);
+                          cli_name(sptr), cli_name(acptr));
       SetJunction(acptr);
     }
     /*
@@ -1360,11 +1335,11 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       if (!(bcptr = LocalClientArray[i]) || !IsServer(bcptr) ||
           bcptr == cptr || IsMe(bcptr))
         continue;
-      if (0 == match(me.name, acptr->name))
+      if (0 == match(cli_name(&me), cli_name(acptr)))
         continue;
       sendcmdto_one(sptr, CMD_SERVER, bcptr, "%s %d 0 %s %s %s%s 0 :%s",
-                   acptr->name, hop + 1, parv[4], parv[5], NumServCap(acptr),
-                   acptr->info);
+                   cli_name(acptr), hop + 1, parv[4], parv[5], NumServCap(acptr),
+                   cli_info(acptr));
     }
     return 0;
   }
@@ -1372,32 +1347,32 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (IsUnknown(cptr) || IsHandshake(cptr))
   {
     make_server(cptr);
-    cptr->serv->timestamp = timestamp;
-    cptr->serv->prot = prot;
-    cptr->serv->ghost = ghost;
+    cli_serv(cptr)->timestamp = timestamp;
+    cli_serv(cptr)->prot = prot;
+    cli_serv(cptr)->ghost = ghost;
     SetServerYXX(cptr, cptr, parv[6]);
     if (start_timestamp > OLDEST_TS)
     {
 #ifndef RELIABLE_CLOCK
 #ifdef TESTNET
       sendto_opmask_butone(0, SNO_OLDSNO, "Debug: my start time: %Tu ; "
-                          "others start time: %Tu", me.serv->timestamp,
+                          "others start time: %Tu", cli_serv(&me)->timestamp,
                           start_timestamp);
       sendto_opmask_butone(0, SNO_OLDSNO, "Debug: receive time: %Tu ; "
                           "received timestamp: %Tu ; difference %ld",
                           recv_time, timestamp, timestamp - recv_time);
 #endif
-      if (start_timestamp < me.serv->timestamp)
+      if (start_timestamp < cli_serv(&me)->timestamp)
       {
         sendto_opmask_butone(0, SNO_OLDSNO, "got earlier start time: "
-                            "%Tu < %Tu", start_timestamp, me.serv->timestamp);
-        me.serv->timestamp = start_timestamp;
+                            "%Tu < %Tu", start_timestamp, cli_serv(&me)->timestamp);
+        cli_serv(&me)->timestamp = start_timestamp;
         TSoffset += timestamp - recv_time;
         sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
                             (int)(timestamp - recv_time));
       }
-      else if ((start_timestamp > me.serv->timestamp) && IsUnknown(cptr))
-        cptr->serv->timestamp = TStime();
+      else if ((start_timestamp > cli_serv(&me)->timestamp) && IsUnknown(cptr))
+        cli_serv(cptr)->timestamp = TStime();
 
       else if (timestamp != recv_time)
       {
@@ -1407,7 +1382,7 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
          * attempts.
          */
         if (IsUnknown(cptr))
-          cptr->serv->timestamp = TStime();
+          cli_serv(cptr)->timestamp = TStime();
         else if (IsHandshake(cptr))
         {
           sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
@@ -1416,10 +1391,10 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         }
       }
 #else /* RELIABLE CLOCK IS TRUE, we _always_ use our own clock */
-      if (start_timestamp < me.serv->timestamp)
-        me.serv->timestamp = start_timestamp;
+      if (start_timestamp < cli_serv(&me)->timestamp)
+        cli_serv(&me)->timestamp = start_timestamp;
       if (IsUnknown(cptr))
-        cptr->serv->timestamp = TStime();
+        cli_serv(cptr)->timestamp = TStime();
 #endif
     }
 
@@ -1428,12 +1403,12 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   else
     ret = 0;
 #ifdef RELIABLE_CLOCK
-  if (abs(cptr->serv->timestamp - recv_time) > 30)
+  if (abs(cli_serv(cptr)->timestamp - recv_time) > 30)
   {
     sendto_opmask_butone(0, SNO_OLDSNO, "Connected to a net with a "
                         "timestamp-clock difference of %Td seconds! Used "
                         "SETTIME to correct this.", timestamp - recv_time);
-    sendcmdto_one(&me, CMD_SETTIME, cptr, "%Tu :%s", TStime(), me.name);
+    sendcmdto_one(&me, CMD_SETTIME, cptr, "%Tu :%s", TStime(), cli_name(&me));
   }
 #endif
 
index 7077690f696337b93af9b9b17e252f2de01fd170..a75a3c00fc3ebc77438cc5774299f74497b74fb2 100644 (file)
@@ -124,7 +124,7 @@ int ms_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     return need_more_params(sptr, "SETTIME");
 
   if (parc == 2 && MyUser(sptr))
-    parv[parc++] = me.name;
+    parv[parc++] = cli_name(&me);
 
   t = atoi(parv[1]);
   dt = TStime() - t;
@@ -141,8 +141,8 @@ int ms_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     sprintf_irc(tbuf, TIME_T_FMT, TStime());
     parv[1] = tbuf;
 #endif
-    for (lp = me.serv->down; lp; lp = lp->next)
-      if (cptr != lp->value.cptr && MsgQLength(&lp->value.cptr->sendQ) < 8000)
+    for (lp = cli_serv(&me)->down; lp; lp = lp->next)
+      if (cptr != lp->value.cptr && MsgQLength(&(cli_sendQ(lp->value.cptr))) < 8000)
        sendcmdto_one(sptr, CMD_NOTICE, lp->value.cptr, "%s", parv[1]);
   }
   else
@@ -157,7 +157,7 @@ int ms_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 #ifdef RELIABLE_CLOCK
   if ((dt > 600) || (dt < -600))
     sendcmdto_serv_butone(&me, CMD_WALLOPS, 0, ":Bad SETTIME from %s: %Tu",
-                         sptr->name, t);
+                         cli_name(sptr), t);
   if (IsUser(sptr))
   {
     sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :clock is not set %ld seconds %s "
@@ -166,7 +166,7 @@ int ms_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
 #else
   sendto_opmask_butone(0, SNO_OLDSNO, "SETTIME from %s, clock is set %ld "
-                      "seconds %s", sptr->name, (dt < 0) ? -dt : dt,
+                      "seconds %s", cli_name(sptr), (dt < 0) ? -dt : dt,
                       (dt < 0) ? "forwards" : "backwards");
   TSoffset -= dt;
   if (IsUser(sptr))
@@ -200,7 +200,7 @@ int mo_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     return need_more_params(sptr, "SETTIME");
 
   if (parc == 2 && MyUser(sptr))
-    parv[parc++] = me.name;
+    parv[parc++] = cli_name(&me);
 
   t = atoi(parv[1]);
   dt = TStime() - t;
@@ -217,8 +217,8 @@ int mo_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     sprintf_irc(tbuf, TIME_T_FMT, TStime());
     parv[1] = tbuf;
 #endif
-    for (lp = me.serv->down; lp; lp = lp->next)
-      if (cptr != lp->value.cptr && MsgQLength(&lp->value.cptr->sendQ) < 8000)
+    for (lp = cli_serv(&me)->down; lp; lp = lp->next)
+      if (cptr != lp->value.cptr && MsgQLength(&(cli_sendQ(lp->value.cptr))) < 8000)
        sendcmdto_one(sptr, CMD_SETTIME, lp->value.cptr, "%s", parv[1]);
   }
   else
@@ -233,7 +233,7 @@ int mo_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 #ifdef RELIABLE_CLOCK
   if ((dt > 600) || (dt < -600))
     sendcmdto_serv_butone(&me, CMD_WALLOPS, 0, ":Bad SETTIME from %s: %Tu",
-                         sptr->name, t);
+                         cli_name(sptr), t);
   if (IsUser(sptr))
   {
     sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :clock is not set %ld seconds %s "
@@ -242,7 +242,7 @@ int mo_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
 #else
   sendto_opmask_butone(0, SNO_OLDSNO, "SETTIME from %s, clock is set %ld "
-                      "seconds %s", sptr->name, (dt < 0) ? -dt : dt,
+                      "seconds %s", cli_name(sptr), (dt < 0) ? -dt : dt,
                       (dt < 0) ? "forwards" : "backwards");
   TSoffset -= dt;
   if (IsUser(sptr))
index 6451d981c72bfb3582ece667338d2db7338d79a5..9e61fec0c0822b08572e287aabaa22bf06c821cd 100644 (file)
@@ -130,11 +130,11 @@ int m_silence(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   acptr = sptr;
 
   if (parc < 2 || EmptyString(parv[1]) || (acptr = FindUser(parv[1]))) {
-    if (!(acptr->user))
+    if (!(cli_user(acptr)))
       return 0;
-    for (lp = acptr->user->silence; lp; lp = lp->next)
-      send_reply(sptr, RPL_SILELIST, acptr->name, lp->value.cp);
-    send_reply(sptr, RPL_ENDOFSILELIST, acptr->name);
+    for (lp = cli_user(acptr)->silence; lp; lp = lp->next)
+      send_reply(sptr, RPL_SILELIST, cli_name(acptr), lp->value.cp);
+    send_reply(sptr, RPL_ENDOFSILELIST, cli_name(acptr));
     return 0;
   }
   cp = parv[1];
@@ -187,7 +187,7 @@ int ms_silence(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
   else {
     add_silence(sptr, parv[2]);
-    if (acptr && IsServer(acptr->from)) {
+    if (acptr && IsServer(cli_from(acptr))) {
       sendcmdto_one(sptr, CMD_SILENCE, acptr, "%C %s", acptr, parv[2]);
     }
   }
index 2d46d8c69e04b726703514223ab488fd45f63363..c36af4ba5df2156d6e7292327485337f73d28c0c 100644 (file)
@@ -76,7 +76,7 @@ int ms_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   comment = parv[parc-1];
   
   if (BadPtr(parv[parc - 1]))
-       comment=sptr->name;
+       comment = cli_name(sptr);
        
   acptr = FindNServer(server);
 
@@ -99,7 +99,7 @@ int ms_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   /* If atoi(parv[2]) == 0 we must indeed squit !
    * It will be our neighbour.
    */
-  if ( timestamp != 0 && timestamp != acptr->serv->timestamp) {
+  if ( timestamp != 0 && timestamp != cli_serv(acptr)->timestamp) {
     Debug((DEBUG_NOTICE, "Ignoring SQUIT with the wrong timestamp"));
     return 0;
   }
@@ -126,7 +126,7 @@ int mo_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     return need_more_params(sptr, "SQUIT");
 
   if (parc < 3 || BadPtr(parv[2]))
-    comment = sptr->name;
+    comment = cli_name(sptr);
   else
     comment = parv[2];
 
@@ -136,7 +136,7 @@ int mo_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    * when the command is issued by an oper.
    */
   for (acptr = GlobalClientList; (acptr = next_client(acptr, server));
-      acptr = acptr->next) {
+      acptr = cli_next(acptr)) {
     if (IsServer(acptr) || IsMe(acptr))
       break;
   }
@@ -151,9 +151,9 @@ int mo_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    * servers like davis.* and davis-r.* when typing
    * /SQUIT davis*
    */
-  for (acptr2 = acptr->serv->up; acptr2 != &me;
-      acptr2 = acptr2->serv->up)
-    if (!match(server, acptr2->name))
+  for (acptr2 = cli_serv(acptr)->up; acptr2 != &me;
+      acptr2 = cli_serv(acptr2)->up)
+    if (!match(server, cli_name(acptr2)))
       acptr = acptr2;
   
   /* Disallow local opers to squit remote servers */
index 202933e699b579c750e47518f6d06ff388864b72..51a6c5f96daa5c7ef29d183a94ba4750a7251579 100644 (file)
@@ -240,16 +240,16 @@ int m_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         if (IsInvisible(acptr) && (doall || wilds) && !IsAnOper(acptr) && (acptr != sptr))
           continue;
         /* Only show the ones that match the given mask - if any */
-        if (!doall && wilds && match(name, acptr->name))
+        if (!doall && wilds && match(name, cli_name(acptr)))
           continue;
         /* Skip all that do not match the specific query */
-        if (!(doall || wilds) && 0 != ircd_strcmp(name, acptr->name))
+        if (!(doall || wilds) && 0 != ircd_strcmp(name, cli_name(acptr)))
           continue;
         send_reply(sptr, SND_EXPLICIT | RPL_STATSLINKINFO,
-                   "%s %u %u %u %u %u :%Tu", (*acptr->name) ? acptr->name : "<unregistered>",
-                   (int)MsgQLength(&acptr->sendQ), (int)acptr->sendM,
-                   (int)acptr->sendK, (int)acptr->receiveM,
-                   (int)acptr->receiveK, CurrentTime - acptr->firsttime);
+                   "%s %u %u %u %u %u :%Tu", (*(cli_name(acptr))) ? cli_name(acptr) : "<unregistered>",
+                   (int)MsgQLength(&(cli_sendQ(acptr))), (int)cli_sendM(acptr),
+                   (int)cli_sendK(acptr), (int)cli_receiveM(acptr),
+                   (int)cli_receiveK(acptr), CurrentTime - cli_firsttime(acptr));
       }
       break;
     }
@@ -312,20 +312,6 @@ int m_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       send_reply(sptr, RPL_STATMEMTOT, fda_get_byte_count(),
                  fda_get_block_count());
 #endif
-
-#if 0
-#ifdef MEMSIZESTATS
-      sendto_one(sptr, rpl_str(RPL_STATMEMTOT), /* XXX DEAD */
-          me.name, parv[0], get_mem_size(), get_alloc_cnt());
-#endif
-#ifdef MEMLEAKSTATS
-      report_memleak_stats(sptr, parc, parv);
-#endif
-#if !defined(MEMSIZESTATS) && !defined(MEMLEAKSTATS)
-      sendto_one(sptr, ":%s NOTICE %s :stats M : Memory allocation monitoring " /* XXX DEAD */
-          "is not enabled on this server", me.name, parv[0]);
-#endif
-#endif /* 0 */
       break;
     case 'm':
       for (mptr = msgtab; mptr->cmd; mptr++)
@@ -371,7 +357,7 @@ int m_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     {
       time_t nowr;
 
-      nowr = CurrentTime - me.since;
+      nowr = CurrentTime - cli_since(&me);
       send_reply(sptr, RPL_STATSUPTIME, nowr / 86400, (nowr / 3600) % 24,
                  (nowr / 60) % 60, nowr % 60);
       send_reply(sptr, RPL_STATSCONN, max_connection_count, max_client_count);
@@ -475,16 +461,16 @@ int ms_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
          * Not here, because ms_stats is specifically a remote command, 
          * thus the check was removed. -Ghostwolf */
         /* Only show the ones that match the given mask - if any */
-        if (!doall && wilds && match(name, acptr->name))
+        if (!doall && wilds && match(name, cli_name(acptr)))
           continue;
         /* Skip all that do not match the specific query */
-        if (!(doall || wilds) && 0 != ircd_strcmp(name, acptr->name))
+        if (!(doall || wilds) && 0 != ircd_strcmp(name, cli_name(acptr)))
           continue;
         send_reply(sptr, SND_EXPLICIT | RPL_STATSLINKINFO,
-                   "%s %u %u %u %u %u :%Tu", acptr->name,
-                   (int)MsgQLength(&acptr->sendQ), (int)acptr->sendM,
-                   (int)acptr->sendK, (int)acptr->receiveM,
-                   (int)acptr->receiveK, CurrentTime - acptr->firsttime);
+                   "%s %u %u %u %u %u :%Tu", cli_name(acptr),
+                   (int)MsgQLength(&(cli_sendQ(acptr))), (int)cli_sendM(acptr),
+                   (int)cli_sendK(acptr), (int)cli_receiveM(acptr),
+                   (int)cli_receiveK(acptr), CurrentTime - cli_firsttime(acptr));
       }
       break;
     }
@@ -551,20 +537,6 @@ int ms_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       send_reply(sptr, RPL_STATMEMTOT, fda_get_byte_count(),
                  fda_get_block_count());
 #endif
-
-#if 0
-#ifdef MEMSIZESTATS
-      sendto_one(sptr, rpl_str(RPL_STATMEMTOT), /* XXX DEAD */
-          me.name, parv[0], get_mem_size(), get_alloc_cnt());
-#endif
-#ifdef MEMLEAKSTATS
-      report_memleak_stats(sptr, parc, parv);
-#endif
-#if !defined(MEMSIZESTATS) && !defined(MEMLEAKSTATS)
-      sendto_one(sptr, ":%s NOTICE %s :stats M : Memory allocation monitoring " /* XXX DEAD */
-          "is not enabled on this server", me.name, parv[0]);
-#endif
-#endif /* 0 */
       break;
     case 'm':
       for (mptr = msgtab; mptr->cmd; mptr++)
@@ -611,7 +583,7 @@ int ms_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     {
       time_t nowr;
 
-      nowr = CurrentTime - me.since;
+      nowr = CurrentTime - cli_since(&me);
       send_reply(sptr, RPL_STATSUPTIME, nowr / 86400, (nowr / 3600) % 24,
                  (nowr / 60) % 60, nowr % 60);
       send_reply(sptr, RPL_STATSCONN, max_connection_count, max_client_count);
@@ -708,16 +680,16 @@ int mo_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         if (doall && IsUser(acptr))
           continue;
         /* Only show the ones that match the given mask - if any */
-        if (!doall && wilds && match(name, acptr->name))
+        if (!doall && wilds && match(name, cli_name(acptr)))
           continue;
         /* Skip all that do not match the specific query */
-        if (!(doall || wilds) && 0 != ircd_strcmp(name, acptr->name))
+        if (!(doall || wilds) && 0 != ircd_strcmp(name, cli_name(acptr)))
           continue;
         send_reply(sptr, SND_EXPLICIT | RPL_STATSLINKINFO,
-                   "%s %u %u %u %u %u :%Tu", acptr->name,
-                   (int)MsgQLength(&acptr->sendQ), (int)acptr->sendM,
-                   (int)acptr->sendK, (int)acptr->receiveM,
-                   (int)acptr->receiveK, CurrentTime - acptr->firsttime);
+                   "%s %u %u %u %u %u :%Tu", cli_name(acptr),
+                   (int)MsgQLength(&(cli_sendQ(acptr))), (int)cli_sendM(acptr),
+                   (int)cli_sendK(acptr), (int)cli_receiveM(acptr),
+                   (int)cli_receiveK(acptr), CurrentTime - cli_firsttime(acptr));
       }
       break;
     }
@@ -780,20 +752,6 @@ int mo_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       send_reply(sptr, RPL_STATMEMTOT, fda_get_byte_count(),
                  fda_get_block_count());
 #endif
-
-#if 0
-#ifdef MEMSIZESTATS
-      sendto_one(sptr, rpl_str(RPL_STATMEMTOT), /* XXX DEAD */
-          me.name, parv[0], get_mem_size(), get_alloc_cnt());
-#endif
-#ifdef MEMLEAKSTATS
-      report_memleak_stats(sptr, parc, parv);
-#endif
-#if !defined(MEMSIZESTATS) && !defined(MEMLEAKSTATS)
-      sendto_one(sptr, ":%s NOTICE %s :stats M : Memory allocation monitoring " /* XXX DEAD */
-          "is not enabled on this server", me.name, parv[0]);
-#endif
-#endif /* 0 */
       break;
     case 'm':
       for (mptr = msgtab; mptr->cmd; mptr++)
@@ -840,7 +798,7 @@ int mo_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     {
       time_t nowr;
 
-      nowr = CurrentTime - me.since;
+      nowr = CurrentTime - cli_since(&me);
       send_reply(sptr, RPL_STATSUPTIME, nowr / 86400, (nowr / 3600) % 24,
                  (nowr / 60) % 60, nowr % 60);
       send_reply(sptr, RPL_STATSCONN, max_connection_count, max_client_count);
index c7d3561c5c00d039fd0c1d875dd669bd474ae953..b74794e25962ef3af195afeeddb4e5b78e97eeaa 100644 (file)
@@ -112,7 +112,7 @@ int m_time(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       HUNTED_ISME)
     return 0;
 
-  send_reply(sptr, RPL_TIME, me.name, TStime(), TSoffset, date((long)0));
+  send_reply(sptr, RPL_TIME, cli_name(&me), TStime(), TSoffset, date((long)0));
   return 0;
 }
 
index 95f054e9e963d1fc284b8948a7a0e0e084dbb026..a8d5649afe25d42a89fc8c4011a14f9ad2f3fab1 100644 (file)
@@ -117,7 +117,7 @@ static void do_settopic(struct Client *sptr, struct Client *cptr,
    newtopic=ircd_strncmp(chptr->topic,topic,TOPICLEN)!=0;
    /* setting a topic */
    ircd_strncpy(chptr->topic, topic, TOPICLEN);
-   ircd_strncpy(chptr->topic_nick, sptr->name, NICKLEN);
+   ircd_strncpy(chptr->topic_nick, cli_name(sptr), NICKLEN);
    chptr->topic_time = CurrentTime;
    /* Fixed in 2.10.11: Don't propergate local topics */
    if (!IsLocalChannel(chptr->chname))
index 01f723945d642ea0f46c65ed8604c099df0efcd8..d35a2705d1681d71c6378f56ce0a0579a6643422 100644 (file)
@@ -130,7 +130,7 @@ int m_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /* just "TRACE" without parameters. Must be from local client */
     parc = 1;
     acptr = &me;
-    tname = me.name;
+    tname = cli_name(&me);
     i = HUNTED_ISME;
   } else if (parc < 3 || BadPtr(parv[2])) {
     /* No target specified. Make one before propagating. */
@@ -139,9 +139,9 @@ int m_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if ((acptr = find_match_server(parv[1])) ||
         ((acptr = FindClient(parv[1])) && !MyUser(acptr))) {
       if (IsUser(acptr))
-        parv[2] = acptr->user->server->name;
+        parv[2] = cli_name(cli_user(acptr)->server);
       else
-        parv[2] = acptr->name;
+        parv[2] = cli_name(acptr);
       parc = 3;
       parv[3] = 0;
       if ((i = hunt_server_cmd(sptr, CMD_TRACE, cptr, IsServer(acptr),
@@ -166,19 +166,14 @@ int m_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if (!acptr)
       acptr = next_client(GlobalClientList, tname);
     else
-      acptr = acptr->from;
+      acptr = cli_from(acptr);
     send_reply(sptr, RPL_TRACELINK,
-#ifndef GODMODE
-        version, debugmode, tname, acptr ? acptr->from->name : "<No_match>"
-#else /* GODMODE */
-        version, debugmode, tname, acptr ? acptr->from->name : "<No_match>",
-        (acptr && acptr->from->serv) ? acptr->from->serv->timestamp : 0
-#endif /* GODMODE */
-              ); /* I really could do without GODMODE */
+              version, debugmode, tname,
+              acptr ? cli_name(cli_from(acptr)) : "<No_match>");
     return 0;
   }
 
-  doall = (parv[1] && (parc > 1)) ? !match(tname, me.name) : 1;
+  doall = (parv[1] && (parc > 1)) ? !match(tname, cli_name(&me)) : 1;
   wilds = !parv[1] || strchr(tname, '*') || strchr(tname, '?');
   dow = wilds || doall;
 
@@ -190,11 +185,11 @@ int m_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     link_s[i] = 0, link_u[i] = 0;
 
   if (doall) {
-    for (acptr = GlobalClientList; acptr; acptr = acptr->next) {
+    for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr)) {
       if (IsUser(acptr))
-        link_u[acptr->from->fd]++;
+        link_u[cli_fd(cli_from(acptr))]++;
       else if (IsServer(acptr))
-        link_s[acptr->from->fd]++;
+        link_s[cli_fd(cli_from(acptr))]++;
     }
   }
 
@@ -208,20 +203,20 @@ int m_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if (IsInvisible(acptr) && dow && !(MyConnect(sptr) && IsOper(sptr)) &&
         !IsAnOper(acptr) && (acptr != sptr))
       continue;
-    if (!doall && wilds && match(tname, acptr->name))
+    if (!doall && wilds && match(tname, cli_name(acptr)))
       continue;
-    if (!dow && 0 != ircd_strcmp(tname, acptr->name))
+    if (!dow && 0 != ircd_strcmp(tname, cli_name(acptr)))
       continue;
 
     conClass = get_client_class(acptr);
 
-    switch (acptr->status) {
+    switch (cli_status(acptr)) {
       case STAT_CONNECTING:
-       send_reply(sptr, RPL_TRACECONNECTING, conClass, acptr->name);
+       send_reply(sptr, RPL_TRACECONNECTING, conClass, cli_name(acptr));
         cnt++;
         break;
       case STAT_HANDSHAKE:
-       send_reply(sptr, RPL_TRACEHANDSHAKE, conClass, acptr->name);
+       send_reply(sptr, RPL_TRACEHANDSHAKE, conClass, cli_name(acptr));
         cnt++;
         break;
       case STAT_ME:
@@ -244,11 +239,11 @@ int m_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
           if (IsAnOper(acptr))
            send_reply(sptr, RPL_TRACEOPERATOR, conClass,
                       get_client_name(acptr, HIDE_IP),
-                      CurrentTime - acptr->lasttime);
+                      CurrentTime - cli_lasttime(acptr));
           else
            send_reply(sptr, RPL_TRACEUSER, conClass,
                       get_client_name(acptr, HIDE_IP),
-                      CurrentTime - acptr->lasttime);
+                      CurrentTime - cli_lasttime(acptr));
           cnt++;
         }
         break;
@@ -269,19 +264,19 @@ int m_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
          */
 
       case STAT_SERVER:
-        if (acptr->serv->user)
+        if (cli_serv(acptr)->user)
          send_reply(sptr, RPL_TRACESERVER, conClass, link_s[i],
-                     link_u[i], acptr->name,
-                     (*acptr->serv->by) ? acptr->serv->by : "*",
-                     acptr->serv->user->username, acptr->serv->user->host,
-                     CurrentTime - acptr->lasttime,
-                     CurrentTime - acptr->serv->timestamp);
+                     link_u[i], cli_name(acptr),
+                     (*(cli_serv(acptr))->by) ? cli_serv(acptr)->by : "*",
+                     cli_serv(acptr)->user->username, cli_serv(acptr)->user->host,
+                     CurrentTime - cli_lasttime(acptr),
+                     CurrentTime - cli_serv(acptr)->timestamp);
        else
          send_reply(sptr, RPL_TRACESERVER, conClass, link_s[i],
-                     link_u[i], acptr->name,
-                     (*acptr->serv->by) ?  acptr->serv->by : "*", "*",
-                     me.name, CurrentTime - acptr->lasttime,
-                    CurrentTime - acptr->serv->timestamp);
+                     link_u[i], cli_name(acptr),
+                     (*(cli_serv(acptr))->by) ?  cli_serv(acptr)->by : "*", "*",
+                     cli_name(&me), CurrentTime - cli_lasttime(acptr),
+                    CurrentTime - cli_serv(acptr)->timestamp);
         cnt++;
         break;
       default:                  /* We actually shouldn't come here, -msa */
@@ -297,9 +292,9 @@ int m_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (!IsAnOper(sptr) || !cnt) {
     if (!cnt)
       /* let the user have some idea that its at the end of the trace */
-      send_reply(sptr, RPL_TRACESERVER, 0, link_s[me.fd],
-                 link_u[me.fd], "<No_match>", *(me.serv->by) ?
-                 me.serv->by : "*", "*", me.name, 0, 0);
+      send_reply(sptr, RPL_TRACESERVER, 0, link_s[cli_fd(&me)],
+                 link_u[cli_fd(&me)], "<No_match>", *(cli_serv(&me)->by) ?
+                 cli_serv(&me)->by : "*", "*", cli_name(&me), 0, 0);
     return 0;
   }
   if (doall) {
@@ -335,7 +330,7 @@ int ms_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /* just "TRACE" without parameters. Must be from local client */
     parc = 1;
     acptr = &me;
-    tname = me.name;
+    tname = cli_name(&me);
     i = HUNTED_ISME;
   } else if (parc < 3 || BadPtr(parv[2])) {
     /* No target specified. Make one before propagating. */
@@ -344,9 +339,9 @@ int ms_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if ((acptr = find_match_server(parv[1])) ||
         ((acptr = FindClient(parv[1])) && !MyUser(acptr))) {
       if (IsUser(acptr))
-        parv[2] = acptr->user->server->name;
+        parv[2] = cli_name(cli_user(acptr)->server);
       else
-        parv[2] = acptr->name;
+        parv[2] = cli_name(acptr);
       parc = 3;
       parv[3] = 0;
 
@@ -372,19 +367,14 @@ int ms_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if (!acptr)
       acptr = next_client(GlobalClientList, tname);
     else
-      acptr = acptr->from;
+      acptr = cli_from(acptr);
     send_reply(sptr, RPL_TRACELINK,
-#ifndef GODMODE
-        version, debugmode, tname, acptr ? acptr->from->name : "<No_match>"
-#else /* GODMODE */
-        version, debugmode, tname, acptr ? acptr->from->name : "<No_match>",
-        (acptr && acptr->from->serv) ? acptr->from->serv->timestamp : 0
-#endif /* GODMODE */
-              ); /* I really could do without GODMODE */
+              version, debugmode, tname,
+              acptr ? cli_name(cli_from(acptr)) : "<No_match>");
     return 0;
   }
 
-  doall = (parv[1] && (parc > 1)) ? !match(tname, me.name) : 1;
+  doall = (parv[1] && (parc > 1)) ? !match(tname, cli_name(&me)) : 1;
   wilds = !parv[1] || strchr(tname, '*') || strchr(tname, '?');
   dow = wilds || doall;
 
@@ -396,11 +386,11 @@ int ms_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     link_s[i] = 0, link_u[i] = 0;
 
   if (doall) {
-    for (acptr = GlobalClientList; acptr; acptr = acptr->next) {
+    for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr)) {
       if (IsUser(acptr))
-        link_u[acptr->from->fd]++;
+        link_u[cli_fd(cli_from(acptr))]++;
       else if (IsServer(acptr))
-        link_s[acptr->from->fd]++;
+        link_s[cli_fd(cli_from(acptr))]++;
     }
   }
 
@@ -414,19 +404,19 @@ int ms_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if (IsInvisible(acptr) && dow && !(MyConnect(sptr) && IsOper(sptr)) &&
         !IsAnOper(acptr) && (acptr != sptr))
       continue;
-    if (!doall && wilds && match(tname, acptr->name))
+    if (!doall && wilds && match(tname, cli_name(acptr)))
       continue;
-    if (!dow && 0 != ircd_strcmp(tname, acptr->name))
+    if (!dow && 0 != ircd_strcmp(tname, cli_name(acptr)))
       continue;
     conClass = get_client_class(acptr);
 
-    switch (acptr->status) {
+    switch (cli_status(acptr)) {
       case STAT_CONNECTING:
-       send_reply(sptr, RPL_TRACECONNECTING, conClass, acptr->name);
+       send_reply(sptr, RPL_TRACECONNECTING, conClass, cli_name(acptr));
         cnt++;
         break;
       case STAT_HANDSHAKE:
-       send_reply(sptr, RPL_TRACEHANDSHAKE, conClass, acptr->name);
+       send_reply(sptr, RPL_TRACEHANDSHAKE, conClass, cli_name(acptr));
         cnt++;
         break;
       case STAT_ME:
@@ -449,11 +439,11 @@ int ms_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
           if (IsAnOper(acptr))
            send_reply(sptr, RPL_TRACEOPERATOR, conClass,
                       get_client_name(acptr, HIDE_IP),
-                      CurrentTime - acptr->lasttime);
+                      CurrentTime - cli_lasttime(acptr));
           else
            send_reply(sptr, RPL_TRACEUSER, conClass,
                       get_client_name(acptr, HIDE_IP),
-                      CurrentTime - acptr->lasttime);
+                      CurrentTime - cli_lasttime(acptr));
           cnt++;
         }
         break;
@@ -474,19 +464,19 @@ int ms_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
          */
 
       case STAT_SERVER:
-        if (acptr->serv->user)
+        if (cli_serv(acptr)->user)
          send_reply(sptr, RPL_TRACESERVER, conClass, link_s[i],
-                     link_u[i], acptr->name,
-                     (*acptr->serv->by) ? acptr->serv->by : "*",
-                     acptr->serv->user->username, acptr->serv->user->host,
-                     CurrentTime - acptr->lasttime,
-                     CurrentTime - acptr->serv->timestamp);
+                     link_u[i], cli_name(acptr),
+                     (*(cli_serv(acptr))->by) ? cli_serv(acptr)->by : "*",
+                     cli_serv(acptr)->user->username, cli_serv(acptr)->user->host,
+                     CurrentTime - cli_lasttime(acptr),
+                     CurrentTime - cli_serv(acptr)->timestamp);
         else
          send_reply(sptr, RPL_TRACESERVER, conClass, link_s[i],
-                     link_u[i], acptr->name,
-                     (*acptr->serv->by) ?  acptr->serv->by : "*", "*",
-                     me.name, CurrentTime - acptr->lasttime,
-                     CurrentTime - acptr->serv->timestamp);
+                     link_u[i], cli_name(acptr),
+                     (*(cli_serv(acptr))->by) ? cli_serv(acptr)->by : "*", "*",
+                     cli_name(&me), CurrentTime - cli_lasttime(acptr),
+                     CurrentTime - cli_serv(acptr)->timestamp);
         cnt++;
         break;
       default:                  /* We actually shouldn't come here, -msa */
@@ -502,9 +492,9 @@ int ms_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (!IsAnOper(sptr) || !cnt) {
     if (!cnt)
       /* let the user have some idea that its at the end of the trace */
-      send_reply(sptr, RPL_TRACESERVER, 0, link_s[me.fd],
-          link_u[me.fd], "<No_match>", *(me.serv->by) ?
-          me.serv->by : "*", "*", me.name, 0, 0);
+      send_reply(sptr, RPL_TRACESERVER, 0, link_s[cli_fd(&me)],
+          link_u[cli_fd(&me)], "<No_match>", *(cli_serv(&me)->by) ?
+          cli_serv(&me)->by : "*", "*", cli_name(&me), 0, 0);
     return 0;
   }
   if (doall) {
@@ -540,7 +530,7 @@ int mo_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /* just "TRACE" without parameters. Must be from local client */
     parc = 1;
     acptr = &me;
-    tname = me.name;
+    tname = cli_name(&me);
     i = HUNTED_ISME;
   } else if (parc < 3 || BadPtr(parv[2])) {
     /* No target specified. Make one before propagating. */
@@ -549,9 +539,9 @@ int mo_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if ((acptr = find_match_server(parv[1])) ||
         ((acptr = FindClient(parv[1])) && !MyUser(acptr))) {
       if (IsUser(acptr))
-        parv[2] = acptr->user->server->name;
+        parv[2] = cli_name(cli_user(acptr)->server);
       else
-        parv[2] = acptr->name;
+        parv[2] = cli_name(acptr);
       parc = 3;
       parv[3] = 0;
       if ((i = hunt_server_cmd(sptr, CMD_TRACE, cptr, IsServer(acptr),
@@ -576,19 +566,14 @@ int mo_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if (!acptr)
       acptr = next_client(GlobalClientList, tname);
     else
-      acptr = acptr->from;
+      acptr = cli_from(acptr);
     send_reply(sptr, RPL_TRACELINK,
-#ifndef GODMODE
-        version, debugmode, tname, acptr ? acptr->from->name : "<No_match>"
-#else /* GODMODE */
-        version, debugmode, tname, acptr ? acptr->from->name : "<No_match>",
-        (acptr && acptr->from->serv) ? acptr->from->serv->timestamp : 0
-#endif /* GODMODE */
-              ); /* I really could do without GODMODE */
+              version, debugmode, tname,
+              acptr ? cli_name(cli_from(acptr)) : "<No_match>");
     return 0;
   }
 
-  doall = (parv[1] && (parc > 1)) ? !match(tname, me.name) : 1;
+  doall = (parv[1] && (parc > 1)) ? !match(tname, cli_name(&me)) : 1;
   wilds = !parv[1] || strchr(tname, '*') || strchr(tname, '?');
   dow = wilds || doall;
 
@@ -600,11 +585,11 @@ int mo_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     link_s[i] = 0, link_u[i] = 0;
 
   if (doall) {
-    for (acptr = GlobalClientList; acptr; acptr = acptr->next) {
+    for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr)) {
       if (IsUser(acptr))
-        link_u[acptr->from->fd]++;
+        link_u[cli_fd(cli_from(acptr))]++;
       else if (IsServer(acptr))
-        link_s[acptr->from->fd]++;
+        link_s[cli_fd(cli_from(acptr))]++;
     }
   }
 
@@ -618,19 +603,19 @@ int mo_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if (IsInvisible(acptr) && dow && !(MyConnect(sptr) && IsOper(sptr)) &&
         !IsAnOper(acptr) && (acptr != sptr))
       continue;
-    if (!doall && wilds && match(tname, acptr->name))
+    if (!doall && wilds && match(tname, cli_name(acptr)))
       continue;
-    if (!dow && 0 != ircd_strcmp(tname, acptr->name))
+    if (!dow && 0 != ircd_strcmp(tname, cli_name(acptr)))
       continue;
     conClass = get_client_class(acptr);
 
-    switch (acptr->status) {
+    switch (cli_status(acptr)) {
       case STAT_CONNECTING:
-       send_reply(sptr, RPL_TRACECONNECTING, conClass, acptr->name);
+       send_reply(sptr, RPL_TRACECONNECTING, conClass, cli_name(acptr));
         cnt++;
         break;
       case STAT_HANDSHAKE:
-       send_reply(sptr, RPL_TRACEHANDSHAKE, conClass, acptr->name);
+       send_reply(sptr, RPL_TRACEHANDSHAKE, conClass, cli_name(acptr));
         cnt++;
         break;
       case STAT_ME:
@@ -653,11 +638,11 @@ int mo_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
           if (IsAnOper(acptr))
            send_reply(sptr, RPL_TRACEOPERATOR, conClass,
                       get_client_name(acptr, HIDE_IP),
-                       CurrentTime - acptr->lasttime);
+                       CurrentTime - cli_lasttime(acptr));
           else
            send_reply(sptr, RPL_TRACEUSER, conClass,
                       get_client_name(acptr, HIDE_IP),
-                       CurrentTime - acptr->lasttime);
+                       CurrentTime - cli_lasttime(acptr));
           cnt++;
         }
         break;
@@ -678,19 +663,19 @@ int mo_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
          */
 
       case STAT_SERVER:
-        if (acptr->serv->user)
+        if (cli_serv(acptr)->user)
          send_reply(sptr, RPL_TRACESERVER, conClass, link_s[i],
-                     link_u[i], acptr->name,
-                     (*acptr->serv->by) ? acptr->serv->by : "*",
-                     acptr->serv->user->username, acptr->serv->user->host,
-                     CurrentTime - acptr->lasttime,
-                     CurrentTime - acptr->serv->timestamp);
+                     link_u[i], cli_name(acptr),
+                     (*(cli_serv(acptr))->by) ? cli_serv(acptr)->by : "*",
+                     cli_serv(acptr)->user->username, cli_serv(acptr)->user->host,
+                     CurrentTime - cli_lasttime(acptr),
+                     CurrentTime - cli_serv(acptr)->timestamp);
         else
          send_reply(sptr, RPL_TRACESERVER, conClass, link_s[i],
-                     link_u[i], acptr->name,
-                     (*acptr->serv->by) ?  acptr->serv->by : "*", "*",
-                     me.name, CurrentTime - acptr->lasttime,
-                     CurrentTime - acptr->serv->timestamp);
+                     link_u[i], cli_name(acptr),
+                     (*(cli_serv(acptr))->by) ? cli_serv(acptr)->by : "*", "*",
+                     cli_name(&me), CurrentTime - cli_lasttime(acptr),
+                     CurrentTime - cli_serv(acptr)->timestamp);
         cnt++;
         break;
       default:                  /* We actually shouldn't come here, -msa */
@@ -706,9 +691,9 @@ int mo_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (!IsAnOper(sptr) || !cnt) {
     if (!cnt)
       /* let the user have some idea that its at the end of the trace */
-      send_reply(sptr, RPL_TRACESERVER, 0, link_s[me.fd],
-                 link_u[me.fd], "<No_match>", *(me.serv->by) ?
-                 me.serv->by : "*", "*", me.name, 0, 0);
+      send_reply(sptr, RPL_TRACESERVER, 0, link_s[cli_fd(&me)],
+                 link_u[cli_fd(&me)], "<No_match>", *(cli_serv(&me)->by) ?
+                 cli_serv(&me)->by : "*", "*", cli_name(&me), 0, 0);
     return 0;
   }
   if (doall) {
index 0c65dcab9ecd7e15bd8c192f03c837eb12cecc3c..de45e31b20cf18fb7978f57b3a71939852a78379 100644 (file)
@@ -193,12 +193,12 @@ int mo_uping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   if (parc == 2) {
     parv[parc++] = UDP_PORT;
-    parv[parc++] = me.name;
+    parv[parc++] = cli_name(&me);
     parv[parc++] = "5";
   }
   else if (parc == 3) {
     if (IsDigit(*parv[2]))
-      parv[parc++] = me.name;
+      parv[parc++] = cli_name(&me);
     else {
       parv[parc++] = parv[2];
       parv[2] = UDP_PORT;
@@ -209,7 +209,7 @@ int mo_uping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if (IsDigit(*parv[2])) {
       if (IsDigit(*parv[3])) {
         parv[parc++] = parv[3];
-        parv[3] = me.name;
+        parv[3] = cli_name(&me);
       }
       else
         parv[parc++] = "5";
index ad0ce75424248d3f1c411ad46f5a8fd8b32dd4af..38f50267610af300a524dfa6649a45b9409bf7e7 100644 (file)
@@ -152,24 +152,24 @@ int m_user(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   user = make_user(cptr);
 
   if (!strchr(umode, '.'))        /* Not an IP# as hostname ? */
-    cptr->flags |= (UFLAGS & atoi(umode));
+    cli_flags(cptr) |= (UFLAGS & atoi(umode));
 
-  if ((cptr->flags & FLAGS_SERVNOTICE))
+  if ((cli_flags(cptr) & FLAGS_SERVNOTICE))
     set_snomask(cptr, (IsDigit(*snomask) && !strchr(snomask, '.')) ?
                 (atoi(snomask) & SNO_USER) : SNO_DEFAULT, SNO_SET);
 
   user->server = &me;
-  ircd_strncpy(cptr->info, info, REALLEN);
+  ircd_strncpy(cli_info(cptr), info, REALLEN);
 
-  if (cptr->name[0] && cptr->cookie == COOKIE_VERIFIED) {
+  if ((cli_name(cptr))[0] && cli_cookie(cptr) == COOKIE_VERIFIED) {
     /*
      * NICK and PONG already received, now we have USER...
      */
-    return register_user(cptr, sptr, sptr->name, username, 0);
+    return register_user(cptr, sptr, cli_name(sptr), username, 0);
   }
   else {
     ircd_strncpy(user->username, username, USERLEN);
-    ircd_strncpy(user->host, cptr->sockhost, HOSTLEN);
+    ircd_strncpy(user->host, cli_sockhost(cptr), HOSTLEN);
   }
   return 0;
 }
index c59e3350a57b7accf22054e983ebadb9017f5246..d8ffb955dc480daf1cd03d7b6a8fb016e4585b7e 100644 (file)
 static void userhost_formatter(struct Client* cptr, struct MsgBuf* mb)
 {
   assert(IsUser(cptr));
-  msgq_append(0, mb, "%s%s=%c%s@%s", cptr->name, IsAnOper(cptr) ? "*" : "",
-             cptr->user->away ? '-' : '+', cptr->user->username,
-             cptr->user->host);
+  msgq_append(0, mb, "%s%s=%c%s@%s", cli_name(cptr), IsAnOper(cptr) ? "*" : "",
+             cli_user(cptr)->away ? '-' : '+', cli_user(cptr)->username,
+             cli_user(cptr)->host);
 }
 
 /*
index c7b5e01441b79d5e00cd9fbedba91f3716591ccf..4fa321d02fe77dfa8daab53ef194298c7ee4d984 100644 (file)
 static void userip_formatter(struct Client* cptr, struct MsgBuf* mb)
 {
   assert(IsUser(cptr));
-  msgq_append(0, mb, "%s%s=%c%s@%s", cptr->name, IsAnOper(cptr) ? "*" : "",
-             cptr->user->away ? '-' : '+', cptr->user->username,
-             ircd_ntoa((const char*) &cptr->ip));
+  msgq_append(0, mb, "%s%s=%c%s@%s", cli_name(cptr), IsAnOper(cptr) ? "*" : "",
+             cli_user(cptr)->away ? '-' : '+', cli_user(cptr)->username,
+             ircd_ntoa((const char*) &(cli_ip(cptr))));
 }
 
 /*
index aa303fbbd1a82b16e39781ddaaf506c1ac572cc7..6bbc79502457a923b05b62cce8cfb9ab5ec522b6 100644 (file)
@@ -120,7 +120,7 @@ int m_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       send_reply(sptr, ERR_NOSUCHSERVER, parv[1]);
       return 0;
     }
-    parv[1] = acptr->name;
+    parv[1] = cli_name(acptr);
   }
 
   if (hunt_server_cmd(sptr, CMD_VERSION, cptr, 0, ":%C", 1, parc, parv) ==
@@ -130,7 +130,7 @@ int m_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     
     sprintf_irc(featurebuf,FEATURES,FEATURESVALUES);
     
-    send_reply(sptr, RPL_VERSION, version, debugmode, me.name, serveropts);
+    send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me), serveropts);
     send_reply(sptr, RPL_ISUPPORT, featurebuf);
   }
 
@@ -154,13 +154,13 @@ int ms_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       send_reply(sptr, ERR_NOSUCHSERVER, parv[1]);
       return 0;
     }
-    parv[1] = acptr->name;
+    parv[1] = cli_name(acptr);
   }
 
   if (hunt_server_cmd(sptr, CMD_VERSION, cptr, 0, ":%C", 1, parc, parv) ==
       HUNTED_ISME)
   {
-    send_reply(sptr, RPL_VERSION, version, debugmode, me.name, serveropts);
+    send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me), serveropts);
   }
 
   return 0;
index da53c90437375e7bda34e0f030bd1234313d87cf..6fa55c140b3d579508c94307b2510470e745f7d6 100644 (file)
@@ -111,7 +111,7 @@ int m_wallchops(struct Client* cptr, struct Client* sptr, int parc, char* parv[]
   assert(0 != cptr);
   assert(cptr == sptr);
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (parc < 2 || EmptyString(parv[1]))
     return send_reply(sptr, ERR_NORECIPIENT, "WALLCHOPS");
index eb9e543be866da0ce78ec696d6d92e29c1f11ad2..dd31cf15bbfe4f7282bd50e7e3f1cdf8dc01af2d 100644 (file)
@@ -119,15 +119,15 @@ static void move_marker(void)
     struct Client *cptr = GlobalClientList;
     while (cptr)
     {
-      cptr->marker = 0;
-      cptr = cptr->next;
+      cli_marker(cptr) = 0;
+      cptr = cli_next(cptr);
     }
     who_marker++;
   }
 }
 
 #define CheckMark(x, y) ((x == y) ? 0 : (x = y))
-#define Process(cptr) CheckMark(cptr->marker, who_marker)
+#define Process(cptr) CheckMark(cli_marker(cptr), who_marker)
 
 /*
  * m_who - generic message handler
@@ -369,7 +369,7 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     if ((!(counter < 1)) && matchsel) {
       struct Membership* member;
       struct Membership* chan;
-      for (chan = sptr->user->channel; chan; chan = chan->next_channel) {
+      for (chan = cli_user(sptr)->channel; chan; chan = chan->next_channel) {
         chptr = chan->channel;
         for (member = chptr->members; member; member = member->next_member)
         {
@@ -381,19 +381,19 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
             continue;
           if ((mask) &&
               ((!(matchsel & WHO_FIELD_NIC))
-              || matchexec(acptr->name, mymask, minlen))
+              || matchexec(cli_name(acptr), mymask, minlen))
               && ((!(matchsel & WHO_FIELD_UID))
-              || matchexec(acptr->user->username, mymask, minlen))
+              || matchexec(cli_user(acptr)->username, mymask, minlen))
               && ((!(matchsel & WHO_FIELD_SER))
-              || (!(acptr->user->server->flags & FLAGS_MAP)))
+              || (!(cli_flags(cli_user(acptr)->server) & FLAGS_MAP)))
               && ((!(matchsel & WHO_FIELD_HOS))
-              || matchexec(acptr->user->host, mymask, minlen))
+              || matchexec(cli_user(acptr)->host, mymask, minlen))
               && ((!(matchsel & WHO_FIELD_REN))
-              || matchexec(acptr->info, mymask, minlen))
+              || matchexec(cli_info(acptr), mymask, minlen))
               && ((!(matchsel & WHO_FIELD_NIP))
-              || ((((acptr->ip.s_addr & imask.mask.s_addr) !=
+              || ((((cli_ip(acptr).s_addr & imask.mask.s_addr) !=
               imask.bits.s_addr)) || (imask.fall
-              && matchexec(ircd_ntoa((const char*) &acptr->ip), mymask, minlen)))))
+              && matchexec(ircd_ntoa((const char*) &(cli_ip(acptr))), mymask, minlen)))))
             continue;
           if (!SHOW_MORE(sptr, counter))
             break;
@@ -404,7 +404,7 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /* Loop through all clients :-\, if we still have something to match to 
        and we can show more clients */
     if ((!(counter < 1)) && matchsel)
-      for (acptr = me.prev; acptr; acptr = acptr->prev)
+      for (acptr = cli_prev(&me); acptr; acptr = cli_prev(acptr))
       {
         if (!(IsUser(acptr) && Process(acptr)))
           continue;
@@ -414,19 +414,19 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
           continue;
         if ((mask) &&
             ((!(matchsel & WHO_FIELD_NIC))
-            || matchexec(acptr->name, mymask, minlen))
+            || matchexec(cli_name(acptr), mymask, minlen))
             && ((!(matchsel & WHO_FIELD_UID))
-            || matchexec(acptr->user->username, mymask, minlen))
+            || matchexec(cli_user(acptr)->username, mymask, minlen))
             && ((!(matchsel & WHO_FIELD_SER))
-            || (!(acptr->user->server->flags & FLAGS_MAP)))
+            || (!(cli_flags(cli_user(acptr)->server) & FLAGS_MAP)))
             && ((!(matchsel & WHO_FIELD_HOS))
-            || matchexec(acptr->user->host, mymask, minlen))
+            || matchexec(cli_user(acptr)->host, mymask, minlen))
             && ((!(matchsel & WHO_FIELD_REN))
-            || matchexec(acptr->info, mymask, minlen))
+            || matchexec(cli_info(acptr), mymask, minlen))
             && ((!(matchsel & WHO_FIELD_NIP))
-            || ((((acptr->ip.s_addr & imask.mask.s_addr) != imask.bits.s_addr))
+            || ((((cli_ip(acptr).s_addr & imask.mask.s_addr) != imask.bits.s_addr))
             || (imask.fall
-            && matchexec(ircd_ntoa((const char*) &acptr->ip), mymask, minlen)))))
+            && matchexec(ircd_ntoa((const char*) &(cli_ip(acptr))), mymask, minlen)))))
           continue;
         if (!SHOW_MORE(sptr, counter))
           break;
index eb041e13af21ef89bcdd77816abcd16d204387c7..9c6ea1bb6de95855fb28a41f9e491264a61b3232 100644 (file)
@@ -139,18 +139,18 @@ static void do_whois(struct Client* sptr, struct Client *acptr)
   int len;
   static char buf[512];
   
-  const struct User* user = acptr->user;
-  const char* name = (!*acptr->name) ? "?" : acptr->name;  
+  const struct User* user = cli_user(acptr);
+  const char* name = (!*(cli_name(acptr))) ? "?" : cli_name(acptr);  
   a2cptr = user->server;
   assert(user);
   send_reply(sptr, RPL_WHOISUSER, name, user->username, user->host,
-                  acptr->info);
+                  cli_info(acptr));
 
   /* Display the channels this user is on. */
   if (!IsChannelService(acptr))
   {
     struct Membership* chan;
-    mlen = strlen(me.name) + strlen(sptr->name) + 12 + strlen(name);
+    mlen = strlen(cli_name(&me)) + strlen(cli_name(sptr)) + 12 + strlen(name);
     len = 0;
     *buf = '\0';
     for (chan = user->channel; chan; chan = chan->next_channel)
@@ -187,7 +187,7 @@ static void do_whois(struct Client* sptr, struct Client *acptr)
      if (buf[0] != '\0')
         send_reply(sptr, RPL_WHOISCHANNELS, name, buf);
   }
-  send_reply(sptr, RPL_WHOISSERVER, name, a2cptr->name, a2cptr->info);
+  send_reply(sptr, RPL_WHOISSERVER, name, cli_name(a2cptr), cli_info(a2cptr));
 
   if (user)
   {
@@ -203,7 +203,7 @@ static void do_whois(struct Client* sptr, struct Client *acptr)
      
     if (MyConnect(acptr))
        send_reply(sptr, RPL_WHOISIDLE, name, CurrentTime - user->last, 
-                  acptr->firsttime);
+                  cli_firsttime(acptr));
   }
 }
 
@@ -225,7 +225,7 @@ static int do_wilds(struct Client* sptr,char *nick,int count)
   
   /* Ech! This is hidious! */
   for (acptr = GlobalClientList; (acptr = next_client(acptr, nick));
-      acptr = acptr->next)
+      acptr = cli_next(acptr))
   {
     if (!IsRegistered(acptr)) 
       continue;
@@ -239,7 +239,7 @@ static int do_wilds(struct Client* sptr,char *nick,int count)
      *         hack?
      */
     if (IsMe(acptr)) {
-      assert(!acptr->next);
+      assert(!cli_next(acptr));
       break;
     }
     
@@ -253,8 +253,8 @@ static int do_wilds(struct Client* sptr,char *nick,int count)
      * - only send replies about common or public channels
      *   the target user(s) are on;
      */
-    user = acptr->user;
-    name = (!*acptr->name) ? "?" : acptr->name;
+    user = cli_user(acptr);
+    name = (!*(cli_name(acptr))) ? "?" : cli_name(acptr);
     assert(user);
 
     invis = (acptr != sptr) && IsInvisible(acptr);
@@ -349,7 +349,7 @@ int m_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      */
     acptr = FindUser(parv[1]);
     if (acptr)
-      parv[1] = acptr->user->server->name;
+      parv[1] = cli_name(cli_user(acptr)->server);
     if (hunt_server_cmd(sptr, CMD_WHOIS, cptr, 0, "%C :%s", 1, parc, parv) !=
         HUNTED_ISME)
       return 0;
@@ -426,7 +426,7 @@ int ms_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      */
     acptr = FindUser(parv[1]);
     if (acptr)
-      parv[1] = acptr->user->server->name;
+      parv[1] = cli_name(cli_user(acptr)->server);
     if (hunt_server_cmd(sptr, CMD_WHOIS, cptr, 0, "%C :%s", 1, parc, parv) !=
         HUNTED_ISME)
       return 0;
index 64893c8fa2c482d4c606a9b00255b93c3063524f..b718827e02d5aaab03791df3992b2b8b2d818a68 100644 (file)
@@ -861,7 +861,7 @@ int parse_client(struct Client *cptr, char *buffer, char *bufend)
   i = bufend - ((s) ? s : ch);
   mptr->bytes += i;
   if ((mptr->flags & MFLG_SLOW))
-    cptr->since += (2 + i / 120);
+    cli_since(cptr) += (2 + i / 120);
   /*
    * Allow only 1 msg per 2 seconds
    * (on average) to prevent dumping.
index 7d9210591fa67c926427a246c322b2f004b1cecc..fea222ec88a18708774878e8cb294bd48a129093 100644 (file)
@@ -332,12 +332,12 @@ static void start_resolver(void)
     ResolverFileDescriptor = socket(AF_INET, SOCK_DGRAM, 0);
     if (-1 == ResolverFileDescriptor) {
       report_error("Resolver: error creating socket for %s: %s", 
-                   me.name, errno);
+                   cli_name(&me), errno);
       return;
     }
     if (!os_set_nonblocking(ResolverFileDescriptor))
       report_error("Resolver: error setting non-blocking for %s: %s", 
-                   me.name, errno);
+                   cli_name(&me), errno);
   }
 }
 
index f521649da2d17d7649dfc34e02e2dbbcd923599c..9b1457bf7ca46cb3835a3aaeb746ba061fa0e172 100644 (file)
@@ -92,7 +92,7 @@ typedef enum {
 } ReportType;
 
 #define sendheader(c, r) \
-   send((c)->fd, HeaderMessages[(r)].message, HeaderMessages[(r)].length, 0)
+   send(cli_fd(c), HeaderMessages[(r)].message, HeaderMessages[(r)].length, 0)
 
 struct AuthRequest* AuthPollList = 0; /* GLOBAL - auth queries pending io */
 static struct AuthRequest* AuthIncompleteList = 0;
@@ -523,7 +523,7 @@ void start_auth(struct Client* client)
 
 #if !defined(NODNS)
   if (LOOPBACK == inet_netof(cli_ip(client))) {
-    strcpy(client->sockhost, cli_name(&me));
+    strcpy(cli_sockhost(client), cli_name(&me));
   }
   else {
     struct DNSQuery query;
@@ -534,7 +534,7 @@ void start_auth(struct Client* client)
     if (IsUserPort(auth->client))
       sendheader(client, REPORT_DO_DNS);
 
-    client->dns_reply = gethost_byaddr((const char*) &(cli_ip(client)), &query);
+    cli_dns_reply(client) = gethost_byaddr((const char*) &(cli_ip(client)), &query);
 
     if (cli_dns_reply(client)) {
       ++(cli_dns_reply(client))->ref_count;
index 949a02a868bffc3cf0136192a104cab1f86c3fb9..e66a9d97c3c2c201e13d1dd2aece12ebae731393 100644 (file)
@@ -482,7 +482,7 @@ void close_connection(struct Client *cptr)
        * CONF_ILLEGAL). But only do this if it was a "good" link.
        */
       aconf->hold = CurrentTime;
-      aconf->hold += (aconf->hold - cptr->since > HANGONGOODLINK) ?
+      aconf->hold += (aconf->hold - cli_since(cptr) > HANGONGOODLINK) ?
                      HANGONRETRYDELAY : ConfConFreq(aconf);
       if (nextconnect > aconf->hold)
         nextconnect = aconf->hold;
@@ -698,7 +698,7 @@ static int read_packet(struct Client *cptr, int socket_ready)
        */
       if (0 == dolen) {
         if (DBufLength(&(cli_recvQ(cptr))) < 510)
-          cptr->flags |= FLAGS_NONL;
+          cli_flags(cptr) |= FLAGS_NONL;
         else
           DBufClear(&(cli_recvQ(cptr)));
       }
@@ -1399,8 +1399,8 @@ int connect_server(struct ConfItem* aconf, struct Client* by,
   if (by && IsUser(by)) {
     sprintf_irc(cli_serv(cptr)->by, "%s%s", NumNick(by));
     assert(0 == cli_serv(cptr)->user);
-    cli_serv(cptr)->user = by->user;
-    by->user->refcnt++;
+    cli_serv(cptr)->user = cli_user(by);
+    cli_user(by)->refcnt++;
   }
   else {
     *(cli_serv(cptr))->by = '\0';
index 4be9c2a00c9a4df30fd4c646ef7ae2294335b066..24f2798b842ebc92f3adf1a1f89d91969bc9d53d 100644 (file)
@@ -424,7 +424,7 @@ static int is_attached(struct ConfItem *aconf, struct Client *cptr)
 {
   struct SLink *lp;
 
-  for (lp = cptr->confs; lp; lp = lp->next) {
+  for (lp = cli_confs(cptr); lp; lp = lp->next) {
     if (lp->value.aconf == aconf)
       return 1;
   }
@@ -451,9 +451,9 @@ enum AuthorizationCheckResult attach_conf(struct Client *cptr, struct ConfItem *
       ConfLinks(aconf) >= ConfMaxLinks(aconf) && ConfMaxLinks(aconf) > 0)
     return ACR_TOO_MANY_IN_CLASS;  /* Use this for printing error message */
   lp = make_link();
-  lp->next = cptr->confs;
+  lp->next = cli_confs(cptr);
   lp->value.aconf = aconf;
-  cptr->confs = lp;
+  cli_confs(cptr) = lp;
   ++aconf->clients;
   if (aconf->status & CONF_CLIENT_MASK)
     ConfLinks(aconf)++;
@@ -1313,7 +1313,7 @@ int rehash(struct Client *cptr, int sig)
       if (IsServer(acptr)) {
         det_confs_butmask(acptr,
             ~(CONF_HUB | CONF_LEAF | CONF_UWORLD | CONF_ILLEGAL));
-        attach_confs_byname(acptr, acptr->name,
+        attach_confs_byname(acptr, cli_name(acptr),
                             CONF_HUB | CONF_LEAF | CONF_UWORLD);
       }
       /* Because admin's are getting so uppity about people managing to
index 90c5b3be731a6f404d6fe6ed66c9dad40436de17..d77caa89d9c954003b8a3cdc13e04886d9e0e756 100644 (file)
@@ -327,7 +327,7 @@ static void exit_downlinks(struct Client *cptr, struct Client *sptr, char *comme
     /* Remove the downlinks and client of the downlink */
     exit_downlinks(acptr, sptr, comment);
     /* Remove the downlink itself */
-    exit_one_client(acptr, me.name);
+    exit_one_client(acptr, cli_name(&me));
   }
   /* Remove all clients of this server */
   acptrp = cli_serv(cptr)->client_list;
index af86cdfdb101de925204758df16ccbf682f62d3b..ea7b01fa3596d9ca273b651a5600b4d653add9c2 100644 (file)
@@ -524,7 +524,7 @@ int register_user(struct Client *cptr, struct Client *sptr,
       else if ((!lower && !upper) || !IsAlnum(c))
         badid = 1;
     }
-    if (badid && (!(sptr->flags & FLAGS_GOTID) ||
+    if (badid && (!(cli_flags(sptr) & FLAGS_GOTID) ||
         strcmp(cli_username(sptr), username) != 0))
     {
       ServerStats->is_ref++;
@@ -576,7 +576,7 @@ int register_user(struct Client *cptr, struct Client *sptr,
     update_load();
     motd_signon(sptr);
     nextping = CurrentTime;
-    if (sptr->snomask & SNO_NOISY)
+    if (cli_snomask(sptr) & SNO_NOISY)
       set_snomask(sptr, cli_snomask(sptr) & SNO_NOISY, SNO_ADD);
     IPcheck_connect_succeeded(sptr);
   }
@@ -812,7 +812,7 @@ int set_nick_name(struct Client* cptr, struct Client* sptr,
       do {
         cli_cookie(sptr) = (ircrandom() & 0x7fffffff);
       } while (!cli_cookie(sptr));
-      sendrawto_one(cptr, MSG_PING " :%u", sptr->cookie);
+      sendrawto_one(cptr, MSG_PING " :%u", cli_cookie(sptr));
     }
     else if (*(cli_user(sptr))->host && cli_cookie(sptr) == COOKIE_VERIFIED) {
       /*
@@ -1305,7 +1305,7 @@ void send_umode(struct Client *cptr, struct Client *sptr, int old, int sendmask)
         *m++ = userModeList[i].c;
       }
     }
-    else if (!(flag & old) && (sptr->flags & flag))
+    else if (!(flag & old) && (cli_flags(sptr) & flag))
     {
       if (what == MODE_ADD)
         *m++ = userModeList[i].c;
index f05d04479672444d6caa5a0c84bc0de76028869f..828c4e099278327654a6948811b2e8836400763a 100644 (file)
@@ -151,7 +151,7 @@ void send_queued(struct Client *to)
 
     if ((len = deliver_it(to, &(cli_sendQ(to))))) {
       msgq_delete(&(cli_sendQ(to)), len);
-      to->lastsq = MsgQLength(&(cli_sendQ(to))) / 1024;
+      cli_lastsq(to) = MsgQLength(&(cli_sendQ(to))) / 1024;
       if (IsBlocked(to))
         break;
     }
@@ -303,7 +303,7 @@ void sendcmdto_serv_butone(struct Client *from, const char *cmd,
   va_end(vd.vd_args);
 
   /* send it to our downlinks */
-  for (lp = me.serv->down; lp; lp = lp->next) {
+  for (lp = cli_serv(&me)->down; lp; lp = lp->next) {
     if (one && lp->value.cptr == cli_from(one))
       continue;
     send_buffer(lp->value.cptr, mb, 0);
@@ -558,7 +558,7 @@ void sendcmdto_match_butone(struct Client *from, const char *cmd,
 
   /* send buffer along */
   sentalong_marker++;
-  for (cptr = GlobalClientList; cptr; cptr = cptr->next) {
+  for (cptr = GlobalClientList; cptr; cptr = cli_next(cptr)) {
     if (cli_from(cptr) == one || IsServer(cptr) || IsMe(cptr) ||
        !match_it(cptr, to, who) || cli_fd(cli_from(cptr)) < 0 ||
        sentalong[cli_fd(cli_from(cptr))] == sentalong_marker)
@@ -612,7 +612,8 @@ void vsendto_opmask_butone(struct Client *one, unsigned int mask,
    */
   vd.vd_format = pattern;
   vd.vd_args = vl;
-  mb = msgq_make(0, ":%s " MSG_NOTICE " * :*** Notice -- %v", me.name, &vd);
+  mb = msgq_make(0, ":%s " MSG_NOTICE " * :*** Notice -- %v", cli_name(&me),
+                &vd);
 
   for (; opslist; opslist = opslist->next)
     send_buffer(opslist->value.cptr, mb, 0);
index 83f8a23e7d6333e5eaebed0e8cee67b5d9f0d56a..3db630d4733829cefbe6ec2350d0d64ca16ab80c 100644 (file)
@@ -362,7 +362,7 @@ void uping_cancel(struct Client *sptr, struct Client* acptr)
   struct UPing* ping;
   struct UPing* ping_next;
 
-  Debug((DEBUG_DEBUG, "UPING: cancelling uping for %s", sptr->name));
+  Debug((DEBUG_DEBUG, "UPING: cancelling uping for %s", cli_name(sptr)));
   for (ping = pingList; ping; ping = ping_next) {
     ping_next = ping->next;
     if (sptr == ping->client) {
index b8b12f3b706db721e8d317a690b6d9d3fe6666f0..61774d7e9dc5b6c2f1a3cf98ee6d596f41c212ab 100644 (file)
@@ -191,7 +191,7 @@ void add_history(struct Client *cptr, int still_on)
   /* Should be changed to server numeric */
   DupString(ww.newww->servername, cli_name(cli_user(cptr)->server));
   DupString(ww.newww->realname, cli_info(cptr));
-  if (cptr->user->away)
+  if (cli_user(cptr)->away)
     DupString(ww.newww->away, cli_user(cptr)->away);
   else
     ww.newww->away = NULL;