tcpreplay.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* $Id: tcpreplay.h 1462 2006-04-13 05:10:27Z aturner $ */
  2. /*
  3. * Copyright (c) 2001-2004 Aaron Turner <aturner@pobox.com>.
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the names of the copyright owners nor the names of its
  16. * contributors may be used to endorse or promote products derived from
  17. * this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  20. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  21. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  22. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  23. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  24. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  25. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  26. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  27. * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  28. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  29. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. #ifndef __TCPREPLAY_H__
  32. #define __TCPREPLAY_H__
  33. #include "config.h"
  34. #include "defines.h"
  35. #include <sys/types.h>
  36. #include <sys/stat.h>
  37. #include <fcntl.h>
  38. /* run-time options */
  39. struct tcpreplay_opt_s {
  40. /* input/output */
  41. char *intf1_name;
  42. char *intf2_name;
  43. libnet_t *intf1;
  44. libnet_t *intf2;
  45. /* disable data dump mode
  46. pcap_t *savepcap1;
  47. pcap_t *savepcap2;
  48. pcap_dumper_t *savedumper1;
  49. pcap_dumper_t *savedumper2;
  50. int datadump_mode;
  51. int datadumpfile1;
  52. int datadumpfile2;
  53. */
  54. tcpr_speed_t speed;
  55. u_int32_t loop;
  56. /* tcpprep cache data */
  57. COUNTER cache_packets;
  58. char *cachedata;
  59. char *comment; /* tcpprep comment */
  60. /* deal with MTU/packet len issues */
  61. int mtu;
  62. int truncate;
  63. char *files[MAX_FILES];
  64. COUNTER limit_send;
  65. /* disable bridge mode
  66. pcap_t *listen1;
  67. pcap_t *listen2;
  68. int sniff_snaplen;
  69. int sniff_bridge;
  70. int promisc;
  71. int poll_timeout;
  72. */
  73. #ifdef HAVE_TCPDUMP
  74. /* tcpdump verbose printing */
  75. int verbose;
  76. char *tcpdump_args;
  77. #endif
  78. };
  79. typedef struct tcpreplay_opt_s tcpreplay_opt_t;
  80. #endif
  81. /*
  82. Local Variables:
  83. mode:c
  84. indent-tabs-mode:nil
  85. c-basic-offset:4
  86. End:
  87. */