• Main Page
  • Classes
  • Files
  • File List

/Users/yzchen/ns/ns-allinone-2.33/ns-2.33/queue/gk.h

00001 
00002 /* -*-  Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */
00003 /*
00004  * Copyright (c) 1994 Regents of the University of California.
00005  * All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  * 1. Redistributions of source code must retain the above copyright
00011  *    notice, this list of conditions and the following disclaimer.
00012  * 2. Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  * 3. All advertising materials mentioning features or use of this software
00016  *    must display the following acknowledgement:
00017  *  This product includes software developed by the Computer Systems
00018  *  Engineering Group at Lawrence Berkeley Laboratory.
00019  * 4. Neither the name of the University nor of the Laboratory may be used
00020  *    to endorse or promote products derived from this software without
00021  *    specific prior written permission.
00022  *
00023  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00024  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00026  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00027  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00028  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00029  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00030  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00031  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00032  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00033  * SUCH DAMAGE.
00034  *
00035  */
00036  
00037 #ifndef ns_gk_h
00038 #define ns_gk_h
00039  
00040 #include <string.h>
00041 #include "queue.h"
00042 
00043 class LinkDelay; 
00044 
00045 class GK : public Queue {
00046  public:
00047         GK(const char *);
00048  protected:
00049   int command(int argc, const char*const* argv);
00050   void enque(Packet*);
00051   Packet* deque();
00052   void deque_vq();    /* Deques from the virtual queue_ */
00053         LinkDelay* link_; /* outgoing link */
00054   PacketQueue *q_;    /* underlying FIFO queue */
00055   int drop_front_;    /* drop-from-front (rather than from tail) */
00056   double ecnlim_;     /* Factor by which capacity and buffer is acled down*/
00057   double vq_len;      /* Virtual Queue length */
00058   double c_;          /* Capacity of the link */
00059   int mark_flag;      /* Indicates that all outgoing packets shd be marked */
00060   double prev_time;
00061   double curr_time;
00062         int mean_pktsize_;
00063         TracedInt curq_;        /* current qlen seen by arrivals */
00064 
00065         // added to be able to trace EDrop Objects
00066         // the other events - forced drop, enque and deque are traced by a 
00067         // different mechanism.
00068         NsObject * EDTrace;    //early drop trace
00069         char traceType[20];    /* the preferred type for early drop trace. 
00070                                                                                                                 better be less than 19 chars long */
00071         Tcl_Channel tchan_;     /* place to write trace records */
00072         void trace(TracedVar*); /* routine to write trace records */
00073 };
00074 
00075 #endif

Generated on Tue Aug 10 2010 16:16:08 for ns-2.33 by  doxygen 1.7.1