add chaos_calmer branch
[15.05/openwrt.git] / package / kernel / mac80211 / patches / 020-add_mpls_h.patch
1 --- /dev/null
2 +++ b/include/uapi/linux/mpls.h
3 @@ -0,0 +1,34 @@
4 +#ifndef _UAPI_MPLS_H
5 +#define _UAPI_MPLS_H
6 +
7 +#include <linux/types.h>
8 +#include <asm/byteorder.h>
9 +
10 +/* Reference: RFC 5462, RFC 3032
11 + *
12 + *  0                   1                   2                   3
13 + *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
14 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
15 + * |                Label                  | TC  |S|       TTL     |
16 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
17 + *
18 + *     Label:  Label Value, 20 bits
19 + *     TC:     Traffic Class field, 3 bits
20 + *     S:      Bottom of Stack, 1 bit
21 + *     TTL:    Time to Live, 8 bits
22 + */
23 +
24 +struct mpls_label {
25 +       __be32 entry;
26 +};
27 +
28 +#define MPLS_LS_LABEL_MASK      0xFFFFF000
29 +#define MPLS_LS_LABEL_SHIFT     12
30 +#define MPLS_LS_TC_MASK         0x00000E00
31 +#define MPLS_LS_TC_SHIFT        9
32 +#define MPLS_LS_S_MASK          0x00000100
33 +#define MPLS_LS_S_SHIFT         8
34 +#define MPLS_LS_TTL_MASK        0x000000FF
35 +#define MPLS_LS_TTL_SHIFT       0
36 +
37 +#endif /* _UAPI_MPLS_H */