Changeset 1734
- Timestamp:
- 03/20/07 22:20:18 (20 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
configure.in (modified) (2 diffs)
-
src/tcpprep.c (modified) (3 diffs)
-
src/tcpreplay.c (modified) (6 diffs)
-
src/tcprewrite.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.in
r1730 r1734 13 13 MAJOR_VERSION=3 14 14 MINOR_VERSION=0 15 MICRO_VERSION= beta1315 MICRO_VERSION=RC1 16 16 TCPREPLAY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION 17 17 … … 495 495 [Does libpcap have dlt_val_to_desc?]) 496 496 fi 497 498 499 dnl Check to see if we've got pcap_snapshot_override() 500 AC_MSG_CHECKING(for pcap_snapshot_override) 501 AC_LINK_IFELSE(AC_LANG_PROGRAM([[ 502 #include <stdio.h> 503 #include <stdlib.h> 504 #include <string.h> 505 #include "$LPCAPINC" 506 ]],[[ 507 pcap_t *pcap; 508 pcap_snapshot_override(pcap, 1); 509 exit(0); 510 ]]),[ 511 have_pcap_snapshot_override=yes 512 AC_MSG_RESULT(yes) 513 ], [ 514 have_pcap_snapshot_override=no 515 AC_MSG_RESULT(no) 516 ]) 517 518 if test $have_pcap_snapshot_override = yes ; then 519 AC_DEFINE([HAVE_PCAP_SNAPSHOT_OVERRIDE], [1], 520 [Does libpcap have pcap_snapshot_override()?]) 521 fi 522 497 523 498 524 dnl This message is placed here for continuity purposes -
trunk/src/tcpprep.c
r1643 r1734 122 122 errx(1, "Error opening file: %s", errbuf); 123 123 124 #ifdef HAVE_PCAP_SNAPSHOT_OVERRIDE 125 /* libpcap >= 0.9.6 have this which handles broken RedHat libpcap files */ 126 pcap_snapshot_override(pin, 65535); 127 #endif 128 124 129 /* make sure we support the DLT type */ 125 130 switch(pcap_datalink(options.pcap)) { … … 307 312 #endif 308 313 314 assert(pcap); 315 309 316 while ((pktdata = pcap_next(pcap, &pkthdr)) != NULL) { 310 317 packetnum++; … … 316 323 if (options.xX.mode < xXExclude) { 317 324 if (!check_list(options.xX.list, packetnum)) { 318 add_cache(& options.cachedata, DONT_SEND, 0);325 add_cache(&(options.cachedata), DONT_SEND, 0); 319 326 continue; 320 327 } 321 328 } 322 329 else if (check_list(options.xX.list, packetnum)) { 323 add_cache(& options.cachedata, DONT_SEND, 0);330 add_cache(&(options.cachedata), DONT_SEND, 0); 324 331 continue; 325 332 } -
trunk/src/tcpreplay.c
r1700 r1734 118 118 if (bytes_sent > 0) 119 119 packet_stats(&begin, &end, bytes_sent, pkts_sent, failed); 120 121 120 return 0; 122 121 } /* main() */ … … 131 130 pcap_t *pcap = NULL; 132 131 char ebuf[PCAP_ERRBUF_SIZE]; 132 int dlt; 133 133 134 134 #ifdef HAVE_TCPDUMP … … 150 150 errx(1, "Error opening pcap file: %s", ebuf); 151 151 152 #ifdef HAVE_PCAP_SNAPSHOT_OVERRIDE 153 /* libpcap >= 0.9.6 have this which handles broken RedHat libpcap files */ 154 pcap_snapshot_override(pcap, 65535); 155 #endif 156 157 dlt = sendpacket_get_dlt(options.intf1); 158 if ((dlt > 0) && (dlt != pcap_datalink(pcap))) 159 warnx("%s DLT does not match that of the outbound interface: %s", path, options.intf1->device); 160 152 161 send_packets(pcap); 153 162 pcap_close(pcap); … … 198 207 char *temp; 199 208 char ebuf[SENDPACKET_ERRBUF_SIZE]; 209 int int1dlt, int2dlt; 200 210 201 211 … … 252 262 errx(1, "Can't open %s: %s", options.intf1_name, ebuf); 253 263 264 int1dlt = sendpacket_get_dlt(options.intf1); 265 254 266 if (HAVE_OPT(INTF2)) { 255 267 options.intf2_name = (char *)safe_malloc(strlen(OPT_ARG(INTF2)) + 1); … … 259 271 if ((options.intf2 = sendpacket_open(options.intf2_name, ebuf)) == NULL) 260 272 errx(1, "Can't open %s: %s", options.intf2_name, ebuf); 273 274 int2dlt = sendpacket_get_dlt(options.intf2); 275 if (int2dlt != int1dlt) 276 errx(1, "DLT type missmatch for %s and %s", options.intf1_name, options.intf2_name); 261 277 } 262 278 -
trunk/src/tcprewrite.c
r1701 r1734 199 199 pkthdr_ptr = &pkthdr; 200 200 201 #ifdef HAVE_PCAP_SNAPSHOT_OVERRIDE 202 /* libpcap >= 0.9.6 have this which handles broken RedHat libpcap files */ 203 pcap_snapshot_override(pin, 65535); 204 #endif 205 201 206 /* MAIN LOOP 202 207 * Keep sending while we have packets or until
