diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2018-11-01 11:59:50 +0000 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2018-11-01 12:00:19 +0000 |
commit | 8d01b9cd70a67cdafd5b965a70420c3bd7fb3f82 (patch) | |
tree | 208e3bc33c220854d89d010e3abf720a2e62e546 /lib/librte_net/rte_mpls.h | |
parent | b63264c8342e6a1b6971c79550d2af2024b6a4de (diff) |
New upstream version 18.11-rc1upstream/18.11-rc1
Change-Id: Iaa71986dd6332e878d8f4bf493101b2bbc6313bb
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'lib/librte_net/rte_mpls.h')
-rw-r--r-- | lib/librte_net/rte_mpls.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/librte_net/rte_mpls.h b/lib/librte_net/rte_mpls.h new file mode 100644 index 00000000..11d26ba3 --- /dev/null +++ b/lib/librte_net/rte_mpls.h @@ -0,0 +1,42 @@ +/* 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. + */ +struct mpls_hdr { + 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. */ +} __attribute__((__packed__)); + +#ifdef __cplusplus +} +#endif + +#endif /* RTE_MPLS_H_ */ |