  
  #endif /* ns_simulator_h */
 --- dist-ns-allinone-2.26/ns-2.26/common/tclAppInit.cc	Wed Feb 26 15:07:42 2003
-+++ ns-allinone-2.26/ns-2.26/common/tclAppInit.cc	Fri Mar 12 10:35:19 2004
++++ ns-allinone-2.26/ns-2.26/common/tclAppInit.cc	Fri Nov 28 16:55:25 2003
 @@ -186,6 +186,7 @@
  	return TCL_OK;
  }

 	// ports are stored in a seperate variable.
 	hdr_ip* iph = hdr_ip::access(p);
+#ifdef STORE_PKTS
+	int newentry = 0;
+	Tcl_HashEntry *he = Tcl_CreateHashEntry( &pktsonport,
+						 (char *)(iph->dport()),
+						 &newentry );
+
+	pkt_dump *dump = 0;
+	if( newentry == 0 ) {
+	    dump = (pkt_dump *)Tcl_GetHashValue(he);
+	} else {
+	    dump = new pkt_dump;
+	    Tcl_SetHashValue( he, (char *)dump );
+	}
+	if ( dump->num_pkts < NUM_PKTS ) {
+	    hdr_cmn *hc = HDR_CMN(p);
+	    dump->pkts[dump->num_pkts].size = hc->size();
+	    dump->pkts[dump->num_pkts].ts = packet_ts; 
+	    dump->pkts[dump->num_pkts].clock = Scheduler::instance().clock(); 
+	    dump->num_pkts += 1;
+	}
+#endif
 	return iph->dport();
 };

+
+#endif
--- dist-ns-allinone-2.26/ns-2.26/common/timer-handler.h	Wed Feb 26 15:07:42 2003
+++ ns-allinone-2.26/ns-2.26/common/timer-handler.h	Fri Nov 28 16:55:25 2003
@@ -88,4 +88,15 @@
 // mode:c++
 // End:
