Here's a preliminary hack against .11, doesn't even have a ChangeLog.
Reporting via /stats v. It works ok with a non-AsLL 2.10.11 server, and
presumably with a .10 too. I'm curious if this is what you had in mind.
Also note that, at least for now, the upstream/downstream lag calculations
rely on the two servers' clocks being sychronized. RTT will always be
correct.

-- 
Alex "Vampire-" Badea * Undernet Coder-Com contributer
? tools/mkpasswd
Index: include/struct.h
===================================================================
RCS file: /home/coder-com/cvs/ircu2.10/include/struct.h,v
retrieving revision 1.2.46.2
diff -u -r1.2.46.2 struct.h
--- include/struct.h    2002/02/03 20:31:46     1.2.46.2
+++ include/struct.h    2002/06/04 21:45:36
@@ -52,6 +52,10 @@
   unsigned short  nn_last;      /* Last numeric nick for p9 servers only */
   unsigned int    nn_mask;      /* [Remote] FD_SETSIZE - 1 */
   char          nn_capacity[4]; /* numeric representation of server capacity */
+  
+  unsigned long   asll_rtt;    /* AsLL round-trip time */
+  unsigned long   asll_to;     /* AsLL upstream lag */
+  unsigned long   asll_from;   /* AsLL downstream lag */
 
   char *last_error_msg;         /* Allocated memory with last message receive with an 
ERROR */
   char by[NICKLEN + 1];
Index: ircd/ircd.c
===================================================================
RCS file: /home/coder-com/cvs/ircu2.10/ircd/ircd.c,v
retrieving revision 1.51.2.6
diff -u -r1.51.2.6 ircd.c
--- ircd/ircd.c 2002/05/10 11:58:20     1.51.2.6
+++ ircd/ircd.c 2002/06/04 21:45:36
@@ -41,6 +41,7 @@
 #include "msg.h"
 #include "numeric.h"
 #include "numnicks.h"
+#include "opercmds.h"
 #include "parse.h"
 #include "res.h"
 #include "s_auth.h"
@@ -410,7 +411,8 @@
       if (IsUser(cptr))
        sendrawto_one(cptr, MSG_PING " :%s", cli_name(&me));
       else
-       sendcmdto_one(&me, CMD_PING, cptr, ":%s", cli_name(&me));
+       sendcmdto_one(&me, CMD_PING, cptr, "%s %s %s", cli_name(&me),
+                     cli_name(cptr), militime(NULL, NULL));
     }
     
     expire = cli_lasttime(cptr) + max_ping * 2;
Index: ircd/m_ping.c
===================================================================
RCS file: /home/coder-com/cvs/ircu2.10/ircd/m_ping.c,v
retrieving revision 1.6.2.1
diff -u -r1.6.2.1 m_ping.c
--- ircd/m_ping.c       2001/10/30 20:47:44     1.6.2.1
+++ ircd/m_ping.c       2002/06/04 21:45:36
@@ -140,6 +140,7 @@
 #include "msg.h"
 #include "numeric.h"
 #include "numnicks.h"
+#include "opercmds.h"
 #include "s_debug.h"
 #include "send.h"
 
@@ -239,6 +240,14 @@
   }
   origin      = parv[1];
   destination = parv[2];        /* Will get NULL or pointer (parc >= 2!!) */
