1105197Ssam/*	$FreeBSD$	*/
2105197Ssam/*	$OpenBSD: ip_ipip.h,v 1.5 2002/06/09 16:26:10 itojun Exp $ */
3139823Simp/*-
4105197Ssam * The authors of this code are John Ioannidis (ji@tla.org),
5105197Ssam * Angelos D. Keromytis (kermit@csd.uch.gr) and
6105197Ssam * Niels Provos (provos@physnet.uni-hamburg.de).
7105197Ssam *
8105197Ssam * The original version of this code was written by John Ioannidis
9105197Ssam * for BSD/OS in Athens, Greece, in November 1995.
10105197Ssam *
11105197Ssam * Ported to OpenBSD and NetBSD, with additional transforms, in December 1996,
12105197Ssam * by Angelos D. Keromytis.
13105197Ssam *
14105197Ssam * Additional transforms and features in 1997 and 1998 by Angelos D. Keromytis
15105197Ssam * and Niels Provos.
16105197Ssam *
17105197Ssam * Additional features in 1999 by Angelos D. Keromytis.
18105197Ssam *
19105197Ssam * Copyright (C) 1995, 1996, 1997, 1998, 1999 by John Ioannidis,
20105197Ssam * Angelos D. Keromytis and Niels Provos.
21105197Ssam * Copyright (c) 2001, Angelos D. Keromytis.
22105197Ssam *
23105197Ssam * Permission to use, copy, and modify this software with or without fee
24105197Ssam * is hereby granted, provided that this entire notice is included in
25105197Ssam * all copies of any software which is or includes a copy or
26105197Ssam * modification of this software.
27105197Ssam * You may use this code under the GNU public license if you so wish. Please
28105197Ssam * contribute changes back to the authors under this freer than GPL license
29105197Ssam * so that we may further the use of strong encryption without limitations to
30105197Ssam * all.
31105197Ssam *
32105197Ssam * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
33105197Ssam * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
34105197Ssam * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
35105197Ssam * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
36105197Ssam * PURPOSE.
37105197Ssam */
38105197Ssam
39105197Ssam#ifndef _NETINET_IPIP_H_
40105197Ssam#define _NETINET_IPIP_H_
41105197Ssam
42105197Ssam/*
43105197Ssam * IP-inside-IP processing.
44105197Ssam * Not quite all the functionality of RFC-1853, but the main idea is there.
45105197Ssam */
46105197Ssam
47105197Ssamstruct ipipstat
48105197Ssam{
49105197Ssam    u_int32_t	ipips_ipackets;		/* total input packets */
50105197Ssam    u_int32_t	ipips_opackets;		/* total output packets */
51105197Ssam    u_int32_t	ipips_hdrops;		/* packet shorter than header shows */
52105197Ssam    u_int32_t	ipips_qfull;
53105197Ssam    u_int64_t   ipips_ibytes;
54105197Ssam    u_int64_t   ipips_obytes;
55105197Ssam    u_int32_t	ipips_pdrops;		/* packet dropped due to policy */
56105197Ssam    u_int32_t	ipips_spoof;		/* IP spoofing attempts */
57105197Ssam    u_int32_t   ipips_family;		/* Protocol family mismatch */
58105197Ssam    u_int32_t   ipips_unspec;            /* Missing tunnel endpoint address */
59105197Ssam};
60105197Ssam
61105197Ssam#ifdef _KERNEL
62195699SrwatsonVNET_DECLARE(int, ipip_allow);
63207369SbzVNET_DECLARE(struct ipipstat, ipipstat);
64207369Sbz
65252693Sae#define	IPIPSTAT_ADD(name, val)	V_ipipstat.name += (val)
66252693Sae#define	IPIPSTAT_INC(name)	IPIPSTAT_ADD(name, 1)
67195727Srwatson#define	V_ipip_allow		VNET(ipip_allow)
68195727Srwatson#define	V_ipipstat		VNET(ipipstat)
69105197Ssam#endif /* _KERNEL */
70105197Ssam#endif /* _NETINET_IPIP_H_ */
71