Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UDM
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-UDM
Commits
bd6bad69
Commit
bd6bad69
authored
Aug 17, 2021
by
yangjian
Browse files
Options
Browse Files
Download
Plain Diff
merge branch docker
parents
2d793f10
f8e13622
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
176 additions
and
11 deletions
+176
-11
build/scripts/build_docker.sh
build/scripts/build_docker.sh
+68
-0
build/scripts/build_install_package.sh
build/scripts/build_install_package.sh
+73
-0
docker/Dockerfile
docker/Dockerfile
+7
-0
etc/udm_docker.conf
etc/udm_docker.conf
+26
-0
src/5gaka/authentication_algorithms_with_5gaka.cpp
src/5gaka/authentication_algorithms_with_5gaka.cpp
+2
-0
src/impl/GenerateAuthDataApiImpl.cpp
src/impl/GenerateAuthDataApiImpl.cpp
+0
-11
No files found.
build/scripts/build_docker.sh
0 → 100755
View file @
bd6bad69
#!/bin/bash
THIS_SCRIPT_PATH
=
$(
dirname
$(
readlink
-f
$0
))
echo
"
$THIS_SCRIPT_PATH
"
source
${
THIS_SCRIPT_PATH
}
/build_install_package.sh
function
build_docker
()
{
docker build
-t
udm:v1.0
-f
${
THIS_SCRIPT_PATH
}
/../../docker/Dockerfile
$1
/
if
[[
$?
-eq
0
]]
;
then
return
0
else
return
1
fi
}
function
main
()
{
local
-i
apk
=
0
local
-i
docker
=
0
until
[
-z
"
$1
"
]
do
case
"
$1
"
in
-g
|
--generate-type
)
if
[
"
$2
"
==
"Apk"
]
;
then
apk
=
1
elif
[
"
$2
"
==
"Docker"
]
;
then
apk
=
1
docker
=
1
else
echo
"Unknown option
\"
Apk
\"
Or
\"
Docker
\"
"
return
1
fi
shift
2
;
;;
*
)
echo
"Unknown option
$1
"
return
1
;;
esac
done
if
[
$apk
-ne
0
]
;
then
echo
"Generating a green installation package"
generate_install_package
${
THIS_SCRIPT_PATH
}
/../UDM/udm
${
THIS_SCRIPT_PATH
}
/../../etc/udm_docker.conf
${
THIS_SCRIPT_PATH
}
/../udm-install-packer
if
[[
$?
-eq
0
]]
;
then
echo
"Green installation package was generated successfully"
else
echo
"Green installation package generation failed"
return
0
fi
fi
if
[
$docker
-ne
0
]
;
then
echo
"Creating a Docker image"
build_docker
${
THIS_SCRIPT_PATH
}
/../udm-install-packer
if
[[
$?
-eq
0
]]
;
then
echo
"Docker image created successfully"
else
echo
"Docker image creation failed"
return
0
fi
fi
}
main
"
$@
"
build/scripts/build_install_package.sh
0 → 100755
View file @
bd6bad69
#!/bin/bash
function
generate_install_package
()
{
local
lib_dir
=
""
local
libs_dir
=
""
local
res
=
""
local
res_new
=
""
local
result
=
false
echo
"[Executable File]
$1
"
echo
"[Config File]
$2
"
echo
"[Generate Dir]
$3
"
if
[
-n
"
$1
"
]
&&
[
-n
"
$2
"
]
&&
[
-n
"
$3
"
]
;
then
if
[
-f
"
$1
"
]
&&
[
-f
"
$2
"
]
;
then
res
=
"
$(
ldd
$1
)
"
for
((
i
=
1
;
i<
=
100
;
i++
))
do
res_new
=
"
${
res
#*/
}
"
if
[
"
$res_new
"
==
"
$res
"
]
;
then
result
=
true
break
fi
lib_dir
=
"/
${
res_new
%%(*
}
"
libs_dir+
=
"
$lib_dir
"
res
=
"
${
res_new
#*
}
"
done
else
echo
"
\"
$1
\"
Or
\"
$2
\"
does not exist!"
fi
if
[
$result
==
true
]
;
then
if
[
-d
"
$3
"
]
;
then
rm
-r
$3
fi
mkdir
$3
$3
/libs
cp
$libs_dir
$3
/libs/
cp
$1
$3
cp
$2
$3
/default.conf
cd
$3
cat
>
start.sh
<<
EOF
#!/bin/bash
cd
\`
dirname
\$
0
\`
ROOT_DIR=
\$
(pwd)
if [ -f "
\$
ROOT_DIR/external.conf" ]; then
echo -e "
\E
[33mUsing external configuration
\E
[00m"
\$
ROOT_DIR/libs/ld-linux-x86-64.so.2 --library-path
\$
ROOT_DIR/libs/
\$
ROOT_DIR/
$(
basename
$1
)
-c
\$
ROOT_DIR/external.conf -o
else
echo -e "
\E
[33mUsing default configuration
\E
[00m"
\$
ROOT_DIR/libs/ld-linux-x86-64.so.2 --library-path
\$
ROOT_DIR/libs/
\$
ROOT_DIR/
$(
basename
$1
)
-c
\$
ROOT_DIR/default.conf -o
fi
EOF
chmod
777 start.sh
return
0
else
echo
"Extract library failed!"
return
1
fi
else
echo
"
$0
[Executable File] [Config File] [Generate Dir]"
fi
}
#generate_install_package "$@"
docker/Dockerfile
0 → 100644
View file @
bd6bad69
FROM
ubuntu:18.04
ADD
. /opt/5gc/udm
RUN
apt-get update
-y
&&
\
apt-get
install
--no-install-recommends
-y
net-tools vim inetutils-ping
&&
\
mkdir
/opt/5gc/log
EXPOSE
8181
CMD
["/opt/5gc/udm/start.sh"]
etc/udm_docker.conf
0 → 100644
View file @
bd6bad69
## udm configuration file
UDM
=
{
INSTANCE_ID
=
10
;
PID_DIRECTORY
=
"/var/run"
;
UDM_NAME
=
"bupt-amf"
;
INTERFACES
:{
SBI_UDM
:{
INTERFACE_NAME
=
"eth0"
;
#interface for providing udm service
IPV4_ADDRESS
=
"read"
;
#address for intercafe (cidr)
PORT
=
8181
;
#udm service port
PPID
=
60
;
};
NUDR
:{
INTERFACE_NAME
=
"eth0"
;
#interface for request for udr service
IPV4_ADDRESS
=
"172.16.200.11/24"
;
#udr address (cidr)
PORT
=
8081
;
#udr port
VERSION
=
"v2"
;
};
};
};
src/5gaka/authentication_algorithms_with_5gaka.cpp
View file @
bd6bad69
...
...
@@ -524,6 +524,8 @@ uint8_t *Authentication_5gaka::sqn_ms_derive(const uint8_t opc[16],
uint8_t
amf_tmp
[
2
]
=
{
0
,
0
};
int
i
=
0
;
// memset(amf,0,2);
conc_sqn_ms
=
auts
;
mac_s
=
&
auts
[
6
];
sqn_ms
=
(
uint8_t
*
)
malloc
(
SQN_LENGTH_OCTEST
);
...
...
src/impl/GenerateAuthDataApiImpl.cpp
View file @
bd6bad69
...
...
@@ -254,10 +254,6 @@ void GenerateAuthDataApiImpl::generate_auth_data(
sqn_s
=
conv
::
uint8_to_hex_string
(
sqn
,
6
);
// Logger::udm_ueau().debug("sqn string = "+sqn_s);
// sqn_s[12] = '\0';
print_buffer
(
"udm_ueau"
,
"SQNms"
,
sqn
,
6
);
if
(
r_sqn
)
{
// free
...
...
@@ -300,19 +296,12 @@ void GenerateAuthDataApiImpl::generate_auth_data(
Logger
::
udm_ueau
().
info
(
"Send 200 Ok response to AUSF"
);
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
AuthInfoResult
.
dump
());
// calculate new sqn----------------------------------------------------------
// unsigned long long sqn_value;
// std::stringstream s1;
// s1 << std::hex << sqn_s;
// s1 >> sqn_value; // hex string to decimal value
uint64_t
sqn_value
=
0
;
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
sqn_value
=
sqn_value
<<
8
;
sqn_value
|=
(
sqn
[
i
]
&
0xff
);
}
sqn_value
+=
32
;
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
...
...
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