tcpbridge.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* $Id: tcpbridge.h 1795 2007-04-11 04:51:58Z aturner $ */
  2. /*
  3. * Copyright (c) 2005 Aaron Turner.
  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 __TCPBRIDGE_H__
  32. #define __TCPBRIDGE_H__
  33. /* we don't support endpoints w/ tcpbridge */
  34. #define TCPEDIT_ENDPOINTS_DISABLE 1
  35. #include "config.h"
  36. #include "defines.h"
  37. #include "common.h"
  38. #include "tcpedit/tcpedit.h"
  39. #include <sys/types.h>
  40. #include <sys/stat.h>
  41. #include <fcntl.h>
  42. #include <regex.h>
  43. /* run-time options */
  44. struct tcpbridge_opt_s {
  45. char *intf1;
  46. char *intf2;
  47. sendpacket_t *sp1;
  48. sendpacket_t *sp2;
  49. /* truncate packet ? */
  50. int truncate;
  51. COUNTER limit_send;
  52. pcap_t *listen1;
  53. pcap_t *listen2;
  54. int unidir;
  55. int snaplen;
  56. int to_ms;
  57. int promisc;
  58. int poll_timeout;
  59. #ifdef ENABLE_VERBOSE
  60. /* tcpdump verbose printing */
  61. int verbose;
  62. char *tcpdump_args;
  63. tcpdump_t *tcpdump;
  64. #endif
  65. /* filter options */
  66. tcpr_xX_t xX;
  67. tcpr_bpf_t bpf;
  68. regex_t preg;
  69. tcpr_cidr_t *cidrdata;
  70. int mtu;
  71. int maxpacket;
  72. int fixcsum;
  73. u_int16_t l2proto;
  74. u_int16_t l2_mem_align; /* keep things 4 byte aligned */
  75. };
  76. typedef struct tcpbridge_opt_s tcpbridge_opt_t;
  77. #endif
  78. /*
  79. Local Variables:
  80. mode:c
  81. indent-tabs-mode:nil
  82. c-basic-offset:4
  83. End:
  84. */