ipsec6.h revision 298398
1195630Ssam/*	$FreeBSD: head/sys/netipsec/ipsec6.h 298398 2016-04-21 10:58:07Z ae $	*/
2195630Ssam/*	$KAME: ipsec.h,v 1.44 2001/03/23 08:08:47 itojun Exp $	*/
3195630Ssam
4195630Ssam/*-
5195630Ssam * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6195630Ssam * All rights reserved.
7195630Ssam *
8195630Ssam * Redistribution and use in source and binary forms, with or without
9195630Ssam * modification, are permitted provided that the following conditions
10195630Ssam * are met:
11195630Ssam * 1. Redistributions of source code must retain the above copyright
12195630Ssam *    notice, this list of conditions and the following disclaimer.
13195630Ssam * 2. Redistributions in binary form must reproduce the above copyright
14195630Ssam *    notice, this list of conditions and the following disclaimer in the
15195630Ssam *    documentation and/or other materials provided with the distribution.
16195630Ssam * 3. Neither the name of the project nor the names of its contributors
17195630Ssam *    may be used to endorse or promote products derived from this software
18195630Ssam *    without specific prior written permission.
19195630Ssam *
20195630Ssam * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21195630Ssam * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22195630Ssam * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23195630Ssam * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24195630Ssam * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25195630Ssam * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26195630Ssam * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27195630Ssam * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28195630Ssam * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29195630Ssam * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30195630Ssam * SUCH DAMAGE.
31195630Ssam */
32195630Ssam
33195630Ssam/*
34195630Ssam * IPsec controller part.
35195630Ssam */
36195630Ssam
37195630Ssam#ifndef _NETIPSEC_IPSEC6_H_
38195630Ssam#define _NETIPSEC_IPSEC6_H_
39195630Ssam
40195630Ssam#include <net/pfkeyv2.h>
41195630Ssam#include <netipsec/keydb.h>
42195630Ssam
43195630Ssam#ifdef _KERNEL
44195630Ssam#include <sys/counter.h>
45195630Ssam
46195630SsamVNET_PCPUSTAT_DECLARE(struct ipsecstat, ipsec6stat);
47195630SsamVNET_DECLARE(int, ip6_esp_trans_deflev);
48195630SsamVNET_DECLARE(int, ip6_esp_net_deflev);
49195630SsamVNET_DECLARE(int, ip6_ah_trans_deflev);
50195630SsamVNET_DECLARE(int, ip6_ah_net_deflev);
51195630SsamVNET_DECLARE(int, ip6_ipsec_ecn);
52195630Ssam
53195630Ssam#define	IPSEC6STAT_INC(name)	\
54195630Ssam    VNET_PCPUSTAT_ADD(struct ipsecstat, ipsec6stat, name, 1)
55195630Ssam#define	V_ip6_esp_trans_deflev	VNET(ip6_esp_trans_deflev)
56195630Ssam#define	V_ip6_esp_net_deflev	VNET(ip6_esp_net_deflev)
57195630Ssam#define	V_ip6_ah_trans_deflev	VNET(ip6_ah_trans_deflev)
58195630Ssam#define	V_ip6_ah_net_deflev	VNET(ip6_ah_net_deflev)
59195630Ssam#define	V_ip6_ipsec_ecn		VNET(ip6_ipsec_ecn)
60195630Ssam
61195630Ssamstruct inpcb;
62195630Ssamextern int ipsec6_in_reject(const struct mbuf *, struct inpcb *);
63195630Ssam
64195630Ssamstruct m_tag;
65195630Ssamextern int ipsec6_common_input(struct mbuf **mp, int *offp, int proto);
66195630Ssamextern int ipsec6_common_input_cb(struct mbuf *m, struct secasvar *sav,
67231564Sed			int skip, int protoff);
68195630Ssamextern void esp6_ctlinput(int, struct sockaddr *, void *);
69195630Ssamextern int ipsec6_process_packet(struct mbuf *, struct ipsecrequest *);
70195630Ssam#endif /*_KERNEL*/
71195630Ssam
72195630Ssam#endif /*_NETIPSEC_IPSEC6_H_*/
73195630Ssam