0001
0002 #ifndef _UAPI_MPLS_H
0003 #define _UAPI_MPLS_H
0004
0005 #include <linux/types.h>
0006 #include <asm/byteorder.h>
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 struct mpls_label {
0023 __be32 entry;
0024 };
0025
0026 #define MPLS_LS_LABEL_MASK 0xFFFFF000
0027 #define MPLS_LS_LABEL_SHIFT 12
0028 #define MPLS_LS_TC_MASK 0x00000E00
0029 #define MPLS_LS_TC_SHIFT 9
0030 #define MPLS_LS_S_MASK 0x00000100
0031 #define MPLS_LS_S_SHIFT 8
0032 #define MPLS_LS_TTL_MASK 0x000000FF
0033 #define MPLS_LS_TTL_SHIFT 0
0034
0035
0036 #define MPLS_LABEL_IPV4NULL 0
0037 #define MPLS_LABEL_RTALERT 1
0038 #define MPLS_LABEL_IPV6NULL 2
0039 #define MPLS_LABEL_IMPLNULL 3
0040 #define MPLS_LABEL_ENTROPY 7
0041 #define MPLS_LABEL_GAL 13
0042 #define MPLS_LABEL_OAMALERT 14
0043 #define MPLS_LABEL_EXTENSION 15
0044
0045 #define MPLS_LABEL_FIRST_UNRESERVED 16
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 enum {
0058 MPLS_STATS_UNSPEC,
0059 MPLS_STATS_LINK,
0060 __MPLS_STATS_MAX,
0061 };
0062
0063 #define MPLS_STATS_MAX (__MPLS_STATS_MAX - 1)
0064
0065 struct mpls_link_stats {
0066 __u64 rx_packets;
0067 __u64 tx_packets;
0068 __u64 rx_bytes;
0069 __u64 tx_bytes;
0070 __u64 rx_errors;
0071 __u64 tx_errors;
0072 __u64 rx_dropped;
0073 __u64 tx_dropped;
0074 __u64 rx_noroute;
0075 };
0076
0077 #endif