xref: /openbsd-src/sys/net/if_sec.h (revision 433cd47b3998c7b6449aab67696f889070f0a238)
1 /*	$OpenBSD: if_sec.h,v 1.1 2023/08/07 01:57:33 dlg Exp $ */
2 
3 /*
4  * Copyright (c) 2023 David Gwynne <dlg@openbsd.org>
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #ifndef _NET_IF_SEC_H
20 #define _NET_IF_SEC_H
21 
22 #ifdef _KERNEL
23 struct sec_softc;
24 struct tdb;
25 
26 /*
27  * let the IPsec stack hand packets to sec(4) for input
28  */
29 
30 struct sec_softc	*sec_get(unsigned int);
31 void			 sec_input(struct sec_softc * , int, int,
32 			     struct mbuf *);
33 void			 sec_put(struct sec_softc *);
34 
35 /*
36  * let the IPsec stack give tdbs to sec(4) for output
37  */
38 
39 void			 sec_tdb_insert(struct tdb *);
40 void			 sec_tdb_remove(struct tdb *);
41 
42 #endif /* _KERNEL */
43 
44 #endif /* _NET_IF_SEC_H */
45