1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2016 6WIND S.A. 3 */ 4 5 #ifndef _RTE_MPLS_H_ 6 #define _RTE_MPLS_H_ 7 8 /** 9 * @file 10 * 11 * MPLS-related defines 12 */ 13 14 #include <stdint.h> 15 #include <rte_byteorder.h> 16 17 /** 18 * MPLS header. 19 */ 20 __extension__ 21 struct __rte_packed_begin rte_mpls_hdr { 22 rte_be16_t tag_msb; /**< Label(msb). */ 23 #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN 24 uint8_t tag_lsb:4; /**< Label(lsb). */ 25 uint8_t tc:3; /**< Traffic class. */ 26 uint8_t bs:1; /**< Bottom of stack. */ 27 #else 28 uint8_t bs:1; /**< Bottom of stack. */ 29 uint8_t tc:3; /**< Traffic class. */ 30 uint8_t tag_lsb:4; /**< label(lsb) */ 31 #endif 32 uint8_t ttl; /**< Time to live. */ 33 } __rte_packed_end; 34 35 #endif /* RTE_MPLS_H_ */ 36