Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
Michael Black
OpenXG UE
Commits
7391b440
Commit
7391b440
authored
Dec 30, 2021
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add gtp-u echo reply implementation, and ci trace improvement
parent
09cedc4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
13 deletions
+29
-13
ci-scripts/ran.py
ci-scripts/ran.py
+1
-1
common/utils/LOG/log.c
common/utils/LOG/log.c
+1
-1
openair3/ocp-gtpu/gtp_itf.cpp
openair3/ocp-gtpu/gtp_itf.cpp
+27
-11
No files found.
ci-scripts/ran.py
View file @
7391b440
...
@@ -474,7 +474,7 @@ class RANManagement():
...
@@ -474,7 +474,7 @@ class RANManagement():
mySSH
.
command
(
'echo '
+
lPassWord
+
' | echo "ulimit -c unlimited && sudo UHD_RFNOC_DIR=/usr/local/share/uhd/rfnoc ./ran_build/build/'
+
self
.
air_interface
[
self
.
eNB_instance
]
+
' -O '
+
lSourcePath
+
'/'
+
ci_full_config_file
+
extra_options
+
'" > ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
lPassWord
+
' | echo "ulimit -c unlimited && sudo UHD_RFNOC_DIR=/usr/local/share/uhd/rfnoc ./ran_build/build/'
+
self
.
air_interface
[
self
.
eNB_instance
]
+
' -O '
+
lSourcePath
+
'/'
+
ci_full_config_file
+
extra_options
+
'" > ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
,
'\$'
,
5
)
#otherwise the regular command is ok
#otherwise the regular command is ok
else
:
else
:
mySSH
.
command
(
'echo "ulimit -c unlimited && ./ran_build/build/'
+
self
.
air_interface
[
self
.
eNB_instance
]
+
' -O '
+
lSourcePath
+
'/'
+
ci_full_config_file
+
extra_options
+
'" > ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
,
'\$'
,
5
)
mySSH
.
command
(
'echo "ulimit -c unlimited &&
catchsegv
./ran_build/build/'
+
self
.
air_interface
[
self
.
eNB_instance
]
+
' -O '
+
lSourcePath
+
'/'
+
ci_full_config_file
+
extra_options
+
'" > ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
,
'\$'
,
5
)
mySSH
.
command
(
'chmod 775 ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
,
'\$'
,
5
)
mySSH
.
command
(
'chmod 775 ./my-lte-softmodem-run'
+
str
(
self
.
eNB_instance
)
+
'.sh'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
lPassWord
+
' | sudo -S rm -Rf enb_'
+
self
.
testCase_id
+
'.log'
,
'\$'
,
5
)
mySSH
.
command
(
'echo '
+
lPassWord
+
' | sudo -S rm -Rf enb_'
+
self
.
testCase_id
+
'.log'
,
'\$'
,
5
)
...
...
common/utils/LOG/log.c
View file @
7391b440
...
@@ -919,7 +919,7 @@ static void log_output_memory(log_component_t *c, const char *file, const char *
...
@@ -919,7 +919,7 @@ static void log_output_memory(log_component_t *c, const char *file, const char *
}
}
}
}
}
else
{
}
else
{
fwrite
(
log_buffer
,
len
,
1
,
c
->
stream
)
;
if
(
write
(
fileno
(
c
->
stream
),
log_buffer
,
len
))
{}
;
}
}
}
}
...
...
openair3/ocp-gtpu/gtp_itf.cpp
View file @
7391b440
...
@@ -106,9 +106,9 @@ instance_t legacyInstanceMapping=0;
...
@@ -106,9 +106,9 @@ instance_t legacyInstanceMapping=0;
#define compatInst(a) ((a)==0 || (a)==INSTANCE_DEFAULT?legacyInstanceMapping:a)
#define compatInst(a) ((a)==0 || (a)==INSTANCE_DEFAULT?legacyInstanceMapping:a)
#define GTPV1U_HEADER_SIZE (8)
#define GTPV1U_HEADER_SIZE (8)
static
int
gtpv1uCreateAndSendMsg
(
int
h
,
uint32_t
peerIp
,
uint16_t
peerPort
,
teid_t
teid
,
uint8_t
*
Msg
,
int
msgLen
,
static
int
gtpv1uCreateAndSendMsg
(
int
h
,
uint32_t
peerIp
,
uint16_t
peerPort
,
int
msgType
,
teid_t
teid
,
uint8_t
*
Msg
,
int
msgLen
,
bool
seqNumFlag
,
bool
npduNumFlag
,
bool
extHdrFlag
,
int
seqNum
,
int
npduNum
,
int
extHdrType
)
{
bool
seqNumFlag
,
bool
npduNumFlag
,
bool
extHdrFlag
,
int
seqNum
,
int
npduNum
,
int
extHdrType
)
{
AssertFatal
(
extHdrFlag
==
false
,
"Not developped"
);
AssertFatal
(
extHdrFlag
==
false
,
"Not developped"
);
int
headerAdditional
=
0
;
int
headerAdditional
=
0
;
...
@@ -116,9 +116,8 @@ static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, te
...
@@ -116,9 +116,8 @@ static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, te
if
(
seqNumFlag
||
npduNumFlag
||
extHdrFlag
)
if
(
seqNumFlag
||
npduNumFlag
||
extHdrFlag
)
headerAdditional
=
4
;
headerAdditional
=
4
;
uint8_t
*
buffer
;
int
fullSize
=
GTPV1U_HEADER_SIZE
+
headerAdditional
+
msgLen
;
int
fullSize
=
GTPV1U_HEADER_SIZE
+
headerAdditional
+
msgLen
;
AssertFatal
((
buffer
=
(
uint8_t
*
)
malloc
(
fullSize
))
!=
NULL
,
""
)
;
uint8_t
buffer
[
fullSize
]
;
Gtpv1uMsgHeaderT
*
msgHdr
=
(
Gtpv1uMsgHeaderT
*
)
buffer
;
Gtpv1uMsgHeaderT
*
msgHdr
=
(
Gtpv1uMsgHeaderT
*
)
buffer
;
// N should be 0 for us (it was used only in 2G and 3G)
// N should be 0 for us (it was used only in 2G and 3G)
msgHdr
->
PN
=
npduNumFlag
;
msgHdr
->
PN
=
npduNumFlag
;
...
@@ -128,7 +127,7 @@ static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, te
...
@@ -128,7 +127,7 @@ static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, te
//PT=0 is for GTP' TS 32.295 (charging)
//PT=0 is for GTP' TS 32.295 (charging)
msgHdr
->
PT
=
1
;
msgHdr
->
PT
=
1
;
msgHdr
->
version
=
1
;
msgHdr
->
version
=
1
;
msgHdr
->
msgType
=
GTP_GPDU
;
msgHdr
->
msgType
=
msgType
;
msgHdr
->
msgLength
=
htons
(
msgLen
);
msgHdr
->
msgLength
=
htons
(
msgLen
);
if
(
seqNumFlag
||
extHdrFlag
||
npduNumFlag
)
if
(
seqNumFlag
||
extHdrFlag
||
npduNumFlag
)
...
@@ -153,11 +152,9 @@ static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, te
...
@@ -153,11 +152,9 @@ static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, te
if
((
ret
=
sendto
(
h
,
(
void
*
)
buffer
,
(
size_t
)
fullSize
,
0
,(
struct
sockaddr
*
)
&
to
,
sizeof
(
to
)
))
!=
fullSize
)
{
if
((
ret
=
sendto
(
h
,
(
void
*
)
buffer
,
(
size_t
)
fullSize
,
0
,(
struct
sockaddr
*
)
&
to
,
sizeof
(
to
)
))
!=
fullSize
)
{
LOG_E
(
GTPU
,
"[SD %d] Failed to send data to "
IPV4_ADDR
" on port %d, buffer size %u, ret: %d, errno: %d
\n
"
,
LOG_E
(
GTPU
,
"[SD %d] Failed to send data to "
IPV4_ADDR
" on port %d, buffer size %u, ret: %d, errno: %d
\n
"
,
h
,
IPV4_ADDR_FORMAT
(
peerIp
),
peerPort
,
fullSize
,
ret
,
errno
);
h
,
IPV4_ADDR_FORMAT
(
peerIp
),
peerPort
,
fullSize
,
ret
,
errno
);
free
(
buffer
);
return
GTPNOK
;
return
GTPNOK
;
}
}
free
(
buffer
);
return
!
GTPNOK
;
return
!
GTPNOK
;
}
}
...
@@ -199,6 +196,7 @@ static void gtpv1uSend(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req, b
...
@@ -199,6 +196,7 @@ static void gtpv1uSend(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req, b
gtpv1uCreateAndSendMsg
(
compatInst
(
instance
),
gtpv1uCreateAndSendMsg
(
compatInst
(
instance
),
tmp
.
outgoing_ip_addr
,
tmp
.
outgoing_ip_addr
,
tmp
.
outgoing_port
,
tmp
.
outgoing_port
,
GTP_GPDU
,
tmp
.
teid_outgoing
,
tmp
.
teid_outgoing
,
buffer
,
length
,
seqNumFlag
,
npduNumFlag
,
false
,
tmp
.
seqNum
,
tmp
.
npduNum
,
0
)
;
buffer
,
length
,
seqNumFlag
,
npduNumFlag
,
false
,
tmp
.
seqNum
,
tmp
.
npduNum
,
0
)
;
}
}
...
@@ -241,6 +239,7 @@ static void gtpv1uSend2(instance_t instance, gtpv1u_gnb_tunnel_data_req_t *req,
...
@@ -241,6 +239,7 @@ static void gtpv1uSend2(instance_t instance, gtpv1u_gnb_tunnel_data_req_t *req,
gtpv1uCreateAndSendMsg
(
compatInst
(
instance
),
gtpv1uCreateAndSendMsg
(
compatInst
(
instance
),
tmp
.
outgoing_ip_addr
,
tmp
.
outgoing_ip_addr
,
tmp
.
outgoing_port
,
tmp
.
outgoing_port
,
GTP_GPDU
,
tmp
.
teid_outgoing
,
tmp
.
teid_outgoing
,
buffer
,
length
,
seqNumFlag
,
npduNumFlag
,
false
,
tmp
.
seqNum
,
tmp
.
npduNum
,
0
)
;
buffer
,
length
,
seqNumFlag
,
npduNumFlag
,
false
,
tmp
.
seqNum
,
tmp
.
npduNum
,
0
)
;
}
}
...
@@ -647,9 +646,26 @@ static int Gtpv1uHandleEchoReq(int h,
...
@@ -647,9 +646,26 @@ static int Gtpv1uHandleEchoReq(int h,
uint32_t
msgBufLen
,
uint32_t
msgBufLen
,
uint16_t
peerPort
,
uint16_t
peerPort
,
uint32_t
peerIp
)
{
uint32_t
peerIp
)
{
LOG_E
(
GTPU
,
"EchoReq reply to be dev
\n
"
);
Gtpv1uMsgHeaderT
*
msgHdr
=
(
Gtpv1uMsgHeaderT
*
)
msgBuf
;
int
rc
=
GTPNOK
;
return
rc
;
if
(
msgHdr
->
version
!=
1
||
msgHdr
->
PT
!=
1
)
{
LOG_E
(
GTPU
,
"[%d] Received a packet that is not GTP header
\n
"
,
h
);
return
GTPNOK
;
}
if
(
msgHdr
->
S
!=
1
)
{
LOG_E
(
GTPU
,
"[%d] Received a echo request packet with no sequence number
\n
"
,
h
);
return
GTPNOK
;
}
uint16_t
seq
=
ntohs
(
*
(
uint16_t
*
)(
msgHdr
+
1
));
LOG_D
(
GTPU
,
"[%d] Received a echo request, TEID: %d, seq: %hu
\n
"
,
h
,
msgHdr
->
teid
,
seq
);
uint8_t
recovery
[
2
]
=
{
14
,
0
};
return
gtpv1uCreateAndSendMsg
(
h
,
peerIp
,
peerPort
,
GTP_ECHO_RSP
,
ntohl
(
msgHdr
->
teid
),
recovery
,
sizeof
recovery
,
1
,
0
,
0
,
seq
,
0
,
0
);
}
}
static
int
Gtpv1uHandleError
(
int
h
,
static
int
Gtpv1uHandleError
(
int
h
,
...
...
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