Commit 1426ee5e authored by Frédéric Leroy's avatar Frédéric Leroy

feat: add optional parameter port for mme connection

parent cad82409
...@@ -386,6 +386,7 @@ typedef struct s1ap_register_enb_req_s { ...@@ -386,6 +386,7 @@ typedef struct s1ap_register_enb_req_s {
uint8_t nb_mme; uint8_t nb_mme;
/* List of MME to connect to */ /* List of MME to connect to */
net_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS]; net_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS];
uint16_t mme_port[S1AP_MAX_NB_MME_IP_ADDRESS];
uint8_t broadcast_plmn_num[S1AP_MAX_NB_MME_IP_ADDRESS]; uint8_t broadcast_plmn_num[S1AP_MAX_NB_MME_IP_ADDRESS];
uint8_t broadcast_plmn_index[S1AP_MAX_NB_MME_IP_ADDRESS][PLMN_LIST_MAX_SIZE]; uint8_t broadcast_plmn_index[S1AP_MAX_NB_MME_IP_ADDRESS][PLMN_LIST_MAX_SIZE];
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#include "enb_paramdef.h" #include "enb_paramdef.h"
#include "proto_agent.h" #include "proto_agent.h"
#include "executables/thread-common.h" #include "executables/thread-common.h"
#include "s1ap_eNB_default_values.h"
extern uint32_t to_earfcn_DL(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw); extern uint32_t to_earfcn_DL(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw);
extern uint32_t to_earfcn_UL(int eutra_bandP, uint32_t ul_CarrierFreq, uint32_t bw); extern uint32_t to_earfcn_UL(int eutra_bandP, uint32_t ul_CarrierFreq, uint32_t bw);
...@@ -2511,6 +2512,13 @@ int RCconfig_S1( ...@@ -2511,6 +2512,13 @@ int RCconfig_S1(
S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] = 0; S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] = 0;
} }
/* set S1-mme port (sctp) */
if (S1ParamList.paramarray[l][ENB_MME_PORT_IDX].u16ptr) {
S1AP_REGISTER_ENB_REQ(msg_p).mme_port[l] = *S1ParamList.paramarray[l][ENB_MME_PORT_IDX].u16ptr;
} else {
S1AP_REGISTER_ENB_REQ(msg_p).mme_port[l] = S1AP_PORT_NUMBER;
}
AssertFatal(S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] <= S1AP_REGISTER_ENB_REQ(msg_p).num_plmn, AssertFatal(S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] <= S1AP_REGISTER_ENB_REQ(msg_p).num_plmn,
"List of broadcast PLMN to be sent to MME can not be longer than actual " "List of broadcast PLMN to be sent to MME can not be longer than actual "
"PLMN list (max %d, but is %d)\n", "PLMN list (max %d, but is %d)\n",
......
...@@ -907,6 +907,7 @@ typedef struct srb1_params_s { ...@@ -907,6 +907,7 @@ typedef struct srb1_params_s {
#define ENB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4" #define ENB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4"
#define ENB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6" #define ENB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6"
#define ENB_CONFIG_STRING_MME_PORT "port"
#define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active" #define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active"
#define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference" #define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference"
#define ENB_CONFIG_STRING_MME_BROADCAST_PLMN_INDEX "broadcast_plmn_index" #define ENB_CONFIG_STRING_MME_BROADCAST_PLMN_INDEX "broadcast_plmn_index"
...@@ -921,14 +922,20 @@ typedef struct srb1_params_s { ...@@ -921,14 +922,20 @@ typedef struct srb1_params_s {
{ENB_CONFIG_STRING_MME_IPV6_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ {ENB_CONFIG_STRING_MME_IPV6_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ {ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ {ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_BROADCAST_PLMN_INDEX, NULL, 0, uptr:NULL, defintarrayval:NULL, TYPE_UINTARRAY, 6} \ {ENB_CONFIG_STRING_MME_BROADCAST_PLMN_INDEX, NULL, 0, uptr:NULL, defintarrayval:NULL, TYPE_UINTARRAY, 6}, \
{ENB_CONFIG_STRING_MME_PORT, NULL, 0, u16ptr:NULL, defuintval:0, TYPE_UINT16, 0}, \
} }
#define ENB_MME_IPV4_ADDRESS_IDX 0 #define ENB_MME_IPV4_ADDRESS_IDX 0
#define ENB_MME_IPV6_ADDRESS_IDX 1 #define ENB_MME_IPV6_ADDRESS_IDX 1
#define ENB_MME_IP_ADDRESS_ACTIVE_IDX 2 #define ENB_MME_IP_ADDRESS_ACTIVE_IDX 2
#define ENB_MME_IP_ADDRESS_PREFERENCE_IDX 3 #define ENB_MME_IP_ADDRESS_PREFERENCE_IDX 3
#define ENB_MME_BROADCAST_PLMN_INDEX 4 #define ENB_MME_BROADCAST_PLMN_INDEX 4
#define ENB_MME_PORT_IDX 5
/*---------------------------------------------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------------------------------------------*/
/* X2 configuration parameters section name */ /* X2 configuration parameters section name */
......
...@@ -89,6 +89,7 @@ uint32_t s1ap_generate_eNB_id(void) { ...@@ -89,6 +89,7 @@ uint32_t s1ap_generate_eNB_id(void) {
static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
net_ip_address_t *mme_ip_address, net_ip_address_t *mme_ip_address,
uint16_t mme_port,
net_ip_address_t *local_ip_addr, net_ip_address_t *local_ip_addr,
uint16_t in_streams, uint16_t in_streams,
uint16_t out_streams, uint16_t out_streams,
...@@ -102,7 +103,7 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, ...@@ -102,7 +103,7 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
DevAssert(mme_ip_address != NULL); DevAssert(mme_ip_address != NULL);
message_p = itti_alloc_new_message(TASK_S1AP, SCTP_NEW_ASSOCIATION_REQ); message_p = itti_alloc_new_message(TASK_S1AP, SCTP_NEW_ASSOCIATION_REQ);
sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req; sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req;
sctp_new_association_req_p->port = S1AP_PORT_NUMBER; sctp_new_association_req_p->port = mme_port;
sctp_new_association_req_p->ppid = S1AP_SCTP_PPID; sctp_new_association_req_p->ppid = S1AP_SCTP_PPID;
sctp_new_association_req_p->in_streams = in_streams; sctp_new_association_req_p->in_streams = in_streams;
sctp_new_association_req_p->out_streams = out_streams; sctp_new_association_req_p->out_streams = out_streams;
...@@ -221,6 +222,7 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t * ...@@ -221,6 +222,7 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
/* Trying to connect to provided list of MME ip address */ /* Trying to connect to provided list of MME ip address */
for (index = 0; index < s1ap_register_eNB->nb_mme; index++) { for (index = 0; index < s1ap_register_eNB->nb_mme; index++) {
net_ip_address_t *mme_ip = &s1ap_register_eNB->mme_ip_address[index]; net_ip_address_t *mme_ip = &s1ap_register_eNB->mme_ip_address[index];
uint16_t mme_port = s1ap_register_eNB->mme_port[index];
struct s1ap_eNB_mme_data_s *mme = NULL; struct s1ap_eNB_mme_data_s *mme = NULL;
RB_FOREACH(mme, s1ap_mme_map, &new_instance->s1ap_mme_head) { RB_FOREACH(mme, s1ap_mme_map, &new_instance->s1ap_mme_head) {
/* Compare whether IPv4 and IPv6 information is already present, in which /* Compare whether IPv4 and IPv6 information is already present, in which
...@@ -235,6 +237,7 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t * ...@@ -235,6 +237,7 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
continue; continue;
s1ap_eNB_register_mme(new_instance, s1ap_eNB_register_mme(new_instance,
mme_ip, mme_ip,
mme_port,
&s1ap_register_eNB->enb_ip_address, &s1ap_register_eNB->enb_ip_address,
s1ap_register_eNB->sctp_in_streams, s1ap_register_eNB->sctp_in_streams,
s1ap_register_eNB->sctp_out_streams, s1ap_register_eNB->sctp_out_streams,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment