mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
Compare commits
6 Commits
23796f054f
...
o1-cu-supp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ea7be7448 | ||
|
|
18005429e1 | ||
|
|
7339670103 | ||
|
|
f8ce2e7668 | ||
|
|
64e7d9f816 | ||
|
|
59f5b0d6ac |
@@ -1206,6 +1206,7 @@ set(L2_NR_SRC
|
||||
${NR_RRC_DIR}/rrc_gNB_cuup.c
|
||||
${NR_RRC_DIR}/rrc_gNB_du.c
|
||||
${NR_RRC_DIR}/rrc_gNB_mobility.c
|
||||
${NR_RRC_DIR}/rrc_telnet_tasks.c
|
||||
)
|
||||
|
||||
set(L2_SRC_UE
|
||||
|
||||
@@ -59,6 +59,7 @@ typedef struct IttiMsgText_s {
|
||||
#include <openair2/COMMON/as_message.h>
|
||||
#include <openair2/RRC/LTE/rrc_types.h>
|
||||
#include <openair2/COMMON/rrc_messages_types.h>
|
||||
#include <openair2/RRC/NR/nr_rrc_messages_types.h>
|
||||
#include <openair2/COMMON/e1ap_messages_types.h>
|
||||
|
||||
#include <openair3/NAS/COMMON/UTIL/OctetString.h>
|
||||
@@ -293,6 +294,7 @@ typedef struct {
|
||||
TASK_DEF(TASK_CUCP_E1, 200) \
|
||||
TASK_DEF(TASK_CUUP_E1, 200) \
|
||||
TASK_DEF(TASK_NAS_NRUE, 200) \
|
||||
TASK_DEF(TASK_TELNET, 200) \
|
||||
TASK_DEF(TASK_MAX, 200)
|
||||
|
||||
#define TASK_DEF(TaskID, qUEUEsIZE) {qUEUEsIZE, #TaskID},
|
||||
|
||||
@@ -664,6 +664,8 @@ void run_telnetsrv(void) {
|
||||
int plen = sprintf(prompt, "%s_%s> ", TELNET_PROMPT_PREFIX, get_softmodem_function());
|
||||
TELNET_LOG("\nInitializing telnet server...\n");
|
||||
|
||||
|
||||
|
||||
while( (telnetparams.new_socket = accept(sock, &cli_addr, &cli_len)) ) {
|
||||
TELNET_LOG("Telnet client connected....\n");
|
||||
read_history(telnetparams.histfile);
|
||||
@@ -754,7 +756,7 @@ void run_telnetclt(void) {
|
||||
name.sin_family = AF_INET;
|
||||
struct in_addr addr;
|
||||
inet_aton("127.0.0.1", &addr) ;
|
||||
name.sin_addr.s_addr = addr.s_addr;
|
||||
name.sin_addr.s_addr = addr.s_addr;
|
||||
name.sin_port = htons((unsigned short)(telnetparams.listenport));
|
||||
while (1) {
|
||||
sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
@@ -763,29 +765,29 @@ void run_telnetclt(void) {
|
||||
|
||||
if(connect(sock, (void *) &name, sizeof(name)))
|
||||
fprintf(stderr,"[TELNETSRV] Error %s on connect call\n",strerror(errno));
|
||||
|
||||
|
||||
struct timeval ts;
|
||||
ts.tv_sec = 1; // 1 second
|
||||
ts.tv_usec = 0;
|
||||
while (1) {
|
||||
fd_set fds;
|
||||
fd_set fds;
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(sock, &fds);
|
||||
FD_SET(STDIN_FILENO , &fds);
|
||||
FD_SET(STDIN_FILENO , &fds);
|
||||
// wait for data
|
||||
int nready = select(sock + 1, &fds, (fd_set *) 0, (fd_set *) 0, &ts);
|
||||
if (nready < 0) {
|
||||
perror("select. Error");
|
||||
break;
|
||||
break;
|
||||
}
|
||||
else if (nready == 0) {
|
||||
ts.tv_sec = 1; // 1 second
|
||||
ts.tv_usec = 0;
|
||||
}
|
||||
else if ( FD_ISSET(sock, &fds)) {
|
||||
int rv;
|
||||
int rv;
|
||||
char inbuf[TELNET_MAX_MSGLENGTH*2];
|
||||
memset(inbuf,0,sizeof(inbuf));
|
||||
memset(inbuf,0,sizeof(inbuf));
|
||||
rv = recv(sock , inbuf , sizeof(inbuf)-1 , 0);
|
||||
if (rv > 0) {
|
||||
printf("%s",inbuf);
|
||||
@@ -796,18 +798,18 @@ void run_telnetclt(void) {
|
||||
}
|
||||
else {
|
||||
perror("recv error");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (FD_ISSET(STDIN_FILENO , &fds)) {
|
||||
char *inbuf=NULL;
|
||||
size_t inlen=0;
|
||||
inlen = getline( &inbuf,&inlen, stdin);
|
||||
if ( inlen > 0 ) {
|
||||
if ( send(sock, inbuf,inlen, 0) < 0)
|
||||
break;
|
||||
}
|
||||
free(inbuf);
|
||||
}
|
||||
else if (FD_ISSET(STDIN_FILENO , &fds)) {
|
||||
char *inbuf=NULL;
|
||||
size_t inlen=0;
|
||||
inlen = getline( &inbuf,&inlen, stdin);
|
||||
if ( inlen > 0 ) {
|
||||
if ( send(sock, inbuf,inlen, 0) < 0)
|
||||
break;
|
||||
}
|
||||
free(inbuf);
|
||||
}
|
||||
}
|
||||
close(sock);
|
||||
@@ -817,7 +819,7 @@ void run_telnetclt(void) {
|
||||
|
||||
void poll_telnetcmdq(void *qid, void *arg) {
|
||||
notifiedFIFO_elt_t *msg = pollNotifiedFIFO((notifiedFIFO_t *)qid);
|
||||
|
||||
|
||||
if (msg != NULL) {
|
||||
telnetsrv_qmsg_t *msgdata=NotifiedFifoData(msg);
|
||||
msgdata->cmdfunc(msgdata->cmdbuff,msgdata->debug,msgdata->prnt,arg);
|
||||
@@ -904,7 +906,7 @@ int telnetsrv_autoinit(void) {
|
||||
fprintf(stderr,"[TELNETSRV] Error %s on pthread_create f() run_telnetclt \n",strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include "intertask_interface.h"
|
||||
|
||||
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
|
||||
|
||||
@@ -19,11 +20,10 @@
|
||||
|
||||
static int get_single_ue_rnti(void)
|
||||
{
|
||||
rrc_gNB_ue_context_t *ue_context_p = NULL;
|
||||
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[0]->rrc_ue_head)) {
|
||||
return ue_context_p->ue_context.rnti;
|
||||
}
|
||||
return -1;
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_SINGLE_UE_RNTI);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
return msg_p->ittiMsg.rrc_get_single_ue_rnti.rnti ? msg_p->ittiMsg.rrc_get_single_ue_rnti.rnti : -1;
|
||||
}
|
||||
|
||||
int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
@@ -56,8 +56,11 @@ int add_bearer(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
}
|
||||
|
||||
// verify it exists in RRC as well
|
||||
rrc_gNB_ue_context_t *rrcue = rrc_gNB_get_ue_context_by_rnti_any_du(RC.nrrrc[0], rnti);
|
||||
if (!rrcue)
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_SINGLE_UE_RNTI);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
Rrc_get_single_ue_rnti ue = msg_p->ittiMsg.rrc_get_single_ue_rnti;
|
||||
if (!ue.id)
|
||||
ERROR_MSG_RET("could not find UE with RNTI %04x\n", rnti);
|
||||
|
||||
AssertFatal(false, "not implemented\n");
|
||||
@@ -82,8 +85,11 @@ int release_bearer(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
}
|
||||
|
||||
// verify it exists in RRC as well
|
||||
rrc_gNB_ue_context_t *rrcue = rrc_gNB_get_ue_context_by_rnti_any_du(RC.nrrrc[0], rnti);
|
||||
if (!rrcue)
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_SINGLE_UE_RNTI);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
Rrc_get_single_ue_rnti ue = msg_p->ittiMsg.rrc_get_single_ue_rnti;
|
||||
if (!ue.id)
|
||||
ERROR_MSG_RET("could not find UE with RNTI %04x\n", rnti);
|
||||
|
||||
AssertFatal(false, "not implemented\n");
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_config.h"
|
||||
#include "openair2/RRC/NR/rrc_gNB_mobility.h"
|
||||
#include "openair3/NGAP/ngap_gNB_ue_context.h"
|
||||
#include "intertask_interface.h"
|
||||
|
||||
#define TELNETSERVERCODE
|
||||
#include "telnetsrv.h"
|
||||
@@ -59,48 +60,34 @@ int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
rrc_gNB_ue_context_t *get_single_rrc_ue(void)
|
||||
{
|
||||
rrc_gNB_ue_context_t *ue = NULL;
|
||||
rrc_gNB_ue_context_t *l = NULL;
|
||||
int n = 0;
|
||||
RB_FOREACH (l, rrc_nr_ue_tree_s, &RC.nrrrc[0]->rrc_ue_head) {
|
||||
if (ue == NULL)
|
||||
ue = l;
|
||||
n++;
|
||||
}
|
||||
if (!ue) {
|
||||
printf("could not find any UE in RRC\n");
|
||||
}
|
||||
if (n > 1) {
|
||||
printf("more than one UE in RRC present\n");
|
||||
ue = NULL;
|
||||
}
|
||||
|
||||
return ue;
|
||||
}
|
||||
|
||||
int get_reestab_count(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (!RC.nrrrc)
|
||||
ERROR_MSG_RET("no RRC present, cannot list counts\n");
|
||||
rrc_gNB_ue_context_t *ue = NULL;
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_SINGLE_UE_RNTI);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
Rrc_get_single_ue_rnti ue = msg_p->ittiMsg.rrc_get_single_ue_rnti;
|
||||
if (!buf) {
|
||||
ue = get_single_rrc_ue();
|
||||
if (!ue)
|
||||
if (!ue.rnti || !ue.ue_reconfiguration_counter || !ue.ue_reestablishment_counter) {
|
||||
ERROR_MSG_RET("no single UE in RRC present\n");
|
||||
} else {
|
||||
}
|
||||
} else
|
||||
{
|
||||
ue_id_t ue_id = strtol(buf, NULL, 10);
|
||||
ue = rrc_gNB_get_ue_context(RC.nrrrc[0], ue_id);
|
||||
if (!ue)
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_UE_CONTEXT_BY_UE_ID);
|
||||
msg_p->ittiMsg.rrc_get_ue_context_by_ue_id.rnti = ue_id;
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
ue = msg_p->ittiMsg.rrc_get_ue_context_by_ue_id;
|
||||
if (!ue.rnti || !ue.ue_reconfiguration_counter || !ue.ue_reestablishment_counter){
|
||||
ERROR_MSG_RET("could not find UE with ue_id %d in RRC\n");
|
||||
}
|
||||
}
|
||||
|
||||
prnt("UE RNTI %04x reestab %d reconfig %d\n",
|
||||
ue->ue_context.rnti,
|
||||
ue->ue_context.ue_reestablishment_counter,
|
||||
ue->ue_context.ue_reconfiguration_counter);
|
||||
ue.rnti,
|
||||
ue.ue_reestablishment_counter,
|
||||
ue.ue_reconfiguration_counter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -132,8 +119,6 @@ int trigger_reestab(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern nr_rrc_du_container_t *get_du_for_ue(gNB_RRC_INST *rrc, uint32_t ue_id);
|
||||
|
||||
/** @brief Get connected DU by the UE ID */
|
||||
int fetch_du_by_ue_id(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
@@ -146,16 +131,23 @@ int fetch_du_by_ue_id(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
ue_id = strtol(buf, NULL, 10);
|
||||
} else {
|
||||
// No UE ID provided: find the connected UE first
|
||||
rrc_gNB_ue_context_t *ue = get_single_rrc_ue();
|
||||
if (!ue)
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_SINGLE_UE_RNTI);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
Rrc_get_single_ue_rnti ue = msg_p->ittiMsg.rrc_get_single_ue_rnti;
|
||||
if (!ue.rnti)
|
||||
ERROR_MSG_RET("no single UE in RRC present\n");
|
||||
ue_id = ue->ue_context.rrc_ue_id;
|
||||
ue_id = ue.rnti;
|
||||
}
|
||||
|
||||
nr_rrc_du_container_t *du = get_du_for_ue(RC.nrrrc[0], ue_id);
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_DU_ID_BY_RNTI);
|
||||
msg_p->ittiMsg.rrc_get_du_id_by_rnti.rnti = ue_id;
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
int du_id = msg_p->ittiMsg.rrc_get_du_id_by_rnti.du_id;
|
||||
|
||||
if (du) {
|
||||
prnt("gNB_DU_id %ld is connected to ue_id %ld\n", du->gNB_DU_id, ue_id);
|
||||
if (du_id) {
|
||||
prnt("gNB_DU_id %ld is connected to ue_id %ld\n", du_id, ue_id);
|
||||
return 0;
|
||||
} else {
|
||||
ERROR_MSG_RET("No DU connected\n");
|
||||
@@ -174,23 +166,29 @@ extern void nr_HO_F1_trigger_telnet(gNB_RRC_INST *rrc, uint32_t rrc_ue_id);
|
||||
int rrc_gNB_trigger_f1_ho(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (!RC.nrrrc)
|
||||
ERROR_MSG_RET("no RRC present, cannot list counts\n");
|
||||
rrc_gNB_ue_context_t *ue = NULL;
|
||||
ue_id_t ue_id = -1;
|
||||
if (!buf) {
|
||||
ue = get_single_rrc_ue();
|
||||
if (!ue)
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_SINGLE_UE_RNTI);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
ue_id = msg_p->ittiMsg.rrc_get_single_ue_rnti.id;
|
||||
if (ue_id == -1)
|
||||
ERROR_MSG_RET("no single UE in RRC present\n");
|
||||
} else {
|
||||
ue_id_t ue_id = strtol(buf, NULL, 10);
|
||||
ue = rrc_gNB_get_ue_context(RC.nrrrc[0], ue_id);
|
||||
if (!ue)
|
||||
ue_id = strtol(buf, NULL, 10);
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_DU_ID_BY_RNTI);
|
||||
msg_p->ittiMsg.rrc_get_du_id_by_rnti.rnti = ue_id;
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
int du_id = msg_p->ittiMsg.rrc_get_du_id_by_rnti.du_id;
|
||||
if (!du_id)
|
||||
ERROR_MSG_RET("could not find UE with ue_id %d in RRC\n", ue_id);
|
||||
}
|
||||
|
||||
gNB_RRC_UE_t *UE = &ue->ue_context;
|
||||
nr_HO_F1_trigger_telnet(RC.nrrrc[0], UE->rrc_ue_id);
|
||||
prnt("RRC F1 handover triggered for UE %u\n", UE->rrc_ue_id);
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_NR_HO_F1_TRIGGER);
|
||||
msg_p->ittiMsg.rrc_trigger_ho_f1.id = ue_id;
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
prnt("RRC F1 handover triggered for UE %u\n", ue_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -204,9 +202,6 @@ extern void nr_HO_N2_trigger_telnet(gNB_RRC_INST *rrc, uint32_t neighbour_pci, u
|
||||
int rrc_gNB_trigger_n2_ho(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (!RC.nrrrc)
|
||||
ERROR_MSG_RET("no RRC present, cannot list counts\n");
|
||||
|
||||
if (!buf) {
|
||||
ERROR_MSG_RET("Please provide neighbour cell id and ue id\n");
|
||||
} else {
|
||||
@@ -225,15 +220,18 @@ int rrc_gNB_trigger_n2_ho(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
uint32_t ueId = strtol(token, NULL, 10);
|
||||
|
||||
// Retrieve UE context
|
||||
rrc_gNB_ue_context_t *ue_p = rrc_gNB_get_ue_context(RC.nrrrc[0], ueId);
|
||||
if (!ue_p) {
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_CHECK_UE_CONTEXT);
|
||||
msg_p->ittiMsg.rrc_check_ue_context.id = ueId;
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
if (!msg_p->ittiMsg.rrc_check_ue_context.check) {
|
||||
ERROR_MSG_RET("UE with id %u not found\n", ueId);
|
||||
}
|
||||
gNB_RRC_UE_t *UE = &ue_p->ue_context;
|
||||
|
||||
// Trigger N2 handover
|
||||
nr_HO_N2_trigger_telnet(RC.nrrrc[0], neighbour_pci, UE->rrc_ue_id);
|
||||
|
||||
msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_NR_HO_N2_TRIGGER);
|
||||
msg_p->ittiMsg.rrc_trigger_ho_n2.id=ueId;
|
||||
msg_p->ittiMsg.rrc_trigger_ho_n2.neighbour_pci=neighbour_pci;
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
// Print success message
|
||||
prnt("RRC N2 handover triggered for UE %u with neighbour cell id %u\n",
|
||||
ueId,
|
||||
@@ -319,21 +317,23 @@ static int trigger_ngap_pdu_session_release(char *buf, int debug, telnet_printfu
|
||||
gNB_ue_ngap_id = atoi(tokens[0] + 6);
|
||||
pdu_start_index = 1;
|
||||
} else {
|
||||
// No UE ID: infer it
|
||||
if (!RC.nrrrc)
|
||||
ERROR_MSG_RET("No RRC present\n");
|
||||
rrc_gNB_ue_context_t *ue = get_single_rrc_ue();
|
||||
if (!ue)
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_SINGLE_UE_RNTI);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
ue_id_t ue_id = msg_p->ittiMsg.rrc_get_single_ue_rnti.id;
|
||||
if (!ue_id)
|
||||
ERROR_MSG_RET("No single UE in RRC present\n");
|
||||
gNB_ue_ngap_id = ue->ue_context.rrc_ue_id;
|
||||
}
|
||||
|
||||
if (pdu_start_index >= count) {
|
||||
ERROR_MSG_RET("No pdusession_id(int) provided\n");
|
||||
}
|
||||
|
||||
ngap_gNB_ue_context_t *ngap = ngap_get_ue_context(gNB_ue_ngap_id);
|
||||
if (!ngap) {
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_NGAP_UE_ID);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
int amf_ue_ngap_id = msg_p->ittiMsg.rrc_get_ngap_ue_id.amf_ue_ngap_id;
|
||||
if (!amf_ue_ngap_id) {
|
||||
ERROR_MSG_RET("No NGAP UE context for gNB_ue_ngap_id %d\n", gNB_ue_ngap_id);
|
||||
}
|
||||
|
||||
@@ -341,8 +341,8 @@ static int trigger_ngap_pdu_session_release(char *buf, int debug, telnet_printfu
|
||||
ngap_pdusession_release_command_t *msg = &NGAP_PDUSESSION_RELEASE_COMMAND(message_p);
|
||||
memset(msg, 0, sizeof(*msg));
|
||||
|
||||
msg->amf_ue_ngap_id = ngap->amf_ue_ngap_id;
|
||||
msg->gNB_ue_ngap_id = ngap->gNB_ue_ngap_id;
|
||||
msg->amf_ue_ngap_id = amf_ue_ngap_id;
|
||||
msg->gNB_ue_ngap_id = gNB_ue_ngap_id;
|
||||
|
||||
int nb_sessions = 0;
|
||||
for (int i = pdu_start_index; i < count; ++i) {
|
||||
|
||||
@@ -2,74 +2,111 @@
|
||||
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define TELNETSERVERCODE
|
||||
#include "telnetsrv.h"
|
||||
#include "telnetsrv_o1.h"
|
||||
|
||||
#include "openair2/RRC/NR/nr_rrc_defs.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/nr_radio_config.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c"
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
|
||||
#define ERROR_MSG_RET(mSG, aRGS...) do { prnt("FAILURE: " mSG, ##aRGS); return 1; } while (0)
|
||||
|
||||
#define ISINITBWP "bwp3gpp:isInitialBwp"
|
||||
//#define CYCLPREF "bwp3gpp:cyclicPrefix"
|
||||
#define NUMRBS "bwp3gpp:numberOfRBs"
|
||||
#define STARTRB "bwp3gpp:startRB"
|
||||
#define BWPSCS "bwp3gpp:subCarrierSpacing"
|
||||
|
||||
#define SSBFREQ "nrcelldu3gpp:ssbFrequency"
|
||||
#define ARFCNDL "nrcelldu3gpp:arfcnDL"
|
||||
#define BWDL "nrcelldu3gpp:bSChannelBwDL"
|
||||
#define ARFCNUL "nrcelldu3gpp:arfcnUL"
|
||||
#define BWUL "nrcelldu3gpp:bSChannelBwUL"
|
||||
#define PCI "nrcelldu3gpp:nRPCI"
|
||||
#define TAC "nrcelldu3gpp:nRTAC"
|
||||
#define MCC "nrcelldu3gpp:mcc"
|
||||
#define MNC "nrcelldu3gpp:mnc"
|
||||
#define SD "nrcelldu3gpp:sd"
|
||||
#define SST "nrcelldu3gpp:sst"
|
||||
|
||||
typedef struct b {
|
||||
long int dl;
|
||||
long int ul;
|
||||
} b_t;
|
||||
|
||||
typedef struct ue_stat {
|
||||
rnti_t rnti;
|
||||
b_t thr;
|
||||
} ue_stat_t;
|
||||
|
||||
#define PRINTLIST_i(len, fmt, ...) \
|
||||
{ \
|
||||
for (int i = 0; i < len; ++i) { \
|
||||
if (i != 0) prnt(", "); \
|
||||
prnt(fmt, __VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
|
||||
static int get_stats(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
static void get_cu_stats(telnet_printfunc_t prnt, uint32_t node_id, char *node_name)
|
||||
{
|
||||
UNUSED(debug);
|
||||
if (buf)
|
||||
ERROR_MSG_RET("no parameter allowed\n");
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_ACTIVE_UE_LIST);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
Rrc_get_active_ue_list ue_list = msg_p->ittiMsg.rrc_active_ue_list;
|
||||
|
||||
gNB_MAC_INST *mac = RC.nrmac[0];
|
||||
AssertFatal(mac != NULL, "need MAC\n");
|
||||
MessageDef *msg_p2 = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_CUUP_CELLS_LIST);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p2);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p2);
|
||||
Rrc_get_cuup_cells_list cell_list = msg_p2->ittiMsg.rrc_cuup_cells_list;
|
||||
|
||||
const int srb_flag = 0;
|
||||
const int rb_id = 1;
|
||||
int ue_id;
|
||||
int sum_pdcpsduvolumeul = 0;
|
||||
int sum_pdcpsduvolumedl = 0;
|
||||
int sum_pdcppduvolumeul = 0;
|
||||
int sum_pdcppduvolumedl = 0;
|
||||
for(int i=0; i<ue_list.num_ues; i++){
|
||||
ue_id = ue_list.rnti_list[i];
|
||||
nr_pdcp_statistics_t pdcp = {0};
|
||||
nr_pdcp_get_statistics(ue_id, srb_flag, rb_id, &pdcp);
|
||||
sum_pdcpsduvolumedl += pdcp.rxsdu_bytes;
|
||||
sum_pdcpsduvolumeul += pdcp.txsdu_bytes;
|
||||
sum_pdcppduvolumedl += pdcp.rxpdu_bytes;
|
||||
sum_pdcppduvolumeul += pdcp.txpdu_bytes;
|
||||
}
|
||||
sum_pdcpsduvolumedl = sum_pdcpsduvolumedl*8/1000000;
|
||||
sum_pdcpsduvolumeul = sum_pdcpsduvolumeul*8/1000000;
|
||||
sum_pdcppduvolumedl = sum_pdcppduvolumedl*8/1000000;
|
||||
sum_pdcppduvolumeul = sum_pdcppduvolumeul*8/1000000;
|
||||
bool first = true;
|
||||
|
||||
prnt("{\n");
|
||||
prnt(" \"o1-config\": {\n");
|
||||
prnt(" \"NRCELLCU\": [\n");
|
||||
|
||||
for(int i=0; i<cell_list.cell_count; i++){
|
||||
if (!first)
|
||||
prnt(",\n");
|
||||
prnt(" {\n");
|
||||
prnt(" \""CELLLOCALID"\": %d,\n", cell_list.cell_ids[i]);
|
||||
prnt(" \""CU_MCC"\": \"%03d\",\n", cell_list.mccs[i]);
|
||||
prnt(" \""CU_MNC"\": \"%0*d\",\n", cell_list.mnc_digit_lengths[i], cell_list.mncs[i]);
|
||||
prnt(" \""CU_SST"\": %d,\n", cell_list.sst);
|
||||
prnt(" \""CU_SD "\": %d\n", cell_list.sd);
|
||||
prnt(" }");
|
||||
first = false;
|
||||
}
|
||||
prnt("\n ],\n");
|
||||
|
||||
/* TODO harmonize this between DU&CU to be able to have one in monolithic */
|
||||
prnt(" \"device\": {\n");
|
||||
prnt(" \"gNBId\": %d,\n", node_id);
|
||||
prnt(" \"gnbName\": \"%s\",\n", node_name);
|
||||
prnt(" \"vendor\": \"OpenAirInterface\"\n");
|
||||
prnt(" },\n");
|
||||
prnt(" \"O1-Operational\": {\n");
|
||||
prnt(" \"PdcpSduVolumeUl\": %d,\n", sum_pdcpsduvolumeul);
|
||||
prnt(" \"PdcpSduVolumeDl\": %d,\n", sum_pdcpsduvolumedl);
|
||||
prnt(" \"PdcpPduVolumeUl\": %d,\n", sum_pdcppduvolumeul);
|
||||
prnt(" \"PdcpPduVolumeDl\": %d\n", sum_pdcppduvolumedl);
|
||||
prnt(" }\n");
|
||||
prnt(" }\n");
|
||||
|
||||
prnt("}\n");
|
||||
prnt("OK\n");
|
||||
}
|
||||
|
||||
static inline int gnb_id_bit_length(uint32_t gnb_id) {
|
||||
if (gnb_id == 0) return 1;
|
||||
return 32 - __builtin_clz(gnb_id);
|
||||
}
|
||||
|
||||
|
||||
uint32_t extract_cell_id(uint64_t nci, const cell_config_t *cfg) {
|
||||
for (int gnb_bits = 22; gnb_bits <= 32; gnb_bits++) {
|
||||
int cell_bits = NR_NCI_BITS - gnb_bits;
|
||||
|
||||
uint32_t candidate_gnb_id = (uint32_t)(nci >> cell_bits);
|
||||
|
||||
if (candidate_gnb_id == cfg->gnb_id) {
|
||||
return (uint32_t)(nci & ((1ULL << cell_bits) - 1));
|
||||
}
|
||||
}
|
||||
|
||||
return UINT32_MAX;
|
||||
}
|
||||
|
||||
static void get_du_stats(telnet_printfunc_t prnt, gNB_MAC_INST *mac)
|
||||
{
|
||||
NR_SCHED_LOCK(&mac->sched_lock);
|
||||
|
||||
int sum_rlcpacketdropratedl = 0;
|
||||
int sum_rlcpacketdl = 0;
|
||||
int sum_thpunresvoldl = 0;
|
||||
int sum_thpvoldl = 0;
|
||||
int sum_thpunresvolul = 0;
|
||||
int sum_thpvolul = 0;
|
||||
|
||||
const f1ap_setup_req_t *sr = mac->f1_config.setup_req;
|
||||
const f1ap_served_cell_info_t *cell_info = &sr->cell[0].info;
|
||||
|
||||
@@ -110,6 +147,8 @@ static int get_stats(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
UE_iterator((NR_UE_info_t **)mac->UE_info.connected_ue_list, it) {
|
||||
nr_rlc_statistics_t rlc = {0};
|
||||
nr_rlc_get_statistics(it->rnti, srb_flag, rb_id, &rlc);
|
||||
sum_rlcpacketdropratedl += rlc.rxsdu_dd_pkts;
|
||||
sum_rlcpacketdl += rlc.rxsdu_pkts;
|
||||
b_t *lt = &last_total[num_ues];
|
||||
ue_stat_t *ue_s = &ue_stat[num_ues];
|
||||
ue_s->rnti = it->rnti;
|
||||
@@ -119,12 +158,35 @@ static int get_stats(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
lt->dl = rlc.txpdu_bytes;
|
||||
if (lt->ul > rlc.rxpdu_bytes)
|
||||
lt->ul = rlc.rxpdu_bytes;
|
||||
if (lt->unres_ul > rlc.rxpdu_bytes + rlc.rxpdu_dd_bytes)
|
||||
lt->unres_ul = rlc.rxpdu_bytes + rlc.rxpdu_dd_bytes;
|
||||
if (lt->unres_dl > rlc.txpdu_bytes + rlc.txpdu_dd_bytes)
|
||||
lt->unres_dl = rlc.txpdu_bytes + rlc.txpdu_dd_bytes;
|
||||
ue_s->thr.dl = (rlc.txpdu_bytes - lt->dl) * 8 / diff_msec;
|
||||
ue_s->thr.ul = (rlc.rxpdu_bytes - lt->ul) * 8 / diff_msec;
|
||||
ue_s->thr.unres_ul = (rlc.rxpdu_bytes + rlc.rxpdu_dd_bytes - lt->unres_ul) * 8 / diff_msec;
|
||||
ue_s->thr.unres_dl = (rlc.txpdu_bytes + rlc.txpdu_dd_bytes - lt->unres_dl) * 8 / diff_msec;
|
||||
lt->dl = rlc.txpdu_bytes;
|
||||
lt->ul = rlc.rxpdu_bytes;
|
||||
lt->unres_ul = rlc.rxpdu_bytes + rlc.rxpdu_dd_bytes;
|
||||
lt->unres_dl = rlc.txpdu_bytes + rlc.txpdu_dd_bytes;
|
||||
sum_thpunresvoldl = lt->unres_dl;
|
||||
sum_thpvoldl += lt->dl;
|
||||
sum_thpunresvolul = lt->unres_ul;
|
||||
sum_thpvolul += lt->ul;
|
||||
num_ues++;
|
||||
}
|
||||
int RlcPacketDropRateDl = sum_rlcpacketdl == 0 ? 1 : 1000000*(sum_rlcpacketdropratedl/sum_rlcpacketdl);
|
||||
double unres_ul = sum_thpunresvolul+sum_thpvolul > 0 ? 100*sum_thpunresvolul/(sum_thpunresvolul+sum_thpvolul) : 0;
|
||||
double unres_dl = sum_thpunresvoldl+sum_thpvoldl > 0 ? 100*sum_thpunresvoldl/(sum_thpunresvoldl+sum_thpvoldl) : 0;
|
||||
|
||||
cell_config_t *cfg = malloc(sizeof(cell_config_t));
|
||||
cfg->mcc = cell_info->plmn.mcc;
|
||||
cfg->mnc = cell_info->plmn.mnc;
|
||||
cfg->mnc_digit_length = cell_info->plmn.mnc_digit_length;
|
||||
cfg->gnb_id = mac->f1_config.gnb_id;
|
||||
|
||||
uint32_t local_cell_id = extract_cell_id(cell_info->nr_cellid, cfg);
|
||||
|
||||
prnt("{\n");
|
||||
prnt(" \"o1-config\": {\n");
|
||||
@@ -154,10 +216,15 @@ static int get_stats(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
prnt(" \"" BWUL "\": %ld,\n", bw_mhz);
|
||||
prnt(" \"" PCI "\": %ld,\n", *scc->physCellId);
|
||||
prnt(" \"" TAC "\": %ld,\n", *cell_info->tac);
|
||||
prnt(" \"" MCC "\": \"%03d\",\n", cell_info->plmn.mcc);
|
||||
prnt(" \"" MNC "\": \"%0*d\",\n", cell_info->plmn.mnc_digit_length, cell_info->plmn.mnc);
|
||||
prnt(" \"" MCC "\": \"%03d\",\n", cfg->mcc);
|
||||
prnt(" \"" MNC "\": \"%0*d\",\n", cfg->mnc_digit_length, cfg->mnc);
|
||||
prnt(" \"" CLI "\": \"%d\",\n", local_cell_id);
|
||||
prnt(" \"" SD "\": %d,\n", cell_info->nssai[0].sd);
|
||||
prnt(" \"" SST "\": %d\n", cell_info->nssai[0].sst);
|
||||
prnt(" \"" SST "\": %d,\n", cell_info->nssai[0].sst);
|
||||
prnt(" \"" SSBSCS "\": %d,\n", 30);
|
||||
prnt(" \"" SSBPRD "\": %d,\n", 20);
|
||||
prnt(" \"" SSBOFF "\": %d,\n", 0);
|
||||
prnt(" \"" SSBDUR "\": %d\n", 1);
|
||||
prnt(" },\n");
|
||||
prnt(" \"device\": {\n");
|
||||
prnt(" \"gnbId\": %d,\n", sr->gNB_DU_id);
|
||||
@@ -173,12 +240,38 @@ static int get_stats(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
prnt(" \"ues\": ["); PRINTLIST_i(num_ues, "%d", ue_stat[i].rnti); prnt("],\n");
|
||||
prnt(" \"load\": %d,\n", load);
|
||||
prnt(" \"ues-thp\": [");
|
||||
PRINTLIST_i(num_ues, "\n {\"rnti\": %d, \"dl\": %ld, \"ul\": %ld}", ue_stat[i].rnti, ue_stat[i].thr.dl, ue_stat[i].thr.ul);
|
||||
prnt("\n ]\n");
|
||||
PRINTLIST_i(num_ues, "\n {\"rnti\": %d, \"dl\": %ld, \"ul\": %ld, \"unres_ul\": %ld, \"unres_dl\": %ld}", ue_stat[i].rnti, ue_stat[i].thr.dl, ue_stat[i].thr.ul, unres_ul, unres_dl);
|
||||
prnt("\n ],\n");
|
||||
prnt(" \"RlcPacketDropRateDl\": %d\n", RlcPacketDropRateDl);
|
||||
prnt(" }\n");
|
||||
prnt("}\n");
|
||||
prnt("OK\n");
|
||||
|
||||
NR_SCHED_UNLOCK(&mac->sched_lock);
|
||||
}
|
||||
|
||||
static int get_stats(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
|
||||
if (buf)
|
||||
ERROR_MSG_RET("no parameter allowed\n");
|
||||
|
||||
|
||||
gNB_MAC_INST *mac = RC.nrmac ? RC.nrmac[0] : NULL;
|
||||
bool is_du = mac != NULL;
|
||||
if (is_du)
|
||||
get_du_stats(prnt, mac);
|
||||
else {
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_NODE_INFO);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
Rrc_get_node_info *ni = &msg_p->ittiMsg.rrc_node_info;
|
||||
bool is_cu = NODE_IS_MONOLITHIC(ni->node_type) || NODE_IS_CU(ni->node_type);
|
||||
if (is_cu)
|
||||
get_cu_stats(prnt, ni->node_id, ni->node_name);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
81
common/utils/telnetsrv/telnetsrv_o1.h
Normal file
81
common/utils/telnetsrv/telnetsrv_o1.h
Normal file
@@ -0,0 +1,81 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "telnetsrv.h"
|
||||
|
||||
#include "openair2/RRC/NR/nr_rrc_defs.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/nr_radio_config.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c"
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
|
||||
|
||||
|
||||
#define ERROR_MSG_RET(mSG, aRGS...) do { prnt("FAILURE: " mSG, ##aRGS); return 1; } while (0)
|
||||
|
||||
#define ISINITBWP "bwp3gpp:isInitialBwp"
|
||||
//#define CYCLPREF "bwp3gpp:cyclicPrefix"
|
||||
#define NUMRBS "bwp3gpp:numberOfRBs"
|
||||
#define STARTRB "bwp3gpp:startRB"
|
||||
#define BWPSCS "bwp3gpp:subCarrierSpacing"
|
||||
|
||||
#define SSBFREQ "nrcelldu3gpp:ssbFrequency"
|
||||
#define ARFCNDL "nrcelldu3gpp:arfcnDL"
|
||||
#define BWDL "nrcelldu3gpp:bSChannelBwDL"
|
||||
#define ARFCNUL "nrcelldu3gpp:arfcnUL"
|
||||
#define BWUL "nrcelldu3gpp:bSChannelBwUL"
|
||||
#define PCI "nrcelldu3gpp:nRPCI"
|
||||
#define TAC "nrcelldu3gpp:nRTAC"
|
||||
#define MCC "nrcelldu3gpp:mcc"
|
||||
#define MNC "nrcelldu3gpp:mnc"
|
||||
#define SD "nrcelldu3gpp:sd"
|
||||
#define SST "nrcelldu3gpp:sst"
|
||||
#define SSBSCS "nrcelldu3gpp:ssbSubCarrierSpacing"
|
||||
#define SSBPRD "nrcelldu3gpp:ssbPeriodicity"
|
||||
#define SSBOFF "nrcelldu3gpp:ssbOffset"
|
||||
#define SSBDUR "nrcelldu3gpp:ssbDuration"
|
||||
#define PMAX "nrfreqrel3gpp:pMax"
|
||||
#define CELLLOCALID "nrcellcu3gpp:cellLocalId"
|
||||
#define CU_MCC "nrcellcu3gpp:mcc"
|
||||
#define CU_MNC "nrcellcu3gpp:mnc"
|
||||
#define CU_SST "nrcellcu3gpp:sst"
|
||||
#define CU_SD "nrcellcu3gpp:sd"
|
||||
#define CLI "nrcelldu3gpp:cellLocalId"
|
||||
|
||||
#define NR_NCI_BITS 36
|
||||
|
||||
#define PRINTLIST_i(len, fmt, ...) \
|
||||
{ \
|
||||
for (int i = 0; i < len; ++i) { \
|
||||
if (i != 0) prnt(", "); \
|
||||
prnt(fmt, __VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
|
||||
typedef struct b {
|
||||
long int dl;
|
||||
long int ul;
|
||||
long int unres_ul;
|
||||
long int unres_dl;
|
||||
} b_t;
|
||||
|
||||
typedef struct ue_stat {
|
||||
rnti_t rnti;
|
||||
b_t thr;
|
||||
} ue_stat_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t mcc;
|
||||
uint32_t mnc;
|
||||
int mnc_digit_length;
|
||||
uint32_t gnb_id;
|
||||
} cell_config_t;
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include "intertask_interface.h"
|
||||
|
||||
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
|
||||
|
||||
@@ -21,27 +22,26 @@
|
||||
* Module brief:
|
||||
* This module is used to add RRCRelease commands to the telnet server in the
|
||||
* absence of full support for E2SM RAN Control (RC).
|
||||
* This provides similar functionality to the ORAN.WG3.E2SM-RC-R003-v05.00
|
||||
* 8.4.5.4 RRC Connection Release Control which is initiated by the RIC.
|
||||
*
|
||||
* This provides similar functionality to the ORAN.WG3.E2SM-RC-R003-v05.00
|
||||
* 8.4.5.4 RRC Connection Release Control which is initiated by the RIC.
|
||||
*
|
||||
* Implementation notes:
|
||||
* We refer to the method call rrc_gNB_generate_RRCRelease at rrc_gNB_NGAP.c
|
||||
* during rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND message generation.
|
||||
*
|
||||
* We refer to the method call rrc_gNB_generate_RRCRelease at rrc_gNB_NGAP.c
|
||||
* during rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND message generation.
|
||||
*
|
||||
* Building the telnetsrv and module:
|
||||
* ./build_oai --build-lib telnetsrv
|
||||
*
|
||||
*
|
||||
* Loading the module:
|
||||
* sudo ./nr-softmodem -E --rfsim --log_config.global_log_options level,nocolor,time -O ~/gnb.sa.band78.106prb.rfsim.conf --telnetsrv --telnetsrv.shrmod rrc
|
||||
*/
|
||||
|
||||
static int get_single_ue_id(void)
|
||||
{
|
||||
rrc_gNB_ue_context_t *ue_context_p = NULL;
|
||||
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[0]->rrc_ue_head)) {
|
||||
return ue_context_p->ue_context.rrc_ue_id;
|
||||
}
|
||||
return -1;
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_SINGLE_UE_RNTI);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
return msg_p->ittiMsg.rrc_get_single_ue_rnti.rnti ? msg_p->ittiMsg.rrc_get_single_ue_rnti.rnti : -1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,19 +71,24 @@ int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
}
|
||||
|
||||
/* get RRC and UE */
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[0];
|
||||
rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(rrc, ue_id);
|
||||
if (!ue_context_p) {
|
||||
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GET_UE_CONTEXT_BY_UE_ID);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
Rrc_get_single_ue_rnti ue = msg_p->ittiMsg.rrc_get_single_ue_rnti;
|
||||
if (!ue.rnti) {
|
||||
prnt("Could not find UE context associated with UE ID %lu\n", ue_id);
|
||||
LOG_E(RRC, "Could not find UE context associated with UE ID %lu\n", ue_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
|
||||
|
||||
rrc_gNB_generate_RRCRelease(rrc, UE);
|
||||
msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GNB_GENERATE_RRCRELEASE);
|
||||
msg_p->ittiMsg.rrc_gnb_generate_rrcrelease.ue_id = ue.id;
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
|
||||
|
||||
prnt("RRC Release triggered for UE %u\n", ue_id);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -94,15 +99,12 @@ int rrc_gNB_trigger_release_all(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
UNUSED(debug);
|
||||
UNUSED(buf);
|
||||
rrc_gNB_ue_context_t *ue_context_p = NULL;
|
||||
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[0];
|
||||
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &rrc->rrc_ue_head) {
|
||||
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
|
||||
rrc_gNB_generate_RRCRelease(rrc, UE);
|
||||
prnt("RRC Release triggered for UE %u\n", UE->rrc_ue_id);
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, RRC_GNB_GENERATE_RRCRELEASE_ALL);
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg_p);
|
||||
itti_receive_msg(TASK_TELNET, &msg_p);
|
||||
for(int i=0; i<sizeof(msg_p->ittiMsg.rrc_gnb_generate_rrcrelease_all.rrc_gnb_generate_rrcreleases);i++){
|
||||
prnt("RRC Release triggered for UE %u\n", msg_p->ittiMsg.rrc_gnb_generate_rrcrelease_all.rrc_gnb_generate_rrcreleases[i].ue_id);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,3 +47,12 @@ MESSAGE_DEF(GNB_SAT_POSITION_UPDATE, MESSAGE_PRIORITY_MED, gnb_sat_position_upda
|
||||
// nrUE
|
||||
MESSAGE_DEF(NR_RRC_MAC_MEAS_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, NRRrcMacMeasDataInd, nr_rrc_mac_meas_data_ind)
|
||||
|
||||
MESSAGE_DEF(RRC_GET_SINGLE_UE_RNTI, MESSAGE_PRIORITY_MED_PLUS, Rrc_get_single_ue_rnti, rrc_get_single_ue_rnti)
|
||||
MESSAGE_DEF(RRC_GET_UE_CONTEXT_BY_UE_ID, MESSAGE_PRIORITY_MED_PLUS, Rrc_get_single_ue_rnti, rrc_get_ue_context_by_ue_id)
|
||||
MESSAGE_DEF(RRC_GET_DU_ID_BY_RNTI, MESSAGE_PRIORITY_MED_PLUS, Rrc_get_du_id_by_rnti, rrc_get_du_id_by_rnti)
|
||||
MESSAGE_DEF(RRC_NR_HO_F1_TRIGGER, MESSAGE_PRIORITY_MED_PLUS, Rrc_trigger_ho, rrc_trigger_ho_f1)
|
||||
MESSAGE_DEF(RRC_GET_NGAP_UE_ID, MESSAGE_PRIORITY_MED_PLUS, Rrc_get_ngap_ue_id, rrc_get_ngap_ue_id)
|
||||
MESSAGE_DEF(RRC_NR_HO_N2_TRIGGER, MESSAGE_PRIORITY_MED_PLUS, Rrc_trigger_ho, rrc_trigger_ho_n2)
|
||||
MESSAGE_DEF(RRC_CHECK_UE_CONTEXT, MESSAGE_PRIORITY_MED_PLUS, Rrc_check_ue_context, rrc_check_ue_context)
|
||||
MESSAGE_DEF(RRC_GNB_GENERATE_RRCRELEASE, MESSAGE_PRIORITY_MED_PLUS, Rrc_gnb_generate_rrcrelease, rrc_gnb_generate_rrcrelease)
|
||||
MESSAGE_DEF(RRC_GNB_GENERATE_RRCRELEASE_ALL, MESSAGE_PRIORITY_MED_PLUS, Rrc_gnb_generate_rrcrelease_all, rrc_gnb_generate_rrcrelease_all)
|
||||
|
||||
@@ -69,3 +69,7 @@ MESSAGE_DEF(NAS_PDU_SESSION_REQ, MESSAGE_PRIORITY_MED, nas_pdu_session_req_t, na
|
||||
|
||||
// UE: RLC -> RRC messages
|
||||
MESSAGE_DEF(NR_RRC_RLC_MAXRTX, MESSAGE_PRIORITY_MED, RlcMaxRtxIndication, nr_rlc_maxrtx_indication)
|
||||
|
||||
MESSAGE_DEF(RRC_GET_ACTIVE_UE_LIST, MESSAGE_PRIORITY_MED, Rrc_get_active_ue_list, rrc_active_ue_list)
|
||||
MESSAGE_DEF(RRC_GET_CUUP_CELLS_LIST, MESSAGE_PRIORITY_MED, Rrc_get_cuup_cells_list, rrc_cuup_cells_list)
|
||||
MESSAGE_DEF(RRC_GET_NODE_INFO, MESSAGE_PRIORITY_MED, Rrc_get_node_info, rrc_node_info)
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "NR_BCCH-BCH-Message.h"
|
||||
#include "NR_ReestablishmentCause.h"
|
||||
#include "NR_UE-NR-Capability.h"
|
||||
#include "common/ngran_types.h"
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
// Messages for RRC logging
|
||||
@@ -484,4 +485,30 @@ typedef struct {
|
||||
} payload;
|
||||
} nr_mac_rrc_message_t;
|
||||
|
||||
typedef struct Rrc_get_active_ue_list_s{
|
||||
uint32_t num_ues;
|
||||
uint32_t rnti_list[MAX_MOBILES_PER_GNB]; // Define a safe upper bound
|
||||
} Rrc_get_active_ue_list;
|
||||
#define RRC_GET_ACTIVE_UE_LIST(mSGpTR) (mSGpTR)->ittiMsg.rrc_active_ue_list;
|
||||
|
||||
|
||||
typedef struct Rrc_get_cuup_cells_list_s{
|
||||
uint64_t cell_ids[10];
|
||||
uint16_t mccs[10];
|
||||
uint16_t mncs[10];
|
||||
uint8_t mnc_digit_lengths[10];
|
||||
int cell_count;
|
||||
uint8_t sst;
|
||||
uint32_t sd;
|
||||
} Rrc_get_cuup_cells_list;
|
||||
#define RRC_GET_CUUP_CELLS_LIST(mSGpTR) (mSGpTR)->ittiMsg.rrc_cuup_cells_list;
|
||||
|
||||
|
||||
typedef struct Rrc_get_node_info_s{
|
||||
ngran_node_t node_type;
|
||||
uint32_t node_id;
|
||||
char *node_name;
|
||||
} Rrc_get_node_info;
|
||||
#define RRC_GET_NODE_INFO(mSGpTR) (mSGpTR)->ittiMsg.rrc_node_info;
|
||||
|
||||
#endif /* RRC_MESSAGES_TYPES_H_ */
|
||||
|
||||
@@ -705,7 +705,7 @@ void RCconfig_nr_prs(void)
|
||||
for (int l = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].numelt; l++)
|
||||
{
|
||||
prs_config->MutingPattern1[l] = PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].uptr[l];
|
||||
if (k == 0) // print only for 0th resource
|
||||
if (k == 0) // print only for 0th resource
|
||||
snprintf(str[5]+strlen(str[5]),sizeof(str[5])-strlen(str[5]),"%d, ",prs_config->MutingPattern1[l]);
|
||||
}
|
||||
for (int l = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].numelt; l++)
|
||||
@@ -1814,7 +1814,7 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg)
|
||||
|
||||
if (IS_SA_MODE(get_softmodem_params()))
|
||||
nr_mac_configure_sib1(RC.nrmac[0], &info.plmn, info.nr_cellid, *info.tac);
|
||||
|
||||
|
||||
// read F1 Setup information from config and generated MIB/SIB1
|
||||
// and store it at MAC for sending later
|
||||
NR_BCCH_BCH_Message_t *mib = RC.nrmac[0]->common_channels[0].mib;
|
||||
@@ -2281,6 +2281,8 @@ static void fill_measurement_configuration(uint8_t gnb_idx, gNB_RRC_INST *rrc)
|
||||
}
|
||||
}
|
||||
|
||||
extern void openair_rrc_gNB_configuration(gNB_RRC_INST *rrc, nr_rrc_config_t *configuration);
|
||||
|
||||
/** @brief Parse and populate SIB2 configuration from config file
|
||||
* @param[in] gnb_idx gNB index
|
||||
* @return populated SIB2 configuration */
|
||||
@@ -2395,7 +2397,7 @@ gNB_RRC_INST *RCconfig_NRRRC()
|
||||
}
|
||||
|
||||
if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_mac") == 0) {
|
||||
|
||||
|
||||
} else if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "cudu") == 0) {
|
||||
rrc->eth_params_s.my_addr = strdup(*(GNBParamList.paramarray[i][GNB_LOCAL_S_ADDRESS_IDX].strptr));
|
||||
rrc->eth_params_s.remote_addr = strdup(*(GNBParamList.paramarray[i][GNB_REMOTE_S_ADDRESS_IDX].strptr));
|
||||
@@ -2405,10 +2407,10 @@ gNB_RRC_INST *RCconfig_NRRRC()
|
||||
rrc->eth_params_s.remote_portd = *(GNBParamList.paramarray[i][GNB_REMOTE_S_PORTD_IDX].uptr);
|
||||
rrc->eth_params_s.transp_preference = ETH_UDP_MODE;
|
||||
} else { // other midhaul
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// search if in active list
|
||||
|
||||
|
||||
nr_rrc_config_t nrrrc_config = {0};
|
||||
for (k=0; k <num_gnbs ; k++) {
|
||||
if (strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[k], *(GNBParamList.paramarray[i][GNB_GNB_NAME_IDX].strptr) )== 0) {
|
||||
@@ -2755,7 +2757,7 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up
|
||||
// generate gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE
|
||||
msg_ack_p = itti_alloc_new_message (TASK_GNB_APP, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE);
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).num_cells_failed_to_be_activated = 0;
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).have_criticality = 0;
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).have_criticality = 0;
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_to_setup =0;
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_failed = 0;
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofDedicatedSIDeliveryNeededUEs = 0;
|
||||
@@ -2778,7 +2780,7 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up
|
||||
ngran_node_t get_node_type(void)
|
||||
{
|
||||
GET_PARAMS_LIST(GNBParamList, GNBParams, GNBPARAMS_DESC, GNB_CONFIG_STRING_GNB_LIST, NULL);
|
||||
if (GNBParamList.numelt == 0) // We have no valid configuration, let's return a default
|
||||
if (GNBParamList.numelt == 0) // We have no valid configuration, let's return a default
|
||||
return ngran_gNB;
|
||||
|
||||
// MAC/RLC params
|
||||
|
||||
@@ -658,6 +658,4 @@ const ue_serving_cell_t *ue_get_pcell_entry(const gNB_RRC_UE_t *ue);
|
||||
#define LOG_UE_EVENT(ue_context, fmt, ...) LOG_A(NR_RRC, "[--] " UE_LOG_FMT " " fmt, UE_LOG_ARGS(ue_context) __VA_OPT__(,) __VA_ARGS__)
|
||||
#define LOG_UE_UL_EVENT(ue_context, fmt, ...) LOG_A(NR_RRC, "[UL] " UE_LOG_FMT " " fmt, UE_LOG_ARGS(ue_context) __VA_OPT__(,) __VA_ARGS__)
|
||||
|
||||
#include "nr_rrc_proto.h" //should be put here otherwise compilation error
|
||||
|
||||
#endif
|
||||
|
||||
54
openair2/RRC/NR/nr_rrc_messages_types.h
Normal file
54
openair2/RRC/NR/nr_rrc_messages_types.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#ifndef NR_RRC_MESSAGES_TYPES_H_
|
||||
#define NR_RRC_MESSAGES_TYPES_H_
|
||||
|
||||
typedef struct Rrc_get_single_ue_rnti_s{
|
||||
rnti_t rnti;
|
||||
ue_id_t id;
|
||||
int32_t ue_reestablishment_counter;
|
||||
int32_t ue_reconfiguration_counter;
|
||||
} Rrc_get_single_ue_rnti;
|
||||
#define RRC_GET_SINGLE_UE_RNTI(mSGpTR) (mSGpTR)->ittiMsg.rrc_get_single_ue_rnti;
|
||||
#define RRC_GET_UE_CONTEXT_BY_UE_ID(mSGpTR) (mSGpTR)->ittiMsg.rrc_get_ue_context_by_ue_id;
|
||||
|
||||
typedef struct Rrc_get_du_id_by_rnti_s{
|
||||
rnti_t rnti;
|
||||
int du_id;
|
||||
} Rrc_get_du_id_by_rnti;
|
||||
#define RRC_GET_DU_ID_BY_RNTI(mSGpTR) (mSGpTR)->ittiMsg.rrc_get_du_id_by_rnti;
|
||||
|
||||
|
||||
typedef struct Rrc_trigger_ho_s{
|
||||
ue_id_t id;
|
||||
uint32_t neighbour_pci;
|
||||
} Rrc_trigger_ho;
|
||||
#define RRC_NR_HO_F1_TRIGGER(mSGpTR) (mSGpTR)->ittiMsg.rrc_trigger_ho;
|
||||
#define RRC_NR_HO_N2_TRIGGER(mSGpTR) (mSGpTR)->ittiMsg.rrc_trigger_ho;
|
||||
|
||||
|
||||
typedef struct Rrc_get_ngap_ue_id_s{
|
||||
int amf_ue_ngap_id;
|
||||
int gNB_ue_ngap_id;
|
||||
} Rrc_get_ngap_ue_id;
|
||||
#define RRC_GET_NGAP_UE_ID(mSGpTR) (mSGpTR)->ittiMsg.rrc_ngap_ue_id;
|
||||
|
||||
|
||||
typedef struct Rrc_check_ue_context_s{
|
||||
int id;
|
||||
bool check;
|
||||
} Rrc_check_ue_context;
|
||||
#define RRC_CHECK_UE_CONTEXT(mSGpTR) (mSGpTR)->ittiMsg.rrc_check_ue_context;
|
||||
|
||||
|
||||
typedef struct Rrc_gnb_generate_rrcrelease_s{
|
||||
ue_id_t ue_id;
|
||||
} Rrc_gnb_generate_rrcrelease;
|
||||
#define RRC_GNB_GENERATE_RRCRELEASE(mSGpTR) (mSGpTR)->ittiMsg.rrc_gnb_generate_rrcrelease;
|
||||
|
||||
|
||||
typedef struct Rrc_gnb_generate_rrcrelease_all_s{
|
||||
Rrc_gnb_generate_rrcrelease rrc_gnb_generate_rrcreleases[64];
|
||||
} Rrc_gnb_generate_rrcrelease_all;
|
||||
#define RRC_GNB_GENERATE_RRCRELEASE_ALL(mSGpTR) (mSGpTR)->ittiMsg.rrc_gnb_generate_rrcrelease_all;
|
||||
|
||||
|
||||
#endif /* NR_RRC_MESSAGES_TYPES_H_ */
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "NR_RRCReconfiguration.h"
|
||||
#include "RRC/NR/MESSAGES/asn1_msg.h"
|
||||
#include "f1ap_messages_types.h"
|
||||
#include "intertask_interface.h"
|
||||
|
||||
#define SRB1 1
|
||||
#define SRB2 2
|
||||
|
||||
@@ -81,6 +81,8 @@
|
||||
#include "alg/find.h"
|
||||
#include "NR_HandoverCommand.h"
|
||||
#include "openair2/SDAP/nr_sdap/nr_sdap_configuration.h"
|
||||
#include "rrc_telnet_tasks.h"
|
||||
#include "rrc_gNB_UE_context.h"
|
||||
|
||||
#ifdef E2_AGENT
|
||||
#include "openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_extern.h"
|
||||
@@ -3696,6 +3698,82 @@ void *rrc_gnb_task(void *args_p)
|
||||
rrc_gNB_free_Handover_Command(&NGAP_HANDOVER_COMMAND(msg_p)); // Free transfered NG message
|
||||
break;
|
||||
|
||||
case RRC_GET_ACTIVE_UE_LIST:
|
||||
int count_ue = 0;
|
||||
struct rrc_gNB_ue_context_s* rrc_ue_context = NULL;
|
||||
if(RC.nrrrc[instance]->rrc_ue_head.rbh_root != NULL){
|
||||
RB_FOREACH(rrc_ue_context, rrc_nr_ue_tree_s, &RC.nrrrc[instance]->rrc_ue_head) {
|
||||
if (count_ue < MAX_MOBILES_PER_GNB) {
|
||||
msg_p->ittiMsg.rrc_active_ue_list.rnti_list[count_ue] = rrc_ue_context->ue_context.rrc_ue_id;
|
||||
count_ue++;
|
||||
}
|
||||
}
|
||||
}
|
||||
msg_p->ittiMsg.rrc_active_ue_list.num_ues = count_ue;
|
||||
itti_send_msg_to_task(TASK_TELNET, 0, msg_p);
|
||||
break;
|
||||
|
||||
case RRC_GET_NODE_INFO:
|
||||
msg_p->ittiMsg.rrc_node_info.node_type = RC.nrrrc[instance]->node_type;
|
||||
msg_p->ittiMsg.rrc_node_info.node_id = RC.nrrrc[instance]->node_id;
|
||||
msg_p->ittiMsg.rrc_node_info.node_name = RC.nrrrc[instance]->node_name;
|
||||
itti_send_msg_to_task(TASK_TELNET, 0, msg_p);
|
||||
break;
|
||||
|
||||
case RRC_GET_CUUP_CELLS_LIST:
|
||||
int count_cell = 0;
|
||||
nr_rrc_cell_container_t *cell = NULL;
|
||||
msg_p->ittiMsg.rrc_cuup_cells_list.sst = RC.nrrrc[instance]->cuups.rbh_root->setup_req->plmn->slice->sst;
|
||||
msg_p->ittiMsg.rrc_cuup_cells_list.sd = RC.nrrrc[instance]->cuups.rbh_root->setup_req->plmn->slice->sd;
|
||||
RB_FOREACH (cell, rrc_cell_tree, &RC.nrrrc[instance]->cells) {
|
||||
if(count_cell<10){
|
||||
msg_p->ittiMsg.rrc_cuup_cells_list.cell_ids[count_cell] = cell->info.cell_id;
|
||||
msg_p->ittiMsg.rrc_cuup_cells_list.mccs[count_cell] = cell->info.plmn.mcc;
|
||||
msg_p->ittiMsg.rrc_cuup_cells_list.mncs[count_cell] = cell->info.plmn.mnc;
|
||||
msg_p->ittiMsg.rrc_cuup_cells_list.mnc_digit_lengths[count_cell] = cell->info.plmn.mnc_digit_length;
|
||||
count_cell++;
|
||||
}
|
||||
}
|
||||
msg_p->ittiMsg.rrc_cuup_cells_list.cell_count = count_cell;
|
||||
itti_send_msg_to_task(TASK_TELNET, 0, msg_p);
|
||||
break;
|
||||
|
||||
case RRC_GET_SINGLE_UE_RNTI:
|
||||
rrc_get_single_ue_rnti(msg_p, instance);
|
||||
break;
|
||||
|
||||
case RRC_GET_UE_CONTEXT_BY_UE_ID:
|
||||
rrc_get_ue_context_by_ue_id(msg_p, instance);
|
||||
break;
|
||||
|
||||
case RRC_GET_DU_ID_BY_RNTI:
|
||||
rrc_get_du_id_by_rnti(msg_p, instance);
|
||||
break;
|
||||
|
||||
case RRC_NR_HO_F1_TRIGGER:
|
||||
rrc_trigger_ho_f1(msg_p, instance);
|
||||
break;
|
||||
|
||||
case RRC_NR_HO_N2_TRIGGER:
|
||||
rrc_trigger_ho_n2(msg_p, instance);
|
||||
break;
|
||||
|
||||
case RRC_GET_NGAP_UE_ID:
|
||||
rrc_get_ngap_ue_id(msg_p, instance);
|
||||
break;
|
||||
|
||||
case RRC_CHECK_UE_CONTEXT:
|
||||
rrc_check_ue_context(msg_p, instance);
|
||||
break;
|
||||
|
||||
case RRC_GNB_GENERATE_RRCRELEASE:
|
||||
rrc_gnb_generate_rrcrelease(msg_p,instance);
|
||||
break;
|
||||
|
||||
case RRC_GNB_GENERATE_RRCRELEASE_ALL:
|
||||
rrc_gnb_generate_rrcrelease_all(msg_p,instance);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(NR_RRC, "[gNB %ld] Received unexpected message %s\n", instance, msg_name_p);
|
||||
break;
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "common/utils/oai_asn1.h"
|
||||
#include "utils.h"
|
||||
#include "xer_encoder.h"
|
||||
#include "nr_rrc_proto.h"
|
||||
|
||||
static int get_dl_band(const f1ap_served_cell_info_t *cell_info)
|
||||
{
|
||||
|
||||
89
openair2/RRC/NR/rrc_telnet_tasks.c
Normal file
89
openair2/RRC/NR/rrc_telnet_tasks.c
Normal file
@@ -0,0 +1,89 @@
|
||||
#include "./rrc_telnet_tasks.h"
|
||||
|
||||
void rrc_get_single_ue_rnti(MessageDef *msg_p, instance_t instance)
|
||||
{
|
||||
if(RC.nrrrc[instance] != NULL ){
|
||||
rrc_gNB_ue_context_t *ue = NULL;
|
||||
RB_FOREACH (ue, rrc_nr_ue_tree_s, &RC.nrrrc[instance]->rrc_ue_head) {
|
||||
msg_p->ittiMsg.rrc_get_single_ue_rnti.rnti = ue->ue_context.rnti;
|
||||
msg_p->ittiMsg.rrc_get_single_ue_rnti.id = ue->ue_context.rrc_ue_id;
|
||||
msg_p->ittiMsg.rrc_get_single_ue_rnti.ue_reestablishment_counter = ue->ue_context.ue_reestablishment_counter;
|
||||
msg_p->ittiMsg.rrc_get_single_ue_rnti.ue_reconfiguration_counter = ue->ue_context.ue_reconfiguration_counter;
|
||||
}
|
||||
}
|
||||
itti_send_msg_to_task(TASK_TELNET, 0, msg_p);
|
||||
}
|
||||
|
||||
void rrc_check_ue_context(MessageDef *msg_p, instance_t instance)
|
||||
{
|
||||
if(RC.nrrrc[instance] != NULL ){
|
||||
rrc_gNB_ue_context_t *ue = rrc_gNB_get_ue_context(RC.nrrrc[instance], msg_p->ittiMsg.rrc_check_ue_context.id);
|
||||
if(!ue){
|
||||
msg_p->ittiMsg.rrc_check_ue_context.check = false;
|
||||
} else {
|
||||
msg_p->ittiMsg.rrc_check_ue_context.check = true;
|
||||
}
|
||||
}
|
||||
itti_send_msg_to_task(TASK_TELNET, 0, msg_p);
|
||||
}
|
||||
|
||||
void rrc_get_ue_context_by_ue_id(MessageDef *msg_p, instance_t instance)
|
||||
{
|
||||
if(RC.nrrrc[instance] != NULL ){
|
||||
rrc_gNB_ue_context_t *ue = NULL;
|
||||
ue = rrc_gNB_get_ue_context(RC.nrrrc[instance], msg_p->ittiMsg.rrc_get_ue_context_by_ue_id.id);
|
||||
RB_FOREACH (ue, rrc_nr_ue_tree_s, &RC.nrrrc[instance]->rrc_ue_head) {
|
||||
msg_p->ittiMsg.rrc_get_ue_context_by_ue_id.rnti = ue->ue_context.rnti;
|
||||
msg_p->ittiMsg.rrc_get_ue_context_by_ue_id.ue_reestablishment_counter = ue->ue_context.ue_reestablishment_counter;
|
||||
msg_p->ittiMsg.rrc_get_ue_context_by_ue_id.ue_reconfiguration_counter = ue->ue_context.ue_reconfiguration_counter;
|
||||
}
|
||||
}
|
||||
itti_send_msg_to_task(TASK_TELNET, 0, msg_p);
|
||||
}
|
||||
|
||||
void rrc_get_du_id_by_rnti(MessageDef *msg_p, instance_t instance)
|
||||
{
|
||||
nr_rrc_du_container_t *du = get_du_for_ue(RC.nrrrc[instance], msg_p->ittiMsg.rrc_get_du_id_by_rnti.rnti);
|
||||
msg_p->ittiMsg.rrc_get_du_id_by_rnti.du_id = du->gNB_DU_id;
|
||||
itti_send_msg_to_task(TASK_TELNET, 0, msg_p);
|
||||
}
|
||||
|
||||
extern void nr_HO_F1_trigger_telnet(gNB_RRC_INST *rrc, uint32_t rrc_ue_id);
|
||||
extern void nr_HO_N2_trigger_telnet(gNB_RRC_INST *rrc, uint32_t neighbour_pci, uint32_t rrc_ue_id);
|
||||
|
||||
|
||||
void rrc_trigger_ho_f1(MessageDef *msg_p, instance_t instance)
|
||||
{
|
||||
nr_HO_F1_trigger_telnet(RC.nrrrc[instance], msg_p->ittiMsg.rrc_trigger_ho_f1.id);
|
||||
}
|
||||
|
||||
void rrc_trigger_ho_n2(MessageDef *msg_p, instance_t instance)
|
||||
{
|
||||
nr_HO_N2_trigger_telnet(RC.nrrrc[instance], msg_p->ittiMsg.rrc_trigger_ho_n2.neighbour_pci,msg_p->ittiMsg.rrc_trigger_ho_n2.id);
|
||||
}
|
||||
|
||||
void rrc_get_ngap_ue_id(MessageDef *msg_p, instance_t instance)
|
||||
{
|
||||
ngap_gNB_ue_context_t *ngap_ue_context = ngap_get_ue_context(msg_p->ittiMsg.rrc_get_ngap_ue_id.gNB_ue_ngap_id);
|
||||
msg_p->ittiMsg.rrc_get_ngap_ue_id.amf_ue_ngap_id = ngap_ue_context->amf_ue_ngap_id;
|
||||
msg_p->ittiMsg.rrc_get_ngap_ue_id.gNB_ue_ngap_id = ngap_ue_context->gNB_ue_ngap_id;
|
||||
itti_send_msg_to_task(TASK_TELNET, 0, msg_p);
|
||||
}
|
||||
|
||||
extern void rrc_gNB_generate_RRCRelease(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE);
|
||||
|
||||
void rrc_gnb_generate_rrcrelease(MessageDef *msg_p, instance_t instance)
|
||||
{
|
||||
rrc_gNB_ue_context_t *ue = rrc_gNB_get_ue_context(RC.nrrrc[instance], msg_p->ittiMsg.rrc_gnb_generate_rrcrelease.ue_id);
|
||||
gNB_RRC_UE_t *UE = &ue->ue_context;
|
||||
rrc_gNB_generate_RRCRelease(RC.nrrrc[instance], UE);
|
||||
}
|
||||
|
||||
void rrc_gnb_generate_rrcrelease_all(MessageDef *msg_p, instance_t instance)
|
||||
{
|
||||
rrc_gNB_ue_context_t *ue_context_p = NULL;
|
||||
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &RC.nrrrc[instance]->rrc_ue_head) {
|
||||
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
|
||||
rrc_gNB_generate_RRCRelease(RC.nrrrc[instance], UE);
|
||||
}
|
||||
}
|
||||
17
openair2/RRC/NR/rrc_telnet_tasks.h
Normal file
17
openair2/RRC/NR/rrc_telnet_tasks.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "nr_rrc_defs.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "rrc_gNB_UE_context.h"
|
||||
#include "rrc_gNB_mobility.h"
|
||||
#include "ngap_gNB_ue_context.h"
|
||||
#include "rrc_gNB_du.h"
|
||||
#include "ran_context.h"
|
||||
|
||||
void rrc_get_single_ue_rnti(MessageDef *msg_p, instance_t instance);
|
||||
void rrc_get_ue_context_by_ue_id(MessageDef *msg_p, instance_t instance);
|
||||
void rrc_get_du_id_by_rnti(MessageDef *msg_p, instance_t instance);
|
||||
void rrc_trigger_ho_f1(MessageDef *msg_p, instance_t instance);
|
||||
void rrc_trigger_ho_n2(MessageDef *msg_p, instance_t instance);
|
||||
void rrc_get_ngap_ue_id(MessageDef *msg_p, instance_t instance);
|
||||
void rrc_check_ue_context(MessageDef *msg_p, instance_t instance);
|
||||
void rrc_gnb_generate_rrcrelease(MessageDef *msg_p, instance_t instance);
|
||||
void rrc_gnb_generate_rrcrelease_all(MessageDef *msg_p, instance_t instance);
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "ds/seq_arr.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/5g_platform_types.h"
|
||||
#include "softmodem-common.h"
|
||||
|
||||
int nr_rlc_get_available_tx_space(int module_id, int rnti, int drb_id) { return 0; }
|
||||
softmodem_params_t *get_softmodem_params(void) { return NULL; }
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "common/utils/LOG/log.h" // for LOG_I, LOG_A, etc.
|
||||
#include "common/utils/ds/seq_arr.h" // for seq_arr_free
|
||||
#include "openair2/F1AP/f1ap_ids.h" // for cu_init_f1_ue_data, cu_add_f1_ue_data
|
||||
#include "softmodem-common.h"
|
||||
|
||||
// Test constants
|
||||
static const sctp_assoc_t ASSOC_ID_DU1 = 8;
|
||||
|
||||
Reference in New Issue
Block a user