[Sumover-dev] [svn commit] r4382 - in vic/branches/cc: rtp

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Tue Feb 10 16:47:14 GMT 2009


Author: soohyunc
Date: Tue Feb 10 16:47:13 2009
New Revision: 4382

Modified:
   vic/branches/cc/cc/tfwc_rcvr.h
   vic/branches/cc/rtp/session.cpp

Log:
Completed AckVec cloning from TfwcRcvr to SessionManager class.

(This is necessary because we need to copy AckVec array from TFWC receiver to Vic
application when we send AckVec to sender using XR's send_xreport() method.)


Modified: vic/branches/cc/cc/tfwc_rcvr.h
==============================================================================
--- vic/branches/cc/cc/tfwc_rcvr.h	(original)
+++ vic/branches/cc/cc/tfwc_rcvr.h	Tue Feb 10 16:47:13 2009
@@ -45,8 +45,8 @@
 			u_int16_t ackofack, u_int32_t ts);
 
 protected:
-	// AckVec pointer
-	inline u_int16_t * tfwc_rcvr_getvec_p() { return tfwcAV; }
+	// AckVec clone
+	inline u_int16_t tfwc_rcvr_getvec(int i) { return tfwcAV[i]; }
 	// ts echo
 	inline u_int32_t tfwc_rcvr_ts_echo() { return ts_echo_; }
 

Modified: vic/branches/cc/rtp/session.cpp
==============================================================================
--- vic/branches/cc/rtp/session.cpp	(original)
+++ vic/branches/cc/rtp/session.cpp	Tue Feb 10 16:47:13 2009
@@ -733,8 +733,27 @@
 			ent[1] <<= 16;
 			ent[1] |= htons(tfwc_rcvr_ends());
 
-			// get AckVec pointer from TfwcRcvr
-			//xr->chunk = htons(tfwc_rcvr_getvec_p());
+			// clone AckVec from TfwcRcvr
+			for (int i = 1; i <= num_chunks; i++) {
+				bool odd = true;
+				int j = i/2 + 1;
+
+				if (i%2 == 0) {
+					odd = false;
+					j -= 1;
+				}
+
+				// clone AckVec array to chunk entry
+				if(odd) {
+					// odd number chunk
+					ent[j+1] = 0;	// initialize
+					ent[j+1] |= htons(tfwc_rcvr_getvec(i-1));
+				} else {
+					// even number chunk
+					ent[j+1] <<= 16; // left-shift first
+					ent[j+1] |= htons(tfwc_rcvr_getvec(i-1));
+				}
+			}
 		}
 	} // end of if (am_i_sender())
 



More information about the Sumover-dev mailing list