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 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 /** 22 * MPLS header. 23 */ 24 __extension__ 25 struct rte_mpls_hdr { 26 uint16_t tag_msb; /**< Label(msb). */ 27 #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN 28 uint8_t tag_lsb:4; /**< Label(lsb). */ 29 uint8_t tc:3; /**< Traffic class. */ 30 uint8_t bs:1; /**< Bottom of stack. */ 31 #else 32 uint8_t bs:1; /**< Bottom of stack. */ 33 uint8_t tc:3; /**< Traffic class. */ 34 uint8_t tag_lsb:4; /**< label(lsb) */ 35 #endif 36 uint8_t ttl; /**< Time to live. */ 37 } __rte_packed; 38 39 #ifdef __cplusplus 40 } 41 #endif 42 43 #endif /* RTE_MPLS_H_ */ 44