enb_config.h 4.05 KB
Newer Older
1 2 3 4 5
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
6
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
7 8 9 10 11 12 13 14 15 16 17 18 19 20
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
21

Lionel Gauthier's avatar
Lionel Gauthier committed
22 23 24
/*
                                enb_config.h
                             -------------------
25
  AUTHOR  : Lionel GAUTHIER, Navid Nikaein, Laurent Winckel
Lionel Gauthier's avatar
Lionel Gauthier committed
26
  COMPANY : EURECOM
27
  EMAIL   : Lionel.Gauthier@eurecom.fr, navid.nikaein@eurecom.fr
Lionel Gauthier's avatar
Lionel Gauthier committed
28
*/
29 30 31

#ifndef ENB_CONFIG_H_
#define ENB_CONFIG_H_
32 33 34
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
laurent's avatar
laurent committed
35
#include <libconfig.h>
36 37

#include "commonDef.h"
Lionel Gauthier's avatar
 
Lionel Gauthier committed
38
#include "platform_types.h"
Navid Nikaein's avatar
Navid Nikaein committed
39
#include "platform_constants.h"
40
#include "PHY/impl_defs_lte.h"
41
#include "PHY/defs_eNB.h"
42
#include "s1ap_messages_types.h"
43
#include "f1ap_messages_types.h"
44
#include "LTE_SystemInformationBlockType2.h"
laurent's avatar
laurent committed
45
#include "rrc_messages_types.h"
46
#include "RRC/LTE/rrc_defs.h"
laurent's avatar
laurent committed
47
#include <intertask_interface.h>
48
#include "enb_paramdef.h"
49

Lionel Gauthier's avatar
Lionel Gauthier committed
50 51 52 53 54 55 56 57
#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\
            struct in_addr inp;\
            if ( inet_aton(AdDr_StR, &inp ) < 0 ) {\
                AssertFatal (0, MeSsAgE);\
            } else {\
                NwBo = inp.s_addr;\
            }\
        } while (0);
58

59 60 61 62 63 64 65 66
/** @defgroup _enb_app ENB APP 
 * @ingroup _oai2
 * @{
 */

// Hard to find a defined value for max enb...
#define MAX_ENB 16

67 68 69
#define MAX_DU	4
#define CU_BALANCING_ALL		127
#define CU_BALANCING_ROUND_ROBIN	126
70

71
typedef struct mme_ip_address_s {
72 73 74 75 76
  unsigned  ipv4:1;
  unsigned  ipv6:1;
  unsigned  active:1;
  char     *ipv4_address;
  char     *ipv6_address;
77 78
} mme_ip_address_t;

79 80 81
typedef struct cu_params {
  const char    *local_ipv4_address;
  const uint16_t local_port;
Robert Schmidt's avatar
Robert Schmidt committed
82 83 84
  const char    *remote_ipv4_address;
  const int16_t  remote_port;
} cudu_params_t;
85

86 87 88 89
typedef struct ru_config_s {
  // indicates if local or remote rf is used (1 == LOCAL)
  unsigned  local_rf:1;
  // indicates if UDP socket is used
90
  unsigned  udp:1;
91
  // indicates if RAW socket is used
92
  unsigned  raw:1;
93
  char      *ru_if_name;
94 95 96 97
  char     *local_address;
  char     *remote_address;
  uint16_t  local_port;
  uint16_t  remote_port;
Raymond Knopp's avatar
Raymond Knopp committed
98 99
  uint8_t   udpif4p5;
  uint8_t   rawif4p5;
100
  uint8_t   rawif5_mobipass;
101
  uint8_t   if_compress;
102
} ru_config_t;
103

104
extern void RCconfig_RU(void);
105
extern void RCconfig_flexran(void);
106
extern void RCconfig_L1(void);
107
extern void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]);
108
extern void UE_config_stub_pnf(void);
109 110
extern int  RCconfig_gtpu(void );
extern void RCConfig(void);
111

112
void                          enb_config_display(void);
113
void                          ru_config_display(void);
114

115
int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1);
Cedric Roux's avatar
Cedric Roux committed
116
int RCconfig_S1(MessageDef *msg_p, uint32_t i);
117

118
void read_config_and_init(void);
119
int RCconfig_X2(MessageDef *msg_p, uint32_t i);
120
int RCconfig_M2(MessageDef *msg_p, uint32_t i);
121

122 123 124
void fill_SL_configuration(MessageDef *msg_p,  ccparams_sidelink_t *SLconfig,int cell_idx,int cc_idx,char *config_fname);
void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, int cell_idx,int cc_idx,char *config_fname,char *brparamspath);

Robert Schmidt's avatar
Robert Schmidt committed
125 126 127
int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i);
void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp);

128
#endif /* ENB_CONFIG_H_ */
129
/** @} */