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