• Main Page
  • Classes
  • Files
  • File List

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

00001 /*
00002  * Copyright (c) 2000-2002, by the Rector and Board of Visitors of the 
00003  * University of Virginia.
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, 
00007  * with or without modification, are permitted provided 
00008  * that the following conditions are met:
00009  *
00010  * Redistributions of source code must retain the above 
00011  * copyright notice, this list of conditions and the following 
00012  * disclaimer. 
00013  *
00014  * Redistributions in binary form must reproduce the above 
00015  * copyright notice, this list of conditions and the following 
00016  * disclaimer in the documentation and/or other materials provided 
00017  * with the distribution. 
00018  *
00019  * Neither the name of the University of Virginia nor the names 
00020  * of its contributors may be used to endorse or promote products 
00021  * derived from this software without specific prior written 
00022  * permission. 
00023  *
00024  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
00025  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
00026  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
00027  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
00028  * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE 
00029  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 
00030  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
00031  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
00032  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
00033  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
00034  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
00035  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
00036  * THE POSSIBILITY OF SUCH DAMAGE.
00037  */
00038 /*
00039  *                                                                     
00040  * Marker module for JoBS (and WTP).
00041  *                                                                     
00042  * Authors: Constantinos Dovrolis <dovrolis@mail.eecis.udel.edu>, 
00043  *          Nicolas Christin <nicolas@cs.virginia.edu>, 2000-2002       
00044  *                                                                    
00045  * $Id: demarker.h,v 1.1 2003/02/02 22:18:22 xuanc Exp $
00046  */
00047 
00048 #ifndef DEMARKER_H
00049 #define DEMARKER_H
00050 
00051 #define START_STATISTICS 0.0    // When do we start writing the delays? (sec)
00052 #define NO_CLASSES      4       // This number cannot be changed 
00053                                 // w/o modifying the code. 
00054                                 // This is, again, a prototype 
00055                                 // implementation...
00056 #define VERBOSE 1               // Write e2e delay of packet in trace file 
00057                                 // (per class)
00058 #define QUIET   2               // Do not do anything basically
00059 
00060 
00061 class Demarker: public Queue {
00062 public:
00063         Demarker();
00064         virtual int command(int argc, const char*const* argv); 
00065         void    enque(Packet*);
00066         Packet* deque();
00067         double  demarker_arrvs_[NO_CLASSES+1];
00068 protected:
00069         int     demarker_type_;         // Demarker Type
00070         PacketQueue     *q_;            // Underlying FIFO queue 
00071         FILE*   delay_tr_[NO_CLASSES+1];// Delay trace per class
00072         char*   file_name_;             // Trace filename
00073 private:
00074         int link_id_;
00075         double arrived_Bits_[NO_CLASSES+1];
00076         double monitoring_window_;
00077         double last_monitor_update_;
00078 };
00079 
00080 #endif /* DEMARKER_H */

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