2018-10-23 07:46:48 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
* Copyright(c) 2016 6WIND S.A.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _RTE_MPLS_H_
|
|
|
|
#define _RTE_MPLS_H_
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* MPLS-related defines
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <rte_byteorder.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MPLS header.
|
|
|
|
*/
|
2020-07-21 08:31:55 +00:00
|
|
|
__extension__
|
2019-10-23 13:40:00 +00:00
|
|
|
struct rte_mpls_hdr {
|
2018-10-23 07:46:48 +00:00
|
|
|
uint16_t tag_msb; /**< Label(msb). */
|
|
|
|
#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
|
|
|
|
uint8_t tag_lsb:4; /**< Label(lsb). */
|
|
|
|
uint8_t tc:3; /**< Traffic class. */
|
|
|
|
uint8_t bs:1; /**< Bottom of stack. */
|
|
|
|
#else
|
|
|
|
uint8_t bs:1; /**< Bottom of stack. */
|
|
|
|
uint8_t tc:3; /**< Traffic class. */
|
|
|
|
uint8_t tag_lsb:4; /**< label(lsb) */
|
|
|
|
#endif
|
|
|
|
uint8_t ttl; /**< Time to live. */
|
2020-02-09 17:29:23 +00:00
|
|
|
} __rte_packed;
|
2018-10-23 07:46:48 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* RTE_MPLS_H_ */
|