Changeset 2426
- Timestamp:
- 03/17/10 03:42:49 (5 months ago)
- Location:
- branches/3.4/src
- Files:
-
- 4 edited
-
tcpbridge_opts.def (modified) (14 diffs)
-
tcpprep_opts.def (modified) (23 diffs)
-
tcpreplay_opts.def (modified) (4 diffs)
-
tcprewrite_opts.def (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.4/src/tcpbridge_opts.def
r2129 r2426 3 3 4 4 copyright = { 5 date = "200 5-2008";5 date = "2000-2010"; 6 6 owner = "Aaron Turner"; 7 7 type = "bsd"; 8 8 author = <<- EOText 9 Copyright 2000-20 08Aaron Turner9 Copyright 2000-2010 Aaron Turner 10 10 11 11 For support please use the tcpreplay-users@lists.sourceforge.net mailing list. … … 30 30 "#include \"common.h\"\n" 31 31 "#include \"config.h\"\n" 32 "#include <stdlib.h>\n"33 "#include <string.h>\n"34 "#include <sys/types.h>\n"35 "#include <unistd.h>\n"32 "#include <stdlib.h>\n" 33 "#include <string.h>\n" 34 "#include <sys/types.h>\n" 35 "#include <unistd.h>\n" 36 36 "extern tcpbridge_opt_t options;\n"; 37 37 … … 128 128 129 129 flag = { 130 name= unidir;131 value= u;132 max= 1;133 descrip= "Send and receive in only one direction";134 doc= <<- EOText130 name = unidir; 131 value = u; 132 max = 1; 133 descrip = "Send and receive in only one direction"; 134 doc = <<- EOText 135 135 Normally, tcpbridge will send and receive traffic in both directions 136 136 (bi-directionally). However, if you choose this option, traffic will … … 140 140 141 141 flag = { 142 ifdef= ENABLE_PCAP_FINDALLDEVS;143 name= listnics;144 descrip= "List available network interfaces and exit";145 immediate;146 doc= "";147 flag-code= <<- EOFlag148 149 interface_list_t *list = get_interface_list();150 list_interfaces(list);151 free(list);152 exit(0);153 142 ifdef = ENABLE_PCAP_FINDALLDEVS; 143 name = listnics; 144 descrip = "List available network interfaces and exit"; 145 immediate; 146 doc = ""; 147 flag-code = <<- EOFlag 148 149 interface_list_t *list = get_interface_list(); 150 list_interfaces(list); 151 free(list); 152 exit(0); 153 154 154 EOFlag; 155 155 }; … … 161 161 162 162 flag = { 163 name= limit;164 value= L;165 arg-type= number;166 max= 1;167 arg-default= -1;168 arg-range= "1->";169 descrip= "Limit the number of packets to send";170 doc= <<- EOText163 name = limit; 164 value = L; 165 arg-type = number; 166 max = 1; 167 arg-default = -1; 168 arg-range = "1->"; 169 descrip = "Limit the number of packets to send"; 170 doc = <<- EOText 171 171 By default, tcpbridge will send packets forever or until Ctrl-C. Alternatively, 172 172 you can specify a maximum number of packets to send. … … 203 203 flags-cant = exclude; 204 204 flag-code = <<- EOInclude 205 205 206 206 char *include; 207 207 208 208 include = safe_strdup(OPT_ARG(INCLUDE)); 209 209 options.xX.mode = xX_MODE_INCLUDE; 210 210 211 211 if ((options.xX.mode = parse_xX_str(&options.xX, include, &options.bpf)) == xXError) 212 212 errx(-1, "Unable to parse include/exclude rule: %s", OPT_ARG(INCLUDE)); 213 213 214 214 free(include); 215 215 216 216 EOInclude; 217 217 doc = <<- EOText … … 220 220 221 221 @table @bullet 222 @item S:<CIDR1>,... 222 @item S:<CIDR1>,... 223 223 - Source IP must match specified CIDR(s) 224 @item D:<CIDR1>,... 224 @item D:<CIDR1>,... 225 225 - Destination IP must match specified CIDR(s) 226 @item B:<CIDR1>,... 226 @item B:<CIDR1>,... 227 227 - Both source and destination IP must match specified CIDR(s) 228 @item E:<CIDR1>,... 228 @item E:<CIDR1>,... 229 229 - Either IP must match specified CIDR(s) 230 @item P:<LIST> 230 @item P:<LIST> 231 231 - Must be one of the listed packets where the list 232 232 corresponds to the packet number in the capture file. … … 250 250 flags-cant = include; 251 251 flag-code = <<- EOExclude 252 252 253 253 char *exclude; 254 254 255 255 exclude = safe_strdup(OPT_ARG(EXCLUDE)); 256 256 options.xX.mode = xX_MODE_EXCLUDE; 257 257 258 258 if ((options.xX.mode = parse_xX_str(&options.xX, exclude, &options.bpf)) == xXError) 259 259 errx(-1, "Unable to parse include/exclude rule: %s", OPT_ARG(EXCLUDE)); 260 260 261 261 free(exclude); 262 262 263 263 EOExclude; 264 264 doc = <<- EOText … … 267 267 268 268 @table @bullet 269 @item S:<CIDR1>,... 269 @item S:<CIDR1>,... 270 270 - Source IP must not match specified CIDR(s) 271 @item D:<CIDR1>,... 271 @item D:<CIDR1>,... 272 272 - Destination IP must not match specified CIDR(s) 273 @item B:<CIDR1>,... 273 @item B:<CIDR1>,... 274 274 - Both source and destination IP must not match specified CIDR(s) 275 @item E:<CIDR1>,... 275 @item E:<CIDR1>,... 276 276 - Either IP must not match specified CIDR(s) 277 @item P:<LIST> 277 @item P:<LIST> 278 278 - Must not be one of the listed packets where the list 279 279 corresponds to the packet number in the capture file. … … 292 292 descrip = "Print the PID of tcpbridge at startup"; 293 293 flag-code = <<- EOPid 294 294 295 295 fprintf(stderr, "PID: %hu\n", getpid()); 296 296 297 297 EOPid; 298 298 doc = ""; … … 337 337 descrip = "Print version information"; 338 338 flag-code = <<- EOVersion 339 339 340 340 fprintf(stderr, "tcpbridge version: %s (build %s)", VERSION, svn_version()); 341 341 #ifdef DEBUG … … 343 343 #endif 344 344 fprintf(stderr, "\n"); 345 fprintf(stderr, "Copyright 200 1-2009by Aaron Turner <aturner at synfin dot net>\n");345 fprintf(stderr, "Copyright 2000-2010 by Aaron Turner <aturner at synfin dot net>\n"); 346 346 #ifdef HAVE_LIBDNET 347 347 fprintf(stderr, "Compiled against libdnet: %s\n", LIBDNET_VERSION); 348 348 #else 349 fprintf(stderr, "Not compiled with libdnet.\n");349 fprintf(stderr, "Not compiled with libdnet.\n"); 350 350 #endif 351 351 #ifdef HAVE_WINPCAP … … 365 365 #endif 366 366 fprintf(stderr, "Injection method: %s\n", sendpacket_get_method()); 367 367 368 368 exit(0); 369 369 370 370 EOVersion; 371 371 doc = ""; … … 378 378 descrip = "Display less usage information and exit"; 379 379 flag-code = <<- EOHelp 380 380 381 381 USAGE(EXIT_FAILURE); 382 382 -
branches/3.4/src/tcpprep_opts.def
r2318 r2426 2 2 3 3 copyright = { 4 date = "2000-20 08";4 date = "2000-2010"; 5 5 owner = "Aaron Turner"; 6 6 type = "bsd"; 7 7 author = <<- EOText 8 Copyright 2000-20 08Aaron Turner8 Copyright 2000-2010 Aaron Turner 9 9 10 10 For support please use the tcpreplay-users@lists.sourceforge.net mailing list. … … 29 29 "#include \"config.h\"\n" 30 30 "#include \"tcpprep.h\"\n" 31 "#include <stdlib.h>\n"32 "#include <string.h>\n"31 "#include <stdlib.h>\n" 32 "#include <string.h>\n" 33 33 "extern tcpprep_opt_t options;\n"; 34 34 … … 85 85 flags-cant = port; 86 86 flags-cant = regex; 87 flags-cant= mac;87 flags-cant = mac; 88 88 flag-code = <<- EOAuto 89 89 90 90 options.mode = AUTO_MODE; 91 91 if (strcmp(OPT_ARG(AUTO), "bridge") == 0) { … … 157 157 flags-cant = port; 158 158 flags-cant = regex; 159 flags-cant= mac;159 flags-cant = mac; 160 160 flag-code = <<- EOCidr 161 161 162 162 char *cidr = safe_strdup(OPT_ARG(CIDR)); 163 163 options.mode = CIDR_MODE; … … 192 192 flags-cant = port; 193 193 flags-cant = cidr; 194 flags-cant= mac;194 flags-cant = mac; 195 195 flag-code = <<- EORegex 196 196 197 197 int regex_error; 198 198 char ebuf[EBUF_SIZE]; 199 199 200 200 options.mode = REGEX_MODE; 201 201 if ((regex_error = regcomp(&options.preg, OPT_ARG(REGEX), … … 204 204 errx(-1, "Unable to compile regex: %s", ebuf); 205 205 } 206 206 207 207 EORegex; 208 208 doc = <<- EOText … … 213 213 214 214 flag = { 215 name = port;216 value = p;217 descrip = "Port-split mode";218 max= 1;219 flags-cant = auto;220 flags-cant = regex;221 flags-cant = cidr;222 flags-cant= mac;223 flag-code = <<- EOPort224 215 name = port; 216 value = p; 217 descrip = "Port-split mode"; 218 max = 1; 219 flags-cant = auto; 220 flags-cant = regex; 221 flags-cant = cidr; 222 flags-cant = mac; 223 flag-code = <<- EOPort 224 225 225 options.mode = PORT_MODE; 226 226 227 227 EOPort; 228 228 doc = <<- EOText … … 233 233 234 234 flag = { 235 name = mac; 236 value = e; 237 arg-type = string; 238 max = 1; 239 descrip = "Source MAC split mode"; 240 flags-cant = auto; 241 flags-cant = regex; 242 flags-cant = cidr; 243 flags-cant = port; 244 flag-code = <<- EOMac 245 246 options.mode = MAC_MODE; 247 options.maclist = safe_strdup(OPT_ARG(MAC)); 248 235 name = mac; 236 value = e; 237 arg-type = string; 238 max = 1; 239 descrip = "Source MAC split mode"; 240 flags-cant = auto; 241 flags-cant = regex; 242 flags-cant = cidr; 243 flags-cant = port; 244 flag-code = <<- EOMac 245 246 options.mode = MAC_MODE; 247 options.maclist = safe_strdup(OPT_ARG(MAC)); 249 248 250 249 EOMac; 251 doc= <<- EOText250 doc = <<- EOText 252 251 Specify a list of MAC addresses to match against the source MAC 253 252 of each packet. Packets matching one of the values are classified 254 as servers. 255 EOText; 256 253 as servers. 254 EOText; 255 257 256 }; 258 257 … … 281 280 errx(-1, "Comment length %zu is longer then max allowed (%d)", 282 281 strlen(OPT_ARG(COMMENT)), (1 << 16) - 1 - MYARGS_LEN); 283 282 284 283 /* save the comment */ 285 284 options.comment = (char *)safe_malloc(strlen(OPT_ARG(COMMENT)) + 1); 286 285 strcpy(options.comment, OPT_ARG(COMMENT)); 287 286 288 287 EOComment; 289 288 doc = <<- EOText … … 294 293 295 294 flag = { 296 name= no-arg-comment;297 max= 1;298 descrip= "Do not embed any cache file comment";299 flag-code= <<- EOCode295 name = no-arg-comment; 296 max = 1; 297 descrip = "Do not embed any cache file comment"; 298 flag-code = <<- EOCode 300 299 301 300 options.nocomment = 1; 302 301 EOCode; 303 doc= <<- EOText302 doc = <<- EOText 304 303 By default, tcpprep includes the arguments passed on the command line 305 304 in the cache file comment (in addition to any user specified --comment). … … 318 317 flags-cant = exclude; 319 318 flag-code = <<- EOInclude 320 319 321 320 char *include; 322 321 323 322 include = safe_strdup(OPT_ARG(INCLUDE)); 324 323 options.xX.mode = xX_MODE_INCLUDE; 325 324 326 325 if ((options.xX.mode = parse_xX_str(&options.xX, include, &options.bpf)) == xXError) 327 326 errx(-1, "Unable to parse include/exclude rule: %s", OPT_ARG(INCLUDE)); 328 327 329 328 free(include); 330 329 331 330 EOInclude; 332 331 doc = <<- EOText … … 335 334 336 335 @table @bullet 337 @item S:<CIDR1>,... 336 @item S:<CIDR1>,... 338 337 - Source IP must match specified IPv4/v6 CIDR(s) 339 @item D:<CIDR1>,... 338 @item D:<CIDR1>,... 340 339 - Destination IP must match specified IPv4/v6 CIDR(s) 341 @item B:<CIDR1>,... 340 @item B:<CIDR1>,... 342 341 - Both source and destination IP must match specified IPv4/v6 CIDR(s) 343 @item E:<CIDR1>,... 342 @item E:<CIDR1>,... 344 343 - Either IP must match specified IPv4/v6 CIDR(s) 345 @item P:<LIST> 344 @item P:<LIST> 346 345 - Must be one of the listed packets where the list 347 346 corresponds to the packet number in the capture file. … … 365 364 flags-cant = include; 366 365 flag-code = <<- EOExclude 367 366 368 367 char *exclude; 369 368 370 369 exclude = safe_strdup(OPT_ARG(EXCLUDE)); 371 370 options.xX.mode = xX_MODE_EXCLUDE; 372 371 373 372 if ((options.xX.mode = parse_xX_str(&options.xX, exclude, &options.bpf)) == xXError) 374 373 errx(-1, "Unable to parse include/exclude rule: %s", OPT_ARG(EXCLUDE)); 375 374 376 375 free(exclude); 377 376 378 377 EOExclude; 379 378 doc = <<- EOText … … 382 381 383 382 @table @bullet 384 @item S:<CIDR1>,... 383 @item S:<CIDR1>,... 385 384 - Source IP must not match specified IPv4/v6 CIDR(s) 386 @item D:<CIDR1>,... 385 @item D:<CIDR1>,... 387 386 - Destination IP must not match specified IPv4/v6 CIDR(s) 388 @item B:<CIDR1>,... 387 @item B:<CIDR1>,... 389 388 - Both source and destination IP must not match specified IPv4/v6 CIDR(s) 390 @item E:<CIDR1>,... 389 @item E:<CIDR1>,... 391 390 - Either IP must not match specified IPv4/v6 CIDR(s) 392 @item P:<LIST> 391 @item P:<LIST> 393 392 - Must not be one of the listed packets where the list 394 393 corresponds to the packet number in the capture file. … … 423 422 name = print-comment; 424 423 value = P; 425 arg-type = string;424 arg-type = string; 426 425 descrip = "Print embedded comment in the specified cache file"; 427 426 max = 1; … … 432 431 name = print-info; 433 432 value = I; 434 arg-type = string;433 arg-type = string; 435 434 descrip = "Print basic info from the specified cache file"; 436 435 max = 1; … … 439 438 440 439 flag = { 441 name= print-stats;442 value= S;443 arg-type= string;444 descrip= "Print statistical information about the specified cache file";445 max = 1;446 doc= "";440 name = print-stats; 441 value = S; 442 arg-type = string; 443 descrip = "Print statistical information about the specified cache file"; 444 max = 1; 445 doc = ""; 447 446 }; 448 447 … … 463 462 flag-code = <<- EOServices 464 463 parse_services(OPT_ARG(SERVICES), &options.services); 465 464 466 465 EOServices; 467 466 }; … … 473 472 max = 1; 474 473 flag-code = <<- EONonip 475 474 476 475 options.nonip = DIR_SERVER; 477 476 478 477 EONonip; 479 478 doc = <<- EOText … … 574 573 descrip = "Print version information"; 575 574 flag-code = <<- EOVersion 576 575 577 576 fprintf(stderr, "tcpprep version: %s (build %s)", VERSION, svn_version()); 578 577 #ifdef DEBUG … … 580 579 #endif 581 580 fprintf(stderr, "\n"); 582 fprintf(stderr, "Copyright 200 1-2009by Aaron Turner <aturner at synfin dot net>\n");581 fprintf(stderr, "Copyright 2000-2010 by Aaron Turner <aturner at synfin dot net>\n"); 583 582 fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION); 584 583 #ifdef HAVE_LIBDNET 585 584 fprintf(stderr, "Compiled against libdnet: %s\n", LIBDNET_VERSION); 586 585 #else 587 fprintf(stderr, "Not compiled with libdnet.\n");586 fprintf(stderr, "Not compiled with libdnet.\n"); 588 587 #endif 589 588 #ifdef HAVE_WINPCAP 590 fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());589 fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version()); 591 590 #else 592 591 fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version()); … … 603 602 #endif 604 603 exit(0); 605 604 606 605 EOVersion; 607 606 doc = ""; … … 614 613 descrip = "Display less usage information and exit"; 615 614 flag-code = <<- EOHelp 616 615 617 616 USAGE(EXIT_FAILURE); 618 617 -
branches/3.4/src/tcpreplay_opts.def
r2407 r2426 3 3 4 4 copyright = { 5 date = "2000-20 08";5 date = "2000-2010"; 6 6 owner = "Aaron Turner"; 7 7 type = "bsd"; 8 8 author = <<- EOText 9 Copyright 2000-20 08Aaron Turner9 Copyright 2000-2010 Aaron Turner 10 10 11 11 For support please use the tcpreplay-users@lists.sourceforge.net mailing list. … … 131 131 @item ioport 132 132 - Write to the i386 IO Port 0x80 133 @item rdtsc 133 @item rdtsc 134 134 - Use the x86/x86_64/PPC RDTSC 135 135 @item gtod [default] … … 196 196 }; 197 197 198 /* Cache files to internal memory */ 198 /* Cache files to internal memory */ 199 199 flag = { 200 200 name = enable_file_cache; … … 433 433 #endif 434 434 fprintf(stderr, "\n"); 435 fprintf(stderr, "Copyright 200 1-2009by Aaron Turner <aturner at synfin dot net>\n");435 fprintf(stderr, "Copyright 2000-2010 by Aaron Turner <aturner at synfin dot net>\n"); 436 436 fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION); 437 437 #ifdef HAVE_LIBDNET -
branches/3.4/src/tcprewrite_opts.def
r2314 r2426 2 2 3 3 copyright = { 4 date = "200 4-2008";4 date = "2000-2010"; 5 5 owner = "Aaron Turner"; 6 6 type = "bsd"; 7 7 author = <<- EOText 8 Copyright 200 4-2008Aaron Turner8 Copyright 2000-2010 Aaron Turner 9 9 10 10 For support please use the tcpreplay-users@lists.sourceforge.net mailing list. … … 27 27 #include tcpedit/tcpedit_opts.def 28 28 29 detail = <<- EOText30 Tcprewrite is a tool to rewrite packets stored in @file{pcap(3)} file format, 31 such as crated by tools such as @file{tcpdump(1)} and @file{ethereal(1)}. 32 Once a pcap file has had it's packets rewritten, they can be replayed back 29 detail = <<- EOText 30 Tcprewrite is a tool to rewrite packets stored in @file{pcap(3)} file format, 31 such as crated by tools such as @file{tcpdump(1)} and @file{ethereal(1)}. 32 Once a pcap file has had it's packets rewritten, they can be replayed back 33 33 out on the network using @file{tcpreplay(1)}. 34 34 … … 71 71 "#include \"config.h\"\n" 72 72 "#include \"tcprewrite.h\"\n" 73 "#include <stdlib.h>\n"74 "#include <string.h>\n"73 "#include <stdlib.h>\n" 74 "#include <string.h>\n" 75 75 "extern tcprewrite_opt_t options;\n"; 76 76 … … 106 106 107 107 flag = { 108 name = outfile;109 value = o;110 arg-type = string;111 descrip = "Output pcap file";112 max = 1;108 name = outfile; 109 value = o; 110 arg-type = string; 111 descrip = "Output pcap file"; 112 max = 1; 113 113 must-set; 114 doc = "";114 doc = ""; 115 115 /* options.outfile is set in post_args, because we need to make 116 116 * sure that options.infile is processed first … … 126 126 settable; 127 127 flag-code = <<- EOCachefile 128 129 options.cache_packets = 128 129 options.cache_packets = 130 130 read_cache(&options.cachedata, OPT_ARG(CACHEFILE), &options.comment); 131 131 132 EOCachefile; 132 EOCachefile; 133 133 doc = <<- EOText 134 134 Use tcpprep cache file to split traffic based upon client/server relationships. … … 163 163 the way packets are decoded. By default, -n and -l are used. 164 164 Be sure to quote the arguments so that they are not interpreted 165 by tcprewrite. Please see the tcpdump(1) man page for a complete list of 165 by tcprewrite. Please see the tcpdump(1) man page for a complete list of 166 166 options. 167 167 EOText; … … 179 179 Enable advanced evasion techniques using the built-in fragroute(8) 180 180 engine. See the fragroute(8) man page for more details. Important: 181 tcprewrite does not support the delay, echo or print commands. 181 tcprewrite does not support the delay, echo or print commands. 182 182 EOText; 183 183 }; … … 192 192 descrip = "Which flows to apply fragroute to: c2s, s2c, both"; 193 193 doc = <<- EOText 194 Apply the fragroute engine to packets going c2s, s2c or both when using a cache file. 195 EOText; 196 }; 197 198 flag = { 199 name = skip-soft-errors; 200 max = 1; 201 descrip = "Skip writing packets with soft errors"; 202 doc = <<- EOText 194 Apply the fragroute engine to packets going c2s, s2c or both when 195 using a cache file. 196 EOText; 197 }; 198 199 flag = { 200 name = skip-soft-errors; 201 max = 1; 202 descrip = "Skip writing packets with soft errors"; 203 doc = <<- EOText 203 204 In some cases, packets can't be decoded or the requested editing 204 205 is not possible. Normally these packets are written to the output … … 216 217 descrip = "Print version information"; 217 218 flag-code = <<- EOVersion 218 219 219 220 fprintf(stderr, "tcprewrite version: %s (build %s)", VERSION, svn_version()); 220 221 #ifdef DEBUG … … 222 223 #endif 223 224 fprintf(stderr, "\n"); 224 fprintf(stderr, "Copyright 200 1-2009by Aaron Turner <aturner at synfin dot net>\n");225 fprintf(stderr, "Copyright 2000-2010 by Aaron Turner <aturner at synfin dot net>\n"); 225 226 fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION); 226 227 #ifdef HAVE_LIBDNET 227 228 fprintf(stderr, "Compiled against libdnet: %s\n", LIBDNET_VERSION); 228 229 #else 229 fprintf(stderr, "Not compiled with libdnet.\n");230 fprintf(stderr, "Not compiled with libdnet.\n"); 230 231 #endif 231 232 #ifdef HAVE_WINPCAP 232 fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());233 fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version()); 233 234 #else 234 235 fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version()); … … 250 251 #endif 251 252 exit(0); 252 253 253 254 EOVersion; 254 255 doc = ""; … … 261 262 descrip = "Display less usage information and exit"; 262 263 flag-code = <<- EOHelp 263 264 264 265 USAGE(EXIT_FAILURE); 265 266
Note: See TracChangeset
for help on using the changeset viewer.
