1 /******************************************************************************
3 * Copyright (c) 2020 Intel.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 *******************************************************************************/
20 * @brief This file provides the definitions for Transport layer (eCPRI) API.
22 * @file xran_transport.h
23 * @ingroup group_lte_source_xran
24 * @author Intel Corporation
28 #ifndef _XRAN_TRANSPORT_H_
29 #define _XRAN_TRANSPORT_H_
35 #include <rte_common.h>
40 #define XRAN_ECPRI_HDR_SZ (sizeof(struct xran_ecpri_hdr) - sizeof(union xran_ecpri_cmn_hdr))
42 struct xran_eaxc_info {
49 struct xran_recv_packet_info {
51 enum ecpri_msg_type msg_type;
53 struct xran_eaxc_info eaxc;
60 int xran_get_ecpri_hdr_size(void);
61 void xran_update_ecpri_payload_size(struct rte_mbuf *mbuf, int size);
63 uint16_t xran_compose_cid(uint8_t CU_Port_ID, uint8_t BandSector_ID, uint8_t CC_ID, uint8_t Ant_ID);
64 void xran_decompose_cid(uint16_t cid, struct xran_eaxc_info *result);
66 int xran_build_ecpri_hdr(struct rte_mbuf *mbuf,
67 uint8_t CC_ID, uint8_t Ant_ID,
69 struct xran_ecpri_hdr **ecpri_hdr);
71 int xran_parse_ecpri_hdr(struct rte_mbuf *mbuf,
72 struct xran_ecpri_hdr **ecpri_hdr,
73 struct xran_recv_packet_info *pkt_info);