DiffApp Class Reference

#include <diffapp.hh>

Inheritance diagram for DiffApp:

GearReceiverApp GearSenderApp GeoRoutingFilter GradientFilter LogFilter OnePhasePullFilter OPPPingReceiverApp OPPPingSenderApp PushReceiverApp PushSenderApp RmstFilter RmstSink RmstSource SrcRtFilter TagFilter TPPPingReceiverApp TPPPingSenderApp Collaboration diagram for DiffApp:

Collaboration graph
[legend]

Detailed Description

Definition at line 69 of file diffapp.hh.

Public Member Functions

virtual void run ()=0

Protected Member Functions

void parseCommandLine (int argc, char **argv)
void usage (char *s)

Protected Attributes

char * config_file_
u_int16_t diffusion_port_
NRdr_


Member Function Documentation

void DiffApp::parseCommandLine int  argc,
char **  argv
[protected]
 

Reimplemented in GearReceiverApp, and GearSenderApp.

Definition at line 76 of file diffapp.cc.

References config_file_, DEBUG_ALWAYS, DEFAULT_DIFFUSION_PORT, DiffPrint(), diffusion_port_, global_debug_level, optarg, and usage().

Referenced by GeoRoutingFilter::GeoRoutingFilter(), GradientFilter::GradientFilter(), OnePhasePullFilter::OnePhasePullFilter(), RmstFilter::RmstFilter(), RmstSink::RmstSink(), and SrcRtFilter::SrcRtFilter().

00077 {
00078   u_int16_t diff_port = DEFAULT_DIFFUSION_PORT;
00079   int debug_level;
00080   int opt;
00081 
00082   config_file_ = NULL;
00083   opterr = 0;
00084 
00085   while (1){
00086     opt = getopt(argc, argv, "f:hd:p:");
00087     switch (opt){
00088 
00089     case 'p':
00090 
00091       diff_port = (u_int16_t) atoi(optarg);
00092       if ((diff_port < 1024) || (diff_port >= 65535)){
00093     DiffPrint(DEBUG_ALWAYS, "Error: Diffusion port must be between 1024 and 65535 !\n");
00094     exit(-1);
00095       }
00096 
00097       break;
00098 
00099     case 'h':
00100 
00101       usage(argv[0]);
00102 
00103       break;
00104 
00105     case 'd':
00106 
00107       debug_level = atoi(optarg);
00108 
00109       if (debug_level < 1 || debug_level > 10){
00110     DiffPrint(DEBUG_ALWAYS, "Error: Debug level outside range or missing !\n");
00111     usage(argv[0]);
00112       }
00113 
00114       global_debug_level = debug_level;
00115 
00116       break;
00117 
00118     case 'f':
00119 
00120       if (!strncasecmp(optarg, "-", 1)){
00121     DiffPrint(DEBUG_ALWAYS, "Error: Parameter missing !\n");
00122     usage(argv[0]);
00123       }
00124 
00125       config_file_ = strdup(optarg);
00126 
00127       break;
00128 
00129     case '?':
00130 
00131       DiffPrint(DEBUG_ALWAYS,
00132         "Error: %c isn't a valid option or its parameter is missing !\n", optopt);
00133       usage(argv[0]);
00134 
00135       break;
00136 
00137     case ':':
00138 
00139       DiffPrint(DEBUG_ALWAYS, "Parameter missing !\n");
00140       usage(argv[0]);
00141 
00142       break;
00143 
00144     }
00145 
00146     if (opt == -1)
00147       break;
00148   }
00149 
00150   diffusion_port_ = diff_port;
00151 }

Here is the call graph for this function:

virtual void DiffApp::run  )  [pure virtual]
 

Implemented in GearReceiverApp, GearSenderApp, OPPPingReceiverApp, OPPPingSenderApp, TPPPingReceiverApp, TPPPingSenderApp, PushReceiverApp, PushSenderApp, RmstSink, RmstSource, OnePhasePullFilter, GradientFilter, GeoRoutingFilter, LogFilter, SrcRtFilter, TagFilter, and RmstFilter.

void DiffApp::usage char *  s  )  [protected]
 

Reimplemented in GearReceiverApp, and GearSenderApp.

Definition at line 66 of file diffapp.cc.

References DEBUG_ALWAYS, and DiffPrint().

Referenced by parseCommandLine().

