Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常顺宇
OpenXG-RAN
Commits
5697057f
Commit
5697057f
authored
Oct 16, 2020
by
Xue Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unblock ITTI SIM process
parent
a76ef07a
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
240 additions
and
179 deletions
+240
-179
openair2/COMMON/itti_sim_messages_types.h
openair2/COMMON/itti_sim_messages_types.h
+1
-1
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+28
-22
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+47
-35
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+125
-106
openair2/RRC/NR_UE/rrc_proto.h
openair2/RRC/NR_UE/rrc_proto.h
+6
-0
openair2/SIMULATION/NR_RRC/itti_sim.c
openair2/SIMULATION/NR_RRC/itti_sim.c
+33
-15
No files found.
openair2/COMMON/itti_sim_messages_types.h
View file @
5697057f
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
typedef
struct
itti_sim_rrc_ch_s
{
typedef
struct
itti_sim_rrc_ch_s
{
const
rb_id_t
rbid
;
rb_id_t
rbid
;
uint8_t
*
sdu
;
uint8_t
*
sdu
;
int
size
;
int
size
;
}
itti_sim_rrc_ch_t
;
}
itti_sim_rrc_ch_t
;
...
...
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
5697057f
...
@@ -631,12 +631,12 @@ uint8_t do_RRCReject(uint8_t Mod_id,
...
@@ -631,12 +631,12 @@ uint8_t do_RRCReject(uint8_t Mod_id,
100
);
100
);
if
(
enc_rval
.
encoded
==
-
1
)
{
if
(
enc_rval
.
encoded
==
-
1
)
{
LOG_E
(
RRC
,
"[gNB AssertFatal]ASN1 message encoding failed (%s, %lu)!
\n
"
,
LOG_E
(
NR_
RRC
,
"[gNB AssertFatal]ASN1 message encoding failed (%s, %lu)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
return
-
1
;
return
-
1
;
}
}
LOG_D
(
RRC
,
"RRCReject Encoded %zd bits (%zd bytes)
\n
"
,
LOG_D
(
NR_
RRC
,
"RRCReject Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
}
...
@@ -762,13 +762,13 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP,
...
@@ -762,13 +762,13 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP,
100
);
100
);
if
(
enc_rval
.
encoded
==
-
1
)
{
if
(
enc_rval
.
encoded
==
-
1
)
{
LOG_E
(
RRC
,
"ASN1 message CellGroupConfig encoding failed (%s, %lu)!
\n
"
,
LOG_E
(
NR_
RRC
,
"ASN1 message CellGroupConfig encoding failed (%s, %lu)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
return
-
1
;
return
-
1
;
}
}
if
(
OCTET_STRING_fromBuf
(
&
ie
->
masterCellGroup
,
masterCellGroup_buf
,
(
enc_rval
.
encoded
+
7
)
/
8
)
==
-
1
)
{
if
(
OCTET_STRING_fromBuf
(
&
ie
->
masterCellGroup
,
masterCellGroup_buf
,
(
enc_rval
.
encoded
+
7
)
/
8
)
==
-
1
)
{
LOG_E
(
RRC
,
"fatal: OCTET_STRING_fromBuf failed
\n
"
);
LOG_E
(
NR_
RRC
,
"fatal: OCTET_STRING_fromBuf failed
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -783,12 +783,12 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP,
...
@@ -783,12 +783,12 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP,
100
);
100
);
if
(
enc_rval
.
encoded
==
-
1
)
{
if
(
enc_rval
.
encoded
==
-
1
)
{
LOG_E
(
RRC
,
"[gNB AssertFatal]ASN1 message encoding failed (%s, %lu)!
\n
"
,
LOG_E
(
NR_
RRC
,
"[gNB AssertFatal]ASN1 message encoding failed (%s, %lu)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
return
-
1
;
return
-
1
;
}
}
LOG_D
(
RRC
,
"RRCSetup Encoded %zd bits (%zd bytes)
\n
"
,
LOG_D
(
NR_
RRC
,
"RRCSetup Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
}
...
@@ -890,19 +890,19 @@ uint8_t do_NR_UECapabilityEnquiry_nr( const protocol_ctxt_t *const ctxt_pP,
...
@@ -890,19 +890,19 @@ uint8_t do_NR_UECapabilityEnquiry_nr( const protocol_ctxt_t *const ctxt_pP,
100
);
100
);
if
(
enc_rval
.
encoded
==
-
1
)
{
if
(
enc_rval
.
encoded
==
-
1
)
{
LOG_I
(
RRC
,
"[gNB AssertFatal]ASN1 message encoding failed (%s, %lu)!
\n
"
,
LOG_I
(
NR_
RRC
,
"[gNB AssertFatal]ASN1 message encoding failed (%s, %lu)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
return
-
1
;
return
-
1
;
}
}
LOG_D
(
RRC
,
"[gNB %d] NR UECapabilityRequest for UE %x Encoded %zd bits (%zd bytes)
\n
"
,
LOG_D
(
NR_
RRC
,
"[gNB %d] NR UECapabilityRequest for UE %x Encoded %zd bits (%zd bytes)
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
module_id
,
ctxt_pP
->
rnti
,
ctxt_pP
->
rnti
,
enc_rval
.
encoded
,
enc_rval
.
encoded
,
(
enc_rval
.
encoded
+
7
)
/
8
);
(
enc_rval
.
encoded
+
7
)
/
8
);
if
(
enc_rval
.
encoded
==-
1
)
{
if
(
enc_rval
.
encoded
==-
1
)
{
LOG_E
(
RRC
,
"[e
NB %d] ASN1 : NR UECapabilityRequest encoding failed for UE %x
\n
"
,
LOG_E
(
NR_RRC
,
"[g
NB %d] ASN1 : NR UECapabilityRequest encoding failed for UE %x
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
module_id
,
ctxt_pP
->
rnti
);
ctxt_pP
->
rnti
);
return
(
-
1
);
return
(
-
1
);
...
@@ -1106,14 +1106,16 @@ uint8_t do_RRCSetupRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv) {
...
@@ -1106,14 +1106,16 @@ uint8_t do_RRCSetupRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv) {
ul_ccch_msg
.
message
.
present
=
NR_UL_CCCH_MessageType_PR_c1
;
ul_ccch_msg
.
message
.
present
=
NR_UL_CCCH_MessageType_PR_c1
;
ul_ccch_msg
.
message
.
choice
.
c1
=
CALLOC
(
1
,
sizeof
(
struct
NR_UL_CCCH_MessageType__c1
));
ul_ccch_msg
.
message
.
choice
.
c1
=
CALLOC
(
1
,
sizeof
(
struct
NR_UL_CCCH_MessageType__c1
));
ul_ccch_msg
.
message
.
choice
.
c1
->
present
=
NR_UL_CCCH_MessageType__c1_PR_rrcSetupRequest
;
ul_ccch_msg
.
message
.
choice
.
c1
->
present
=
NR_UL_CCCH_MessageType__c1_PR_rrcSetupRequest
;
ul_ccch_msg
.
message
.
choice
.
c1
->
choice
.
rrcSetupRequest
=
CALLOC
(
1
,
sizeof
(
NR_RRCSetupRequest_t
));
rrcSetupRequest
=
ul_ccch_msg
.
message
.
choice
.
c1
->
choice
.
rrcSetupRequest
;
rrcSetupRequest
=
ul_ccch_msg
.
message
.
choice
.
c1
->
choice
.
rrcSetupRequest
;
if
(
1
)
{
if
(
1
)
{
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
present
=
NR_InitialUE_Identity_PR_randomValue
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
present
=
NR_InitialUE_Identity_PR_randomValue
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
size
=
5
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
size
=
5
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
bits_unused
=
0
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
bits_unused
=
1
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
=
buf
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
=
buf
;
rv
[
0
]
=
rv
[
0
]
&
0x7F
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
[
0
]
=
rv
[
0
];
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
[
0
]
=
rv
[
0
];
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
[
1
]
=
rv
[
1
];
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
[
1
]
=
rv
[
1
];
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
[
2
]
=
rv
[
2
];
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
[
2
]
=
rv
[
2
];
...
@@ -1132,9 +1134,9 @@ uint8_t do_RRCSetupRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv) {
...
@@ -1132,9 +1134,9 @@ uint8_t do_RRCSetupRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv) {
rrcSetupRequest
->
rrcSetupRequest
.
spare
.
size
=
1
;
rrcSetupRequest
->
rrcSetupRequest
.
spare
.
size
=
1
;
rrcSetupRequest
->
rrcSetupRequest
.
spare
.
bits_unused
=
7
;
rrcSetupRequest
->
rrcSetupRequest
.
spare
.
bits_unused
=
7
;
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
)
)
{
//
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint
(
stdout
,
&
asn_DEF_NR_UL_CCCH_Message
,
(
void
*
)
&
ul_ccch_msg
);
xer_fprint
(
stdout
,
&
asn_DEF_NR_UL_CCCH_Message
,
(
void
*
)
&
ul_ccch_msg
);
}
//
}
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_UL_CCCH_Message
,
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_UL_CCCH_Message
,
NULL
,
NULL
,
...
@@ -1142,7 +1144,7 @@ uint8_t do_RRCSetupRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv) {
...
@@ -1142,7 +1144,7 @@ uint8_t do_RRCSetupRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv) {
buffer
,
buffer
,
100
);
100
);
AssertFatal
(
enc_rval
.
encoded
>
0
,
"ASN1 message encoding failed (%s, %lu)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
AssertFatal
(
enc_rval
.
encoded
>
0
,
"ASN1 message encoding failed (%s, %lu)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
LOG_D
(
RRC
,
"[UE] RRCSetupRequest Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,
(
enc_rval
.
encoded
+
7
)
/
8
);
LOG_D
(
NR_
RRC
,
"[UE] RRCSetupRequest Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,
(
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
@@ -1178,7 +1180,7 @@ do_NR_RRCReconfigurationComplete(
...
@@ -1178,7 +1180,7 @@ do_NR_RRCReconfigurationComplete(
100
);
100
);
AssertFatal
(
enc_rval
.
encoded
>
0
,
"ASN1 message encoding failed (%s, %lu)!
\n
"
,
AssertFatal
(
enc_rval
.
encoded
>
0
,
"ASN1 message encoding failed (%s, %lu)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
LOG_D
(
RRC
,
"rrcReconfigurationComplete Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
LOG_D
(
NR_
RRC
,
"rrcReconfigurationComplete Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
}
...
@@ -1197,16 +1199,20 @@ uint8_t do_RRCSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uint8_t Trans
...
@@ -1197,16 +1199,20 @@ uint8_t do_RRCSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uint8_t Trans
}
}
ul_dcch_msg
.
message
.
present
=
NR_UL_DCCH_MessageType_PR_c1
;
ul_dcch_msg
.
message
.
present
=
NR_UL_DCCH_MessageType_PR_c1
;
ul_dcch_msg
.
message
.
choice
.
c1
=
CALLOC
(
1
,
sizeof
(
struct
NR_
D
L_DCCH_MessageType__c1
));
ul_dcch_msg
.
message
.
choice
.
c1
=
CALLOC
(
1
,
sizeof
(
struct
NR_
U
L_DCCH_MessageType__c1
));
ul_dcch_msg
.
message
.
choice
.
c1
->
present
=
NR_UL_DCCH_MessageType__c1_PR_rrcSetupComplete
;
ul_dcch_msg
.
message
.
choice
.
c1
->
present
=
NR_UL_DCCH_MessageType__c1_PR_rrcSetupComplete
;
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
rrcSetupComplete
=
CALLOC
(
1
,
sizeof
(
NR_RRCSetupComplete_t
));
RrcSetupComplete
=
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
rrcSetupComplete
;
RrcSetupComplete
=
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
rrcSetupComplete
;
RrcSetupComplete
->
rrc_TransactionIdentifier
=
Transaction_id
;
RrcSetupComplete
->
rrc_TransactionIdentifier
=
Transaction_id
;
RrcSetupComplete
->
criticalExtensions
.
present
=
NR_RRCSetupComplete__criticalExtensions_PR_rrcSetupComplete
;
RrcSetupComplete
->
criticalExtensions
.
present
=
NR_RRCSetupComplete__criticalExtensions_PR_rrcSetupComplete
;
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
nonCriticalExtension
=
CALLOC
(
1
,
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
=
CALLOC
(
1
,
sizeof
(
NR_RRCSetupComplete_IEs_t
));
sizeof
(
*
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
nonCriticalExtension
));
// RrcSetupComplete->criticalExtensions.choice.rrcSetupComplete->nonCriticalExtension = CALLOC(1,
// sizeof(*RrcSetupComplete->criticalExtensions.choice.rrcSetupComplete->nonCriticalExtension));
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
selectedPLMN_Identity
=
sel_plmn_id
;
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
selectedPLMN_Identity
=
sel_plmn_id
;
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
registeredAMF
=
NULL
;
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
registeredAMF
=
NULL
;
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
ng_5G_S_TMSI_Value
=
CALLOC
(
1
,
sizeof
(
struct
NR_RRCSetupComplete_IEs__ng_5G_S_TMSI_Value
));
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
ng_5G_S_TMSI_Value
->
present
=
NR_RRCSetupComplete_IEs__ng_5G_S_TMSI_Value_PR_ng_5G_S_TMSI
;
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
ng_5G_S_TMSI_Value
->
choice
.
ng_5G_S_TMSI
.
size
=
6
;
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
ng_5G_S_TMSI_Value
->
choice
.
ng_5G_S_TMSI
.
size
=
6
;
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
ng_5G_S_TMSI_Value
->
choice
.
ng_5G_S_TMSI
.
buf
=
buf
;
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
ng_5G_S_TMSI_Value
->
choice
.
ng_5G_S_TMSI
.
buf
=
buf
;
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
ng_5G_S_TMSI_Value
->
choice
.
ng_5G_S_TMSI
.
buf
[
0
]
=
rv
[
0
];
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
ng_5G_S_TMSI_Value
->
choice
.
ng_5G_S_TMSI
.
buf
[
0
]
=
rv
[
0
];
...
@@ -1218,11 +1224,11 @@ uint8_t do_RRCSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uint8_t Trans
...
@@ -1218,11 +1224,11 @@ uint8_t do_RRCSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uint8_t Trans
memset
(
&
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
dedicatedNAS_Message
,
0
,
sizeof
(
OCTET_STRING_t
));
memset
(
&
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
dedicatedNAS_Message
,
0
,
sizeof
(
OCTET_STRING_t
));
OCTET_STRING_fromBuf
(
&
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
dedicatedNAS_Message
,
dedicatedInfoNAS
,
dedicatedInfoNASLength
);
OCTET_STRING_fromBuf
(
&
RrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
dedicatedNAS_Message
,
dedicatedInfoNAS
,
dedicatedInfoNASLength
);
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
)
)
{
//
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint
(
stdout
,
&
asn_DEF_NR_
D
L_DCCH_Message
,
(
void
*
)
&
ul_dcch_msg
);
xer_fprint
(
stdout
,
&
asn_DEF_NR_
U
L_DCCH_Message
,
(
void
*
)
&
ul_dcch_msg
);
}
//
}
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_
D
L_DCCH_Message
,
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_
U
L_DCCH_Message
,
NULL
,
NULL
,
(
void
*
)
&
ul_dcch_msg
,
(
void
*
)
&
ul_dcch_msg
,
buffer
,
buffer
,
...
@@ -1230,7 +1236,7 @@ enc_rval = uper_encode_to_buffer(&asn_DEF_NR_DL_DCCH_Message,
...
@@ -1230,7 +1236,7 @@ enc_rval = uper_encode_to_buffer(&asn_DEF_NR_DL_DCCH_Message,
AssertFatal
(
enc_rval
.
encoded
>
0
,
"ASN1 message encoding failed (%s, %lu)!
\n
"
,
AssertFatal
(
enc_rval
.
encoded
>
0
,
"ASN1 message encoding failed (%s, %lu)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
LOG_D
(
RRC
,
"RRCConnection
SetupComplete Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
LOG_D
(
NR_RRC
,
"RRC
SetupComplete Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
}
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
5697057f
...
@@ -422,7 +422,7 @@ rrc_gNB_generate_RRCSetup(
...
@@ -422,7 +422,7 @@ rrc_gNB_generate_RRCSetup(
// ue_context_pP->ue_context.ue_rrc_inactivity_timer = 0;
// ue_context_pP->ue_context.ue_rrc_inactivity_timer = 0;
#ifdef ITTI_SIM
#ifdef ITTI_SIM
MessageDef
*
message_p
;
MessageDef
*
message_p
;
message_p
=
itti_alloc_new_message
(
TASK_RRC_
UE
_SIM
,
GNB_RRC_CCCH_DATA_IND
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_
GNB
_SIM
,
GNB_RRC_CCCH_DATA_IND
);
GNB_RRC_CCCH_DATA_IND
(
message_p
).
sdu
=
(
uint8_t
*
)
ue_p
->
Srb0
.
Tx_buffer
.
Payload
;
GNB_RRC_CCCH_DATA_IND
(
message_p
).
sdu
=
(
uint8_t
*
)
ue_p
->
Srb0
.
Tx_buffer
.
Payload
;
GNB_RRC_CCCH_DATA_IND
(
message_p
).
size
=
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
;
GNB_RRC_CCCH_DATA_IND
(
message_p
).
size
=
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
;
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
ctxt_pP
->
instance
,
message_p
);
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
ctxt_pP
->
instance
,
message_p
);
...
@@ -481,7 +481,11 @@ rrc_gNB_process_RRCSetupComplete(
...
@@ -481,7 +481,11 @@ rrc_gNB_process_RRCSetupComplete(
// T_INT(ctxt_pP->subframe),
// T_INT(ctxt_pP->subframe),
// T_INT(ctxt_pP->rnti));
// T_INT(ctxt_pP->rnti));
rrc_gNB_send_NGAP_NAS_FIRST_REQ
(
ctxt_pP
,
ue_context_pP
,
rrcSetupComplete
);
// if (AMF_MODE_ENABLED) {
// rrc_gNB_send_NGAP_NAS_FIRST_REQ(ctxt_pP, ue_context_pP, rrcSetupComplete);
// } else {
rrc_gNB_generate_SecurityModeCommand
(
ctxt_pP
,
ue_context_pP
);
// }
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
@@ -890,6 +894,7 @@ rrc_gNB_decode_dcch(
...
@@ -890,6 +894,7 @@ rrc_gNB_decode_dcch(
sdu_sizeP
,
sdu_sizeP
,
0
,
0
,
0
);
0
);
xer_fprint
(
stdout
,
&
asn_DEF_NR_UL_DCCH_Message
,
(
void
*
)
&
ul_dcch_msg
);
{
{
for
(
i
=
0
;
i
<
sdu_sizeP
;
i
++
)
{
for
(
i
=
0
;
i
<
sdu_sizeP
;
i
++
)
{
...
@@ -980,6 +985,8 @@ rrc_gNB_decode_dcch(
...
@@ -980,6 +985,8 @@ rrc_gNB_decode_dcch(
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcSetupComplete
->
criticalExtensions
.
present
==
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcSetupComplete
->
criticalExtensions
.
present
==
NR_RRCSetupComplete__criticalExtensions_PR_rrcSetupComplete
)
{
NR_RRCSetupComplete__criticalExtensions_PR_rrcSetupComplete
)
{
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
ng_5G_S_TMSI_Value
!=
NULL
)
{
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcSetupComplete
->
criticalExtensions
.
choice
.
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
ng_5G_S_TMSI_Value
->
present
==
NR_RRCSetupComplete_IEs__ng_5G_S_TMSI_Value_PR_ng_5G_S_TMSI_Part2
)
{
rrcSetupComplete
->
ng_5G_S_TMSI_Value
->
present
==
NR_RRCSetupComplete_IEs__ng_5G_S_TMSI_Value_PR_ng_5G_S_TMSI_Part2
)
{
// ng-5G-S-TMSI-Part2 BIT STRING (SIZE (9))
// ng-5G-S-TMSI-Part2 BIT STRING (SIZE (9))
...
@@ -1012,14 +1019,19 @@ rrc_gNB_decode_dcch(
...
@@ -1012,14 +1019,19 @@ rrc_gNB_decode_dcch(
return
-
1
;
return
-
1
;
}
}
uint64_t
fiveg_s_TMSI
=
BIT_STRING_to_uint16
(
&
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcSetupComplete
->
uint64_t
fiveg_s_TMSI
=
BIT_STRING_to_uint64
(
&
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcSetupComplete
->
criticalExtensions
.
choice
.
rrcSetupComplete
->
ng_5G_S_TMSI_Value
->
choice
.
ng_5G_S_TMSI
);
criticalExtensions
.
choice
.
rrcSetupComplete
->
ng_5G_S_TMSI_Value
->
choice
.
ng_5G_S_TMSI
);
LOG_I
(
NR_RRC
,
"Received rrcSetupComplete, 5g_s_TMSI: 0x%lX, amf_set_id: 0x%lX(%d), amf_pointer: 0x%lX(%d), 5g TMSI: 0x%lX
\n
"
,
fiveg_s_TMSI
,
fiveg_s_TMSI
>>
38
,
fiveg_s_TMSI
>>
38
,
(
fiveg_s_TMSI
>>
32
)
&
0x3F
,
(
fiveg_s_TMSI
>>
32
)
&
0x3F
,
(
uint32_t
)
fiveg_s_TMSI
);
if
(
ue_context_p
->
ue_context
.
Initialue_identity_5g_s_TMSI
.
presence
==
TRUE
)
{
if
(
ue_context_p
->
ue_context
.
Initialue_identity_5g_s_TMSI
.
presence
==
TRUE
)
{
ue_context_p
->
ue_context
.
Initialue_identity_5g_s_TMSI
.
amf_set_id
=
fiveg_s_TMSI
>>
38
;
ue_context_p
->
ue_context
.
Initialue_identity_5g_s_TMSI
.
amf_set_id
=
fiveg_s_TMSI
>>
38
;
ue_context_p
->
ue_context
.
Initialue_identity_5g_s_TMSI
.
amf_pointer
=
(
fiveg_s_TMSI
>>
32
)
&
0x3F
;
ue_context_p
->
ue_context
.
Initialue_identity_5g_s_TMSI
.
amf_pointer
=
(
fiveg_s_TMSI
>>
32
)
&
0x3F
;
ue_context_p
->
ue_context
.
Initialue_identity_5g_s_TMSI
.
fiveg_tmsi
=
(
uint32_t
)
fiveg_s_TMSI
;
ue_context_p
->
ue_context
.
Initialue_identity_5g_s_TMSI
.
fiveg_tmsi
=
(
uint32_t
)
fiveg_s_TMSI
;
}
}
}
}
}
rrc_gNB_process_RRCSetupComplete
(
rrc_gNB_process_RRCSetupComplete
(
ctxt_pP
,
ctxt_pP
,
...
...
openair2/RRC/NR_UE/rrc_UE.c
View file @
5697057f
This diff is collapsed.
Click to expand it.
openair2/RRC/NR_UE/rrc_proto.h
View file @
5697057f
...
@@ -118,6 +118,12 @@ int8_t mac_rrc_nr_data_req_ue(const module_id_t Mod_idP,
...
@@ -118,6 +118,12 @@ int8_t mac_rrc_nr_data_req_ue(const module_id_t Mod_idP,
/**\brief RRC UE task.
/**\brief RRC UE task.
\param void *args_p Pointer on arguments to start the task. */
\param void *args_p Pointer on arguments to start the task. */
void
*
rrc_nrue_task
(
void
*
args_p
);
void
*
rrc_nrue_task
(
void
*
args_p
);
/**\brief RRC UE generate RRCSetupRequest message.
\param ctxt_pP protocol context
\param gNB_index gNB index */
void
rrc_ue_generate_RRCSetupRequest
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
uint8_t
gNB_index
);
/** @}*/
/** @}*/
#endif
#endif
openair2/SIMULATION/NR_RRC/itti_sim.c
View file @
5697057f
...
@@ -59,6 +59,7 @@ unsigned short config_frames[4] = {2,9,11,13};
...
@@ -59,6 +59,7 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "x2ap_eNB.h"
#include "x2ap_eNB.h"
#include "ngap_gNB.h"
#include "ngap_gNB.h"
#include "RRC/NR_UE/rrc_proto.h"
#include "RRC/NR_UE/rrc_proto.h"
#include "RRC/NR_UE/rrc_vars.h"
#include "openair3/NAS/UE/nas_ue_task.h"
#include "openair3/NAS/UE/nas_ue_task.h"
pthread_cond_t
nfapi_sync_cond
;
pthread_cond_t
nfapi_sync_cond
;
...
@@ -380,7 +381,7 @@ int create_tasks_nrue(uint32_t ue_nb) {
...
@@ -380,7 +381,7 @@ int create_tasks_nrue(uint32_t ue_nb) {
if
(
ue_nb
>
0
)
{
if
(
ue_nb
>
0
)
{
printf
(
"create TASK_RRC_NRUE
\n
"
);
printf
(
"create TASK_RRC_NRUE
\n
"
);
if
(
itti_create_task
(
TASK_RRC_NRUE
,
rrc_nrue_task
,
NULL
)
<
0
)
{
if
(
itti_create_task
(
TASK_RRC_NRUE
,
rrc_nrue_task
,
NULL
)
<
0
)
{
LOG_E
(
RRC
,
"Create task for RRC UE failed
\n
"
);
LOG_E
(
NR_
RRC
,
"Create task for RRC UE failed
\n
"
);
return
-
1
;
return
-
1
;
}
}
}
}
...
@@ -406,12 +407,12 @@ void *itti_sim_ue_rrc_task( void *args_p) {
...
@@ -406,12 +407,12 @@ void *itti_sim_ue_rrc_task( void *args_p) {
switch
(
ITTI_MSG_ID
(
msg_p
))
{
switch
(
ITTI_MSG_ID
(
msg_p
))
{
case
TERMINATE_MESSAGE
:
case
TERMINATE_MESSAGE
:
LOG_W
(
RRC
,
" *** Exiting RRC thread
\n
"
);
LOG_W
(
NR_
RRC
,
" *** Exiting RRC thread
\n
"
);
itti_exit_task
();
itti_exit_task
();
break
;
break
;
case
MESSAGE_TEST
:
case
MESSAGE_TEST
:
LOG_D
(
RRC
,
"[UE %d] Received %s
\n
"
,
ue_mod_id
,
ITTI_MSG_NAME
(
msg_p
));
LOG_D
(
NR_
RRC
,
"[UE %d] Received %s
\n
"
,
ue_mod_id
,
ITTI_MSG_NAME
(
msg_p
));
break
;
break
;
case
GNB_RRC_BCCH_DATA_IND
:
case
GNB_RRC_BCCH_DATA_IND
:
message_p
=
itti_alloc_new_message
(
TASK_RRC_NRUE
,
NR_RRC_MAC_BCCH_DATA_IND
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_NRUE
,
NR_RRC_MAC_BCCH_DATA_IND
);
...
@@ -433,12 +434,11 @@ void *itti_sim_ue_rrc_task( void *args_p) {
...
@@ -433,12 +434,11 @@ void *itti_sim_ue_rrc_task( void *args_p) {
message_p
=
itti_alloc_new_message
(
TASK_RRC_NRUE
,
NR_RRC_DCCH_DATA_IND
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_NRUE
,
NR_RRC_DCCH_DATA_IND
);
NR_RRC_DCCH_DATA_IND
(
message_p
).
dcch_index
=
GNB_RRC_DCCH_DATA_IND
(
msg_p
).
rbid
;
NR_RRC_DCCH_DATA_IND
(
message_p
).
dcch_index
=
GNB_RRC_DCCH_DATA_IND
(
msg_p
).
rbid
;
NR_RRC_DCCH_DATA_IND
(
message_p
).
sdu_size
=
GNB_RRC_DCCH_DATA_IND
(
msg_p
).
size
;
NR_RRC_DCCH_DATA_IND
(
message_p
).
sdu_size
=
GNB_RRC_DCCH_DATA_IND
(
msg_p
).
size
;
memset
(
NR_RRC_DCCH_DATA_IND
(
message_p
).
sdu_p
,
0
,
GNB_RRC_DCCH_DATA_IND
(
msg_p
).
size
);
NR_RRC_DCCH_DATA_IND
(
message_p
).
sdu_p
=
GNB_RRC_DCCH_DATA_IND
(
msg_p
).
sdu
;
memcpy
(
NR_RRC_DCCH_DATA_IND
(
message_p
).
sdu_p
,
GNB_RRC_DCCH_DATA_IND
(
msg_p
).
sdu
,
GNB_RRC_DCCH_DATA_IND
(
msg_p
).
size
);
itti_send_msg_to_task
(
TASK_RRC_NRUE
,
instance
,
message_p
);
itti_send_msg_to_task
(
TASK_RRC_NRUE
,
instance
,
message_p
);
break
;
break
;
default:
default:
LOG_E
(
RRC
,
"[UE %d] Received unexpected message %s
\n
"
,
ue_mod_id
,
ITTI_MSG_NAME
(
msg_p
));
LOG_E
(
NR_
RRC
,
"[UE %d] Received unexpected message %s
\n
"
,
ue_mod_id
,
ITTI_MSG_NAME
(
msg_p
));
break
;
break
;
}
}
...
@@ -464,30 +464,30 @@ void *itti_sim_gnb_rrc_task( void *args_p) {
...
@@ -464,30 +464,30 @@ void *itti_sim_gnb_rrc_task( void *args_p) {
switch
(
ITTI_MSG_ID
(
msg_p
))
{
switch
(
ITTI_MSG_ID
(
msg_p
))
{
case
TERMINATE_MESSAGE
:
case
TERMINATE_MESSAGE
:
LOG_W
(
RRC
,
" *** Exiting RRC thread
\n
"
);
LOG_W
(
NR_
RRC
,
" *** Exiting RRC thread
\n
"
);
itti_exit_task
();
itti_exit_task
();
break
;
break
;
case
MESSAGE_TEST
:
case
MESSAGE_TEST
:
LOG_D
(
RRC
,
"[UE %d] Received %s
\n
"
,
ue_mod_id
,
ITTI_MSG_NAME
(
msg_p
));
LOG_D
(
NR_
RRC
,
"[UE %d] Received %s
\n
"
,
ue_mod_id
,
ITTI_MSG_NAME
(
msg_p
));
break
;
break
;
case
UE_RRC_CCCH_DATA_IND
:
case
UE_RRC_CCCH_DATA_IND
:
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
NR_RRC_MAC_CCCH_DATA_IND
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
NR_RRC_MAC_CCCH_DATA_IND
);
RRC_MAC_CCCH_DATA_IND
(
message_p
).
sdu_size
=
UE_RRC_CCCH_DATA_IND
(
msg_p
).
size
;
NR_
RRC_MAC_CCCH_DATA_IND
(
message_p
).
sdu_size
=
UE_RRC_CCCH_DATA_IND
(
msg_p
).
size
;
memset
(
RRC_MAC_CCCH_DATA_IND
(
message_p
).
sdu
,
0
,
CCCH_SDU_SIZE
);
memset
(
NR_
RRC_MAC_CCCH_DATA_IND
(
message_p
).
sdu
,
0
,
CCCH_SDU_SIZE
);
memcpy
(
RRC_MAC_CCCH_DATA_IND
(
message_p
).
sdu
,
UE_RRC_CCCH_DATA_IND
(
msg_p
).
sdu
,
UE_RRC_CCCH_DATA_IND
(
msg_p
).
size
);
memcpy
(
NR_
RRC_MAC_CCCH_DATA_IND
(
message_p
).
sdu
,
UE_RRC_CCCH_DATA_IND
(
msg_p
).
sdu
,
UE_RRC_CCCH_DATA_IND
(
msg_p
).
size
);
itti_send_msg_to_task
(
TASK_RRC_GNB
,
instance
,
message_p
);
itti_send_msg_to_task
(
TASK_RRC_GNB
,
instance
,
message_p
);
break
;
break
;
case
UE_RRC_DCCH_DATA_IND
:
case
UE_RRC_DCCH_DATA_IND
:
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
NR_RRC_DCCH_DATA_IND
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
NR_RRC_DCCH_DATA_IND
);
RRC_DCCH_DATA_IND
(
message_p
).
sdu_size
=
UE_RRC_DCCH_DATA_IND
(
msg_p
).
size
;
NR_
RRC_DCCH_DATA_IND
(
message_p
).
sdu_size
=
UE_RRC_DCCH_DATA_IND
(
msg_p
).
size
;
memset
(
RRC_MAC_CCCH_DATA_IND
(
message_p
).
sdu
,
0
,
UE_RRC_DCCH_DATA_IND
(
msg_p
).
size
)
;
NR_RRC_DCCH_DATA_IND
(
message_p
).
dcch_index
=
UE_RRC_DCCH_DATA_IND
(
msg_p
).
rbid
;
memcpy
(
RRC_MAC_CCCH_DATA_IND
(
message_p
).
sdu
,
UE_RRC_DCCH_DATA_IND
(
msg_p
).
sdu
,
UE_RRC_DCCH_DATA_IND
(
msg_p
).
size
)
;
NR_RRC_DCCH_DATA_IND
(
message_p
).
sdu_p
=
UE_RRC_DCCH_DATA_IND
(
msg_p
).
sdu
;
itti_send_msg_to_task
(
TASK_RRC_GNB
,
instance
,
message_p
);
itti_send_msg_to_task
(
TASK_RRC_GNB
,
instance
,
message_p
);
break
;
break
;
default:
default:
LOG_E
(
RRC
,
"[UE %d] Received unexpected message %s
\n
"
,
ue_mod_id
,
ITTI_MSG_NAME
(
msg_p
));
LOG_E
(
NR_
RRC
,
"[UE %d] Received unexpected message %s
\n
"
,
ue_mod_id
,
ITTI_MSG_NAME
(
msg_p
));
break
;
break
;
}
}
...
@@ -584,7 +584,25 @@ int main( int argc, char **argv )
...
@@ -584,7 +584,25 @@ int main( int argc, char **argv )
// wait for end of program
// wait for end of program
printf
(
"TYPE <CTRL-C> TO TERMINATE
\n
"
);
printf
(
"TYPE <CTRL-C> TO TERMINATE
\n
"
);
usleep
(
10000
);
protocol_ctxt_t
ctxt
;
struct
rrc_gNB_ue_context_s
*
ue_context_p
=
NULL
;
ue_context_p
=
rrc_gNB_allocate_new_UE_context
(
RC
.
nrrrc
[
0
]);
if
(
ue_context_p
==
NULL
){
printf
(
"ue_context_p == NULL"
);
}
PROTOCOL_CTXT_SET_BY_INSTANCE
(
&
ctxt
,
0
,
ENB_FLAG_YES
,
0
,
0
,
0
);
NR_UE_rrc_inst
[
ctxt
.
module_id
].
Info
[
0
].
State
=
RRC_SI_RECEIVED
;
rrc_ue_generate_RRCSetupRequest
(
&
ctxt
,
0
);
#if 0
#if 0
// test itti sim
// test itti sim
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment