+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
* 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
*/
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.
* 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 */
*/
/* 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)
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)
#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; \
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)
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()
{
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);
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;
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);
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;
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);
}
if (!cli_user(acptr))
continue;
- if (acptr->user->username &&
+ if (cli_user(acptr)->username &&
match (gline->gl_user, (cli_user(acptr))->username) != 0)
continue;
continue;
}
else {
- if (match(gline->gl_host, acptr->sockhost) != 0)
+ if (match(gline->gl_host, cli_sockhost(acptr)) != 0)
continue;
}
assert(0 != cptr);
hRemClient(cptr);
- cptr->hnext = clientTable[newhash];
+ cli_hnext(cptr) = clientTable[newhash];
clientTable[newhash] = cptr;
return 0;
}
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];
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;
}
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);
}
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, "");
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? */
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 */
}
}
- if (!(acptr = findNUser(nick)) || acptr->from != cptr)
+ if (!(acptr = findNUser(nick)) || cli_from(acptr) != cptr)
continue; /* ignore this client */
/* Build nick buffer */
*/
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;
}
/*
* 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
* 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;
*/
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;
}
/*
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 */
-
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')
*/
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 */
/* 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
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);
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;
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];
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;
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;
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;
* 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;
/* 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;
}
}
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;
}
/* 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;
}
/*
* 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;
}
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;
}
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 */
}
}
return 0;
}
-
-
#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.
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);
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);
} 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)
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')
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;
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");
/* 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];
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");
* 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);
"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
* 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
*/
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
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);
* 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
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;
/*
* 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 {
/*
* 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);
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);
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);
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. */
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;
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);
}
*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)
{
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 = '`';
!(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];
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 */
/* 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)
{
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 */
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 */
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)
{
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 */
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 */
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)
{
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 */
/*
* 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);
* 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
*/
*/
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);
}
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
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;
}
* 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
*/
* 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
*/
*/
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);
}
*
* 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 {
*
* 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.
*
* 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
*/
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);
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);
char* name;
char* server;
- sptr->flags &= ~FLAGS_TS8;
+ cli_flags(sptr) &= ~FLAGS_TS8;
if (parc < 3) {
/*
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);
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) {
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);
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;
}
*/
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;
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')
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')
/* Do something here */
}
#endif
- ircd_strncpy(cptr->passwd, password, PASSWDLEN);
+ ircd_strncpy(cli_passwd(cptr), password, PASSWDLEN);
return 0;
}
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
/* 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';
/*
* 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
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);
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;
}
{
assert(0 != cptr);
assert(cptr == sptr);
- cptr->flags &= ~FLAGS_PINGSENT;
- cptr->lasttime = CurrentTime;
+ cli_flags(cptr) &= ~FLAGS_PINGSENT;
+ cli_lasttime(cptr) = CurrentTime;
return 0;
}
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]))
char* name;
char* server;
- sptr->flags &= ~FLAGS_TS8;
+ cli_flags(sptr) &= ~FLAGS_TS8;
if (parc < 3) {
/*
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]))
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';
}
* 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",
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);
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],
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
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)))
{
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]);
}
}
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);
}
* 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)))
{
/*
* 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;
/* 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;
* 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++)
/*
* 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.
* 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 :)
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;
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;
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)
{
/*
* 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
{
* 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 ?
{
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
{
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
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;
}
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);
}
/*
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;
}
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)
{
* 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",
}
}
#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
}
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
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,
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]);
}
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);
}
* 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)))
{
/*
* 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;
/* 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;
* 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++)
/*
* 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.
* 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 :)
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;
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;
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)
{
/*
* 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
{
* 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 ?
{
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
{
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
{
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;
}
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);
}
/*
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;
}
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)
{
* 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",
}
}
#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
}
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
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;
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
#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 "
}
#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))
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;
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
#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 "
}
#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))
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];
}
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]);
}
}
comment = parv[parc-1];
if (BadPtr(parv[parc - 1]))
- comment=sptr->name;
+ comment = cli_name(sptr);
acptr = FindNServer(server);
/* 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;
}
return need_more_params(sptr, "SQUIT");
if (parc < 3 || BadPtr(parv[2]))
- comment = sptr->name;
+ comment = cli_name(sptr);
else
comment = parv[2];
* 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;
}
* 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 */
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;
}
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++)
{
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);
* 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;
}
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++)
{
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);
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;
}
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++)
{
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);
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;
}
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))
/* 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. */
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),
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;
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))]++;
}
}
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:
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;
*/
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 */
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) {
/* 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. */
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 (!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;
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))]++;
}
}
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:
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;
*/
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 */
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) {
/* 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. */
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),
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;
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))]++;
}
}
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:
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;
*/
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 */
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) {
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;
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";
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;
}
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);
}
/*
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))));
}
/*
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) ==
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);
}
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;
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");
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
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)
{
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;
/* 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;
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;
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)
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)
{
if (MyConnect(acptr))
send_reply(sptr, RPL_WHOISIDLE, name, CurrentTime - user->last,
- acptr->firsttime);
+ cli_firsttime(acptr));
}
}
/* Ech! This is hidious! */
for (acptr = GlobalClientList; (acptr = next_client(acptr, nick));
- acptr = acptr->next)
+ acptr = cli_next(acptr))
{
if (!IsRegistered(acptr))
continue;
* hack?
*/
if (IsMe(acptr)) {
- assert(!acptr->next);
+ assert(!cli_next(acptr));
break;
}
* - 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);
*/
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;
*/
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;
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.
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);
}
}
} 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;
#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;
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;
* 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;
*/
if (0 == dolen) {
if (DBufLength(&(cli_recvQ(cptr))) < 510)
- cptr->flags |= FLAGS_NONL;
+ cli_flags(cptr) |= FLAGS_NONL;
else
DBufClear(&(cli_recvQ(cptr)));
}
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';
{
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;
}
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)++;
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
/* 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;
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++;
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);
}
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) {
/*
*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;
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;
}
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);
/* 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)
*/
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);
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) {
/* 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;