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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG-RAN
Commits
2a1e7b73
Commit
2a1e7b73
authored
Sep 30, 2021
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix gcc warnings, hardcode gtpu debug level for ci debug
parent
c739058c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
71 deletions
+49
-71
openair2/F1AP/f1ap_cu_rrc_message_transfer.c
openair2/F1AP/f1ap_cu_rrc_message_transfer.c
+0
-1
openair2/F1AP/f1ap_du_task.c
openair2/F1AP/f1ap_du_task.c
+1
-12
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+3
-18
openair3/ocp-gtpu/gtp_itf.cpp
openair3/ocp-gtpu/gtp_itf.cpp
+45
-40
No files found.
openair2/F1AP/f1ap_cu_rrc_message_transfer.c
View file @
2a1e7b73
...
...
@@ -68,7 +68,6 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_InitialULRRCMessageTransferIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID
,
true
);
instance_t
du_ue_f1ap_id
=
ie
->
value
.
choice
.
GNB_DU_UE_F1AP_ID
;
/* NRCGI
* Fixme: process NRCGI
*/
...
...
openair2/F1AP/f1ap_du_task.c
View file @
2a1e7b73
...
...
@@ -90,18 +90,7 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
tmp
=
&
RC
.
nrmac
[
instance
]
->
eth_params_n
;
else
tmp
=
&
RC
.
mac
[
instance
]
->
eth_params_n
;
const
cudu_params_t
params
=
{
.
local_ipv4_address
=
tmp
->
my_addr
,
.
local_port
=
tmp
->
my_portd
,
.
remote_ipv4_address
=
tmp
->
remote_addr
,
.
remote_port
=
tmp
->
remote_portd
};
/*
if (!RC.nrrrc)
AssertFatal(proto_agent_start(instance, ¶ms) == 0,
"could not start PROTO_AGENT for F1U on instance %ld!\n", instance);
*/
DU_send_F1_SETUP_REQUEST
(
instance
);
}
...
...
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
2a1e7b73
...
...
@@ -153,15 +153,6 @@ typedef struct xer_sprint_string_s {
size_t
string_index
;
}
xer_sprint_string_t
;
#define asn1cCallocOne(VaR, VaLue) \
VaR = calloc(1,sizeof(*VaR)); *VaR=VaLue;
#define asn1cCalloc(VaR, lOcPtr) \
typeof(VaR) lOcPtr = VaR = calloc(1,sizeof(*VaR));
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) \
TyPe *lOcPtr= calloc(1,sizeof(TyPe)); \
ASN_SEQUENCE_ADD(&VaR,lOcPtr);
//replace LTE
//extern unsigned char NB_eNB_INST;
extern
unsigned
char
NB_gNB_INST
;
...
...
@@ -310,9 +301,6 @@ uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) {
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
#define asn1cCalloc(VaR, TyPe, lOcPtr) TyPe *lOcPtr=VaR=(TyPe*) calloc(1,sizeof(TyPe));
#define asn1cCallocOne(VaR, VaLue) VaR=calloc(1,sizeof(*VaR)); *VaR=VaLue;
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) TyPe *lOcPtr=(TyPe*) calloc(1,sizeof(TyPe)); ASN_SEQUENCE_ADD(&VaR,lOcPtr);
uint8_t
do_SIB1_NR
(
rrc_gNB_carrier_data_t
*
carrier
,
gNB_RrcConfigurationReq
*
configuration
...
...
@@ -342,7 +330,7 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
asn1cSequenceAdd
(
sib1
->
cellAccessRelatedInfo
.
plmn_IdentityList
.
list
,
struct
NR_PLMN_IdentityInfo
,
nr_plmn_info
);
for
(
int
i
=
0
;
i
<
num_plmn
;
++
i
)
{
asn1cSequenceAdd
(
nr_plmn_info
->
plmn_IdentityList
.
list
,
struct
NR_PLMN_Identity
,
nr_plmn
);
asn1cCalloc
(
nr_plmn
->
mcc
,
struct
NR_MCC
,
mcc
);
asn1cCalloc
(
nr_plmn
->
mcc
,
mcc
);
int
confMcc
=
configuration
->
mcc
[
i
];
asn1cSequenceAdd
(
mcc
->
list
,
NR_MCC_MNC_Digit_t
,
mcc0
);
*
mcc0
=
(
confMcc
/
100
)
%
10
;
...
...
@@ -411,8 +399,7 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
ASN_SEQUENCE_ADD(&sib1->si_SchedulingInfo->schedulingInfoList.list,schedulingInfo);*/
// servingCellConfigCommon
asn1cCalloc
(
sib1
->
servingCellConfigCommon
,
struct
NR_ServingCellConfigCommonSIB
,
ServCellCom
);
asn1cCalloc
(
sib1
->
servingCellConfigCommon
,
ServCellCom
);
NR_BWP_DownlinkCommon_t
*
initialDownlinkBWP
=&
ServCellCom
->
downlinkConfigCommon
.
initialDownlinkBWP
;
initialDownlinkBWP
->
genericParameters
=
configuration
->
scc
->
downlinkConfigCommon
->
initialDownlinkBWP
->
genericParameters
;
...
...
@@ -547,19 +534,17 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
ServCellCom
->
downlinkConfigCommon
.
pcch_Config
.
ns
=
NR_PCCH_Config__ns_one
;
asn1cCalloc
(
ServCellCom
->
downlinkConfigCommon
.
pcch_Config
.
firstPDCCH_MonitoringOccasionOfPO
,
struct
NR_PCCH_Config__firstPDCCH_MonitoringOccasionOfPO
,
P0
);
P0
->
present
=
NR_PCCH_Config__firstPDCCH_MonitoringOccasionOfPO_PR_sCS120KHZoneT_SCS60KHZhalfT_SCS30KHZquarterT_SCS15KHZoneEighthT
;
asn1cCalloc
(
P0
->
choice
.
sCS120KHZoneT_SCS60KHZhalfT_SCS30KHZquarterT_SCS15KHZoneEighthT
,
struct
NR_PCCH_Config__firstPDCCH_MonitoringOccasionOfPO__sCS120KHZoneT_SCS60KHZhalfT_SCS30KHZquarterT_SCS15KHZoneEighthT
,
Z8
);
asn1cSequenceAdd
(
Z8
->
list
,
long
,
ZoneEight
);
asn1cCallocOne
(
ZoneEight
,
0
);
asn1cCalloc
(
ServCellCom
->
uplinkConfigCommon
,
struct
NR_UplinkConfigCommonSIB
,
UL
)
asn1cCalloc
(
ServCellCom
->
uplinkConfigCommon
,
UL
)
asn_set_empty
(
&
UL
->
frequencyInfoUL
.
scs_SpecificCarrierList
.
list
);
for
(
int
i
=
0
;
i
<
configuration
->
scc
->
uplinkConfigCommon
->
frequencyInfoUL
->
scs_SpecificCarrierList
.
list
.
count
;
i
++
)
{
ASN_SEQUENCE_ADD
(
&
UL
->
frequencyInfoUL
.
scs_SpecificCarrierList
.
list
,
...
...
openair3/ocp-gtpu/gtp_itf.cpp
View file @
2a1e7b73
...
...
@@ -163,7 +163,7 @@ static void gtpv1uSend(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req, b
auto
ptrRnti
=
inst
->
ue2te_mapping
.
find
(
rnti
);
if
(
ptrRnti
==
inst
->
ue2te_mapping
.
end
()
)
{
LOG_E
(
GTPU
,
"
gtpv1uSend failed: while getting ue rnti %x in hashtable ue_mapping
\n
"
,
rnti
);
LOG_E
(
GTPU
,
"
[%ld] gtpv1uSend failed: while getting ue rnti %x in hashtable ue_mapping
\n
"
,
instance
,
rnti
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
return
;
}
...
...
@@ -171,13 +171,13 @@ static void gtpv1uSend(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req, b
map
<
int
,
ocp_gtpv1u_bearer_t
>::
iterator
ptr2
=
ptrRnti
->
second
.
bearers
.
find
(
rab_id
);
if
(
ptr2
==
ptrRnti
->
second
.
bearers
.
end
()
)
{
LOG_E
(
GTPU
,
"
GTP-U instance: %ld
sending a packet to a non existant RNTI:RAB: %x/%x
\n
"
,
instance
,
rnti
,
rab_id
);
LOG_E
(
GTPU
,
"
[%ld] GTP-U instance:
sending a packet to a non existant RNTI:RAB: %x/%x
\n
"
,
instance
,
rnti
,
rab_id
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
return
;
}
LOG_D
(
GTPU
,
"sending a packet to RNTI:RAB:teid %x/%x/%x, len %lu, oldseq %d, oldnum %d
\n
"
,
rnti
,
rab_id
,
ptr2
->
second
.
teid_outgoing
,
length
,
ptr2
->
second
.
seqNum
,
ptr2
->
second
.
npduNum
);
LOG_D
(
GTPU
,
"
[%ld]
sending a packet to RNTI:RAB:teid %x/%x/%x, len %lu, oldseq %d, oldnum %d
\n
"
,
instance
,
rnti
,
rab_id
,
ptr2
->
second
.
teid_outgoing
,
length
,
ptr2
->
second
.
seqNum
,
ptr2
->
second
.
npduNum
);
if
(
seqNumFlag
)
ptr2
->
second
.
seqNum
++
;
...
...
@@ -205,7 +205,7 @@ static void gtpv1uSend2(instance_t instance, gtpv1u_gnb_tunnel_data_req_t *req,
auto
ptrRnti
=
inst
->
ue2te_mapping
.
find
(
rnti
);
if
(
ptrRnti
==
inst
->
ue2te_mapping
.
end
()
)
{
LOG_E
(
GTPU
,
"
GTP-U instance: %ld
gtpv1uSend failed: while getting ue rnti %x in hashtable ue_mapping
\n
"
,
instance
,
rnti
);
LOG_E
(
GTPU
,
"
[%ld] GTP-U
gtpv1uSend failed: while getting ue rnti %x in hashtable ue_mapping
\n
"
,
instance
,
rnti
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
return
;
}
...
...
@@ -218,7 +218,7 @@ static void gtpv1uSend2(instance_t instance, gtpv1u_gnb_tunnel_data_req_t *req,
return
;
}
LOG_D
(
GTPU
,
"
GTP-U instance: %ld
sending a packet to RNTI:RAB:teid %x/%x/%x, len %lu, oldseq %d, oldnum %d
\n
"
,
LOG_D
(
GTPU
,
"
[%ld] GTP-U
sending a packet to RNTI:RAB:teid %x/%x/%x, len %lu, oldseq %d, oldnum %d
\n
"
,
instance
,
rnti
,
rab_id
,
ptr2
->
second
.
teid_outgoing
,
length
,
ptr2
->
second
.
seqNum
,
ptr2
->
second
.
npduNum
);
if
(
seqNumFlag
)
...
...
@@ -245,7 +245,7 @@ static void gtpv1uEndTunnel(instance_t instance, gtpv1u_enb_tunnel_data_req_t *r
auto
ptrRnti
=
inst
->
ue2te_mapping
.
find
(
rnti
);
if
(
ptrRnti
==
inst
->
ue2te_mapping
.
end
()
)
{
LOG_E
(
GTPU
,
"
gtpv1uSend failed: while getting ue rnti %x in hashtable ue_mapping
\n
"
,
rnti
);
LOG_E
(
GTPU
,
"
[%ld] gtpv1uSend failed: while getting ue rnti %x in hashtable ue_mapping
\n
"
,
instance
,
rnti
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
return
;
}
...
...
@@ -253,13 +253,13 @@ static void gtpv1uEndTunnel(instance_t instance, gtpv1u_enb_tunnel_data_req_t *r
map
<
int
,
ocp_gtpv1u_bearer_t
>::
iterator
ptr2
=
ptrRnti
->
second
.
bearers
.
find
(
rab_id
);
if
(
ptr2
==
ptrRnti
->
second
.
bearers
.
end
()
)
{
LOG_E
(
GTPU
,
"
GTP-U instance: %ld
sending a packet to a non existant RNTI:RAB: %x/%x
\n
"
,
instance
,
rnti
,
rab_id
);
LOG_E
(
GTPU
,
"
[%ld] GTP-U
sending a packet to a non existant RNTI:RAB: %x/%x
\n
"
,
instance
,
rnti
,
rab_id
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
return
;
}
LOG_D
(
GTPU
,
"sending a end packet packet to RNTI:RAB:teid %x/%x/%x
\n
"
,
rnti
,
rab_id
,
ptr2
->
second
.
teid_outgoing
);
LOG_D
(
GTPU
,
"
[%ld]
sending a end packet packet to RNTI:RAB:teid %x/%x/%x
\n
"
,
instance
,
rnti
,
rab_id
,
ptr2
->
second
.
teid_outgoing
);
ocp_gtpv1u_bearer_t
tmp
=
ptr2
->
second
;
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
Gtpv1uMsgHeaderT
msgHdr
;
...
...
@@ -281,11 +281,11 @@ static void gtpv1uEndTunnel(instance_t instance, gtpv1u_enb_tunnel_data_req_t *r
to
.
sin_addr
.
s_addr
=
tmp
.
outgoing_ip_addr
;
char
ip4
[
INET_ADDRSTRLEN
];
//char ip6[INET6_ADDRSTRLEN];
LOG_D
(
GTPU
,
"
sending end packet to %s
\n
"
,
inet_ntoa
(
to
.
sin_addr
)
);
LOG_D
(
GTPU
,
"
[%ld] sending end packet to %s
\n
"
,
instance
,
inet_ntoa
(
to
.
sin_addr
)
);
if
(
sendto
(
compatInst
(
instance
),
(
void
*
)
&
msgHdr
,
sizeof
(
msgHdr
),
0
,(
struct
sockaddr
*
)
&
to
,
sizeof
(
to
)
)
!=
sizeof
(
msgHdr
))
{
LOG_E
(
GTPU
,
"[
SD
%ld] Failed to send data to %s on port %d, buffer size %lu
\n
"
,
"[%ld] Failed to send data to %s on port %d, buffer size %lu
\n
"
,
compatInst
(
instance
),
inet_ntop
(
AF_INET
,
&
tmp
.
outgoing_ip_addr
,
ip4
,
INET_ADDRSTRLEN
),
tmp
.
outgoing_port
,
sizeof
(
msgHdr
));
}
}
...
...
@@ -373,7 +373,7 @@ static int udpServerSocket(openAddr_s addr) {
int
sendbuff
=
1000
*
1000
*
10
;
AssertFatal
(
0
==
setsockopt
(
sockfd
,
SOL_SOCKET
,
SO_SNDBUF
,
&
sendbuff
,
sizeof
(
sendbuff
)),
""
);
LOG_D
(
GTPU
,
"
Created listener for paquets to: %s:%s, send buffer size: %d
\n
"
,
addr
.
originHost
,
addr
.
originService
,
sendbuff
);
LOG_D
(
GTPU
,
"
[%d] Created listener for paquets to: %s:%s, send buffer size: %d
\n
"
,
sockfd
,
addr
.
originHost
,
addr
.
originService
,
sendbuff
);
return
sockfd
;
}
...
...
@@ -397,7 +397,7 @@ void GtpuUpdateTunnelOutgoingTeid(instance_t instance, rnti_t rnti, ebi_t bearer
auto
ptrRnti
=
inst
->
ue2te_mapping
.
find
(
rnti
);
if
(
ptrRnti
==
inst
->
ue2te_mapping
.
end
()
)
{
LOG_E
(
GTPU
,
"
Update tunnel for a not existing rnti %x
\n
"
,
rnti
);
LOG_E
(
GTPU
,
"
[%ld] Update tunnel for a not existing rnti %x
\n
"
,
instance
,
rnti
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
return
;
}
...
...
@@ -405,13 +405,13 @@ void GtpuUpdateTunnelOutgoingTeid(instance_t instance, rnti_t rnti, ebi_t bearer
map
<
int
,
ocp_gtpv1u_bearer_t
>::
iterator
ptr2
=
ptrRnti
->
second
.
bearers
.
find
(
bearer_id
);
if
(
ptr2
==
ptrRnti
->
second
.
bearers
.
end
()
)
{
LOG_E
(
GTPU
,
"
Update tunnel for a existing rnti %x, but wrong bearer_id %u
\n
"
,
rnti
,
bearer_id
);
LOG_E
(
GTPU
,
"
[%ld] Update tunnel for a existing rnti %x, but wrong bearer_id %u
\n
"
,
instance
,
rnti
,
bearer_id
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
return
;
}
ptr2
->
second
.
teid_outgoing
=
newOutgoingTeid
;
LOG_I
(
GTPU
,
"
Tunnel Outgoing TEID updated to %d
\n
"
,
ptr2
->
second
.
teid_outgoing
);
LOG_I
(
GTPU
,
"
[%ld] Tunnel Outgoing TEID updated to %d
\n
"
,
instance
,
ptr2
->
second
.
teid_outgoing
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
return
;
}
...
...
@@ -424,14 +424,14 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer
auto
it
=
inst
->
ue2te_mapping
.
find
(
rnti
);
if
(
it
!=
inst
->
ue2te_mapping
.
end
()
)
{
LOG_W
(
GTPU
,
"
Create a config for a already existing GTP tunnel (rnti %x)
\n
"
,
rnti
);
LOG_W
(
GTPU
,
"
[%ld] Create a config for a already existing GTP tunnel (rnti %x)
\n
"
,
instance
,
rnti
);
inst
->
ue2te_mapping
.
erase
(
it
);
}
teid_t
incoming_teid
=
gtpv1uNewTeid
();
while
(
inst
->
te2ue_mapping
.
find
(
incoming_teid
)
!=
inst
->
te2ue_mapping
.
end
()
)
{
LOG_W
(
GTPU
,
"
generated a random Teid that exists, re-generating (%x)
\n
"
,
incoming_teid
);
LOG_W
(
GTPU
,
"
[%ld] generated a random Teid that exists, re-generating (%x)
\n
"
,
instance
,
incoming_teid
);
incoming_teid
=
gtpv1uNewTeid
();
};
...
...
@@ -471,7 +471,8 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
char
ip4
[
INET_ADDRSTRLEN
];
char
ip6
[
INET6_ADDRSTRLEN
];
LOG_I
(
GTPU
,
"Created tunnel for RNTI %x, teid for DL: %u, teid for UL %u to remote IPv4: %s, IPv6 %s
\n
"
,
LOG_I
(
GTPU
,
"[%ld] Created tunnel for RNTI %x, teid for DL: %u, teid for UL %u to remote IPv4: %s, IPv6 %s
\n
"
,
instance
,
rnti
,
tmp
->
teid_incoming
,
tmp
->
teid_outgoing
,
...
...
@@ -483,7 +484,8 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer
int
ocp_gtpv1u_create_s1u_tunnel
(
instance_t
instance
,
const
gtpv1u_enb_create_tunnel_req_t
*
create_tunnel_req
,
gtpv1u_enb_create_tunnel_resp_t
*
create_tunnel_resp
)
{
LOG_D
(
GTPU
,
"Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %x
\n
"
,
LOG_D
(
GTPU
,
"[%ld] Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %x
\n
"
,
instance
,
create_tunnel_req
->
rnti
,
create_tunnel_req
->
num_tunnels
,
create_tunnel_req
->
sgw_S1u_teid
[
0
]);
...
...
@@ -517,7 +519,8 @@ int ocp_gtpv1u_update_s1u_tunnel(
const
gtpv1u_enb_create_tunnel_req_t
*
const
create_tunnel_req
,
const
rnti_t
prior_rnti
)
{
LOG_D
(
GTPU
,
"Start update tunnels for old RNTI %x, new RNTI %x, num_tunnels %d, sgw_S1u_teid %x, eps_bearer_id %x
\n
"
,
LOG_D
(
GTPU
,
"[%ld] Start update tunnels for old RNTI %x, new RNTI %x, num_tunnels %d, sgw_S1u_teid %x, eps_bearer_id %x
\n
"
,
instance
,
prior_rnti
,
create_tunnel_req
->
rnti
,
create_tunnel_req
->
num_tunnels
,
...
...
@@ -527,13 +530,13 @@ int ocp_gtpv1u_update_s1u_tunnel(
auto
inst
=&
globGtp
.
instances
[
compatInst
(
instance
)];
if
(
inst
->
ue2te_mapping
.
find
(
create_tunnel_req
->
rnti
)
==
inst
->
ue2te_mapping
.
end
()
)
{
LOG_E
(
GTPU
,
"
Update not already existing tunnel (new rnti %x, old rnti %x)
\n
"
,
create_tunnel_req
->
rnti
,
prior_rnti
);
LOG_E
(
GTPU
,
"
[%ld] Update not already existing tunnel (new rnti %x, old rnti %x)
\n
"
,
instance
,
create_tunnel_req
->
rnti
,
prior_rnti
);
}
auto
it
=
inst
->
ue2te_mapping
.
find
(
prior_rnti
);
if
(
it
!=
inst
->
ue2te_mapping
.
end
()
)
{
LOG_W
(
GTPU
,
"
Update a not existing tunnel, start create the new one (new rnti %x, old rnti %x)
\n
"
,
create_tunnel_req
->
rnti
,
prior_rnti
);
LOG_W
(
GTPU
,
"
[%ld] Update a not existing tunnel, start create the new one (new rnti %x, old rnti %x)
\n
"
,
instance
,
create_tunnel_req
->
rnti
,
prior_rnti
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
gtpv1u_enb_create_tunnel_resp_t
tmp
;
(
void
)
ocp_gtpv1u_create_s1u_tunnel
(
instance
,
create_tunnel_req
,
&
tmp
);
...
...
@@ -549,7 +552,8 @@ int ocp_gtpv1u_update_s1u_tunnel(
int
gtpv1u_create_ngu_tunnel
(
const
instance_t
instance
,
const
gtpv1u_gnb_create_tunnel_req_t
*
const
create_tunnel_req
,
gtpv1u_gnb_create_tunnel_resp_t
*
const
create_tunnel_resp
)
{
LOG_D
(
GTPU
,
"Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %x
\n
"
,
LOG_D
(
GTPU
,
"[%ld] Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %x
\n
"
,
instance
,
create_tunnel_req
->
rnti
,
create_tunnel_req
->
num_tunnels
,
create_tunnel_req
->
outgoing_teid
[
0
]);
...
...
@@ -590,14 +594,14 @@ int ocp_gtpv1u_create_x2u_tunnel(
}
int
newGtpuDeleteTunnel
(
instance_t
instance
,
rnti_t
rnti
)
{
LOG_D
(
GTPU
,
"Start delete tunnels for RNTI %x
\n
"
,
rnti
);
LOG_D
(
GTPU
,
"
[%ld]
Start delete tunnels for RNTI %x
\n
"
,
instance
,
rnti
);
pthread_mutex_lock
(
&
globGtp
.
gtp_lock
);
auto
inst
=&
globGtp
.
instances
[
compatInst
(
instance
)];
auto
it
=
inst
->
ue2te_mapping
.
find
(
rnti
);
if
(
it
==
inst
->
ue2te_mapping
.
end
()
)
{
LOG_W
(
GTPU
,
"
Delete a non existing GTP tunnel
\n
"
);
LOG_W
(
GTPU
,
"
[%ld] Delete a non existing GTP tunnel
\n
"
,
instance
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
return
-
1
;
}
...
...
@@ -613,7 +617,7 @@ int newGtpuDeleteTunnel(instance_t instance, rnti_t rnti) {
inst
->
ue2te_mapping
.
erase
(
it
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
LOG_I
(
GTPU
,
"
Deleted all tunnels for RNTI %d (%d tunnels deleted)
\n
"
,
rnti
,
nb
);
LOG_I
(
GTPU
,
"
[%ld] Deleted all tunnels for RNTI %d (%d tunnels deleted)
\n
"
,
instance
,
rnti
,
nb
);
return
!
GTPNOK
;
}
...
...
@@ -671,7 +675,7 @@ static int Gtpv1uHandleEndMarker(int h,
Gtpv1uMsgHeaderT
*
msgHdr
=
(
Gtpv1uMsgHeaderT
*
)
msgBuf
;
if
(
msgHdr
->
version
!=
1
||
msgHdr
->
PT
!=
1
)
{
LOG_E
(
GTPU
,
"
Received a packet that is not GTP header
\n
"
);
LOG_E
(
GTPU
,
"
[%d] Received a packet that is not GTP header
\n
"
,
h
);
return
GTPNOK
;
}
...
...
@@ -681,7 +685,7 @@ static int Gtpv1uHandleEndMarker(int h,
auto
tunnel
=
inst
->
te2ue_mapping
.
find
(
ntohl
(
msgHdr
->
teid
));
if
(
tunnel
==
inst
->
te2ue_mapping
.
end
()
)
{
LOG_E
(
GTPU
,
"
Received a incoming packet on unknown teid (%x) Dropping!
\n
"
,
msgHdr
->
teid
);
LOG_E
(
GTPU
,
"
[%d] Received a incoming packet on unknown teid (%x) Dropping!
\n
"
,
h
,
msgHdr
->
teid
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
return
GTPNOK
;
}
...
...
@@ -717,9 +721,9 @@ static int Gtpv1uHandleEndMarker(int h,
mode
,
&
sourceL2Id
,
&
destinationL2Id
)
)
LOG_E
(
GTPU
,
"
down layer refused incoming packet
\n
"
);
LOG_E
(
GTPU
,
"
[%d] down layer refused incoming packet
\n
"
,
h
);
LOG_D
(
GTPU
,
"
Received END marker packet for: teid:%x
\n
"
,
ntohl
(
msgHdr
->
teid
));
LOG_D
(
GTPU
,
"
[%d] Received END marker packet for: teid:%x
\n
"
,
h
,
ntohl
(
msgHdr
->
teid
));
return
!
GTPNOK
;
}
...
...
@@ -731,7 +735,7 @@ static int Gtpv1uHandleGpdu(int h,
Gtpv1uMsgHeaderT
*
msgHdr
=
(
Gtpv1uMsgHeaderT
*
)
msgBuf
;
if
(
msgHdr
->
version
!=
1
||
msgHdr
->
PT
!=
1
)
{
LOG_E
(
GTPU
,
"
Received a packet that is not GTP header
\n
"
);
LOG_E
(
GTPU
,
"
[%d] Received a packet that is not GTP header
\n
"
,
h
);
return
GTPNOK
;
}
...
...
@@ -741,7 +745,7 @@ static int Gtpv1uHandleGpdu(int h,
auto
tunnel
=
inst
->
te2ue_mapping
.
find
(
ntohl
(
msgHdr
->
teid
));
if
(
tunnel
==
inst
->
te2ue_mapping
.
end
()
)
{
LOG_E
(
GTPU
,
"
Received a incoming packet on unknown teid (%x) Dropping!
\n
"
,
msgHdr
->
teid
);
LOG_E
(
GTPU
,
"
[%d] Received a incoming packet on unknown teid (%x) Dropping!
\n
"
,
h
,
ntohl
(
msgHdr
->
teid
)
);
pthread_mutex_unlock
(
&
globGtp
.
gtp_lock
);
return
GTPNOK
;
}
...
...
@@ -784,9 +788,9 @@ static int Gtpv1uHandleGpdu(int h,
mode
,
&
sourceL2Id
,
&
destinationL2Id
)
)
LOG_E
(
GTPU
,
"
down layer refused incoming packet
\n
"
);
LOG_E
(
GTPU
,
"
[%d] down layer refused incoming packet
\n
"
,
h
);
LOG_D
(
GTPU
,
"
Received a %d bytes packet for: teid:%x
\n
"
,
LOG_D
(
GTPU
,
"
[%d] Received a %d bytes packet for: teid:%x
\n
"
,
h
,
msgBufLen
-
offset
,
ntohl
(
msgHdr
->
teid
));
return
!
GTPNOK
;
...
...
@@ -801,14 +805,14 @@ void gtpv1uReceiver(int h) {
if
((
udpDataLen
=
recvfrom
(
h
,
udpData
,
sizeof
(
udpData
),
0
,
(
struct
sockaddr
*
)
&
addr
,
&
from_len
))
<
0
)
{
LOG_E
(
GTPU
,
"
Recvfrom failed on %
d (%s)
\n
"
,
h
,
strerror
(
errno
));
LOG_E
(
GTPU
,
"
[%d] Recvfrom faile
d (%s)
\n
"
,
h
,
strerror
(
errno
));
return
;
}
else
if
(
udpDataLen
==
0
)
{
LOG_W
(
GTPU
,
"
Recvfrom returned 0
\n
"
);
LOG_W
(
GTPU
,
"
[%d] Recvfrom returned 0
\n
"
,
h
);
return
;
}
else
{
uint8_t
msgType
=
*
((
uint8_t
*
)(
udpData
+
1
));
LOG_D
(
GTPU
,
"
Received GTP data, msg type: %x
\n
"
,
msgType
);
LOG_D
(
GTPU
,
"
[%d] Received GTP data, msg type: %x
\n
"
,
h
,
msgType
);
switch
(
msgType
)
{
case
GTP_ECHO_RSP
:
...
...
@@ -835,7 +839,7 @@ void gtpv1uReceiver(int h) {
break
;
default:
LOG_E
(
GTPU
,
"
Received a GTP packet of unknown type: %d
\n
"
,
msgType
);
LOG_E
(
GTPU
,
"
[%d] Received a GTP packet of unknown type: %d
\n
"
,
h
,
msgType
);
break
;
}
}
...
...
@@ -844,6 +848,7 @@ void gtpv1uReceiver(int h) {
#include <openair2/ENB_APP/enb_paramdef.h>
void
*
ocp_gtpv1uTask
(
void
*
args
)
{
set_log
(
GTPU
,
OAILOG_DEBUG
);
while
(
1
)
{
/* Trying to fetch a message from the message queue.
If the queue is empty, this function will block till a
...
...
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