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
wangjie
OpenXG-RAN
Commits
c99489df
Commit
c99489df
authored
Nov 06, 2014
by
Lionel Gauthier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@5983
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
1c30f692
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
10 deletions
+22
-10
openair-cn/SGI/sgi_egress.c
openair-cn/SGI/sgi_egress.c
+5
-2
openair-cn/SGI/sgi_task.c
openair-cn/SGI/sgi_task.c
+2
-2
openair-cn/SGI/sgi_util.c
openair-cn/SGI/sgi_util.c
+15
-6
No files found.
openair-cn/SGI/sgi_egress.c
View file @
c99489df
...
...
@@ -314,6 +314,8 @@ void sgi_process_raw_packet(sgi_data_t *sgi_data_pP, unsigned char* data_pP, int
//SGI_IF_ERROR("%s UNHANDLED ether type %d of incoming egress packet\n", __FUNCTION__, eh_p->ether_type);
return
;
}
SGI_IF_DEBUG
(
"--------------------------------------------------------------
\n
%s :
\n
"
,
__FUNCTION__
);
sgi_print_hex_octets
(
data_pP
+
sizeof
(
sgi_data_pP
->
eh
),
packet_sizeP
-
sizeof
(
sgi_data_pP
->
eh
));
message_p
=
itti_alloc_new_message
(
TASK_FW_IP
,
GTPV1U_TUNNEL_DATA_REQ
);
if
(
message_p
==
NULL
)
{
...
...
@@ -321,12 +323,12 @@ void sgi_process_raw_packet(sgi_data_t *sgi_data_pP, unsigned char* data_pP, int
return
;
}
AssertFatal
((
packet_sizeP
-
sizeof
(
sgi_data_pP
->
eh
))
>
20
,
"BAD IP PACKET SIZE"
);
message_payload_p
=
itti_malloc
(
TASK_FW_IP
,
TASK_GTPV1_U
,
packet_sizeP
-
sizeof
(
sgi_data_pP
->
eh
));
message_payload_p
=
itti_malloc
(
TASK_FW_IP
,
TASK_GTPV1_U
,
packet_sizeP
-
sizeof
(
sgi_data_pP
->
eh
)
+
GTPU_HEADER_OVERHEAD_MAX
);
if
(
message_payload_p
==
NULL
)
{
SGI_IF_ERROR
(
"%s OUT OF MEMORY DROP EGRESS PACKET
\n
"
,
__FUNCTION__
);
return
;
}
memcpy
(
message_payload_p
,
data_pP
+
sizeof
(
sgi_data_pP
->
eh
),
packet_sizeP
-
sizeof
(
sgi_data_pP
->
eh
));
memcpy
(
message_payload_p
+
GTPU_HEADER_OVERHEAD_MAX
,
data_pP
+
sizeof
(
sgi_data_pP
->
eh
),
packet_sizeP
-
sizeof
(
sgi_data_pP
->
eh
));
gtpv1u_tunnel_data_req_p
=
&
message_p
->
ittiMsg
.
gtpv1uTunnelDataReq
;
gtpv1u_tunnel_data_req_p
->
S1u_enb_teid
=
addr_mapping_p
->
enb_S1U_teid
;
...
...
@@ -334,6 +336,7 @@ void sgi_process_raw_packet(sgi_data_t *sgi_data_pP, unsigned char* data_pP, int
// gtpv1u_tunnel_data_req_p->S1u_enb_teid = 1;
gtpv1u_tunnel_data_req_p
->
local_S1u_teid
=
addr_mapping_p
->
sgw_S1U_teid
;
gtpv1u_tunnel_data_req_p
->
length
=
packet_sizeP
-
sizeof
(
sgi_data_pP
->
eh
);
gtpv1u_tunnel_data_req_p
->
offset
=
GTPU_HEADER_OVERHEAD_MAX
;
gtpv1u_tunnel_data_req_p
->
buffer
=
message_payload_p
;
SGI_IF_DEBUG
(
"%s send GTPV1U_TUNNEL_DATA_REQ to GTPV1U S1u_enb_teid %u local_S1u_teid %u size %u
\n
"
,
__FUNCTION__
,
...
...
openair-cn/SGI/sgi_task.c
View file @
c99489df
...
...
@@ -92,9 +92,9 @@ static void* sgi_task_thread(void *args_p)
*/
Gtpv1uTunnelDataInd
*
data_ind_p
;
data_ind_p
=
&
received_message_p
->
ittiMsg
.
gtpv1uTunnelDataInd
;
sgi_send_data
(
data_ind_p
->
buffer
,
data_ind_p
->
length
,
sgi_data_p
,
data_ind_p
->
local_S1u_teid
);
sgi_send_data
(
&
data_ind_p
->
buffer
[
data_ind_p
->
offset
]
,
data_ind_p
->
length
,
sgi_data_p
,
data_ind_p
->
local_S1u_teid
);
/* Buffer is no longer needed, free it */
free
(
data_ind_p
->
buffer
);
itti_free
(
ITTI_MSG_ORIGIN_ID
(
received_message_p
),
data_ind_p
->
buffer
);
}
break
;
case
SGI_CREATE_ENDPOINT_REQUEST
:
{
...
...
openair-cn/SGI/sgi_util.c
View file @
c99489df
...
...
@@ -42,6 +42,7 @@
#include <netinet/in.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include "sgi.h"
#define FW_2_PRINT_BUFFER_LEN 10000
...
...
@@ -50,24 +51,32 @@ static char fw_2_print_buffer[FW_2_PRINT_BUFFER_LEN];
void
sgi_print_hex_octets
(
unsigned
char
*
dataP
,
unsigned
long
sizeP
)
//-----------------------------------------------------------------------------
{
return
;
unsigned
long
octet_index
=
0
;
unsigned
long
buffer_marker
=
0
;
unsigned
char
aindex
;
struct
timeval
tv
;
struct
timezone
tz
;
char
timeofday
[
64
];
unsigned
int
h
,
m
,
s
;
if
(
dataP
==
NULL
)
{
return
;
}
gettimeofday
(
&
tv
,
&
tz
);
h
=
tv
.
tv_sec
/
3600
/
24
;
m
=
(
tv
.
tv_sec
/
60
)
%
60
;
s
=
tv
.
tv_sec
%
60
;
snprintf
(
timeofday
,
64
,
"%02d:%02d:%02d.%06d"
,
h
,
m
,
s
,
tv
.
tv_usec
);
SGI_IF_DEBUG
(
"
------+-------------------------------------------------|
\n
"
);
SGI_IF_DEBUG
(
"
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
\n
"
);
SGI_IF_DEBUG
(
"
------+-------------------------------------------------|
\n
"
);
SGI_IF_DEBUG
(
"
%s------+-------------------------------------------------|
\n
"
,
timeofday
);
SGI_IF_DEBUG
(
"
%s | 0 1 2 3 4 5 6 7 8 9 a b c d e f |
\n
"
,
timeofday
);
SGI_IF_DEBUG
(
"
%s------+-------------------------------------------------|
\n
"
,
timeofday
);
for
(
octet_index
=
0
;
octet_index
<
sizeP
;
octet_index
++
)
{
if
((
octet_index
%
16
)
==
0
){
if
(
octet_index
!=
0
)
{
buffer_marker
+=
snprintf
(
&
fw_2_print_buffer
[
buffer_marker
],
FW_2_PRINT_BUFFER_LEN
-
buffer_marker
,
" |
\n
"
);
SGI_IF_DEBUG
(
"%s
"
,
fw_2_print_buffer
);
SGI_IF_DEBUG
(
"%s
%s"
,
timeofday
,
fw_2_print_buffer
);
buffer_marker
=
0
;
}
buffer_marker
+=
snprintf
(
&
fw_2_print_buffer
[
buffer_marker
],
FW_2_PRINT_BUFFER_LEN
-
buffer_marker
,
" %04ld |"
,
octet_index
);
...
...
@@ -88,7 +97,7 @@ void sgi_print_hex_octets(unsigned char* dataP, unsigned long sizeP)
buffer_marker
+=
snprintf
(
&
fw_2_print_buffer
[
buffer_marker
],
FW_2_PRINT_BUFFER_LEN
-
buffer_marker
,
" "
);
//SGI_IF_DEBUG(" ");
buffer_marker
+=
snprintf
(
&
fw_2_print_buffer
[
buffer_marker
],
FW_2_PRINT_BUFFER_LEN
-
buffer_marker
,
" |
\n
"
);
SGI_IF_DEBUG
(
"%s
"
,
fw_2_print_buffer
);
SGI_IF_DEBUG
(
"%s
%s"
,
timeofday
,
fw_2_print_buffer
);
}
//-----------------------------------------------------------------------------
...
...
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