Blame include/uapi/linux/mpls.h

Packit Service 3880ab
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
Packit Service 3880ab
#ifndef _MPLS_H
Packit Service 3880ab
#define _MPLS_H
Packit Service 3880ab
Packit Service 3880ab
#include <linux/types.h>
Packit Service 3880ab
#include <asm/byteorder.h>
Packit Service 3880ab
Packit Service 3880ab
/* Reference: RFC 5462, RFC 3032
Packit Service 3880ab
 *
Packit Service 3880ab
 *  0                   1                   2                   3
Packit Service 3880ab
 *  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
Packit Service 3880ab
 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Packit Service 3880ab
 * |                Label                  | TC  |S|       TTL     |
Packit Service 3880ab
 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Packit Service 3880ab
 *
Packit Service 3880ab
 *	Label:  Label Value, 20 bits
Packit Service 3880ab
 *	TC:     Traffic Class field, 3 bits
Packit Service 3880ab
 *	S:      Bottom of Stack, 1 bit
Packit Service 3880ab
 *	TTL:    Time to Live, 8 bits
Packit Service 3880ab
 */
Packit Service 3880ab
Packit Service 3880ab
struct mpls_label {
Packit Service 3880ab
	__be32 entry;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#define MPLS_LS_LABEL_MASK      0xFFFFF000
Packit Service 3880ab
#define MPLS_LS_LABEL_SHIFT     12
Packit Service 3880ab
#define MPLS_LS_TC_MASK         0x00000E00
Packit Service 3880ab
#define MPLS_LS_TC_SHIFT        9
Packit Service 3880ab
#define MPLS_LS_S_MASK          0x00000100
Packit Service 3880ab
#define MPLS_LS_S_SHIFT         8
Packit Service 3880ab
#define MPLS_LS_TTL_MASK        0x000000FF
Packit Service 3880ab
#define MPLS_LS_TTL_SHIFT       0
Packit Service 3880ab
Packit Service 3880ab
/* Reserved labels */
Packit Service 3880ab
#define MPLS_LABEL_IPV4NULL		0 /* RFC3032 */
Packit Service 3880ab
#define MPLS_LABEL_RTALERT		1 /* RFC3032 */
Packit Service 3880ab
#define MPLS_LABEL_IPV6NULL		2 /* RFC3032 */
Packit Service 3880ab
#define MPLS_LABEL_IMPLNULL		3 /* RFC3032 */
Packit Service 3880ab
#define MPLS_LABEL_ENTROPY		7 /* RFC6790 */
Packit Service 3880ab
#define MPLS_LABEL_GAL			13 /* RFC5586 */
Packit Service 3880ab
#define MPLS_LABEL_OAMALERT		14 /* RFC3429 */
Packit Service 3880ab
#define MPLS_LABEL_EXTENSION		15 /* RFC7274 */
Packit Service 3880ab
Packit Service 3880ab
#define MPLS_LABEL_FIRST_UNRESERVED	16 /* RFC3032 */
Packit Service 3880ab
Packit Service 3880ab
/* These are embedded into IFLA_STATS_AF_SPEC:
Packit Service 3880ab
 * [IFLA_STATS_AF_SPEC]
Packit Service 3880ab
 * -> [AF_MPLS]
Packit Service 3880ab
 *    -> [MPLS_STATS_xxx]
Packit Service 3880ab
 *
Packit Service 3880ab
 * Attributes:
Packit Service 3880ab
 * [MPLS_STATS_LINK] = {
Packit Service 3880ab
 *     struct mpls_link_stats
Packit Service 3880ab
 * }
Packit Service 3880ab
 */
Packit Service 3880ab
enum {
Packit Service 3880ab
	MPLS_STATS_UNSPEC, /* also used as 64bit pad attribute */
Packit Service 3880ab
	MPLS_STATS_LINK,
Packit Service 3880ab
	__MPLS_STATS_MAX,
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#define MPLS_STATS_MAX (__MPLS_STATS_MAX - 1)
Packit Service 3880ab
Packit Service 3880ab
struct mpls_link_stats {
Packit Service 3880ab
	__u64	rx_packets;		/* total packets received	*/
Packit Service 3880ab
	__u64	tx_packets;		/* total packets transmitted	*/
Packit Service 3880ab
	__u64	rx_bytes;		/* total bytes received		*/
Packit Service 3880ab
	__u64	tx_bytes;		/* total bytes transmitted	*/
Packit Service 3880ab
	__u64	rx_errors;		/* bad packets received		*/
Packit Service 3880ab
	__u64	tx_errors;		/* packet transmit problems	*/
Packit Service 3880ab
	__u64	rx_dropped;		/* packet dropped on receive	*/
Packit Service 3880ab
	__u64	tx_dropped;		/* packet dropped on transmit	*/
Packit Service 3880ab
	__u64	rx_noroute;		/* no route for packet dest	*/
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#endif /* _MPLS_H */