+
+  if (parc > 4) {
+    /* AsLL ping, send reply back */
+    int diff = atoi(militime(parv[3], parv[4]));
+    sendcmdto_one(&me, CMD_PONG, sptr, "%C %s %s %s %d %s", &me, origin,
+                 parv[3], parv[4], diff, militime(NULL, NULL));
+    return 0;
+  }
 
   if (!EmptyString(destination) && 0 != ircd_strcmp(destination, cli_name(&me))) {
     if ((acptr = FindServer(destination))) {
Index: ircd/m_pong.c
===================================================================
RCS file: /home/coder-com/cvs/ircu2.10/ircd/m_pong.c,v
retrieving revision 1.12
diff -u -r1.12 m_pong.c
--- ircd/m_pong.c       2001/06/29 15:51:02     1.12
+++ ircd/m_pong.c       2002/06/04 21:45:36
@@ -89,6 +89,7 @@
 #include "msg.h"
 #include "numeric.h"
 #include "numnicks.h"
+#include "opercmds.h"
 #include "s_user.h"
 #include "send.h"
 
@@ -119,6 +120,14 @@
   cli_flags(cptr) &= ~FLAGS_PINGSENT;
   cli_flags(sptr) &= ~FLAGS_PINGSENT;
   cli_lasttime(cptr) = CurrentTime;
+
+  if (parc > 7) {
+    /* AsLL pong */
+    cli_serv(cptr)->asll_rtt = atoi(militime(parv[3], parv[4]));
+    cli_serv(cptr)->asll_to = atoi(parv[5]);
+    cli_serv(cptr)->asll_from = atoi(militime(parv[6], parv[7]));
+    return 0;
+  }
 
   if (!EmptyString(destination) && 0 != ircd_strcmp(destination, cli_name(&me))) {
     struct Client* acptr;
Index: ircd/m_stats.c
===================================================================
RCS file: /home/coder-com/cvs/ircu2.10/ircd/m_stats.c,v
retrieving revision 1.22.2.4
diff -u -r1.22.2.4 m_stats.c
--- ircd/m_stats.c      2002/06/04 18:22:13     1.22.2.4
+++ ircd/m_stats.c      2002/06/04 21:45:36
@@ -187,7 +187,7 @@
    * uppercase 'V' is for machine-readable */
   if (stat == 'v')
     send_reply(sptr, SND_EXPLICIT | RPL_STATSVERBOSE,
-              "%-20s %-20s Burst Hops Numeric   Lag Clients/Max Proto "
+              "%-20s %-20s Burst Hops Numeric   Lag  RTT   Up Down Clients/Max Proto 
+"
               "%-10s :Info", "Servername", "Uplink", "LinkTS");
 
   for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr))
@@ -195,7 +195,7 @@
     if (!IsServer(acptr) && !IsMe(acptr))
       continue;
     send_reply(sptr, SND_EXPLICIT | RPL_STATSVERBOSE, stat == 'v' ?
-              "%-20s %-20s %c%c    %4i %s %-4i %5i %5i %5i P%-2i   %Tu :%s" :
+              "%-20s %-20s %c%c    %4i %s %-4i %5i %4i %4i %4i %5i %5i P%-2i   %Tu 
+:%s" :
               "%s %s %c%c %i %s %i %i %i %i P%i %Tu :%s",
               cli_name(acptr),
               cli_name(cli_serv(acptr)->up),
@@ -205,6 +205,9 @@
               NumServ(acptr),
               base64toint(cli_yxx(acptr)),
               cli_serv(acptr)->lag,
+              cli_serv(acptr)->asll_rtt,
+              cli_serv(acptr)->asll_to,
+              cli_serv(acptr)->asll_from,
               cli_serv(acptr)->clients,
               cli_serv(acptr)->nn_mask,
               cli_serv(acptr)->prot,
Index: ircd/s_bsd.c
===================================================================
RCS file: /home/coder-com/cvs/ircu2.10/ircd/s_bsd.c,v
retrieving revision 1.45.2.4
diff -u -r1.45.2.4 s_bsd.c
--- ircd/s_bsd.c        2002/01/28 21:06:17     1.45.2.4
+++ ircd/s_bsd.c        2002/06/04 21:45:36
@@ -702,7 +702,8 @@
     switch (os_recv_nonb(cli_fd(cptr), readbuf, sizeof(readbuf), &length)) {
     case IO_SUCCESS:
       if (length) {
-        cli_lasttime(cptr) = CurrentTime;
+        if (!IsServer(cptr))
+          cli_lasttime(cptr) = CurrentTime;
         if (cli_lasttime(cptr) > cli_since(cptr))
           cli_since(cptr) = cli_lasttime(cptr);
         cli_flags(cptr) &= ~(FLAGS_PINGSENT | FLAGS_NONL);

Reply via email to