00066                           {
00067   DiffPrint(DEBUG_ALWAYS, "Usage: %s [-d debug] [-p port] [-f file] [-h]\n\n", s);
00068   DiffPrint(DEBUG_ALWAYS, "\t-d - Sets debug level (0-10)\n");
00069   DiffPrint(DEBUG_ALWAYS, "\t-p - Uses port 'port' to talk to diffusion\n");
00070   DiffPrint(DEBUG_ALWAYS, "\t-f - Specifies a config file\n");
00071   DiffPrint(DEBUG_ALWAYS, "\t-h - Prints this information\n");
00072   DiffPrint(DEBUG_ALWAYS, "\n");
00073   exit(0);
00074 }

Here is the call graph for this function:


Field Documentation

char* DiffApp::config_file_ [protected]
 

Definition at line 79 of file diffapp.hh.

Referenced by GearSenderApp::parseCommandLine(), GearReceiverApp::parseCommandLine(), and parseCommandLine().

u_int16_t DiffApp::diffusion_port_ [protected]
 

Definition at line 78 of file diffapp.hh.

Referenced by GeoRoutingFilter::GeoRoutingFilter(), GradientFilter::GradientFilter(), OnePhasePullFilter::OnePhasePullFilter(), GearSenderApp::parseCommandLine(), GearReceiverApp::parseCommandLine(), parseCommandLine(), RmstFilter::RmstFilter(), RmstSink::RmstSink(), and SrcRtFilter::SrcRtFilter().

NR* DiffApp::dr_ [protected]
 

Definition at line 77 of file diffapp.hh.

Referenced by GeoRoutingFilter::beaconTimeout(), GeoRoutingFilter::broadcastHeuristicValue(), RmstFilter::cleanUpRmst(), GradientFilter::forwardData(), OnePhasePullFilter::forwardData(), GradientFilter::forwardExploratoryData(), GradientFilter::forwardPushExploratoryData(), GeoRoutingFilter::GeoRoutingFilter(), RmstSource::getDr(), RmstSink::getDr(), GeoRoutingFilter::getNodeLocation(), GradientFilter::GradientFilter(), OnePhasePullFilter::gradientTimeout(), GradientFilter::interestTimeout(), OnePhasePullFilter::interestTimeout(), GradientFilter::messageTimeout(), OnePhasePullFilter::messageTimeout(), GeoRoutingFilter::messageTimeout(), OnePhasePullFilter::OnePhasePullFilter(), GeoRoutingFilter::postProcessFilter(), GeoRoutingFilter::preProcessFilter(), RmstFilter::processExpReq(), SrcRtFilter::ProcessMessage(), GradientFilter::processNewMessage(), OnePhasePullFilter::processNewMessage(), GradientFilter::processOldMessage(), OnePhasePullFilter::processOldMessage(), RmstFilter::processTimer(), TagFilter::recv(), SrcRtFilter::recv(), RmstFilter::recv(), PushReceiverApp::recv(), LogFilter::recv(), GearReceiverApp::recv(), TPPPingReceiverApp::recv(), OPPPingReceiverApp::recv(), GradientFilter::reinforcementTimeout(), OnePhasePullFilter::reinforcementTimeout(), RmstFilter::RmstFilter(), RmstSink::RmstSink(), RmstFilter::run(), PushSenderApp::run(), GearSenderApp::run(), GeoRoutingFilter::run(), TPPPingSenderApp::run(), OPPPingSenderApp::run(), RmstFilter::sendAckToSource(), RmstSource::sendBlob(), RmstFilter::sendContToSource(), RmstFilter::sendExpReqUpstream(), GradientFilter::sendInterest(), OnePhasePullFilter::sendInterest(), GeoRoutingFilter::sendNeighborRequest(), GradientFilter::sendPositiveReinforcement(), RmstFilter::sendRmstToSink(), GradientFilter::setupFilter(), TagFilter::setupFilter(), SrcRtFilter::setupFilter(), RmstFilter::setupFilter(), OnePhasePullFilter::setupFilter(), LogFilter::setupFilter(), RmstSink::setupInterest(), GeoRoutingFilter::setupPostFilter(), GeoRoutingFilter::setupPreFilter(), PushSenderApp::setupPublication(), GearSenderApp::setupPublication(), TPPPingSenderApp::setupPublication(), OPPPingSenderApp::setupPublication(), RmstSource::setupRmstInterest(), RmstSource::setupRmstPublication(), PushReceiverApp::setupSubscription(), GearSenderApp::setupSubscription(), GearReceiverApp::setupSubscription(), TPPPingSenderApp::setupSubscription(), TPPPingReceiverApp::setupSubscription(), OPPPingSenderApp::setupSubscription(), OPPPingReceiverApp::setupSubscription(), and SrcRtFilter::SrcRtFilter().


The documentation for this class was generated from the following files:
Generated on Tue Mar 6 17:05:34 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6