2 * SR-IPv6 implementation
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
14 #ifndef _UAPI_LINUX_SEG6_IPTUNNEL_H
15 #define _UAPI_LINUX_SEG6_IPTUNNEL_H
17 #include <linux/seg6.h> /* For struct ipv6_sr_hdr. */
24 #define SEG6_IPTUNNEL_MAX (__SEG6_IPTUNNEL_MAX - 1)
26 struct seg6_iptunnel_encap {
28 struct ipv6_sr_hdr srh[0];
31 #define SEG6_IPTUN_ENCAP_SIZE(x) ((sizeof(*x)) + (((x)->srh->hdrlen + 1) << 3))
34 SEG6_IPTUN_MODE_INLINE,
35 SEG6_IPTUN_MODE_ENCAP,
36 SEG6_IPTUN_MODE_L2ENCAP,
41 static inline size_t seg6_lwt_headroom(struct seg6_iptunnel_encap *tuninfo)
45 switch (tuninfo->mode) {
46 case SEG6_IPTUN_MODE_INLINE:
48 case SEG6_IPTUN_MODE_ENCAP:
49 head = sizeof(struct ipv6hdr);
51 case SEG6_IPTUN_MODE_L2ENCAP:
55 return ((tuninfo->srh->hdrlen + 1) << 3) + head;