#include <diffapp.hh>
Inheritance diagram for DiffApp:


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_ |
| NR * | dr_ |
|
||||||||||||
|
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: ![]() |
|
|
|
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: ![]() |
|
|
Definition at line 79 of file diffapp.hh. Referenced by GearSenderApp::parseCommandLine(), GearReceiverApp::parseCommandLine(), and parseCommandLine(). |
|
|
1.4.6