Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
0002 /*
0003  *  SR-IPv6 implementation
0004  *
0005  *  Author:
0006  *  David Lebrun <david.lebrun@uclouvain.be>
0007  *
0008  *
0009  *  This program is free software; you can redistribute it and/or
0010  *      modify it under the terms of the GNU General Public License
0011  *      as published by the Free Software Foundation; either version
0012  *      2 of the License, or (at your option) any later version.
0013  */
0014 
0015 #ifndef _UAPI_LINUX_SEG6_H
0016 #define _UAPI_LINUX_SEG6_H
0017 
0018 #include <linux/types.h>
0019 #include <linux/in6.h>      /* For struct in6_addr. */
0020 
0021 /*
0022  * SRH
0023  */
0024 struct ipv6_sr_hdr {
0025     __u8    nexthdr;
0026     __u8    hdrlen;
0027     __u8    type;
0028     __u8    segments_left;
0029     __u8    first_segment; /* Represents the last_entry field of SRH */
0030     __u8    flags;
0031     __u16   tag;
0032 
0033     struct in6_addr segments[];
0034 };
0035 
0036 #define SR6_FLAG1_PROTECTED (1 << 6)
0037 #define SR6_FLAG1_OAM       (1 << 5)
0038 #define SR6_FLAG1_ALERT     (1 << 4)
0039 #define SR6_FLAG1_HMAC      (1 << 3)
0040 
0041 #define SR6_TLV_INGRESS     1
0042 #define SR6_TLV_EGRESS      2
0043 #define SR6_TLV_OPAQUE      3
0044 #define SR6_TLV_PADDING     4
0045 #define SR6_TLV_HMAC        5
0046 
0047 #define sr_has_hmac(srh) ((srh)->flags & SR6_FLAG1_HMAC)
0048 
0049 struct sr6_tlv {
0050     __u8 type;
0051     __u8 len;
0052     __u8 data[0];
0053 };
0054 
0055 #endif