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