tcpbridge.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* $Id$ */
  2. /*
  3. * Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
  4. * Copyright (c) 2013-2022 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
  5. *
  6. * The Tcpreplay Suite of tools is free software: you can redistribute it
  7. * and/or modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation, either version 3 of the
  9. * License, or with the authors permission any later version.
  10. *
  11. * The Tcpreplay Suite is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with the Tcpreplay Suite. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #pragma once
  20. /* we don't support endpoints w/ tcpbridge */
  21. #define TCPEDIT_ENDPOINTS_DISABLE 1
  22. #include "defines.h"
  23. #include "config.h"
  24. #include "common.h"
  25. #include "tcpedit/tcpedit.h"
  26. #include <fcntl.h>
  27. #include <regex.h>
  28. #include <sys/stat.h>
  29. #include <sys/types.h>
  30. #ifdef ENABLE_DMALLOC
  31. #include <dmalloc.h>
  32. #endif
  33. /* run-time options */
  34. typedef struct {
  35. char *intf1;
  36. char *intf2;
  37. /* store the mac address of each interface here to prevent loops */
  38. char intf1_mac[ETHER_ADDR_LEN];
  39. char intf2_mac[ETHER_ADDR_LEN];
  40. /* truncate packet ? */
  41. int truncate;
  42. COUNTER limit_send;
  43. pcap_t *pcap1;
  44. pcap_t *pcap2;
  45. int unidir;
  46. int snaplen;
  47. int to_ms;
  48. int promisc;
  49. int poll_timeout;
  50. #ifdef ENABLE_VERBOSE
  51. /* tcpdump verbose printing */
  52. int verbose;
  53. char *tcpdump_args;
  54. tcpdump_t *tcpdump;
  55. #endif
  56. /* filter options */
  57. tcpr_xX_t xX;
  58. tcpr_bpf_t bpf;
  59. regex_t preg;
  60. tcpr_cidr_t *cidrdata;
  61. int mtu;
  62. int maxpacket;
  63. int fixcsum;
  64. u_int16_t l2proto;
  65. u_int16_t l2_mem_align; /* keep things 4 byte aligned */
  66. } tcpbridge_opt_t;