Index: MgmtMain.java =================================================================== RCS file: /nfs/dart/dartisi/ARP/CVSHOME/Jrsvp/apps/mgmt/MgmtMain.java,v retrieving revision 1.21 diff -u -r1.21 MgmtMain.java --- MgmtMain.java 2000/02/15 16:47:16 1.21 +++ MgmtMain.java 2000/04/12 19:47:16 @@ -294,6 +294,18 @@ return (inf.equals(rpf)); } + static InterfaceNetIO reverseLookup(AddressNet addr) { + MgmtMain mobj = mainObj(); + RSRRupCall upObj = mobj; + if (RSRR.routeQuery(0, null, addr, true, upObj, null) != 0) { + debug().log(Debug.LOG_DEBUG, "MgmtMain: reverse route lookup failed"); + return null; + } + InterfaceNetIO rpf = (InterfaceNetIO)(mobj.outIf); + + return rpf; + } + public static AddressNet getNhop(AddressNet addr) { MgmtMain mobj = mainObj(); RSRRupCall upObj = mobj; Index: OpRUThereRep.java =================================================================== RCS file: /nfs/dart/dartisi/ARP/CVSHOME/Jrsvp/apps/mgmt/OpRUThereRep.java,v retrieving revision 1.18 diff -u -r1.18 OpRUThereRep.java --- OpRUThereRep.java 2000/01/28 22:44:01 1.18 +++ OpRUThereRep.java 2000/03/29 19:35:56 @@ -248,7 +248,7 @@ } if (ll_addr != null) - sb.append("<"+ll_addr.toString()+">"); + sb.append("<"+ll_addr.addr.getHostName(true)+">"); sb.append(" ["); sb.append("UPT: "+Conv.timer2string(uptime.timestamp)); sb.append("] ["); Index: OpTraceRoute.java =================================================================== RCS file: /nfs/dart/dartisi/ARP/CVSHOME/Jrsvp/apps/mgmt/OpTraceRoute.java,v retrieving revision 1.17 diff -u -r1.17 OpTraceRoute.java --- OpTraceRoute.java 2000/01/27 22:40:05 1.17 +++ OpTraceRoute.java 2000/04/12 19:48:02 @@ -64,6 +64,8 @@ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | .................... Operation class name ................... | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | TimeStamp object | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Src Addr object | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Dst Addr object | @@ -73,6 +75,7 @@ * @author Jeff Kann */ public class OpTraceRoute extends MgmtOperation implements MgmtConst { + ObjTimeStamp stamp; ObjAddr dst_addr; private boolean forwarding; @@ -99,6 +102,8 @@ public void writeBytes(DataOutputStream out) throws IOException { writeOperation(out); // write its objects + if (stamp != null) + stamp.writeBytes(out); if (src_addr != null) src_addr.writeBytes(out); dst_addr.writeBytes(out); @@ -124,6 +129,9 @@ /// System.out.println("next_subt = "+next_subt); switch(next_type) { + case OBJ_TIMESTAMP: + stamp = new ObjTimeStamp(msg,offset); + break; case OBJ_ADDR: switch(next_subt) { case ObjAddr.ADDR_SRC: @@ -153,6 +161,8 @@ int execute(InterfaceNetIO inf, AttribRcv atb, boolean sndr) { Debug debug = MgmtMain.debug(); MgmtMain main = MgmtMain.mainObj(); + if (inf == null) + inf = MgmtMain.reverseLookup(src_addr.addr); AddressNet reply_addr = inf.getInfAddress(); inif = inf; forwarding = true; @@ -164,8 +174,9 @@ id = MgmtMain.getRandomInt(); src_addr = new ObjAddr(MgmtMain.localAddr(dst_addr.addr),ObjAddr.ADDR_SRC); reply_addr = src_addr.addr; + stamp = new ObjTimeStamp(); main.registerUser(id, (InterfaceApp)inf); - numObj = 2; + numObj = 3; } if (NetIO.mapAddr2Inf(dst_addr.addr) != null) { @@ -223,6 +234,7 @@ op.create(this.src_addr.addr, reply_addr, nhop); op.id = this.id; + op.stamp = this.stamp; op.execute(inif, null, true); return; } Index: OpTraceRouteRep.java =================================================================== RCS file: /nfs/dart/dartisi/ARP/CVSHOME/Jrsvp/apps/mgmt/OpTraceRouteRep.java,v retrieving revision 1.16 retrieving revision 1.16.2.2 diff -u -r1.16 -r1.16.2.2 --- OpTraceRouteRep.java 2000/01/27 22:18:49 1.16 +++ OpTraceRouteRep.java 2000/04/12 20:13:37 1.16.2.2 @@ -61,6 +61,8 @@ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | .................... Operation class name ................... | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | TimeStamp object | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Src Addr object | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Dst Addr object | @@ -71,6 +73,7 @@ * @author Jeff Kann */ public class OpTraceRouteRep extends MgmtOperation implements MgmtConst { + public ObjTimeStamp stamp; public ObjAddr dst_addr; public ObjAddr nhop; @@ -79,7 +82,7 @@ */ OpTraceRouteRep() { opName = "OpTraceRouteRep"; - numObj = 2; + numObj = 3; } /** @@ -92,7 +95,7 @@ src_addr = new ObjAddr(saddr, ObjAddr.ADDR_SRC); if (naddr != null) { nhop = new ObjAddr(naddr, ObjAddr.ADDR_NHOP); - numObj = 3; + numObj = 4; } } @@ -102,6 +105,7 @@ void writeBytes(DataOutputStream out) throws IOException { writeOperation(out); // write its objects + stamp.writeBytes(out); src_addr.writeBytes(out); dst_addr.writeBytes(out); if (nhop != null) @@ -128,6 +132,9 @@ /// System.out.println("next_subt = "+next_subt); switch(next_type) { + case OBJ_TIMESTAMP: + stamp = new ObjTimeStamp(msg,offset); + break; case OBJ_ADDR: switch(next_subt) { case ObjAddr.ADDR_DST: @@ -174,6 +181,7 @@ // if (inf instanceof InterfaceApp) { // loopback + calInterval(); out_inf = inif; } else { out_inf = new InterfaceWildCard(); @@ -188,6 +196,7 @@ debug.log(Debug.LOG_DEBUG, "UID 0x"+Integer.toHexString(id)+" is not present any more. Drop it."); return length; } + calInterval(); } ByteArrayOutputStream outs = new ByteArrayOutputStream(); @@ -218,9 +227,17 @@ sb.append("HOP: "+str_addr); if (nhop != null) sb.append("] [NHOP: "+nhop.toString()); + sb.append("] ["); + sb.append("RTT: "+stamp.timestamp+" ms"); sb.append("]\n"); return sb.toString(); } protected void reply(AddressNet reply_addr){} + + private void calInterval() { + long nts = System.currentTimeMillis(); + nts -= stamp.timestamp; + stamp = new ObjTimeStamp(nts); + } }