Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
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
OpenXG
OpenXG-SMF
Commits
ba332d2a
Commit
ba332d2a
authored
Feb 25, 2021
by
Rohan
Committed by
Rohan
Mar 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IE Enterprise Specific - decoding function added
parent
2308605a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
1 deletion
+88
-1
src/common/3gpp_29.244.h
src/common/3gpp_29.244.h
+8
-0
src/pfcp/3gpp_29.244.cpp
src/pfcp/3gpp_29.244.cpp
+5
-0
src/pfcp/3gpp_29.244.hpp
src/pfcp/3gpp_29.244.hpp
+65
-1
src/pfcp/msg_pfcp.hpp
src/pfcp/msg_pfcp.hpp
+10
-0
No files found.
src/common/3gpp_29.244.h
View file @
ba332d2a
...
...
@@ -39,6 +39,13 @@
#include <vector>
namespace
pfcp
{
//-------------------------------------
// 8.1.1 IE with Enterprise Info
typedef
struct
enterprise_specific_s
{
uint16_t
enterprise_id
;
std
::
string
proprietary_data
;
}
enterprise_specific_t
;
//-------------------------------------
struct
pfcp_exception
:
public
std
::
exception
{
pfcp_exception
()
throw
()
{
...
...
@@ -312,6 +319,7 @@ struct pfcp_ie_value_exception : public pfcp_ie_exception {
#define PFCP_IE_PAGING_POLICY_INDICATOR (158)
#define PFCP_IE_APN_DNN (159)
#define PFCP_IE_3GPP_INTERFACE_TYPE (160)
#define PFCP_IE_ENTERPRISE_SPECIFIC (32770)
#define PFCP_IE_PFCPSRREQ_FLAGS_3GPP (161)
#define PFCP_IE_PFCPAUREQ_FLAGS (162)
...
...
src/pfcp/3gpp_29.244.cpp
View file @
ba332d2a
...
...
@@ -38,6 +38,11 @@ pfcp_ie* pfcp_ie::new_pfcp_ie_from_stream(std::istream& is) {
tlv
.
load_from
(
is
);
if
(
tlv
.
length
)
{
switch
(
tlv
.
type
)
{
case
PFCP_IE_ENTERPRISE_SPECIFIC
:
{
pfcp_enterprise_specific_ie
*
ie
=
new
pfcp_enterprise_specific_ie
(
tlv
);
ie
->
load_from
(
is
);
return
ie
;
}
break
;
case
PFCP_IE_CREATE_PDR
:
{
pfcp_create_pdr_ie
*
ie
=
new
pfcp_create_pdr_ie
(
tlv
);
ie
->
load_from
(
is
);
...
...
src/pfcp/3gpp_29.244.hpp
View file @
ba332d2a
...
...
@@ -107,7 +107,7 @@ class pfcp_ie : public stream_serializable {
pfcp_ie
()
:
tlv
()
{}
explicit
pfcp_ie
(
const
pfcp_tlv
&
t
)
:
tlv
(
t
)
{}
explicit
pfcp_ie
(
const
uint
8
_t
tlv_type
)
:
tlv
()
{
tlv
.
type
=
tlv_type
;
}
explicit
pfcp_ie
(
const
uint
16
_t
tlv_type
)
:
tlv
()
{
tlv
.
type
=
tlv_type
;
}
virtual
~
pfcp_ie
(){};
...
...
@@ -550,6 +550,70 @@ class pfcp_cause_ie : public pfcp_ie {
}
};
//-------------------------------------
// IE ENTERPRISE SPECIFIC
class
pfcp_enterprise_specific_ie
:
public
pfcp_ie
{
public:
uint16_t
enterprise_id
;
std
::
string
proprietary_data
;
//--------
explicit
pfcp_enterprise_specific_ie
(
const
pfcp
::
enterprise_specific_t
&
b
)
:
pfcp_ie
(
PFCP_IE_ENTERPRISE_SPECIFIC
)
{
enterprise_id
=
b
.
enterprise_id
;
proprietary_data
=
b
.
proprietary_data
;
tlv
.
set_length
(
2
+
proprietary_data
.
size
());
}
//--------
pfcp_enterprise_specific_ie
()
:
pfcp_ie
(
PFCP_IE_ENTERPRISE_SPECIFIC
)
{
enterprise_id
=
0
;
proprietary_data
=
{};
tlv
.
set_length
(
2
);
}
// --------
explicit
pfcp_enterprise_specific_ie
(
const
pfcp_tlv
&
t
)
:
pfcp_ie
(
t
),
enterprise_id
(
0
),
proprietary_data
(){};
//--------
void
to_core_type
(
pfcp
::
enterprise_specific_t
&
b
)
{
b
.
enterprise_id
=
enterprise_id
;
b
.
proprietary_data
=
proprietary_data
;
}
//--------
void
dump_to
(
std
::
ostream
&
os
)
{
tlv
.
dump_to
(
os
);
os
.
write
(
reinterpret_cast
<
const
char
*>
(
&
enterprise_id
),
sizeof
(
enterprise_id
));
os
<<
enterprise_id
;
}
//--------
void
load_from
(
std
::
istream
&
is
)
{
// tlv.load_from(is);
if
(
tlv
.
get_length
()
<
2
)
{
throw
pfcp_tlv_bad_length_exception
(
tlv
.
type
,
tlv
.
get_length
(),
__FILE__
,
__LINE__
);
}
is
.
read
(
reinterpret_cast
<
char
*>
(
&
enterprise_id
),
sizeof
(
enterprise_id
));
char
e
[
tlv
.
get_length
()
-
2
];
is
.
read
(
e
,
tlv
.
get_length
()
-
2
);
proprietary_data
.
assign
(
e
,
tlv
.
get_length
()
-
2
);
if
(
tlv
.
get_length
()
!=
(
2
+
proprietary_data
.
size
()))
{
throw
pfcp_tlv_bad_length_exception
(
tlv
.
type
,
tlv
.
get_length
(),
__FILE__
,
__LINE__
);
}
}
//--------
void
to_core_type
(
pfcp_ies_container
&
s
)
{
pfcp
::
enterprise_specific_t
enterprise_specific
=
{};
to_core_type
(
enterprise_specific
);
s
.
set
(
enterprise_specific
);
}
};
//-------------------------------------
// IE SOURCE_INTERFACE
class
pfcp_source_interface_ie
:
public
pfcp_ie
{
public:
...
...
src/pfcp/msg_pfcp.hpp
View file @
ba332d2a
...
...
@@ -90,6 +90,16 @@ class pfcp_ies_container {
public:
static
const
uint8_t
msg_id
=
0
;
// PFCP_IE_ENTERPRISE_SPECIFIC
virtual
bool
get
(
pfcp
::
enterprise_specific_t
&
v
)
const
{
throw
pfcp_msg_illegal_ie_exception
(
0
,
PFCP_IE_ENTERPRISE_SPECIFIC
,
__FILE__
,
__LINE__
);
}
virtual
void
set
(
const
pfcp
::
enterprise_specific_t
&
v
)
{
throw
pfcp_msg_illegal_ie_exception
(
0
,
PFCP_IE_ENTERPRISE_SPECIFIC
,
__FILE__
,
__LINE__
);
}
// PFCP_IE_CREATE_PDR
virtual
bool
get
(
pfcp
::
create_pdr
&
v
)
const
{
throw
pfcp_msg_illegal_ie_exception
(
...
...
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