00001 00002 /* 00003 * routing_table.h 00004 * Copyright (C) 2000 by the University of Southern California 00005 * $Id: routing_table.h,v 1.5 2005/08/25 18:58:04 johnh Exp $ 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License, 00009 * version 2, as published by the Free Software Foundation. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program; if not, write to the Free Software Foundation, Inc., 00018 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 00019 * 00020 * 00021 * The copyright of this module includes the following 00022 * linking-with-specific-other-licenses addition: 00023 * 00024 * In addition, as a special exception, the copyright holders of 00025 * this module give you permission to combine (via static or 00026 * dynamic linking) this module with free software programs or 00027 * libraries that are released under the GNU LGPL and with code 00028 * included in the standard release of ns-2 under the Apache 2.0 00029 * license or under otherwise-compatible licenses with advertising 00030 * requirements (or modified versions of such code, with unchanged 00031 * license). You may copy and distribute such a system following the 00032 * terms of the GNU GPL for this module and the licenses of the 00033 * other code concerned, provided that you include the source code of 00034 * that other code when and as the GNU GPL requires distribution of 00035 * source code. 00036 * 00037 * Note that people who make modified versions of this module 00038 * are not obligated to grant this special exception for their 00039 * modified versions; it is their choice whether to do so. The GNU 00040 * General Public License gives permission to release a modified 00041 * version without this exception; this exception also makes it 00042 * possible to release a modified version which carries forward this 00043 * exception. 00044 * 00045 */ 00046 00047 /********************************************************************/ 00048 /* routing_table.h : Chalermek Intanagonwiwat (USC/ISI) 08/16/99 */ 00049 /********************************************************************/ 00050 00051 // Important Note: Work still in progress ! 00052 00053 #ifndef ns_routing_table_h 00054 #define ns_routing_table_h 00055 00056 #include <assert.h> 00057 #include <math.h> 00058 #include <stdio.h> 00059 #include <signal.h> 00060 #include <float.h> 00061 00062 #include <tcl.h> 00063 #include <stdlib.h> 00064 00065 #include "diff_header.h" 00066 #include "agent.h" 00067 #include "tclcl.h" 00068 #include "ip.h" 00069 #include "config.h" 00070 #include "packet.h" 00071 #include "trace.h" 00072 #include "random.h" 00073 #include "classifier.h" 00074 #include "node.h" 00075 #include "iflist.h" 00076 #include "hash_table.h" 00077 #include "arp.h" 00078 #include "mac.h" 00079 #include "ll.h" 00080 #include "dsr/path.h" 00081 00082 00083 // Routing Entry 00084 00085 class Diff_Routing_Entry { 00086 public: 00087 int counter; 00088 int num_active; 00089 int num_iif; 00090 Out_List *active; // active and up oif 00091 Out_List *inactive; // inactive and down oif 00092 In_List *iif; // active and up iif 00093 In_List *down_iif; // inactive and down iif 00094 Agent_List *source; 00095 Agent_List *sink; 00096 00097 double last_fwd_time; // the last time forwarding interest 00098 // For Diffusion/RateGradient 00099 int new_org_counter; // Across all incoming gradients. 00100 00101 Diff_Routing_Entry(); 00102 00103 void reset(); 00104 void clear_outlist(Out_List *); 00105 void clear_inlist(In_List *); 00106 void clear_agentlist(Agent_List *); 00107 int MostRecvOrg(); 00108 bool ExistOriginalGradient(); 00109 00110 void IncRecvCnt(ns_addr_t); 00111 00112 void CntPosSend(ns_addr_t); 00113 void CntNeg(ns_addr_t); 00114 void CntNewSub(ns_addr_t); 00115 void ClrNewSub(ns_addr_t); 00116 void CntNewOrg(ns_addr_t); 00117 void CntOldOrg(ns_addr_t); 00118 void ClrAllNewOrg(); 00119 void ClrAllOldOrg(); 00120 00121 In_List *MostRecentIn(); 00122 In_List *AddInList(ns_addr_t); 00123 }; 00124 00125 #endif 00126