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
lizhongxiao
OpenXG-RAN
Commits
1bcf8d5e
Commit
1bcf8d5e
authored
Sep 13, 2022
by
Sakthivel Velumani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GTP rnti to ue_id after rebase
parent
23075ff8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
28 deletions
+28
-28
openair3/ocp-gtpu/gtp_itf.cpp
openair3/ocp-gtpu/gtp_itf.cpp
+28
-28
No files found.
openair3/ocp-gtpu/gtp_itf.cpp
View file @
1bcf8d5e
...
...
@@ -184,20 +184,20 @@ instance_t legacyInstanceMapping=0;
gtpEndPoint * inst=&instChk->second;
#define get
RntiRetVoid(insT, RnTi
) \
auto ptr
Rnti=insT->ue2te_mapping.find(RnTi
); \
#define get
UeRetVoid(insT, Ue
) \
auto ptr
Ue=insT->ue2te_mapping.find(Ue
); \
\
if ( ptr
Rnti
==insT->ue2te_mapping.end() ) { \
LOG_E(GTPU, "[%ld] gtpv1uSend failed: while getting ue id %
x in hashtable ue_mapping\n", instance, rnti
); \
if ( ptr
Ue
==insT->ue2te_mapping.end() ) { \
LOG_E(GTPU, "[%ld] gtpv1uSend failed: while getting ue id %
ld in hashtable ue_mapping\n", instance, ue_id
); \
pthread_mutex_unlock(&globGtp.gtp_lock); \
return; \
}
#define get
RntiRetInt(insT, RnTi
) \
auto ptr
Rnti=insT->ue2te_mapping.find(RnTi
); \
#define get
UeRetInt(insT, Ue
) \
auto ptr
Ue=insT->ue2te_mapping.find(Ue
); \
\
if ( ptr
Rnti
==insT->ue2te_mapping.end() ) { \
LOG_E(GTPU, "[%ld] gtpv1uSend failed: while getting ue id %
x in hashtable ue_mapping\n", instance, rnti
); \
if ( ptr
Ue
==insT->ue2te_mapping.end() ) { \
LOG_E(GTPU, "[%ld] gtpv1uSend failed: while getting ue id %
ld in hashtable ue_mapping\n", instance, ue_id
); \
pthread_mutex_unlock(&globGtp.gtp_lock); \
return GTPNOK; \
}
...
...
@@ -284,22 +284,22 @@ static int gtpv1uCreateAndSendMsg(int h,
static
void
gtpv1uSend
(
instance_t
instance
,
gtpv1u_tunnel_data_req_t
*
req
,
bool
seqNumFlag
,
bool
npduNumFlag
)
{
uint8_t
*
buffer
=
req
->
buffer
+
req
->
offset
;
size_t
length
=
req
->
length
;
ue_id_t
ueid
=
req
->
ue_id
;
ue_id_t
ue
_
id
=
req
->
ue_id
;
int
bearer_id
=
req
->
bearer_id
;
pthread_mutex_lock
(
&
globGtp
.
gtp_lock
);
getInstRetVoid
(
compatInst
(
instance
));
get
Rnti
RetVoid
(
inst
,
ue_id
);
get
Ue
RetVoid
(
inst
,
ue_id
);
auto
ptr2
=
ptrUe
->
second
.
bearers
.
find
(
bearer_id
);
if
(
ptr2
==
ptrUe
->
second
.
bearers
.
end
()
)
{
LOG_E
(
GTPU
,
"[%ld] GTP-U instance: sending a packet to a non existant UE:RAB: %lx/%x
\n
"
,
instance
,
ueid
,
bearer_id
);
LOG_E
(
GTPU
,
"[%ld] GTP-U instance: sending a packet to a non existant UE:RAB: %lx/%x
\n
"
,
instance
,
ue
_
id
,
bearer_id
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
return
;
}
LOG_D
(
GTPU
,
"[%ld] sending a packet to UE:RAB:teid %lx/%x/%x, len %lu, oldseq %d, oldnum %d
\n
"
,
instance
,
ueid
,
bearer_id
,
ptr2
->
second
.
teid_outgoing
,
length
,
ptr2
->
second
.
seqNum
,
ptr2
->
second
.
npduNum
);
instance
,
ue
_
id
,
bearer_id
,
ptr2
->
second
.
teid_outgoing
,
length
,
ptr2
->
second
.
seqNum
,
ptr2
->
second
.
npduNum
);
if
(
seqNumFlag
)
ptr2
->
second
.
seqNum
++
;
...
...
@@ -375,7 +375,7 @@ static void gtpv1uSendDlDeliveryStatus(instance_t instance, gtpv1u_DU_buffer_rep
int
bearer_id
=
req
->
pdusession_id
;
pthread_mutex_lock
(
&
globGtp
.
gtp_lock
);
getInstRetVoid
(
compatInst
(
instance
));
get
Rnti
RetVoid
(
inst
,
ue_id
);
get
Ue
RetVoid
(
inst
,
ue_id
);
auto
ptr2
=
ptrUe
->
second
.
bearers
.
find
(
bearer_id
);
...
...
@@ -399,22 +399,22 @@ static void gtpv1uSendDlDeliveryStatus(instance_t instance, gtpv1u_DU_buffer_rep
}
static
void
gtpv1uEndTunnel
(
instance_t
instance
,
gtpv1u_tunnel_data_req_t
*
req
)
{
ue_id_t
ueid
=
req
->
ue_id
;
ue_id_t
ue
_
id
=
req
->
ue_id
;
int
bearer_id
=
req
->
bearer_id
;
pthread_mutex_lock
(
&
globGtp
.
gtp_lock
);
getInstRetVoid
(
compatInst
(
instance
));
get
Rnti
RetVoid
(
inst
,
ue_id
);
get
Ue
RetVoid
(
inst
,
ue_id
);
auto
ptr2
=
ptrUe
->
second
.
bearers
.
find
(
bearer_id
);
if
(
ptr2
==
ptrUe
->
second
.
bearers
.
end
()
)
{
LOG_E
(
GTPU
,
"[%ld] GTP-U sending a packet to a non existant UE:RAB: %lx/%x
\n
"
,
instance
,
ueid
,
bearer_id
);
LOG_E
(
GTPU
,
"[%ld] GTP-U sending a packet to a non existant UE:RAB: %lx/%x
\n
"
,
instance
,
ue
_
id
,
bearer_id
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
return
;
}
LOG_D
(
GTPU
,
"[%ld] sending a end packet packet to UE:RAB:teid %lx/%x/%x
\n
"
,
instance
,
ueid
,
bearer_id
,
ptr2
->
second
.
teid_outgoing
);
instance
,
ue
_
id
,
bearer_id
,
ptr2
->
second
.
teid_outgoing
);
gtpv1u_bearer_t
tmp
=
ptr2
->
second
;
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
Gtpv1uMsgHeaderT
msgHdr
;
...
...
@@ -553,7 +553,7 @@ void GtpuUpdateTunnelOutgoingPair(instance_t instance,
transport_layer_addr_t
newRemoteAddr
)
{
pthread_mutex_lock
(
&
globGtp
.
gtp_lock
);
getInstRetVoid
(
compatInst
(
instance
));
get
Rnti
RetVoid
(
inst
,
ue_id
);
get
Ue
RetVoid
(
inst
,
ue_id
);
auto
ptr2
=
ptrUe
->
second
.
bearers
.
find
(
bearer_id
);
...
...
@@ -814,18 +814,18 @@ int newGtpuDeleteAllTunnels(instance_t instance, ue_id_t ue_id) {
instance
,
ue_id
);
pthread_mutex_lock
(
&
globGtp
.
gtp_lock
);
getInstRetInt
(
compatInst
(
instance
));
get
Rnti
RetInt
(
inst
,
ue_id
);
get
Ue
RetInt
(
inst
,
ue_id
);
int
nb
=
0
;
for
(
auto
j
=
ptr
Rnti
->
second
.
bearers
.
begin
();
j
!=
ptr
Rnti
->
second
.
bearers
.
end
();
for
(
auto
j
=
ptr
Ue
->
second
.
bearers
.
begin
();
j
!=
ptr
Ue
->
second
.
bearers
.
end
();
++
j
)
{
inst
->
te2ue_mapping
.
erase
(
j
->
second
.
teid_incoming
);
nb
++
;
}
inst
->
ue2te_mapping
.
erase
(
ptr
Rnti
);
inst
->
ue2te_mapping
.
erase
(
ptr
Ue
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
LOG_I
(
GTPU
,
"[%ld] Deleted all tunnels for ue id %ld (%d tunnels deleted)
\n
"
,
instance
,
ue_id
,
nb
);
return
!
GTPNOK
;
...
...
@@ -843,23 +843,23 @@ int newGtpuDeleteTunnels(instance_t instance, ue_id_t ue_id, int nbTunnels, pdus
instance
,
ue_id
);
pthread_mutex_lock
(
&
globGtp
.
gtp_lock
);
getInstRetInt
(
compatInst
(
instance
));
get
Rnti
RetInt
(
inst
,
ue_id
);
get
Ue
RetInt
(
inst
,
ue_id
);
int
nb
=
0
;
for
(
int
i
=
0
;
i
<
nbTunnels
;
i
++
)
{
auto
ptr2
=
ptr
Rnti
->
second
.
bearers
.
find
(
pdusession_id
[
i
]);
auto
ptr2
=
ptr
Ue
->
second
.
bearers
.
find
(
pdusession_id
[
i
]);
if
(
ptr2
==
ptr
Rnti
->
second
.
bearers
.
end
()
)
{
LOG_E
(
GTPU
,
"[%ld] GTP-U instance: delete of not existing tunnel UE ID:RAB: %
x/%x
\n
"
,
instance
,
ud
_id
,
pdusession_id
[
i
]);
if
(
ptr2
==
ptr
Ue
->
second
.
bearers
.
end
()
)
{
LOG_E
(
GTPU
,
"[%ld] GTP-U instance: delete of not existing tunnel UE ID:RAB: %
ld/%x
\n
"
,
instance
,
ue
_id
,
pdusession_id
[
i
]);
}
else
{
inst
->
te2ue_mapping
.
erase
(
ptr2
->
second
.
teid_incoming
);
nb
++
;
}
}
if
(
ptr
Rnti
->
second
.
bearers
.
size
()
==
0
)
if
(
ptr
Ue
->
second
.
bearers
.
size
()
==
0
)
// no tunnels on this ue id, erase the ue entry
inst
->
ue2te_mapping
.
erase
(
ptr
Rnti
);
inst
->
ue2te_mapping
.
erase
(
ptr
Ue
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
LOG_I
(
GTPU
,
"[%ld] Deleted all tunnels for ue id %lu (%d tunnels deleted)
\n
"
,
instance
,
ue_id
,
nb
);
...
...
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