tcpbridge.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* $Id$ */
  2. /*
  3. * Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
  4. * Copyright (c) 2013-2018 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. #ifndef __TCPBRIDGE_H__
  20. #define __TCPBRIDGE_H__
  21. /* we don't support endpoints w/ tcpbridge */
  22. #define TCPEDIT_ENDPOINTS_DISABLE 1
  23. #include "config.h"
  24. #include "defines.h"
  25. #include "common.h"
  26. #include "tcpedit/tcpedit.h"
  27. #include <sys/types.h>
  28. #include <sys/stat.h>
  29. #include <fcntl.h>
  30. #include <regex.h>
  31. #ifdef ENABLE_DMALLOC
  32. #include <dmalloc.h>
  33. #endif
  34. /* run-time options */
  35. typedef struct {
  36. char *intf1;
  37. char *intf2;
  38. /* store the mac address of each interface here to prevent loops */
  39. char intf1_mac[ETHER_ADDR_LEN];
  40. char intf2_mac[ETHER_ADDR_LEN];
  41. /* truncate packet ? */
  42. int truncate;
  43. COUNTER limit_send;
  44. pcap_t *pcap1;
  45. pcap_t *pcap2;
  46. int unidir;
  47. int snaplen;
  48. int to_ms;
  49. int promisc;
  50. int poll_timeout;
  51. #ifdef ENABLE_VERBOSE
  52. /* tcpdump verbose printing */
  53. int verbose;
  54. char *tcpdump_args;
  55. tcpdump_t *tcpdump;
  56. #endif
  57. /* filter options */
  58. tcpr_xX_t xX;
  59. tcpr_bpf_t bpf;
  60. regex_t preg;
  61. tcpr_cidr_t *cidrdata;
  62. int mtu;
  63. int maxpacket;
  64. int fixcsum;
  65. u_int16_t l2proto;
  66. u_int16_t l2_mem_align; /* keep things 4 byte aligned */
  67. } tcpbridge_opt_t;
  68. #endif