xref: /iperf/src/flowlabel.h (revision 3ea0269f)
1 /*
2  * iperf, Copyright (c) 2014, The Regents of the University of
3  * California, through Lawrence Berkeley National Laboratory (subject
4  * to receipt of any required approvals from the U.S. Dept. of
5  * Energy).  All rights reserved.
6  *
7  * If you have questions about your rights to use or distribute this
8  * software, please contact Berkeley Lab's Technology Transfer
9  * Department at [email protected].
10  *
11  * NOTICE.  This software is owned by the U.S. Department of Energy.
12  * As such, the U.S. Government has been granted for itself and others
13  * acting on its behalf a paid-up, nonexclusive, irrevocable,
14  * worldwide license in the Software to reproduce, prepare derivative
15  * works, and perform publicly and display publicly.  Beginning five
16  * (5) years after the date permission to assert copyright is obtained
17  * from the U.S. Department of Energy, and subject to any subsequent
18  * five (5) year renewals, the U.S. Government is granted for itself
19  * and others acting on its behalf a paid-up, nonexclusive,
20  * irrevocable, worldwide license in the Software to reproduce,
21  * prepare derivative works, distribute copies to the public, perform
22  * publicly and display publicly, and to permit others to do so.
23  *
24  * This code is distributed under a BSD style license, see the LICENSE
25  * file for complete information.
26  */
27 #ifndef        __FLOW_LABEL_H
28 #define        __FLOW_LABEL_H
29 
30 
31 #include <linux/types.h>
32 #include <linux/version.h>
33 
34 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
35 #include <linux/in6.h>
36 #else
37 #ifndef __ANDROID__
38 /*
39    It is just a stripped copy of the Linux kernel header "linux/in6.h"
40    "Flow label" things are still not defined in "netinet/in*.h" headers,
41    but we cannot use "linux/in6.h" immediately because it currently
42    conflicts with "netinet/in.h" . (in kernel versions < 3.7.0)
43 */
44 struct in6_flowlabel_req
45 {
46     struct in6_addr flr_dst;
47     __u32   flr_label;
48     __u8    flr_action;
49     __u8    flr_share;
50     __u16   flr_flags;
51     __u16   flr_expires;
52     __u16   flr_linger;
53     __u32   __flr_pad;
54     /* Options in format of IPV6_PKTOPTIONS */
55 };
56 #endif
57 
58 #define IPV6_FL_A_GET           0
59 #define IPV6_FL_A_PUT           1
60 #define IPV6_FL_A_RENEW         2
61 
62 #define IPV6_FL_F_CREATE        1
63 #define IPV6_FL_F_EXCL          2
64 
65 #define IPV6_FL_S_NONE          0
66 #define IPV6_FL_S_EXCL          1
67 #define IPV6_FL_S_PROCESS       2
68 #define IPV6_FL_S_USER          3
69 #define IPV6_FL_S_ANY           255
70 
71 #define IPV6_FLOWINFO_FLOWLABEL 0x000fffff
72 #define IPV6_FLOWINFO_PRIORITY  0x0ff00000
73 
74 #endif
75 #define IPV6_FLOWLABEL_MGR      32
76 #define IPV6_FLOWINFO_SEND      33
77 
78 #endif
79