Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-Spgwu-Tiny-Simple
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
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
CommunityXG
OpenXG-Spgwu-Tiny-Simple
Commits
8312b0ab
Commit
8312b0ab
authored
Feb 22, 2021
by
Rohan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gtpu extension header added for downlink
parent
0c16a497
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
5 deletions
+54
-5
src/common/3gpp_29.281.h
src/common/3gpp_29.281.h
+4
-0
src/gtpv1u/gtpu.h
src/gtpv1u/gtpu.h
+19
-3
src/gtpv1u/gtpv1u.cpp
src/gtpv1u/gtpv1u.cpp
+31
-2
No files found.
src/common/3gpp_29.281.h
View file @
8312b0ab
...
...
@@ -134,6 +134,7 @@ public:
virtual
~
gtpu_ie_value_exception
()
throw
(){}
};
#define GTPU_NO_MORE_EXTENSION_HEADER (0)
#define GTPU_IE_RECOVERY 14
#define GTPU_IE_TUNNEL_ENDPOINT_IDENTIFIER_DATA_I 16
#define GTPU_IE_GTP_U_PEER_ADDRESS 133
...
...
@@ -147,6 +148,9 @@ public:
#define GTPU_END_MARKER (254)
#define GTPU_G_PDU (255)
#define GTPU_DL_PDU_SESSION_INFORMATION (0)
#define GTPU_UL_PDU_SESSION_INFORMATION (1)
#define GTPU_PDU_SESSION_CONTAINER (133)
}
// namespace
// 8.2 Recovery
...
...
src/gtpv1u/gtpu.h
View file @
8312b0ab
...
...
@@ -68,5 +68,21 @@ struct gtpuhdr
/*The options start here. */
uint16_t
sequence
;
uint8_t
pdu_number
;
uint8_t
next_ext_type
;
};
#endif
#endif
struct
gtpu_ext_hdr
{
struct
gtpuhdr
gtpu_hdr
;
uint8_t
message_length
;
// PDU Type - This value indicates the structure of the PDU session UP frame. The field takes the value of the PDU
// Type it identifies; i.e. "0" for PDU Type 0. The PDU type is in bit 4 to bit 7 in the first octet of the frame.
uint8_t
pdu_type
;
// QoS Flow Identifier (QFI): This parameter indicates the QoS Flow Identifier of the QoS flow to which
// the transferred packet bel
uint8_t
qfi
;
// Next Extension Header Type - This field defines the type of Extension Header that follows this field in the GTP-PDU
uint8_t
next_ext_type
;
};
src/gtpv1u/gtpv1u.cpp
View file @
8312b0ab
...
...
@@ -161,7 +161,7 @@ void gtpu_l4_stack::handle_receive_message_cb(
void
gtpu_l4_stack
::
send_g_pdu
(
const
struct
sockaddr_in
&
peer_addr
,
const
teid_t
teid
,
const
char
*
payload
,
const
ssize_t
payload_len
)
{
struct
gtpuhdr
*
gtpuhdr
=
reinterpret_cast
<
struct
gtpuhdr
*>
(
/*
struct gtpuhdr* gtpuhdr = reinterpret_cast<struct gtpuhdr*>(
reinterpret_cast<uintptr_t>(payload) -
(uintptr_t) sizeof(struct gtpuhdr));
gtpuhdr->spare = 0;
...
...
@@ -175,7 +175,36 @@ void gtpu_l4_stack::send_g_pdu(
gtpuhdr->teid = htobe32(teid);
udp_s.async_send_to(
reinterpret_cast<const char*>(gtpuhdr),
payload_len
+
sizeof
(
struct
gtpuhdr
),
peer_addr
);
payload_len + sizeof(struct gtpuhdr), peer_addr);*/
// test this for multiple extension header
struct
gtpu_ext_hdr
*
gtpu_ext_hdr
=
reinterpret_cast
<
struct
gtpu_ext_hdr
*>
(
reinterpret_cast
<
uintptr_t
>
(
payload
)
-
(
uintptr_t
)
sizeof
(
struct
gtpu_ext_hdr
));
gtpu_ext_hdr
->
gtpu_hdr
.
spare
=
0
;
// gtpuhdr->e = 0;
gtpu_ext_hdr
->
gtpu_hdr
.
e
=
1
;
gtpu_ext_hdr
->
gtpu_hdr
.
s
=
0
;
gtpu_ext_hdr
->
gtpu_hdr
.
pn
=
0
;
gtpu_ext_hdr
->
gtpu_hdr
.
pt
=
1
;
gtpu_ext_hdr
->
gtpu_hdr
.
version
=
1
;
gtpu_ext_hdr
->
gtpu_hdr
.
message_type
=
GTPU_G_PDU
;
// gtpuhdr->message_length = htobe16(payload_len);
gtpu_ext_hdr
->
gtpu_hdr
.
message_length
=
htobe16
(
payload_len
+
8
);
gtpu_ext_hdr
->
gtpu_hdr
.
teid
=
htobe32
(
teid
);
gtpu_ext_hdr
->
gtpu_hdr
.
pdu_number
=
0x00
;
gtpu_ext_hdr
->
gtpu_hdr
.
sequence
=
0x00
;
gtpu_ext_hdr
->
gtpu_hdr
.
next_ext_type
=
GTPU_PDU_SESSION_CONTAINER
;
gtpu_ext_hdr
->
message_length
=
0x01
;
gtpu_ext_hdr
->
pdu_type
=
GTPU_DL_PDU_SESSION_INFORMATION
;
gtpu_ext_hdr
->
qfi
=
0x06
;
gtpu_ext_hdr
->
next_ext_type
=
GTPU_NO_MORE_EXTENSION_HEADER
;
udp_s
.
async_send_to
(
reinterpret_cast
<
const
char
*>
(
gtpu_ext_hdr
),
// payload_len + sizeof(struct gtpuhdr), peer_addr);
payload_len
+
sizeof
(
struct
gtpu_ext_hdr
),
peer_addr
);
}
//------------------------------------------------------------------------------
void
gtpu_l4_stack
::
send_g_pdu
(
...
...
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