Commit 6f42ff88 authored by Sakthivel Velumani's avatar Sakthivel Velumani

Added N3 tunnel address in config params

fixed bug in address length feild
parent b5e13204
......@@ -67,6 +67,8 @@ typedef struct e1ap_setup_req_s {
long cn_support;
int port_cuup;
int port_cucp;
in_addr_t IPv4AddressN3;
int portN3;
} e1ap_setup_req_t;
typedef struct e1ap_setup_resp_s {
......
......@@ -1839,6 +1839,13 @@ int RCconfig_NR_CU_E1(MessageDef *msg_p, uint32_t i) {
strcpy(e1Setup->CUUP_e1_ip_address.ipv4_address, *(GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_IPV4_ADDRESS_CUUP].strptr));
e1Setup->CUUP_e1_ip_address.ipv4 = 1;
e1Setup->port_cuup = *GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_PORT_CUUP].uptr;
if (!strcmp(*(GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_CU_TYPE_IDX].strptr),
"up")) {
inet_pton(AF_INET,
*(GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_IPV4_ADDRESS_N3].strptr),
&e1Setup->IPv4AddressN3);
e1Setup->portN3 = *GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_PORT_N3].uptr;
}
e1Setup->cn_support = *GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_CN_SUPPORT].uptr;
}
......
......@@ -373,13 +373,17 @@ typedef enum {
#define GNB_CONFIG_E1_PORT_CUCP 2
#define GNB_CONFIG_E1_IPV4_ADDRESS_CUUP 3
#define GNB_CONFIG_E1_PORT_CUUP 4
#define GNB_CONFIG_E1_CN_SUPPORT 5
#define GNB_CONFIG_E1_IPV4_ADDRESS_N3 5
#define GNB_CONFIG_E1_PORT_N3 6
#define GNB_CONFIG_E1_CN_SUPPORT 7
#define GNB_CONFIG_STRING_E1_CU_TYPE "type"
#define GNB_CONFIG_STRING_E1_IPV4_ADDRESS_CUCP "ipv4_cucp"
#define GNB_CONFIG_STRING_E1_PORT_CUCP "port_cucp"
#define GNB_CONFIG_STRING_E1_IPV4_ADDRESS_CUUP "ipv4_cuup"
#define GNB_CONFIG_STRING_E1_PORT_CUUP "port_cuup"
#define GNB_CONFIG_STRING_E1_IPV4_ADDRESS_N3 "ipv4_N3"
#define GNB_CONFIG_STRING_E1_PORT_N3 "port_N3"
#define GNB_CONFIG_STRING_E1_CN_SUPPORT "cn_support"
#define GNBE1PARAMS_DESC { \
......@@ -388,6 +392,8 @@ typedef enum {
{GNB_CONFIG_STRING_E1_PORT_CUCP, NULL, 0, uptr :NULL, defintval:25L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_E1_IPV4_ADDRESS_CUUP, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_E1_PORT_CUUP, NULL, 0, uptr :NULL, defintval:25L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_E1_IPV4_ADDRESS_N3, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_E1_PORT_N3, NULL, 0, uptr :NULL, defintval:25L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_E1_CN_SUPPORT, NULL, 0, uptr :NULL, defintval:1L, TYPE_UINT, 0} \
}
......
......@@ -4193,7 +4193,7 @@ void rrc_gNB_process_e1_bearer_context_setup_req(e1ap_bearer_setup_req_t *req, i
pduSetup->id = pdu2Setup->sessionId;
memcpy(&pduSetup->tlAddress,
&create_tunnel_resp_N3.gnb_addr.buffer,
&getCxtE1(UPtype, instance)->setupReq.IPv4AddressN3,
sizeof(in_addr_t));
pduSetup->teId = create_tunnel_resp_N3.gnb_NGu_teid[i];
pduSetup->numDRBSetup = pdu2Setup->numDRB2Setup;
......@@ -4306,13 +4306,14 @@ void rrc_gNB_process_e1_bearer_context_setup_resp(e1ap_bearer_setup_resp_t *resp
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, 0, GNB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0, 0);
gtpv1u_gnb_create_tunnel_resp_t create_tunnel_resp={0};
create_tunnel_resp.num_tunnels = resp->numPDUSessions;
for (int i=0; i < resp->numPDUSessions; i++) {
create_tunnel_resp.pdusession_id[i] = resp->pduSession[i].id;
create_tunnel_resp.gnb_NGu_teid[i] = resp->pduSession[i].teId;
memcpy(create_tunnel_resp.gnb_addr.buffer,
&resp->pduSession[i].tlAddress,
sizeof(in_addr_t));
create_tunnel_resp.gnb_addr.length = sizeof(in_addr_t) * 8; // IPv4 bit length
create_tunnel_resp.gnb_addr.length = sizeof(in_addr_t); // IPv4 byte length
}
nr_rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(&ctxt,
......
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