Changeset 547 for trunk/src/ocat.h
- Timestamp:
- 04/26/10 13:29:15 (2 years ago)
- File:
-
- 1 edited
-
trunk/src/ocat.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ocat.h
r546 r547 19 19 #define OCAT_H 20 20 21 #ifdef HAVE_CONFIG_H 21 22 #include "config.h" 23 #endif 22 24 23 25 #include <stdio.h> … … 56 58 #include <sys/wait.h> 57 59 #endif 60 #ifdef HAVE_SYS_ETHERNET_H 61 #include <sys/ethernet.h> 62 #endif 58 63 #ifdef HAVE_NETINET_IN_H 59 64 #include <netinet/in.h> … … 102 107 #ifndef ETHERTYPE_IPV6 103 108 #define ETHERTYPE_IPV6 0x86dd 109 #endif 110 111 #ifndef ETHER_ADDR_LEN 112 #ifdef ETHERADDRL 113 #define ETHER_ADDR_LEN ETHERADDRL 114 #endif 115 #endif 116 117 // At least on Solaris the Ethernet addresses are defined as struct containing 118 // an array of bytes. This is different from most other OSes which define the 119 // addresses directly as array. 120 #ifdef HAVE_ETHER_ADDR_OCTET 121 #define ether_dst ether_dhost.ether_addr_octet 122 #define ether_src ether_shost.ether_addr_octet 123 #else 124 #define ether_dst ether_dhost 125 #define ether_src ether_shost 104 126 #endif 105 127 … … 226 248 #define SYSCONFDIR "/etc" 227 249 #endif 250 251 // this macro returns a constains string if a buffer points to NULL. 252 #define SSTR(x) (x != NULL ? x : "(nil)") 253 254 // Solaris and the Windows OpenVPN tunnel driver do not send a 4 byte tunnel 255 // header thus we adjust reads and writes. 256 #if defined(__sun__) || defined(__CYGWIN__) 257 #define BUF_OFF 4 258 #else 259 #define BUF_OFF 0 260 #endif 261 228 262 229 263 struct OcatSetup … … 306 340 int pid_fd[2]; 307 341 int sig_usr1, clear_stats; 342 int hosts_lookup; 308 343 }; 309 344 … … 468 503 469 504 #ifndef WITHOUT_TUN 470 #ifdef __FreeBSD__ 505 #ifdef __sun__ 506 #define TUN_DEV "/dev/tun" 507 #elif __linux__ 508 #define TUN_DEV "/dev/net/tun" 509 #else 471 510 #define TUN_DEV "/dev/tun0" 472 #e lif __OpenBSD__473 #define TUN_DEV "/dev/tun0" 511 #endif 512 extern char *tun_dev_; 474 513 #else 475 #define TUN_DEV "/dev/net/tun" 476 #endif 477 extern char *tun_dev_; 514 #define TUN_DEV "STDIO" 478 515 #endif 479 516 … … 614 651 int win_read_tun(char *, int); 615 652 int win_write_tun(const char *, int); 616 #endif 617 618 #endif 619 653 #define tun_read(x,y,z) win_read_tun(y,z) 654 #define tun_write(x,y,z) win_write_tun(y,z) 655 #else 656 #define tun_read(x,y,z) read(x,y,z) 657 #define tun_write(x,y,z) write(x,y,z) 658 #endif 659 660 661 #endif 662
Note: See TracChangeset
for help on using the changeset viewer.
