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
47253081Saestruct ipipstat {
48253081Sae	uint64_t	ipips_ipackets;	/* total input packets */
49253081Sae	uint64_t	ipips_opackets;	/* total output packets */
50253081Sae	uint64_t	ipips_hdrops;	/* packet shorter than header shows */
51253081Sae	uint64_t	ipips_qfull;
52253081Sae	uint64_t	ipips_ibytes;
53253081Sae	uint64_t	ipips_obytes;
54253081Sae	uint64_t	ipips_pdrops;	/* packet dropped due to policy */
55253081Sae	uint64_t	ipips_spoof;	/* IP spoofing attempts */
56253081Sae	uint64_t	ipips_family;	/* Protocol family mismatch */
57253081Sae	uint64_t	ipips_unspec;   /* Missing tunnel endpoint address */
58105197Ssam};
59105197Ssam
60105197Ssam#ifdef _KERNEL
61253088Sae#include <sys/counter.h>
62253088Sae
63195699SrwatsonVNET_DECLARE(int, ipip_allow);
64253088SaeVNET_PCPUSTAT_DECLARE(struct ipipstat, ipipstat);
65207369Sbz
66253088Sae#define	IPIPSTAT_ADD(name, val)	\
67253088Sae    VNET_PCPUSTAT_ADD(struct ipipstat, ipipstat, name, (val))
68252028Sae#define	IPIPSTAT_INC(name)	IPIPSTAT_ADD(name, 1)
69195727Srwatson#define	V_ipip_allow		VNET(ipip_allow)
70105197Ssam#endif /* _KERNEL */
71105197Ssam#endif /* _NETINET_IPIP_H_ */
72