diff_rate.cc File Reference

#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <signal.h>
#include <float.h>
#include <tcl.h>
#include <stdlib.h>
#include "diff_header.h"
#include "agent.h"
#include "tclcl.h"
#include "ip.h"
#include "config.h"
#include "packet.h"
#include "trace.h"
#include "random.h"
#include "classifier.h"
#include "node.h"
#include "diffusion.h"
#include "iflist.h"
#include "hash_table.h"
#include "arp.h"
#include "mac.h"
#include "ll.h"
#include "dsr/path.h"
#include "god.h"
#include "routing_table.h"
#include "diff_rate.h"

Include dependency graph for diff_rate.cc:

Go to the source code of this file.

Data Structures

class  DiffusionRateClass

Functions

neg_mxt ParseNegMaxType (const char *str)
neg_tht ParseNegThrType (const char *str)
neg_wint ParseNegWinType (const char *str)
org_t ParseOrgType (const char *str)
pos_ndt ParsePosNodeType (const char *str)
pos_t ParsePosType (const char *str)
sub_t ParseSubType (const char *str)

Variables

DiffusionRateClass class_diffusion_rate
char * MsgStr []


Function Documentation

neg_mxt ParseNegMaxType const char *  str  ) 
 

Definition at line 1161 of file diff_rate.cc.

References NEG_FIXED_MAX, and NEG_SCALE_MAX.

Referenced by DiffusionRate::command().

01162 {
01163   if (strcasecmp(str, "FIXED") == 0) {
01164     return NEG_FIXED_MAX;
01165   }
01166 
01167   if (strcasecmp(str, "SCALE") == 0) {
01168     return NEG_SCALE_MAX;
01169   }
01170 
01171   fprintf(stderr,"ParseNegMaxType Error -- Only FIXED or SCALE\n");
01172   exit(-1);
01173 }

neg_tht ParseNegThrType const char *  str  ) 
 

Definition at line 1146 of file diff_rate.cc.

References NEG_ABSOLUTE, and NEG_RELATIVE.

Referenced by DiffusionRate::command().

01147 {
01148   if (strcasecmp(str, "ABSOLUTE") == 0) {
01149     return NEG_ABSOLUTE;
01150   }
01151 
01152   if (strcasecmp(str, "RELATIVE") == 0) {
01153     return NEG_RELATIVE;
01154   }
01155 
01156   fprintf(stderr,"ParseNegThrType Error -- Only ABSOLUTE or RELATIVE\n");
01157   exit(-1);
01158 }

neg_wint ParseNegWinType const char *  str  ) 
 

Definition at line 1131 of file diff_rate.cc.

References NEG_COUNTER, and NEG_TIMER.

Referenced by DiffusionRate::command().

01132 {
01133   if (strcasecmp(str, "COUNTER") == 0) {
01134     return NEG_COUNTER;
01135   }
01136 
01137   if (strcasecmp(str, "TIMER") == 0) {
01138     return NEG_TIMER;
01139   }
01140 
01141   fprintf(stderr,"ParseNegWinType Error -- Only COUNTER or TIMER\n");
01142   exit(-1);
01143 }

org_t ParseOrgType const char *  str  ) 
 

Definition at line 1082 of file diff_rate.cc.

References BCAST_ORG, and UNICAST_ORG.

Referenced by DiffusionRate::command().

01083 {
01084   if (strcasecmp(str, "BROADCAST") == 0) {
01085     return BCAST_ORG;
01086   }
01087 
01088   if (strcasecmp(str, "UNICAST") == 0) {
01089     return UNICAST_ORG;
01090   }
01091 
01092   fprintf(stderr,"ParseOrgType Error -- Only BROADCAST or UNICAST\n");
01093   exit(-1);
01094 }

pos_ndt ParsePosNodeType const char *  str  ) 
 

Definition at line 1116 of file diff_rate.cc.

References END_POS, and INTM_POS.

Referenced by DiffusionRate::command().

01117 {
01118   if (strcasecmp(str, "END") == 0) {
01119     return END_POS;
01120   }
01121 
01122   if (strcasecmp(str, "INTM") == 0) {
01123     return INTM_POS;
01124   }
01125 
01126   fprintf(stderr,"ParsePosNodeType Error -- Only END or INTM\n");
01127   exit(-1);
01128 }

pos_t ParsePosType const char *  str  ) 
 

Definition at line 1097 of file diff_rate.cc.

References POS_ALL, POS_HASH, and POS_LAST.

Referenced by DiffusionRate::command().

01098 {
01099   if (strcasecmp(str, "HASH") == 0) {
01100     return POS_HASH;
01101   }
01102 
01103   if (strcasecmp(str, "LAST") == 0) {
01104     return POS_LAST;
01105   }
01106 
01107   if (strcasecmp(str, "ALL") == 0) {
01108     return POS_ALL;
01109   }
01110 
01111   fprintf(stderr,"ParsePosType Error -- Only HASH, LAST, or ALL\n");
01112   exit(-1);
01113 }

sub_t ParseSubType const char *  str  ) 
 

Definition at line 1066 of file diff_rate.cc.

References BCAST_SUB, and UNICAST_SUB.

Referenced by DiffusionRate::command().

01067 {
01068   if (strcasecmp(str, "BROADCAST") == 0) {
01069     return BCAST_SUB;
01070   }
01071 
01072   if (strcasecmp(str, "UNICAST") == 0) {
01073     return UNICAST_SUB;
01074   }
01075 
01076   fprintf(stderr,"ParseSubType Error -- Only BROADCAST or UNICAST\n");
01077   exit(-1);
01078 }


Variable Documentation

DiffusionRateClass class_diffusion_rate [static]
 

char* MsgStr[]
 

Definition at line 84 of file diffusion.cc.

Referenced by DiffusionRate::BcastNeg(), DiffusionRate::FwdOriginal(), DiffusionRate::FwdSubsample(), DiffusionRate::InterestHandle(), DiffusionRate::PosReinf(), DiffusionRate::ProcessPosReinf(), DiffusionRate::recv(), DiffusionProb::recv(), and DiffusionRate::UcastNeg().


Generated on Tue Mar 6 16:51:57 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6