xref: /openbsd/sys/net/if_enc.h (revision d415bd75)
1 /*	$OpenBSD: if_enc.h,v 1.13 2021/12/01 21:48:00 deraadt Exp $	*/
2 
3 /*
4  * Copyright (c) 2010 Reyk Floeter <reyk@vantronix.net>
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_ENC_H
20 #define _NET_ENC_H
21 
22 #define ENCMTU		1536		/* XXX should be bigger, maybe LOMTU */
23 #define ENC_HDRLEN	12
24 
25 struct enchdr {
26 	u_int32_t af;
27 	u_int32_t spi;
28 	u_int32_t flags;	/* similar to mbuf m_flags */
29 };
30 
31 #ifdef _KERNEL
32 struct enc_softc {
33 	struct ifnet		 sc_if;		/* virtual interface */
34 	u_int			 sc_unit;
35 	struct ifaddr		 sc_ifa;	/* needed to attach rtentry */
36 };
37 
38 struct ifnet	*enc_getif(u_int, u_int);
39 struct ifaddr	*enc_getifa(u_int, u_int);
40 #endif /* _KERNEL */
41 
42 #endif /* _NET_ENC_H */
43