1 /* 2 * tcpcmds common definitions header (designed for to maximize modularity 3 * between IPv4 and IPv6 test code). 4 * 5 * Copyright (C) 2009, Cisco Systems Inc. 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program 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 along 18 * with this program; if not, write to the Free Software Foundation, Inc., 19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 */ 22 23 #ifndef __NETDEFS_H 24 #define __NETDEFS_H 25 26 #include <netdb.h> 27 28 #if INET6 29 30 #include <netinet/ip6.h> 31 #include <netinet/icmp6.h> 32 33 typedef struct icmp6_hdr icmp_t; 34 typedef struct sockaddr sa_t; 35 typedef struct sockaddr_in6 sai_t; 36 37 #define AFI AF_INET6 38 #define IERP ICMP6_ECHO_REPLY 39 #define IERQ ICMP6_ECHO_REQUEST 40 #define ICMP_PROTO "ipv6-icmp" 41 #define PFI PF_INET6 42 43 #else 44 45 #include <netinet/ip.h> 46 #include <netinet/ip_icmp.h> 47 48 typedef struct icmp icmp_t; 49 typedef struct sockaddr sa_t; 50 typedef struct sockaddr_in sai_t; 51 52 #define AFI AF_INET 53 #define IERP ICMP_ECHOREPLY 54 #define IERQ ICMP_ECHO 55 #define ICMP_PROTO "icmp" 56 #define PFI PF_INET 57 58 #endif 59 60 #define LISTEN_BACKLOG 10 61 62 #ifndef PATH_MAX 63 #define PATH_MAX 4096 64 #endif 65 66 #ifndef TRUE 67 #define TRUE 1 68 #endif 69 #ifndef FALSE 70 #define FALSE 0 71 #endif 72 73 #endif 74