[Sumover-dev] [svn commit] r4224 - vic/branches/cc/rtp

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Fri Jul 25 00:29:07 BST 2008


Author: soohyunc
Date: Fri Jul 25 00:29:06 2008
New Revision: 4224

Modified:
   vic/branches/cc/rtp/transmitter.cpp
   vic/branches/cc/rtp/transmitter.h

Log:
o  start adding congestion control module
   (added a method call in send method in transmitter.cpp)


Modified: vic/branches/cc/rtp/transmitter.cpp
==============================================================================
--- vic/branches/cc/rtp/transmitter.cpp	(original)
+++ vic/branches/cc/rtp/transmitter.cpp	Fri Jul 25 00:29:06 2008
@@ -88,7 +88,8 @@
 	head_(0),
 	tail_(0),
 	loop_layer_(1000),
-	loopback_(0)
+	loopback_(0),
+	is_cc_active_(1)
 {
 	memset((char*)&mh_, 0, sizeof(mh_));
 	mh_.msg_iovlen = 2;
@@ -209,25 +210,28 @@
 
 void Transmitter::send(pktbuf* pb)
 {
-	ccman_->cc_parse_buf(pb);
-	if (!busy_) {
-		double delay = txtime(pb);
-		nextpkttime_ = gettimeofday_secs() + delay;
-		output(pb);
-		/*
-		 * emulate a transmit interrupt --
-		 * assume we will have more to send.
-		 */
-		msched(int(delay * 1e-3));
-		busy_ = 1;
+	if (is_cc_active_) {
+		cc_parse_buf(pb);
 	} else {
-		if (head_ != 0) {
-			tail_->next = pb;
-			tail_ = pb;
-		} else
-			tail_ = head_ = pb;
-		pb->next = 0;
-	}
+		if (!busy_) {
+			double delay = txtime(pb);
+			nextpkttime_ = gettimeofday_secs() + delay;
+			output(pb);
+			/*
+			 * emulate a transmit interrupt --
+			 * assume we will have more to send.
+			 */
+			msched(int(delay * 1e-3));
+			busy_ = 1;
+		} else {
+			if (head_ != 0) {
+				tail_->next = pb;
+				tail_ = pb;
+			} else
+				tail_ = head_ = pb;
+			pb->next = 0;
+		}
+	} // if (is_cc_active_)
 }
 
 void Transmitter::timeout()

Modified: vic/branches/cc/rtp/transmitter.h
==============================================================================
--- vic/branches/cc/rtp/transmitter.h	(original)
+++ vic/branches/cc/rtp/transmitter.h	Fri Jul 25 00:29:06 2008
@@ -122,6 +122,9 @@
 	static buffer* freebufs_;
 	static int nbufs_;
 	static int nhdrs_;
+
+	/* Cc related variables */
+	bool is_cc_active_;		/* is Cc module activated?		*/
 };
 
 #endif



More information about the Sumover-dev mailing list