Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
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
Libraries
UERANSIM
Commits
9d3f49f3
Commit
9d3f49f3
authored
Dec 03, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for 32-bit architectures
parent
aa2b1693
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
3 deletions
+12
-3
src/lib/asn/ngap.cpp
src/lib/asn/ngap.cpp
+5
-3
src/utils/common.cpp
src/utils/common.cpp
+6
-0
src/utils/common.hpp
src/utils/common.hpp
+1
-0
No files found.
src/lib/asn/ngap.cpp
View file @
9d3f49f3
...
...
@@ -8,9 +8,12 @@
#include "ngap.hpp"
#include "utils.hpp"
#include "utils/common.hpp"
#include <algorithm>
#include <functional>
#include <exception>
#include <stdexcept>
#include <asn/ngap/ASN_NGAP_AMFConfigurationUpdate.h>
#include <asn/ngap/ASN_NGAP_AMFConfigurationUpdateAcknowledge.h>
...
...
@@ -858,9 +861,8 @@ static bool GetProtocolIeInfo(const ASN_NGAP_NGAP_PDU &pdu, const asn_TYPE_descr
// Therefore no problem is expected since the structs are already standard layout.
// Assert that the machine is Little Endian. (This assumption is used for presentEnumSize and related)
#if 'ABCD' != 0x41424344
#error "Big Endian architecture is not supported"
#endif
if
(
!
utils
::
IsLittleEndian
())
throw
std
::
runtime_error
(
"Big Endian architecture is not supported"
);
asn_TYPE_descriptor_t
*
desc
;
void
*
ptr
;
...
...
src/utils/common.cpp
View file @
9d3f49f3
...
...
@@ -18,6 +18,7 @@
#include <stdexcept>
#include <thread>
#include <arpa/inet.h>
#include <unistd.h>
static_assert
(
sizeof
(
char
)
==
sizeof
(
uint8_t
));
...
...
@@ -324,3 +325,8 @@ void utils::Trim(std::stringstream &s)
Trim
(
str
);
s
.
str
(
str
);
}
bool
utils
::
IsLittleEndian
()
{
return
htonl
(
1453
)
!=
1453
;
}
src/utils/common.hpp
View file @
9d3f49f3
...
...
@@ -40,6 +40,7 @@ bool IsNumeric(const std::string &str);
void
AssertNodeName
(
const
std
::
string
&
str
);
void
Trim
(
std
::
string
&
str
);
void
Trim
(
std
::
stringstream
&
str
);
bool
IsLittleEndian
();
template
<
typename
T
>
inline
void
ClearAndDelete
(
std
::
vector
<
T
*>
&
vector
)
...
...
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