1 /* $OpenBSD: ip_ipip.h,v 1.7 2017/02/20 17:04:25 jca Exp $ */ 2 /* 3 * The authors of this code are John Ioannidis (ji@tla.org), 4 * Angelos D. Keromytis (kermit@csd.uch.gr) and 5 * Niels Provos (provos@physnet.uni-hamburg.de). 6 * 7 * The original version of this code was written by John Ioannidis 8 * for BSD/OS in Athens, Greece, in November 1995. 9 * 10 * Ported to OpenBSD and NetBSD, with additional transforms, in December 1996, 11 * by Angelos D. Keromytis. 12 * 13 * Additional transforms and features in 1997 and 1998 by Angelos D. Keromytis 14 * and Niels Provos. 15 * 16 * Additional features in 1999 by Angelos D. Keromytis. 17 * 18 * Copyright (C) 1995, 1996, 1997, 1998, 1999 by John Ioannidis, 19 * Angelos D. Keromytis and Niels Provos. 20 * Copyright (c) 2001, Angelos D. Keromytis. 21 * 22 * Permission to use, copy, and modify this software with or without fee 23 * is hereby granted, provided that this entire notice is included in 24 * all copies of any software which is or includes a copy or 25 * modification of this software. 26 * You may use this code under the GNU public license if you so wish. Please 27 * contribute changes back to the authors under this freer than GPL license 28 * so that we may further the use of strong encryption without limitations to 29 * all. 30 * 31 * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR 32 * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY 33 * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE 34 * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR 35 * PURPOSE. 36 */ 37 38 #ifndef _NETINET_IPIP_H_ 39 #define _NETINET_IPIP_H_ 40 41 /* 42 * IP-inside-IP processing. 43 * Not quite all the functionality of RFC-1853, but the main idea is there. 44 */ 45 46 struct ipipstat { 47 u_int64_t ipips_ipackets; /* total input packets */ 48 u_int64_t ipips_opackets; /* total output packets */ 49 u_int64_t ipips_hdrops; /* packet shorter than header shows */ 50 u_int64_t ipips_qfull; 51 u_int64_t ipips_ibytes; 52 u_int64_t ipips_obytes; 53 u_int64_t ipips_pdrops; /* packet dropped due to policy */ 54 u_int64_t ipips_spoof; /* IP spoofing attempts */ 55 u_int64_t ipips_family; /* Protocol family mismatch */ 56 u_int64_t ipips_unspec; /* Missing tunnel endpoint address */ 57 }; 58 59 #define IP4_DEFAULT_TTL 0 60 #define IP4_SAME_TTL -1 61 62 /* 63 * Names for IPIP sysctl objects 64 */ 65 #define IPIPCTL_ALLOW 1 /* accept incoming IP4 packets */ 66 #define IPIPCTL_STATS 2 /* IPIP stats */ 67 #define IPIPCTL_MAXID 3 68 69 #define IPIPCTL_NAMES { \ 70 { 0, 0 }, \ 71 { "allow", CTLTYPE_INT }, \ 72 { "stats", CTLTYPE_STRUCT }, \ 73 } 74 75 #ifdef _KERNEL 76 int ipip_sysctl(int *, u_int, void *, size_t *, void *, size_t); 77 78 extern int ipip_allow; 79 extern struct ipipstat ipipstat; 80 #endif /* _KERNEL */ 81 #endif /* _NETINET_IPIP_H_ */ 82