xref: /linux/include/uapi/linux/seg6_iptunnel.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
26c8702c6SDavid Lebrun /*
36c8702c6SDavid Lebrun  *  SR-IPv6 implementation
46c8702c6SDavid Lebrun  *
56c8702c6SDavid Lebrun  *  Author:
66c8702c6SDavid Lebrun  *  David Lebrun <david.lebrun@uclouvain.be>
76c8702c6SDavid Lebrun  *
86c8702c6SDavid Lebrun  *
96c8702c6SDavid Lebrun  *  This program is free software; you can redistribute it and/or
106c8702c6SDavid Lebrun  *      modify it under the terms of the GNU General Public License
116c8702c6SDavid Lebrun  *      as published by the Free Software Foundation; either version
126c8702c6SDavid Lebrun  *      2 of the License, or (at your option) any later version.
136c8702c6SDavid Lebrun  */
146c8702c6SDavid Lebrun 
156c8702c6SDavid Lebrun #ifndef _UAPI_LINUX_SEG6_IPTUNNEL_H
166c8702c6SDavid Lebrun #define _UAPI_LINUX_SEG6_IPTUNNEL_H
176c8702c6SDavid Lebrun 
18ea3ebc73SDmitry V. Levin #include <linux/seg6.h>		/* For struct ipv6_sr_hdr. */
19ea3ebc73SDmitry V. Levin 
206c8702c6SDavid Lebrun enum {
216c8702c6SDavid Lebrun 	SEG6_IPTUNNEL_UNSPEC,
226c8702c6SDavid Lebrun 	SEG6_IPTUNNEL_SRH,
236c8702c6SDavid Lebrun 	__SEG6_IPTUNNEL_MAX,
246c8702c6SDavid Lebrun };
256c8702c6SDavid Lebrun #define SEG6_IPTUNNEL_MAX (__SEG6_IPTUNNEL_MAX - 1)
266c8702c6SDavid Lebrun 
276c8702c6SDavid Lebrun struct seg6_iptunnel_encap {
286c8702c6SDavid Lebrun 	int mode;
2994dfc73eSGustavo A. R. Silva 	struct ipv6_sr_hdr srh[];
306c8702c6SDavid Lebrun };
316c8702c6SDavid Lebrun 
326c8702c6SDavid Lebrun #define SEG6_IPTUN_ENCAP_SIZE(x) ((sizeof(*x)) + (((x)->srh->hdrlen + 1) << 3))
336c8702c6SDavid Lebrun 
346c8702c6SDavid Lebrun enum {
356c8702c6SDavid Lebrun 	SEG6_IPTUN_MODE_INLINE,
366c8702c6SDavid Lebrun 	SEG6_IPTUN_MODE_ENCAP,
3738ee7f2dSDavid Lebrun 	SEG6_IPTUN_MODE_L2ENCAP,
38b07c8cdbSAndrea Mayer 	SEG6_IPTUN_MODE_ENCAP_RED,
39*13f0296bSAndrea Mayer 	SEG6_IPTUN_MODE_L2ENCAP_RED,
406c8702c6SDavid Lebrun };
416c8702c6SDavid Lebrun 
42a50a05f4SDavid Lebrun #endif
43