1105197Ssam/*	$FreeBSD$	*/
2105197Ssam/*	$KAME: ipsec.h,v 1.53 2001/11/20 08:32:38 itojun Exp $	*/
3105197Ssam
4139823Simp/*-
5105197Ssam * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6105197Ssam * All rights reserved.
7105197Ssam *
8105197Ssam * Redistribution and use in source and binary forms, with or without
9105197Ssam * modification, are permitted provided that the following conditions
10105197Ssam * are met:
11105197Ssam * 1. Redistributions of source code must retain the above copyright
12105197Ssam *    notice, this list of conditions and the following disclaimer.
13105197Ssam * 2. Redistributions in binary form must reproduce the above copyright
14105197Ssam *    notice, this list of conditions and the following disclaimer in the
15105197Ssam *    documentation and/or other materials provided with the distribution.
16105197Ssam * 3. Neither the name of the project nor the names of its contributors
17105197Ssam *    may be used to endorse or promote products derived from this software
18105197Ssam *    without specific prior written permission.
19105197Ssam *
20105197Ssam * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21105197Ssam * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22105197Ssam * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23105197Ssam * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24105197Ssam * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25105197Ssam * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26105197Ssam * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27105197Ssam * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28105197Ssam * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29105197Ssam * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30105197Ssam * SUCH DAMAGE.
31105197Ssam */
32105197Ssam
33105197Ssam/*
34105197Ssam * IPsec controller part.
35105197Ssam */
36105197Ssam
37105197Ssam#ifndef _NETIPSEC_IPSEC_H_
38105197Ssam#define _NETIPSEC_IPSEC_H_
39105197Ssam
40105197Ssam#if defined(_KERNEL) && !defined(_LKM) && !defined(KLD_MODULE)
41105197Ssam#include "opt_inet.h"
42105197Ssam#include "opt_ipsec.h"
43105197Ssam#endif
44105197Ssam
45105197Ssam#include <net/pfkeyv2.h>
46105197Ssam#include <netipsec/keydb.h>
47105197Ssam
48105197Ssam#ifdef _KERNEL
49105197Ssam
50283901Sae#include <sys/_lock.h>
51283901Sae#include <sys/_mutex.h>
52283901Sae#include <sys/_rwlock.h>
53283901Sae
54179067Sgnn#define	IPSEC_ASSERT(_c,_m) KASSERT(_c, _m)
55179067Sgnn
56179067Sgnn#define	IPSEC_IS_PRIVILEGED_SO(_so) \
57179067Sgnn	((_so)->so_cred != NULL && \
58179067Sgnn	 priv_check_cred((_so)->so_cred, PRIV_NETINET_IPSEC, 0) \
59179067Sgnn	 == 0)
60179067Sgnn
61105197Ssam/*
62105197Ssam * Security Policy Index
63105197Ssam * Ensure that both address families in the "src" and "dst" are same.
64105197Ssam * When the value of the ul_proto is ICMPv6, the port field in "src"
65105197Ssam * specifies ICMPv6 type, and the port field in "dst" specifies ICMPv6 code.
66105197Ssam */
67105197Ssamstruct secpolicyindex {
68196882Spjd	u_int8_t dir;			/* direction of packet flow, see below */
69105197Ssam	union sockaddr_union src;	/* IP src address for SP */
70105197Ssam	union sockaddr_union dst;	/* IP dst address for SP */
71105197Ssam	u_int8_t prefs;			/* prefix length in bits for src */
72105197Ssam	u_int8_t prefd;			/* prefix length in bits for dst */
73105197Ssam	u_int16_t ul_proto;		/* upper layer Protocol */
74105197Ssam#ifdef notyet
75105197Ssam	uid_t uids;
76105197Ssam	uid_t uidd;
77105197Ssam	gid_t gids;
78105197Ssam	gid_t gidd;
79105197Ssam#endif
80105197Ssam};
81105197Ssam
82105197Ssam/* Security Policy Data Base */
83105197Ssamstruct secpolicy {
84105197Ssam	LIST_ENTRY(secpolicy) chain;
85119643Ssam	struct mtx lock;
86105197Ssam
87105197Ssam	u_int refcnt;			/* reference count */
88105197Ssam	struct secpolicyindex spidx;	/* selector */
89105197Ssam	u_int32_t id;			/* It's unique number on the system. */
90105197Ssam	u_int state;			/* 0: dead, others: alive */
91105197Ssam#define IPSEC_SPSTATE_DEAD	0
92105197Ssam#define IPSEC_SPSTATE_ALIVE	1
93273736Shselasky	u_int policy;			/* policy_type per pfkeyv2.h */
94120585Ssam	u_int16_t scangen;		/* scan generation # */
95105197Ssam	struct ipsecrequest *req;
96105197Ssam				/* pointer to the ipsec request tree, */
97105197Ssam				/* if policy == IPSEC else this value == NULL.*/
98105197Ssam
99105197Ssam	/*
100105197Ssam	 * lifetime handler.
101105197Ssam	 * the policy can be used without limitiation if both lifetime and
102105197Ssam	 * validtime are zero.
103105197Ssam	 * "lifetime" is passed by sadb_lifetime.sadb_lifetime_addtime.
104105197Ssam	 * "validtime" is passed by sadb_lifetime.sadb_lifetime_usetime.
105105197Ssam	 */
106120585Ssam	time_t created;		/* time created the policy */
107120585Ssam	time_t lastused;	/* updated every when kernel sends a packet */
108105197Ssam	long lifetime;		/* duration of the lifetime of this policy */
109105197Ssam	long validtime;		/* duration this policy is valid without use */
110105197Ssam};
111105197Ssam
112120585Ssam#define	SECPOLICY_LOCK_INIT(_sp) \
113120585Ssam	mtx_init(&(_sp)->lock, "ipsec policy", NULL, MTX_DEF)
114120585Ssam#define	SECPOLICY_LOCK(_sp)		mtx_lock(&(_sp)->lock)
115120585Ssam#define	SECPOLICY_UNLOCK(_sp)		mtx_unlock(&(_sp)->lock)
116120585Ssam#define	SECPOLICY_LOCK_DESTROY(_sp)	mtx_destroy(&(_sp)->lock)
117120585Ssam#define	SECPOLICY_LOCK_ASSERT(_sp)	mtx_assert(&(_sp)->lock, MA_OWNED)
118120585Ssam
119105197Ssam/* Request for IPsec */
120105197Ssamstruct ipsecrequest {
121105197Ssam	struct ipsecrequest *next;
122105197Ssam				/* pointer to next structure */
123105197Ssam				/* If NULL, it means the end of chain. */
124105197Ssam	struct secasindex saidx;/* hint for search proper SA */
125105197Ssam				/* if __ss_len == 0 then no address specified.*/
126105197Ssam	u_int level;		/* IPsec level defined below. */
127105197Ssam
128105197Ssam	struct secasvar *sav;	/* place holder of SA for use */
129105197Ssam	struct secpolicy *sp;	/* back pointer to SP */
130220206Sfabient	struct rwlock lock;	/* to interlock updates */
131105197Ssam};
132105197Ssam
133120585Ssam/*
134120585Ssam * Need recursion for when crypto callbacks happen directly,
135120585Ssam * as in the case of software crypto.  Need to look at how
136120585Ssam * hard it is to remove this...
137120585Ssam */
138120585Ssam#define	IPSECREQUEST_LOCK_INIT(_isr) \
139220206Sfabient	rw_init_flags(&(_isr)->lock, "ipsec request", RW_RECURSE)
140220206Sfabient#define	IPSECREQUEST_LOCK(_isr)		rw_rlock(&(_isr)->lock)
141220206Sfabient#define	IPSECREQUEST_UNLOCK(_isr)	rw_runlock(&(_isr)->lock)
142220206Sfabient#define	IPSECREQUEST_WLOCK(_isr)	rw_wlock(&(_isr)->lock)
143220206Sfabient#define	IPSECREQUEST_WUNLOCK(_isr)	rw_wunlock(&(_isr)->lock)
144220206Sfabient#define	IPSECREQUEST_UPGRADE(_isr)	rw_try_upgrade(&(_isr)->lock)
145220206Sfabient#define	IPSECREQUEST_DOWNGRADE(_isr)	rw_downgrade(&(_isr)->lock)
146220206Sfabient#define	IPSECREQUEST_LOCK_DESTROY(_isr)	rw_destroy(&(_isr)->lock)
147220206Sfabient#define	IPSECREQUEST_LOCK_ASSERT(_isr)	rw_assert(&(_isr)->lock, RA_LOCKED)
148120585Ssam
149105197Ssam/* security policy in PCB */
150105197Ssamstruct inpcbpolicy {
151105197Ssam	struct secpolicy *sp_in;
152105197Ssam	struct secpolicy *sp_out;
153105197Ssam	int priv;			/* privileged socket ? */
154105197Ssam};
155105197Ssam
156105197Ssam/* SP acquiring list table. */
157105197Ssamstruct secspacq {
158105197Ssam	LIST_ENTRY(secspacq) chain;
159105197Ssam
160105197Ssam	struct secpolicyindex spidx;
161105197Ssam
162120585Ssam	time_t created;		/* for lifetime */
163105197Ssam	int count;		/* for lifetime */
164105197Ssam	/* XXX: here is mbuf place holder to be sent ? */
165105197Ssam};
166105197Ssam#endif /* _KERNEL */
167105197Ssam
168105197Ssam/* according to IANA assignment, port 0x0000 and proto 0xff are reserved. */
169105197Ssam#define IPSEC_PORT_ANY		0
170105197Ssam#define IPSEC_ULPROTO_ANY	255
171105197Ssam#define IPSEC_PROTO_ANY		255
172105197Ssam
173105197Ssam/* mode of security protocol */
174105197Ssam/* NOTE: DON'T use IPSEC_MODE_ANY at SPD.  It's only use in SAD */
175105197Ssam#define	IPSEC_MODE_ANY		0	/* i.e. wildcard. */
176105197Ssam#define	IPSEC_MODE_TRANSPORT	1
177105197Ssam#define	IPSEC_MODE_TUNNEL	2
178125680Sbms#define	IPSEC_MODE_TCPMD5	3	/* TCP MD5 mode */
179105197Ssam
180105197Ssam/*
181105197Ssam * Direction of security policy.
182105197Ssam * NOTE: Since INVALID is used just as flag.
183105197Ssam * The other are used for loop counter too.
184105197Ssam */
185105197Ssam#define IPSEC_DIR_ANY		0
186105197Ssam#define IPSEC_DIR_INBOUND	1
187105197Ssam#define IPSEC_DIR_OUTBOUND	2
188105197Ssam#define IPSEC_DIR_MAX		3
189105197Ssam#define IPSEC_DIR_INVALID	4
190105197Ssam
191105197Ssam/* Policy level */
192105197Ssam/*
193105197Ssam * IPSEC, ENTRUST and BYPASS are allowed for setsockopt() in PCB,
194105197Ssam * DISCARD, IPSEC and NONE are allowed for setkey() in SPD.
195105197Ssam * DISCARD and NONE are allowed for system default.
196105197Ssam */
197105197Ssam#define IPSEC_POLICY_DISCARD	0	/* discarding packet */
198105197Ssam#define IPSEC_POLICY_NONE	1	/* through IPsec engine */
199105197Ssam#define IPSEC_POLICY_IPSEC	2	/* do IPsec */
200105197Ssam#define IPSEC_POLICY_ENTRUST	3	/* consulting SPD if present. */
201105197Ssam#define IPSEC_POLICY_BYPASS	4	/* only for privileged socket. */
202105197Ssam
203105197Ssam/* Security protocol level */
204105197Ssam#define	IPSEC_LEVEL_DEFAULT	0	/* reference to system default */
205105197Ssam#define	IPSEC_LEVEL_USE		1	/* use SA if present. */
206105197Ssam#define	IPSEC_LEVEL_REQUIRE	2	/* require SA. */
207105197Ssam#define	IPSEC_LEVEL_UNIQUE	3	/* unique SA. */
208105197Ssam
209105197Ssam#define IPSEC_MANUAL_REQID_MAX	0x3fff
210105197Ssam				/*
211105197Ssam				 * if security policy level == unique, this id
212105197Ssam				 * indicate to a relative SA for use, else is
213105197Ssam				 * zero.
214105197Ssam				 * 1 - 0x3fff are reserved for manual keying.
215105197Ssam				 * 0 are reserved for above reason.  Others is
216105197Ssam				 * for kernel use.
217105197Ssam				 * Note that this id doesn't identify SA
218105197Ssam				 * by only itself.
219105197Ssam				 */
220105197Ssam#define IPSEC_REPLAYWSIZE  32
221105197Ssam
222171133Sgnn/* statistics for ipsec processing */
223105197Ssamstruct ipsecstat {
224253571Sae	uint64_t ips_in_polvio;		/* input: sec policy violation */
225253571Sae	uint64_t ips_in_nomem;		/* input: no memory available */
226253571Sae	uint64_t ips_in_inval;		/* input: generic error */
227125098Ssam
228253081Sae	uint64_t ips_out_polvio;	/* output: sec policy violation */
229253081Sae	uint64_t ips_out_nosa;		/* output: SA unavailable  */
230253081Sae	uint64_t ips_out_nomem;		/* output: no memory available */
231253081Sae	uint64_t ips_out_noroute;	/* output: no route available */
232253081Sae	uint64_t ips_out_inval;		/* output: generic error */
233253081Sae	uint64_t ips_out_bundlesa;	/* output: bundled SA processed */
234253571Sae
235253081Sae	uint64_t ips_mbcoalesced;	/* mbufs coalesced during clone */
236253081Sae	uint64_t ips_clcoalesced;	/* clusters coalesced during clone */
237253081Sae	uint64_t ips_clcopied;		/* clusters copied during clone */
238253081Sae	uint64_t ips_mbinserted;	/* mbufs inserted during makespace */
239105197Ssam	/*
240105197Ssam	 * Temporary statistics for performance analysis.
241105197Ssam	 */
242105197Ssam	/* See where ESP/AH/IPCOMP header land in mbuf on input */
243253081Sae	uint64_t ips_input_front;
244253081Sae	uint64_t ips_input_middle;
245253081Sae	uint64_t ips_input_end;
246105197Ssam};
247105197Ssam
248105197Ssam/*
249105197Ssam * Definitions for IPsec & Key sysctl operations.
250105197Ssam */
251105197Ssam/*
252105197Ssam * Names for IPsec & Key sysctl objects
253105197Ssam */
254105197Ssam#define IPSECCTL_STATS			1	/* stats */
255105197Ssam#define IPSECCTL_DEF_POLICY		2
256105197Ssam#define IPSECCTL_DEF_ESP_TRANSLEV	3	/* int; ESP transport mode */
257105197Ssam#define IPSECCTL_DEF_ESP_NETLEV		4	/* int; ESP tunnel mode */
258105197Ssam#define IPSECCTL_DEF_AH_TRANSLEV	5	/* int; AH transport mode */
259105197Ssam#define IPSECCTL_DEF_AH_NETLEV		6	/* int; AH tunnel mode */
260105197Ssam#if 0	/* obsolete, do not reuse */
261105197Ssam#define IPSECCTL_INBOUND_CALL_IKE	7
262105197Ssam#endif
263105197Ssam#define	IPSECCTL_AH_CLEARTOS		8
264105197Ssam#define	IPSECCTL_AH_OFFSETMASK		9
265105197Ssam#define	IPSECCTL_DFBIT			10
266105197Ssam#define	IPSECCTL_ECN			11
267105197Ssam#define	IPSECCTL_DEBUG			12
268105197Ssam#define	IPSECCTL_ESP_RANDPAD		13
269105197Ssam#define IPSECCTL_MAXID			14
270105197Ssam
271105197Ssam#ifdef _KERNEL
272253088Sae#include <sys/counter.h>
273253088Sae
274105197Ssamstruct ipsec_output_state {
275105197Ssam	struct mbuf *m;
276105197Ssam	struct route *ro;
277105197Ssam	struct sockaddr *dst;
278105197Ssam};
279105197Ssam
280105197Ssamstruct ipsec_history {
281105197Ssam	int ih_proto;
282105197Ssam	u_int32_t ih_spi;
283105197Ssam};
284105197Ssam
285195699SrwatsonVNET_DECLARE(int, ipsec_debug);
286195727Srwatson#define	V_ipsec_debug		VNET(ipsec_debug)
287207369Sbz
288207369Sbz#ifdef REGRESSION
289207369SbzVNET_DECLARE(int, ipsec_replay);
290207369SbzVNET_DECLARE(int, ipsec_integrity);
291207369Sbz
292207369Sbz#define	V_ipsec_replay		VNET(ipsec_replay)
293207369Sbz#define	V_ipsec_integrity	VNET(ipsec_integrity)
294207369Sbz#endif
295207369Sbz
296253088SaeVNET_PCPUSTAT_DECLARE(struct ipsecstat, ipsec4stat);
297207369SbzVNET_DECLARE(struct secpolicy, ip4_def_policy);
298207369SbzVNET_DECLARE(int, ip4_esp_trans_deflev);
299207369SbzVNET_DECLARE(int, ip4_esp_net_deflev);
300207369SbzVNET_DECLARE(int, ip4_ah_trans_deflev);
301207369SbzVNET_DECLARE(int, ip4_ah_net_deflev);
302195699SrwatsonVNET_DECLARE(int, ip4_ah_offsetmask);
303195699SrwatsonVNET_DECLARE(int, ip4_ipsec_dfbit);
304207369SbzVNET_DECLARE(int, ip4_ipsec_ecn);
305207369SbzVNET_DECLARE(int, ip4_esp_randpad);
306207369SbzVNET_DECLARE(int, crypto_support);
307207369Sbz
308253088Sae#define	IPSECSTAT_INC(name)	\
309253088Sae    VNET_PCPUSTAT_ADD(struct ipsecstat, ipsec4stat, name, 1)
310207369Sbz#define	V_ip4_def_policy	VNET(ip4_def_policy)
311195727Srwatson#define	V_ip4_esp_trans_deflev	VNET(ip4_esp_trans_deflev)
312195727Srwatson#define	V_ip4_esp_net_deflev	VNET(ip4_esp_net_deflev)
313195727Srwatson#define	V_ip4_ah_trans_deflev	VNET(ip4_ah_trans_deflev)
314195727Srwatson#define	V_ip4_ah_net_deflev	VNET(ip4_ah_net_deflev)
315207369Sbz#define	V_ip4_ah_offsetmask	VNET(ip4_ah_offsetmask)
316207369Sbz#define	V_ip4_ipsec_dfbit	VNET(ip4_ipsec_dfbit)
317195727Srwatson#define	V_ip4_ipsec_ecn		VNET(ip4_ipsec_ecn)
318195727Srwatson#define	V_ip4_esp_randpad	VNET(ip4_esp_randpad)
319195727Srwatson#define	V_crypto_support	VNET(crypto_support)
320195699Srwatson
321181803Sbz#define ipseclog(x)	do { if (V_ipsec_debug) log x; } while (0)
322105197Ssam/* for openbsd compatibility */
323181803Sbz#define	DPRINTF(x)	do { if (V_ipsec_debug) printf x; } while (0)
324105197Ssam
325119643Ssamextern	struct ipsecrequest *ipsec_newisr(void);
326119643Ssamextern	void ipsec_delisr(struct ipsecrequest *);
327119643Ssam
328105197Ssamstruct tdb_ident;
329283902Saeextern struct secpolicy *ipsec_getpolicy(struct tdb_ident*, u_int);
330105197Ssamstruct inpcb;
331283902Saeextern struct secpolicy *ipsec4_checkpolicy(struct mbuf *, u_int, u_int,
332283902Sae	int *, struct inpcb *);
333105197Ssamextern struct secpolicy * ipsec_getpolicybyaddr(struct mbuf *, u_int,
334105197Ssam	int, int *);
335105197Ssam
336105197Ssamstruct inpcb;
337283902Saeextern int ipsec_init_policy(struct socket *so, struct inpcbpolicy **);
338283902Saeextern int ipsec_copy_policy(struct inpcbpolicy *, struct inpcbpolicy *);
339283902Saeextern u_int ipsec_get_reqlevel(struct ipsecrequest *);
340283902Saeextern int ipsec_in_reject(struct secpolicy *, struct mbuf *);
341105197Ssam
342283902Saeextern int ipsec_set_policy(struct inpcb *inp, int optname,
343283902Sae	caddr_t request, size_t len, struct ucred *cred);
344283902Saeextern int ipsec_get_policy(struct inpcb *inpcb, caddr_t request,
345283902Sae	size_t len, struct mbuf **mp);
346283902Saeextern int ipsec_delete_pcbpolicy(struct inpcb *);
347283902Saeextern int ipsec4_in_reject(struct mbuf *, struct inpcb *);
348105197Ssam
349105197Ssamstruct secas;
350105197Ssamstruct tcpcb;
351283902Saeextern int ipsec_chkreplay(u_int32_t, struct secasvar *);
352283902Saeextern int ipsec_updatereplay(u_int32_t, struct secasvar *);
353105197Ssam
354283902Saeextern size_t ipsec_hdrsiz(struct mbuf *, u_int, struct inpcb *);
355283902Saeextern size_t ipsec_hdrsiz_tcp(struct tcpcb *);
356105197Ssam
357105197Ssamunion sockaddr_union;
358105197Ssamextern char * ipsec_address(union sockaddr_union* sa);
359283902Saeextern const char *ipsec_logsastr(struct secasvar *);
360105197Ssam
361283902Saeextern void ipsec_dumpmbuf(struct mbuf *);
362105197Ssam
363105197Ssamstruct m_tag;
364106680Ssamextern void ah4_input(struct mbuf *m, int off);
365120585Ssamextern void ah4_ctlinput(int cmd, struct sockaddr *sa, void *);
366106680Ssamextern void esp4_input(struct mbuf *m, int off);
367120585Ssamextern void esp4_ctlinput(int cmd, struct sockaddr *sa, void *);
368106680Ssamextern void ipcomp4_input(struct mbuf *m, int off);
369105197Ssamextern int ipsec4_common_input(struct mbuf *m, ...);
370105197Ssamextern int ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav,
371105197Ssam			int skip, int protoff, struct m_tag *mt);
372283902Saeextern int ipsec4_process_packet(struct mbuf *, struct ipsecrequest *,
373283902Sae			int, int);
374283902Saeextern int ipsec_process_done(struct mbuf *, struct ipsecrequest *);
375105197Ssam
376283902Saeextern struct mbuf *ipsec_copypkt(struct mbuf *);
377105197Ssam
378105197Ssamextern	void m_checkalignment(const char* where, struct mbuf *m0,
379105197Ssam		int off, int len);
380105197Ssamextern	struct mbuf *m_makespace(struct mbuf *m0, int skip, int hlen, int *off);
381105197Ssamextern	caddr_t m_pad(struct mbuf *m, int n);
382105197Ssamextern	int m_striphdr(struct mbuf *m, int skip, int hlen);
383174054Sbz
384174054Sbz#ifdef DEV_ENC
385174054Sbz#define	ENC_BEFORE	0x0001
386174054Sbz#define	ENC_AFTER	0x0002
387174054Sbz#define	ENC_IN		0x0100
388174054Sbz#define	ENC_OUT		0x0200
389174054Sbzextern	int ipsec_filter(struct mbuf **, int, int);
390174054Sbzextern	void ipsec_bpf(struct mbuf *, struct secasvar *, int, int);
391174054Sbz#endif
392105197Ssam#endif /* _KERNEL */
393105197Ssam
394105197Ssam#ifndef _KERNEL
395283902Saeextern caddr_t ipsec_set_policy(char *, int);
396283902Saeextern int ipsec_get_policylen(caddr_t);
397283902Saeextern char *ipsec_dump_policy(caddr_t, char *);
398283902Saeextern const char *ipsec_strerror(void);
399105197Ssam
400183550Szec#endif /* ! KERNEL */
401183550Szec
402105197Ssam#endif /* _NETIPSEC_IPSEC_H_ */
403