mirror of
https://github.com/open5gs/open5gs.git
synced 2025-10-24 08:33:48 +00:00
Compare commits
309 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdb7fbe368 | ||
|
|
d08a37f9bb | ||
|
|
8813e0a175 | ||
|
|
dac2bd2e4f | ||
|
|
4f9a2e94fc | ||
|
|
a7e2865ef0 | ||
|
|
7915773900 | ||
|
|
8dca1eacd8 | ||
|
|
a3c5dcd190 | ||
|
|
50e2872ff4 | ||
|
|
2109d7f9de | ||
|
|
470e66d37d | ||
|
|
f4647ca346 | ||
|
|
f5c5701b17 | ||
|
|
a8c14916a7 | ||
|
|
709cce5c48 | ||
|
|
dba1fcac5c | ||
|
|
d791f0034d | ||
|
|
f19009c736 | ||
|
|
82c4c0e1ec | ||
|
|
adb48fbad6 | ||
|
|
78eeb1ad45 | ||
|
|
a40d1dd2af | ||
|
|
46693cd351 | ||
|
|
235121c82d | ||
|
|
5e78b78166 | ||
|
|
9f4204ef8e | ||
|
|
60c0eff085 | ||
|
|
d9238e3036 | ||
|
|
649b6ec5e9 | ||
|
|
ae3e59053d | ||
|
|
5ce04bcc6f | ||
|
|
6a1f628e44 | ||
|
|
b34dafcb09 | ||
|
|
90290d236e | ||
|
|
805869da4f | ||
|
|
42f593d360 | ||
|
|
6dc66bce85 | ||
|
|
f1c913129d | ||
|
|
8cf28d6e16 | ||
|
|
c1c0b640f3 | ||
|
|
9565967517 | ||
|
|
a96398357f | ||
|
|
d6d824acb9 | ||
|
|
83e449ca63 | ||
|
|
a6e3affbec | ||
|
|
964e7ecebd | ||
|
|
cfd8df28c6 | ||
|
|
b642ca1491 | ||
|
|
b9f7e9c409 | ||
|
|
3a5930650e | ||
|
|
18ef1f65c3 | ||
|
|
99d91da6eb | ||
|
|
79a952d910 | ||
|
|
a6fe0cb44f | ||
|
|
3c4601a5e0 | ||
|
|
7d79602eb1 | ||
|
|
942b9466ef | ||
|
|
f043ccd884 | ||
|
|
7d42465f4e | ||
|
|
8e37f64c33 | ||
|
|
663861d17b | ||
|
|
bedd68573e | ||
|
|
9408bb6b4a | ||
|
|
f20a1a6e2b | ||
|
|
74c1e1d481 | ||
|
|
fa07895b1e | ||
|
|
610caf3af3 | ||
|
|
3e51450b3c | ||
|
|
80199a3c87 | ||
|
|
447fd902d2 | ||
|
|
bfcaf15d5d | ||
|
|
10d9159dc5 | ||
|
|
e03c1436fb | ||
|
|
aa4ea44c2c | ||
|
|
e023be67e7 | ||
|
|
0a96d446b8 | ||
|
|
97afc2db60 | ||
|
|
27d5208ea3 | ||
|
|
7e08f7fc45 | ||
|
|
19a01bdda4 | ||
|
|
cb369daaea | ||
|
|
cd814afcff | ||
|
|
de59488e2e | ||
|
|
d9b7e966e1 | ||
|
|
9dbca85c1f | ||
|
|
87cdd71582 | ||
|
|
0e1bd64646 | ||
|
|
346e67b7de | ||
|
|
ecfac8fe3b | ||
|
|
40ae23aca4 | ||
|
|
979fd96a84 | ||
|
|
16a8bea96b | ||
|
|
5e0c10bcb4 | ||
|
|
9863635342 | ||
|
|
bc9cf078a5 | ||
|
|
65cb21ce05 | ||
|
|
0bbc5124e7 | ||
|
|
89ed2dda88 | ||
|
|
a6eb646b76 | ||
|
|
5164b51607 | ||
|
|
cc83c6a586 | ||
|
|
a372bd2949 | ||
|
|
4f7aa2d5b7 | ||
|
|
334c678995 | ||
|
|
0717b57465 | ||
|
|
b440d59ce7 | ||
|
|
770d1cdba6 | ||
|
|
cd2b420470 | ||
|
|
f9f1ac7aac | ||
|
|
fd66c4023e | ||
|
|
6fc412dba7 | ||
|
|
95091210ff | ||
|
|
9abc8575f6 | ||
|
|
3ebe749bb2 | ||
|
|
baa35843fc | ||
|
|
d9e0b0eeaf | ||
|
|
6e5ab199af | ||
|
|
e2af4473dd | ||
|
|
e704295811 | ||
|
|
8e53e82913 | ||
|
|
db348156e2 | ||
|
|
de8ae9823a | ||
|
|
16fdc0d989 | ||
|
|
971f41d951 | ||
|
|
7747a4e32a | ||
|
|
44710d3f63 | ||
|
|
a4d18c2d96 | ||
|
|
6901278816 | ||
|
|
7492ec734b | ||
|
|
4af3fea81b | ||
|
|
148c109d05 | ||
|
|
acd77a8ad6 | ||
|
|
f380af44c3 | ||
|
|
5f8d609d0c | ||
|
|
db83b1e004 | ||
|
|
fe15600e02 | ||
|
|
9177ad4ee0 | ||
|
|
660ebc823f | ||
|
|
9d0b419085 | ||
|
|
79cbd8fb24 | ||
|
|
f9ea5a9136 | ||
|
|
6f65f9b5ec | ||
|
|
e688667b9f | ||
|
|
2ac74ef6ac | ||
|
|
aeedf01d6a | ||
|
|
8902411afe | ||
|
|
1a26354f29 | ||
|
|
712b9c8334 | ||
|
|
693afa922f | ||
|
|
058ebc747d | ||
|
|
5ca6d79590 | ||
|
|
652cfa70d5 | ||
|
|
bbc594330b | ||
|
|
c284ef7429 | ||
|
|
95586eaf09 | ||
|
|
eca47a2773 | ||
|
|
0e0a69ed7c | ||
|
|
5ce95f94ee | ||
|
|
6b0561681f | ||
|
|
d0417d353a | ||
|
|
4013d9203c | ||
|
|
fba54b09eb | ||
|
|
8a711191b3 | ||
|
|
f53e80eec7 | ||
|
|
fa454209a9 | ||
|
|
7ee0b3324b | ||
|
|
bfa526d221 | ||
|
|
6816400247 | ||
|
|
3b26983db9 | ||
|
|
eab4958a81 | ||
|
|
e2aa8ec198 | ||
|
|
ec7d9f2917 | ||
|
|
0be339e52d | ||
|
|
fa81c86e22 | ||
|
|
1f838c0f68 | ||
|
|
aa0001c78b | ||
|
|
c49bda5173 | ||
|
|
bb703243c6 | ||
|
|
f3a6620a65 | ||
|
|
cb00bf848e | ||
|
|
343c72b288 | ||
|
|
bcd784b1f0 | ||
|
|
c855546d77 | ||
|
|
f550919df1 | ||
|
|
f6a8985267 | ||
|
|
1542d70af6 | ||
|
|
3d154cc423 | ||
|
|
fbc73230b0 | ||
|
|
55164b4a1f | ||
|
|
c52cf33c3c | ||
|
|
eb0d8075ef | ||
|
|
d3476eca6d | ||
|
|
9e3ebf9a16 | ||
|
|
88217ff11e | ||
|
|
a550cf5b1d | ||
|
|
d7131dc2e1 | ||
|
|
22c3d66bc3 | ||
|
|
f28f3003c5 | ||
|
|
c530e1cbcf | ||
|
|
3c61858f21 | ||
|
|
477f16ad0b | ||
|
|
75a18a30cf | ||
|
|
a32465ed07 | ||
|
|
7bc245028a | ||
|
|
56567fec12 | ||
|
|
dc7f9d8e12 | ||
|
|
57af70fab9 | ||
|
|
71f1b1cfa4 | ||
|
|
60dc4402c6 | ||
|
|
d4f00da662 | ||
|
|
0ff388fb19 | ||
|
|
ca742661f6 | ||
|
|
c849cc802c | ||
|
|
4fc1e0e22c | ||
|
|
d41ce4d8b1 | ||
|
|
8dc5211448 | ||
|
|
24da20bdc8 | ||
|
|
70b2e51f79 | ||
|
|
9e4d3cb824 | ||
|
|
10675caf89 | ||
|
|
fb1908410e | ||
|
|
b9c0feb40e | ||
|
|
29a50892b5 | ||
|
|
f7ef0f3aab | ||
|
|
5f4b42cbfc | ||
|
|
681a7c87a4 | ||
|
|
a03df8d656 | ||
|
|
a7053eb926 | ||
|
|
fe91a72271 | ||
|
|
5693c0c730 | ||
|
|
eb8b7e96d7 | ||
|
|
85bedf1e35 | ||
|
|
8f8caf5177 | ||
|
|
756859d05c | ||
|
|
d4023da087 | ||
|
|
f384bdef3d | ||
|
|
4cdc891898 | ||
|
|
7abd6b5ab9 | ||
|
|
8a7634d00c | ||
|
|
1f752e51e8 | ||
|
|
282936f215 | ||
|
|
60bfaa2c41 | ||
|
|
937f0319e3 | ||
|
|
32c9c512d8 | ||
|
|
163bc4a040 | ||
|
|
58faa7bcac | ||
|
|
61d0573686 | ||
|
|
f0c84d3037 | ||
|
|
69cfb3280c | ||
|
|
d597912abb | ||
|
|
34e2b4d44a | ||
|
|
241efaf581 | ||
|
|
335e8513e9 | ||
|
|
cbb819f6b9 | ||
|
|
2267a59cc3 | ||
|
|
550be1cd95 | ||
|
|
338f359285 | ||
|
|
3da632dd1e | ||
|
|
8b782eb370 | ||
|
|
5bca0920b9 | ||
|
|
bd1c505024 | ||
|
|
1ed22fe7b2 | ||
|
|
71367627a8 | ||
|
|
88d0a53956 | ||
|
|
4d7b6c04c5 | ||
|
|
e032565991 | ||
|
|
f19f714136 | ||
|
|
94797e7d7a | ||
|
|
581f4feb97 | ||
|
|
7c1c320141 | ||
|
|
244770de65 | ||
|
|
68ac111bd5 | ||
|
|
56556195a9 | ||
|
|
9be8d1fd00 | ||
|
|
cdffdcaa78 | ||
|
|
ed803b27cb | ||
|
|
314642fe1a | ||
|
|
d58ddcb3ae | ||
|
|
60277dcf05 | ||
|
|
77b8656dc3 | ||
|
|
0f892f6e84 | ||
|
|
8ae096f77e | ||
|
|
6c99b7c187 | ||
|
|
fe68841456 | ||
|
|
314a1cd4be | ||
|
|
179df88c32 | ||
|
|
bc180c3ffc | ||
|
|
ab81e38487 | ||
|
|
2d7438313d | ||
|
|
bb67705a66 | ||
|
|
f097364d52 | ||
|
|
0992fbe7f3 | ||
|
|
9bef56806e | ||
|
|
2ef9718209 | ||
|
|
825978d2af | ||
|
|
d744893fba | ||
|
|
0291d97dd5 | ||
|
|
a5f764544f | ||
|
|
39766bc379 | ||
|
|
bf1c6c00fe | ||
|
|
c8ed909f46 | ||
|
|
49adabdc70 | ||
|
|
e5523342d4 | ||
|
|
08efe857a0 | ||
|
|
aec51b399a | ||
|
|
ce2590d6fc | ||
|
|
157d5fd739 | ||
|
|
16aa960b1e |
19
.gitignore
vendored
19
.gitignore
vendored
@@ -46,17 +46,18 @@ m4/*.m4
|
||||
.version
|
||||
|
||||
# autotest
|
||||
test/package.m4
|
||||
test/atconfig
|
||||
test/testsuite
|
||||
test/testsuite.dir/
|
||||
test/testsuite.log
|
||||
tests/package.m4
|
||||
tests/atconfig
|
||||
tests/testsuite
|
||||
tests/testsuite.dir/
|
||||
tests/testsuite.log
|
||||
|
||||
# executables
|
||||
test/testunit
|
||||
test/testsimple
|
||||
test/testcomplex
|
||||
test/testvolte
|
||||
tests/testunit
|
||||
tests/testsimple
|
||||
tests/testcomplex
|
||||
tests/testvolte
|
||||
tests/testcsfb
|
||||
nextepc-mmed
|
||||
nextepc-pcrfd
|
||||
nextepc-pgwd
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
EXTRA_DIST = build/git-version-gen .version README.md LICENSE
|
||||
|
||||
SUBDIRS = lib src support test
|
||||
SUBDIRS = lib src support tests
|
||||
|
||||
bin_PROGRAMS = nextepc-mmed nextepc-hssd nextepc-sgwd nextepc-pgwd nextepc-pcrfd nextepc-epcd
|
||||
|
||||
|
||||
15
configure.ac
15
configure.ac
@@ -24,7 +24,7 @@ AC_INIT([NextEPC],
|
||||
|
||||
AC_CONFIG_AUX_DIR([build])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_TESTDIR(test)
|
||||
AC_CONFIG_TESTDIR(tests)
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects])
|
||||
@@ -119,8 +119,8 @@ if test x$have_srclib == xyes; then
|
||||
AC_SUBST(OGSCRYPT_CFLAGS, '-I$(top_srcdir)/lib/ogslib/src')
|
||||
AC_SUBST(OGSCRYPT_LIBS, '$(top_srcdir)/lib/ogslib/src/crypt/libogscrypt-1.0.la')
|
||||
else
|
||||
PKG_CHECK_MODULES(OGSCORE, ogscore-1.0 >= 1.0.0)
|
||||
PKG_CHECK_MODULES(OGSCRYPT, ogscrypt-1.0 >= 1.0.0)
|
||||
PKG_CHECK_MODULES(OGSCORE, ogscore-1.0 >= 1.1.0)
|
||||
PKG_CHECK_MODULES(OGSCRYPT, ogscrypt-1.0 >= 1.1.0)
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_SRCLIB], [test x$have_srclib = xyes])
|
||||
|
||||
@@ -211,10 +211,11 @@ AC_CONFIG_FILES([support/logrotate/Makefile])
|
||||
AC_CONFIG_FILES([support/newsyslog/nextepc.conf])
|
||||
AC_CONFIG_FILES([support/newsyslog/Makefile])
|
||||
AC_CONFIG_FILES([support/Makefile])
|
||||
AC_CONFIG_FILES([test/sample.conf])
|
||||
AC_CONFIG_FILES([test/sample-simple.conf])
|
||||
AC_CONFIG_FILES([test/sample-volte.conf])
|
||||
AC_CONFIG_FILES([test/Makefile])
|
||||
AC_CONFIG_FILES([tests/sample.conf])
|
||||
AC_CONFIG_FILES([tests/sample-simple.conf])
|
||||
AC_CONFIG_FILES([tests/sample-volte.conf])
|
||||
AC_CONFIG_FILES([tests/sample-csfb.conf])
|
||||
AC_CONFIG_FILES([tests/Makefile])
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
|
||||
100
debian/changelog
vendored
100
debian/changelog
vendored
@@ -1,8 +1,102 @@
|
||||
nextepc (0.4.0-5~ubuntu) bionic; urgency=medium
|
||||
nextepc (0.5.1) unstable; urgency=medium
|
||||
|
||||
* Integration with OGSLIB
|
||||
* SMSoSG Supported
|
||||
* Many BUGS Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Mon, 29 Apr 2019 14:30:15 +0000
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 30 Jul 2019 21:34:15 +0900
|
||||
|
||||
nextepc (0.5.0-1~bionic) bionic; urgency=medium
|
||||
|
||||
* CSFB Supported
|
||||
* OGSLib package name changed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Thu, 11 Jul 2019 15:34:08 +0000
|
||||
|
||||
nextepc (0.5.0-1~xenial) xenial; urgency=medium
|
||||
|
||||
* CSFB Supported
|
||||
* OGSLib package name changed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Thu, 11 Jul 2019 15:09:05 +0000
|
||||
|
||||
nextepc (0.5.0) unstable; urgency=medium
|
||||
|
||||
* CSFB Supported
|
||||
* OGSLib package name changed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Thu, 11 Jul 2019 22:26:35 +0900
|
||||
|
||||
nextepc (0.4.4~bionic) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 30 Jun 2019 13:23:15 +0000
|
||||
|
||||
nextepc (0.4.4~xenial) xenial; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 30 Jun 2019 13:21:59 +0000
|
||||
|
||||
nextepc (0.4.4) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 30 Jun 2019 12:05:12 +0000
|
||||
|
||||
nextepc (0.4.3~xenial) xenial; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sat, 22 Jun 2019 06:57:10 +0000
|
||||
|
||||
nextepc (0.4.3~bionic) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sat, 22 Jun 2019 06:55:56 +0000
|
||||
|
||||
nextepc (0.4.3) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sat, 22 Jun 2019 03:30:10 +0000
|
||||
|
||||
nextepc (0.4.2~xenial) xenial; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 28 May 2019 20:11:51 +0900
|
||||
|
||||
nextepc (0.4.2~bionic) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 28 May 2019 20:09:02 +0900
|
||||
|
||||
nextepc (0.4.2) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 28 May 2019 20:04:53 +0900
|
||||
|
||||
nextepc (0.4.1~bionic) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sat, 18 May 2019 09:59:17 +0000
|
||||
|
||||
nextepc (0.4.1~xenial) xenial; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sat, 18 May 2019 09:57:44 +0000
|
||||
|
||||
nextepc (0.4.1) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sat, 18 May 2019 08:18:59 +0000
|
||||
|
||||
nextepc (0.4.0) unstable; urgency=medium
|
||||
|
||||
|
||||
2
debian/control
vendored
2
debian/control
vendored
@@ -12,7 +12,7 @@ Build-Depends: debhelper (>= 9),
|
||||
libtool,
|
||||
flex,
|
||||
bison,
|
||||
ogslib-dev (>= 1.0.0),
|
||||
libogslib-dev,
|
||||
libgnutls28-dev,
|
||||
libgcrypt-dev,
|
||||
libssl-dev,
|
||||
|
||||
2
debian/rules
vendored
2
debian/rules
vendored
@@ -22,7 +22,7 @@ override_dh_auto_test:
|
||||
if ! cat /proc/net/protocols | grep SCTP > /dev/null; then \
|
||||
sctp_exclude_list="-x sctp-test"; \
|
||||
fi; \
|
||||
test/testunit -f test/sample.conf $$sctp_exclude_list || exit; \
|
||||
tests/testunit -f ./tests/sample.conf $$sctp_exclude_list || exit; \
|
||||
|
||||
#override_dh_makeshlibs:
|
||||
# dh_makeshlibs -V
|
||||
|
||||
@@ -8,10 +8,10 @@ MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
WORKDIR /root
|
||||
COPY setup.sh /root
|
||||
|
||||
ARG USER=acetcom
|
||||
ARG USER=open5gs
|
||||
ARG REPO=nextepc
|
||||
ARG BRANCH=master
|
||||
RUN git clone https://github.com/$USER/$REPO
|
||||
RUN git clone --recursive https://github.com/$USER/$REPO
|
||||
ADD https://api.github.com/repos/$USER/$REPO/git/refs/heads/$BRANCH /root/nextepc-ver.json
|
||||
|
||||
RUN cd nextepc && \
|
||||
|
||||
@@ -5,14 +5,14 @@ FROM ${dist}:${tag}
|
||||
MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
|
||||
ARG tag=stable
|
||||
RUN apt-get update && \
|
||||
apt-get install -y netselect-apt && \
|
||||
apt-get clean && \
|
||||
if [ "x$tag" = "xlatest" ]; then \
|
||||
netselect-apt -o /etc/apt/sources.list; \
|
||||
else \
|
||||
netselect-apt ${tag} -o /etc/apt/sources.list; \
|
||||
fi
|
||||
#RUN apt-get update && \
|
||||
# apt-get install -y netselect-apt && \
|
||||
# apt-get clean && \
|
||||
# if [ "x$tag" = "xlatest" ]; then \
|
||||
# netselect-apt -o /etc/apt/sources.list; \
|
||||
# else \
|
||||
# netselect-apt ${tag} -o /etc/apt/sources.list; \
|
||||
# fi
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get upgrade -y && \
|
||||
|
||||
@@ -1 +1 @@
|
||||
27
|
||||
29
|
||||
@@ -21,7 +21,7 @@ description: >- # this means to ignore newlines until "baseurl:"
|
||||
baseurl: "/nextepc" # the subpath of your site, e.g. /blog
|
||||
url: "https://open5gs.org" # the base hostname & protocol for your site, e.g. http://example.com
|
||||
author: "Sukchan Lee"
|
||||
github_username: acetcom
|
||||
github_username: open5gs
|
||||
google_analytics: UA-139225646-2
|
||||
|
||||
# Build settings
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Qucikstart
|
||||
title: Quickstart
|
||||
---
|
||||
|
||||
**Note:** NextEPC supports installation of packages in *Debian/Ubuntu and openSUSE* environments. *CentOS, Fedora, FreeBSD, and Mac OSX* require you to [build with source code]({{ site.url }}{{ site.baseurl }}/docs/guide/02-building-nextepc-from-sources)
|
||||
@@ -31,7 +31,7 @@ $ sudo apt-key add Release.key
|
||||
In Debian 9.0(stretch), you can install it as follows:
|
||||
|
||||
```bash
|
||||
$ sudo sh -c "echo 'deb https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_9.0/ ./' > /etc/apt/sources.list.d/open5gs.list"
|
||||
$ sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_9.0/ ./' > /etc/apt/sources.list.d/open5gs.list"
|
||||
$ sudo apt update
|
||||
$ sudo apt install nextepc
|
||||
```
|
||||
@@ -39,12 +39,12 @@ $ sudo apt install nextepc
|
||||
Other Linux distributions can be installed by changing the path.
|
||||
|
||||
```
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_9.0/
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Raspbian_9.0/
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_16.04/
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_17.10/
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_18.04/
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_18.10/
|
||||
http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_9.0/
|
||||
http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Raspbian_9.0/
|
||||
http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_16.04/
|
||||
http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_17.10/
|
||||
http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_18.04/
|
||||
http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_18.10/
|
||||
```
|
||||
|
||||
[Martin Hauke](https://build.opensuse.org/user/show/mnhauke) packaged NextEPC for *openSUSE* on [OBS](https://build.opensuse.org/package/show/home:mnhauke:nextepc/nextepc).
|
||||
@@ -119,8 +119,9 @@ $ sudo systemctl restart nextepc-sgwd
|
||||
1. *Debian and Ubuntu* based Linux distributions can install [Node.js](https://nodejs.org/) as follows:
|
||||
|
||||
```bash
|
||||
$ sudo apt update
|
||||
$ sudo apt install curl
|
||||
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
|
||||
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
|
||||
$ sudo apt install nodejs
|
||||
```
|
||||
|
||||
@@ -133,7 +134,7 @@ $ sudo systemctl restart nextepc-sgwd
|
||||
You can now install WebUI of NextEPC.
|
||||
|
||||
```bash
|
||||
$ curl -sL {{ site.url }}/static/webui/install | sudo -E bash -
|
||||
$ curl -sL {{ site.url }}{{ site.baseurl }}/assets/webui/install | sudo -E bash -
|
||||
```
|
||||
|
||||
### Register Subscriber Information
|
||||
@@ -164,17 +165,44 @@ To add subscriber information, you can do WebUI operations in the following orde
|
||||
If your phone can connect to internet, you must run the following command in NextEPC-PGW installed host.
|
||||
|
||||
```bash
|
||||
### Check IP Tables
|
||||
$ sudo iptables -L
|
||||
Chain INPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain FORWARD (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain OUTPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
### Check NAT Tables
|
||||
$ sudo iptables -L -t nat
|
||||
Chain PREROUTING (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain INPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain OUTPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain POSTROUTING (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
### Enable IPv4 Forwarding
|
||||
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
|
||||
$ sudo iptables -t nat -A POSTROUTING -o 'interface-name' -j MASQUERADE
|
||||
$ sudo iptables -I INPUT -i pgwtun -j ACCEPT
|
||||
|
||||
### Add NAT Rule
|
||||
$ sudo iptables -t nat -A POSTROUTING -s 45.45.0.0/16 ! -o pgwtun -j MASQUERADE
|
||||
```
|
||||
|
||||
**Note:** In the above command, you should replace `'interface-name'` with your interface name that can connect to the internet. (For example, `enp0s25`, `wls3`, and so on).
|
||||
**Note:** For the first time, it is a good condition if you do not have any rules in the IP/NAT tables. If a program such as docker has already set up a rule, you will need to add a rule differently.
|
||||
{: .notice--danger}
|
||||
|
||||
### Turn on your eNodeB and Phone
|
||||
---
|
||||
|
||||
- Connect your eNodeB to the IP of your server via the standard S1AP port of SCTP 36412 (for MME)
|
||||
- You can see actual traffic through wireshark -- [[srsenb.pcapng]]({{ site.url }}{{ site.baseurl }}/assets/pcapng/srsenb.pcapng).
|
||||
- You can view the log at `/var/log/nextepc/*.log`.
|
||||
|
||||
@@ -216,7 +244,8 @@ How to remove NextEPC package:
|
||||
1. On *Ubuntu*:
|
||||
|
||||
```bash
|
||||
$ sudo apt purge nextepc*
|
||||
$ sudo apt purge nextepc
|
||||
$ sudo apt autoremove
|
||||
```
|
||||
|
||||
2. On *openSUSE*:
|
||||
|
||||
@@ -186,7 +186,7 @@ Arguments:
|
||||
|
||||
```bash
|
||||
$ sudo apt install curl
|
||||
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
|
||||
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
|
||||
$ sudo apt install nodejs
|
||||
```
|
||||
|
||||
@@ -231,13 +231,39 @@ To add subscriber information, you can do WebUI operations in the following orde
|
||||
If your phone can connect to internet, you must run the following command in NextEPC-PGW installed host.
|
||||
|
||||
```bash
|
||||
### Check IP Tables
|
||||
$ sudo iptables -L
|
||||
Chain INPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain FORWARD (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain OUTPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
### Check NAT Tables
|
||||
$ sudo iptables -L -t nat
|
||||
Chain PREROUTING (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain INPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain OUTPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain POSTROUTING (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
### Enable IPv4 Forwarding
|
||||
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
|
||||
$ sudo iptables -t nat -A POSTROUTING -o 'interface-name' -j MASQUERADE
|
||||
$ sudo iptables -I INPUT -i pgwtun -j ACCEPT
|
||||
|
||||
### Add NAT Rule
|
||||
$ sudo iptables -t nat -A POSTROUTING -s 45.45.0.0/16 ! -o pgwtun -j MASQUERADE
|
||||
```
|
||||
|
||||
**Note:** In the above command, you should replace `'interface-name'` with your interface name that can connect to the internet. (For example, `enp0s25`, `wls3`, and so on).
|
||||
{: .notice--danger}
|
||||
**Note:** It is a good condition if you do not have any rules in the IP/NAT tables. If a program such as docker has already set up a rule, you will need to add a rule differently.
|
||||
|
||||
### Turn on your eNodeB and Phone
|
||||
---
|
||||
|
||||
189
docs/_docs/guide/03-splitting-network-elements.md
Normal file
189
docs/_docs/guide/03-splitting-network-elements.md
Normal file
@@ -0,0 +1,189 @@
|
||||
---
|
||||
title: NextEPC Splitting Network Elements
|
||||
head_inline: "<style> .blue { color: blue; } </style>"
|
||||
---
|
||||
|
||||
In a production network network elements would typically not all be on the same machine, as is the default example that ships with NextEPC.
|
||||
|
||||
NextEPC is designed to be standards compliant, so in theory you can connect any core network element (MME, PGW, SGW, PCRF, HSS) from NextEPC or any other vendor to form a functioning network, so long as they are 3GPP compliant.
|
||||
|
||||
To demonstrate this we will cover isolating each network element onto it's on machine and connect each network element to the other. For some interfaces specifying multiple interfaces is supported to allow connection to multiple
|
||||
|
||||
In these examples we'll be connecting NextEPC elements together, but it could just as easily be EPC elements from a different vendor in the place of any NextEPC network element.
|
||||
|
||||
| Service | IP | Identity |
|
||||
| ------------- |:-------------:|:-------------:|
|
||||
| P-GW | 10.0.1.121 | pgw.localdomain |
|
||||
| S-GW | 10.0.1.122 | |
|
||||
| PCRF | 10.0.1.123 | pcrf.localdomain |
|
||||
| MME | 10.0.1.124 | mme.localdomain |
|
||||
| HSS | 10.0.1.118 | hss.localdomain |
|
||||
|
||||
|
||||
# External P-GW
|
||||
In it's simplest from the P-GW has 3 interfaces:
|
||||
* S5 - Connection to home network S-GW (GTP-C)
|
||||
* Gx - Connection to PCRF (Diameter)
|
||||
* Sgi - Connection to external network (Generally the Internet via standard TCP/IP)
|
||||
|
||||
### S5 Interface Configuration
|
||||
Edit ```/etc/nextepc/pgw.conf```and change the address to IP of the server running the P-GW for the listener on GTP-C and GTP-U interfaces.
|
||||
|
||||
```
|
||||
|
||||
pgw:
|
||||
|
||||
freeDiameter: pgw.conf
|
||||
|
||||
gtpc:
|
||||
|
||||
addr:
|
||||
|
||||
- 10.0.1.121
|
||||
|
||||
gtpu:
|
||||
|
||||
addr:
|
||||
|
||||
- 10.0.1.121
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
### Gx Interface Configuration
|
||||
Edit ```/etc/nextepc/freeDiameter/pgwd.conf```
|
||||
|
||||
Update ```ListenOn``` address to IP of the server running the P-GW:
|
||||
|
||||
``` ListenOn = "10.0.1.121"; ```
|
||||
|
||||
Update ConnectPeer to connect to the PCRF on it's IP.
|
||||
|
||||
```ConnectPeer = "pcrf.localdomain" { ConnectTo = "10.0.1.123"; No_TLS; };```
|
||||
|
||||
|
||||
### Restart Services
|
||||
Restart NextEPC PGW Daemon:
|
||||
|
||||
``` $ sudo systemctl restart nextepc-pgwd ```
|
||||
|
||||
|
||||
# External S-GW
|
||||
In it's simplest form the S-GW has 2 interfaces:
|
||||
* S11 - Connection to MME (GTP-C)
|
||||
* S5 - Connection to the home network P-GW (GTP-C)
|
||||
|
||||
### S5 Interface Configuration
|
||||
Edit ```/etc/nextepc/sgw.conf```and change the address to IP of the server running the S-GW for the listener on GTP-C interface.
|
||||
|
||||
```
|
||||
sgw:
|
||||
|
||||
freeDiameter: pgw.conf
|
||||
|
||||
gtpc:
|
||||
|
||||
addr:
|
||||
|
||||
- 10.0.1.122
|
||||
|
||||
```
|
||||
|
||||
Restart NextEPC SGW Daemon:
|
||||
|
||||
``` $ sudo systemctl restart nextepc-sgwd ```
|
||||
|
||||
|
||||
# External PCRF
|
||||
In it's simplest from the PCRF has 1 network interface:
|
||||
* Gx - Connection to P-GW (Diameter)
|
||||
|
||||
### Gx Interface Configuration
|
||||
Edit ```/etc/nextepc/freeDiameter/hss.conf```
|
||||
|
||||
Update ```ListenOn``` address to IP of the server running the HSS on it's IP:
|
||||
|
||||
``` ListenOn = "10.0.1.123"; ```
|
||||
|
||||
Update ConnectPeer to connect to the MME.
|
||||
|
||||
```ConnectPeer = "pgw.localdomain" { ConnectTo = "10.0.1.121"; No_TLS; };```
|
||||
|
||||
### MongoDB Interface Configuration (NextEPC HSS only)
|
||||
Edit ```/etc/nextepc/freeDiameter/hss.conf``` and change the ```db_uri:``` to point at the HSS: ```db_uri: mongodb://10.0.1.118/nextepc```
|
||||
|
||||
Restart NextEPC PCRF Daemon:
|
||||
|
||||
``` $ sudo systemctl restart nextepc-pcrfd ```
|
||||
|
||||
# External HSS
|
||||
In it's simplest form the HSS has 1 network interface:
|
||||
* S6a - Connection to MME (Diameter)
|
||||
|
||||
### S6a Interface Configuration
|
||||
Edit ```/etc/nextepc/freeDiameter/hss.conf```
|
||||
|
||||
Update ```ListenOn``` address to IP of the server running the HSS on it's IP:
|
||||
|
||||
``` ListenOn = "10.0.1.118"; ```
|
||||
|
||||
Update ConnectPeer to connect to the MME.
|
||||
|
||||
```ConnectPeer = "mme.localdomain" { ConnectTo = "10.0.1.124"; No_TLS; };```
|
||||
|
||||
Restart NextEPC HSS Daemon:
|
||||
|
||||
``` $ sudo systemctl restart nextepc-hssd ```
|
||||
|
||||
### MongoDB Interface Configuration (NextEPC specific)
|
||||
If you are using NextEPC's HSS you may need to enable MongoDB access from the PCRF. This is done by editing ''/etc/mongodb.conf'' and changing the bind IP to:
|
||||
``` bind_ip = 0.0.0.0 ```
|
||||
|
||||
Restart MongoDB for changes to take effect.
|
||||
|
||||
``` $ /etc/init.d/mongodb restart ```
|
||||
|
||||
# External MME
|
||||
In it's simplest form the MME has 3 interfaces:
|
||||
* S1AP - Connections from eNodeBs
|
||||
* S6a - Connection to HSS (Diameter)
|
||||
* S11 - Connection to S-GW (GTP-C)
|
||||
|
||||
### S11 Interface Configuration
|
||||
Edit ```/etc/nextepc/mme.conf```, filling the IP address of the S-GW and P-GW servers.
|
||||
```
|
||||
sgw:
|
||||
|
||||
gtpc:
|
||||
|
||||
addr: 10.0.1.122
|
||||
|
||||
|
||||
pgw:
|
||||
|
||||
gtpc:
|
||||
|
||||
addr:
|
||||
|
||||
- 10.0.1.121
|
||||
```
|
||||
|
||||
### S6a Interface Configuration
|
||||
Edit ```/etc/nextepc/freeDiameter/mme.conf```
|
||||
|
||||
Update ```ListenOn``` address to IP of the server running the MME:
|
||||
|
||||
``` ListenOn = "10.0.1.124"; ```
|
||||
|
||||
Update ConnectPeer to connect to the PCRF on it's IP.
|
||||
|
||||
```ConnectPeer = "hss.localdomain" { ConnectTo = "10.0.1.118"; No_TLS; };```
|
||||
|
||||
|
||||
### Restart Services
|
||||
Restart NextEPC MME Daemon:
|
||||
|
||||
``` $ sudo systemctl restart nextepc-mmed ```
|
||||
|
||||
@@ -75,8 +75,13 @@ To compile with autotools:
|
||||
➜ nextepc git:(master) ✗ make -j `nproc`
|
||||
```
|
||||
|
||||
**Note:** On MAC OS X, the compilation check is not supported at this point.
|
||||
Check whether the compilation is correct.
|
||||
|
||||
**Note:** This should require *sudo* due to access `/dev/tun0`.
|
||||
{: .notice--danger}
|
||||
```bash
|
||||
➜ nextepc git:(master) ✗ sudo make check
|
||||
```
|
||||
|
||||
You need to perform **the installation process**.
|
||||
```bash
|
||||
|
||||
@@ -10,28 +10,105 @@ This post is the perfect starting point for learning to build your own LTE netwo
|
||||
|
||||
First, you have to prepare USRP B200/B210 to run srsENB. However, please keep in mind that you would still need a fairly high-end PC (at least dual-core i5, better quad-core i7) with USB 3.0 to attach the USRP B200/B210.
|
||||
|
||||
Also, for USRP B200/B210 you will need a GPS antenna for clock synchronization. It is good to have a window near your desk where you can put the small GPS patch antenna. In my case, a 1 to 2 meters antenna cable is used between desk/computer and the window.
|
||||
For USRP B200/B210, you can use a GPS antenna for clock synchronization. Of course, it can work without a GPS antenna, but if you have that antenna, it's a good to have a window near your desk where you can put the small GPS patch antenna. In my case, a 1 to 2 meters antenna cable is used between desk/computer and the window.
|
||||
|
||||
For stable operation of USRP B200/B210, I used 10Mhz GPS-DO(GPS disciplined oscillator). Of course, a USIM card(sysmoUSIM-SJS1) was also inserted into the phone.
|
||||
This document will be described with the following equipment.
|
||||
- i5-8500 PC with Ubuntu 18.04(bionic)
|
||||
- USRP B200/B210 with USB 3.0
|
||||
- iPhone XS
|
||||
- sysmoUSIM-SJS1
|
||||
- 10Mhz GPS-DO(Optional)
|
||||
|
||||
### Overall Physical Setup
|
||||
---
|
||||
|
||||
Setup your devices in the following order:
|
||||
If you want to use GPS antenna, setup your devices in the following order:
|
||||
|
||||
1. GPS antenna near window
|
||||
2. GPS antenna connected to "GPS ANT" connector of GPS-DO (SMA)
|
||||
3. 10MHz output (BNC) of GPS-DO connected to 10MHz input of USRP (SMA)
|
||||
4. GPS input of USRP open/unused!
|
||||
5. 1PPS input of USRP open/unused!
|
||||
6. 4x Small Antennas connected to USRP Rx/Tx ports (RF-A/RF-B)
|
||||
7. USRP powered via power supply or over USB
|
||||
8. USRP USB port connected to your PC
|
||||
9. GPS-DO powered via power supply
|
||||
6. GPS-DO powered via power supply
|
||||
|
||||
**Note:** When the GPS-DO acquires a lock on the GPS signal, a **GREEN** LED is displayed. GPS takes time to function normally. You also need to wait for the **RED** LED(ALARM) to turn off.
|
||||
{: .notice--warning}
|
||||
|
||||
Then, setup the USRP B200/B210 as below:
|
||||
1. **4x Small Antennas** should be connected to USRP Rx/Tx ports (RF-A/RF-B)
|
||||
2. USRP powered via power supply or over **USB 3.0**
|
||||
3. USRP **USB 3.0** port connected to your PC
|
||||
|
||||
### USIM Setup
|
||||
---
|
||||
|
||||
Bascially, you can learn how to use it in the [sysmoUSIM manual](https://www.sysmocom.de/manuals/sysmousim-manual.pdf) or on the [official homepage of pysim project](http://osmocom.org/projects/pysim/wiki). Let's take a quickstart guide for this experiment.
|
||||
|
||||
###### Install dependencies:
|
||||
```
|
||||
$ sudo apt-get install pcscd pcsc-tools libccid libpcsclite-dev python-pyscard
|
||||
```
|
||||
- Connect SIM card reader to your computer and insert programmable SIM card to the reader.
|
||||
|
||||
###### Check the status of connection by entering the following command:
|
||||
```
|
||||
$ pcsc_scan
|
||||
PC/SC device scanner
|
||||
V 1.5.2 (c) 2001-2017, Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||
Using reader plug'n play mechanism
|
||||
Scanning present readers...
|
||||
0: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card Reader] 00
|
||||
|
||||
Sun May 26 14:26:12 2019
|
||||
Reader 0: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card Re
|
||||
Card state: Card inserted,
|
||||
ATR: 3B 9F 96 80 1F C7 80 31 A0 73 BE 21 13 67 43 20 07 18 00 00 01 A5
|
||||
...
|
||||
```
|
||||
- If SIM card reader is recognized then we can expect to print "Card inserted".
|
||||
|
||||
###### Get the code of PySIM with installing dependency:
|
||||
|
||||
```
|
||||
$ sudo apt-get install python-pyscard python-serial python-pip
|
||||
$ pip install pytlv
|
||||
$ git clone git://git.osmocom.org/pysim
|
||||
```
|
||||
|
||||
###### Read your SIM card:
|
||||
```
|
||||
$ ./pySim-read.py -p0 or ./pySim-read.py -p1
|
||||
Using PC/SC reader (dev=0) interface
|
||||
Reading ...
|
||||
ICCID: 8988211000000213010
|
||||
IMSI: 310789012345301
|
||||
SMSP: ffffffffffffffffffffffffffffffffffffffffffffffffe1ffffffffffffffffffffffff
|
||||
...
|
||||
```
|
||||
|
||||
###### Program your SIM card like the followings:
|
||||
```
|
||||
./pySim-prog.py -p 0 -n NextEPC -a 62416296 -s 8988211000000213010 -i 310789012345301 -x 310 -y 789 -k 82E9053A1882085FF2C020359938DAE9 -o BFD5771AAF4F6728E9BC6EF2C2533BDB
|
||||
Using PC/SC reader (dev=0) interface
|
||||
Insert card now (or CTRL-C to cancel)
|
||||
Autodetected card type: sysmoUSIM-SJS1
|
||||
Generated card parameters :
|
||||
> Name : NextEPC
|
||||
> SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000
|
||||
> ICCID : 8988211000000213010
|
||||
> MCC/MNC : 310/789
|
||||
> IMSI : 310789012345301
|
||||
> Ki : 82E9053A1882085FF2C020359938DAE9
|
||||
> OPC : BFD5771AAF4F6728E9BC6EF2C2533BDB
|
||||
> ACC : None
|
||||
|
||||
Programming ...
|
||||
Done !
|
||||
```
|
||||
|
||||
**Note:** You should use your ADM value to program USIM card, not my ADM(-a 62416296).
|
||||
{: .notice--warning}
|
||||
|
||||
### Installation
|
||||
---
|
||||
|
||||
@@ -93,7 +170,7 @@ $ sudo apt install nextepc
|
||||
The following shows how to install the Web UI of NextEPC.
|
||||
|
||||
```bash
|
||||
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
|
||||
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
|
||||
$ sudo apt install nodejs
|
||||
$ curl -sL http://nextepc.org/static/webui/install | sudo -E bash -
|
||||
```
|
||||
@@ -116,11 +193,20 @@ IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1
|
||||
Here's my subscriber information from above.
|
||||
|
||||
```
|
||||
MCC/MNC : 901/70
|
||||
IMSI : 901700000017408
|
||||
K : B1233463AB9BC2AD2DB1830EB6417E7B
|
||||
OPc : 625150E2A943E3353DD23554101CAFD4
|
||||
```
|
||||
|
||||
If you programmed USIM using a card reader like me, you should use your SIM information.
|
||||
```
|
||||
MCC/MNC : 310/789
|
||||
IMSI : 310789012345301
|
||||
K : 82E9053A1882085FF2C020359938DAE9
|
||||
OPc : BFD5771AAF4F6728E9BC6EF2C2533BDB
|
||||
```
|
||||
|
||||
Connect to `http://localhost:3000` and login with **admin** account.
|
||||
|
||||
> Username : admin
|
||||
@@ -150,8 +236,8 @@ diff -u mme.conf.old mme.conf
|
||||
plmn_id:
|
||||
- mcc: 001
|
||||
- mnc: 01
|
||||
+ mcc: 901
|
||||
+ mnc: 70
|
||||
+ mcc: 310
|
||||
+ mnc: 789
|
||||
mme_gid: 2
|
||||
mme_code: 1
|
||||
tai:
|
||||
@@ -159,8 +245,8 @@ diff -u mme.conf.old mme.conf
|
||||
- mcc: 001
|
||||
- mnc: 01
|
||||
- tac: 12345
|
||||
+ mcc: 901
|
||||
+ mnc: 70
|
||||
+ mcc: 310
|
||||
+ mnc: 789
|
||||
+ tac: 7
|
||||
security:
|
||||
integrity_order : [ EIA1, EIA2, EIA0 ]
|
||||
@@ -172,7 +258,7 @@ S1AP/GTP-C IP address, PLMN ID, TAC are changed as follows.
|
||||
```
|
||||
S1AP address : 127.0.1.100 - srsENB default value
|
||||
GTP-C address : 127.0.1.100 - Use loopback interface
|
||||
PLMN ID : MNC(901), MCC(70) - sysmoUSIM default value
|
||||
PLMN ID : MNC(310), MCC(789) - Programmed USIM with a card reader
|
||||
TAC : 7 - srsENB default value
|
||||
```
|
||||
|
||||
@@ -200,12 +286,39 @@ $ sudo systemctl restart nextepc-sgwd
|
||||
If your phone can connect to internet, you must run the following command in NextEPC-PGW installed host.
|
||||
|
||||
```bash
|
||||
### Check IP Tables
|
||||
$ sudo iptables -L
|
||||
Chain INPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain FORWARD (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain OUTPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
### Check NAT Tables
|
||||
$ sudo iptables -L -t nat
|
||||
Chain PREROUTING (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain INPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain OUTPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain POSTROUTING (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
### Enable IPv4 Forwarding
|
||||
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
|
||||
$ sudo iptables -t nat -A POSTROUTING -o 'interface-name' -j MASQUERADE
|
||||
$ sudo iptables -I INPUT -i pgwtun -j ACCEPT
|
||||
|
||||
### Add NAT Rule
|
||||
$ sudo iptables -t nat -A POSTROUTING -s 45.45.0.0/16 ! -o pgwtun -j MASQUERADE
|
||||
```
|
||||
|
||||
**Note:** In the above command, you should replace `'interface-name'` with your interface name that can connect to the internet. (For example, `enp0s25`, `wls3`, and so on).
|
||||
**Note:** For the first time, it is a good condition if you do not have any rules in the IP/NAT tables. If a program such as docker has already set up a rule, you will need to add a rule differently.
|
||||
{: .notice--danger}
|
||||
|
||||
#### 2. srsENB
|
||||
@@ -229,8 +342,8 @@ You should check your phone frequency. If your phone does not support Band-3, yo
|
||||
tac = 0x0007
|
||||
-mcc = 001
|
||||
-mnc = 01
|
||||
+mcc = 901
|
||||
+mnc = 70
|
||||
+mcc = 310
|
||||
+mnc = 789
|
||||
mme_addr = 127.0.1.100
|
||||
gtp_bind_addr = 127.0.1.1
|
||||
s1c_bind_addr = 127.0.1.1
|
||||
@@ -253,11 +366,20 @@ You should check your phone frequency. If your phone does not support Band-3, yo
|
||||
PLMN ID, DL EARFCN, and Device Argument are updated as belows.
|
||||
|
||||
```
|
||||
PLMN ID : MNC(901), MCC(70) sysmoUSIM default value
|
||||
PLMN ID : MNC(310), MCC(789) programmed USIM with a card reader
|
||||
DL EARFCN : Band-3 - from your Phone
|
||||
Device Argument : Clock source from external GPS-DO
|
||||
```
|
||||
|
||||
If you do not use the GPS-DO, you should use:
|
||||
```diff
|
||||
#device_name = auto
|
||||
-#device_args = auto
|
||||
+device_args = auto
|
||||
#time_adv_nsamples = auto
|
||||
#burst_preamble_us = auto
|
||||
```
|
||||
|
||||
Now, run the srsENB as follows:
|
||||
|
||||
```bash
|
||||
@@ -272,7 +394,7 @@ Reading configuration file ./enb.conf...
|
||||
Opening USRP with args: "",master_clock_rate=30.72e6
|
||||
-- Detected Device: B200
|
||||
-- Loading FPGA image: /usr/share/uhd/images/usrp_b200_fpga.bin... done
|
||||
-- Operating over USB 3.
|
||||
-- Operating over 'USB 2'.
|
||||
-- Detecting internal GPSDO.... 'No GPSDO found'
|
||||
-- Initialize CODEC control...
|
||||
-- Initialize Radio control...
|
||||
@@ -287,8 +409,9 @@ Setting Sampling frequency 11.52 MHz
|
||||
==== eNodeB started ===
|
||||
Type <t> to view trace
|
||||
```
|
||||
|
||||
If you see the `No GPSDO found`, please exit the program with Ctrl-C.
|
||||
And also, if you see the `USB 2`, it will not be working properly.
|
||||
|
||||
The following console output is the correct result of srsENB.
|
||||
```bash
|
||||
linux; GNU C++ version 6.2.0 20161027; Boost_106200; UHD_003.009.005-0-unknow
|
||||
|
||||
@@ -15,7 +15,8 @@ NextEPC is a C-language Open Source implementation of the 3GPP Evolved Packet Co
|
||||
- Multiple PDN support
|
||||
- S1/X2 Handover
|
||||
- IPv6 support
|
||||
- Supports several IMS servers with Rx interface.
|
||||
- CSFB(Circuit Switched Fall Back) and SMSoS(SMS Over SGs)
|
||||
- VoLTE(Voice over LTE)
|
||||
|
||||
#### Known Limitations
|
||||
---
|
||||
@@ -23,7 +24,7 @@ NextEPC is a C-language Open Source implementation of the 3GPP Evolved Packet Co
|
||||
- No OCS/OFCS
|
||||
- No NB-IoT
|
||||
- No eMBMS
|
||||
- No CS Fallback and SRVCC
|
||||
- No SRVCC
|
||||
- No Roaming
|
||||
- No Emergency Call
|
||||
- No ePDG Gateway
|
||||
|
||||
@@ -8,6 +8,7 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
- User's Guide
|
||||
- [Quickstart](guide/01-quickstart)
|
||||
- [Building nextepc from Sources](guide/02-building-nextepc-from-sources)
|
||||
- [Splitting Network Elements](guide/03-splitting-network-elements)
|
||||
|
||||
- Tutorials
|
||||
- [Your First LTE](tutorial/01-your-first-lte)
|
||||
|
||||
@@ -4,6 +4,211 @@ title: FAQ
|
||||
permalink: /faq/
|
||||
---
|
||||
|
||||
#### Is it possible to setup IP/NAT table along with Docker?
|
||||
|
||||
The following is the default docker IP/NAT table.
|
||||
|
||||
```
|
||||
$ sudo iptables-save
|
||||
# Generated by iptables-save v1.6.1 on Sat Jun 1 23:43:50 2019
|
||||
*nat
|
||||
:PREROUTING ACCEPT [74:4820]
|
||||
:INPUT ACCEPT [4:208]
|
||||
:OUTPUT ACCEPT [49:3659]
|
||||
:POSTROUTING ACCEPT [49:3659]
|
||||
:DOCKER - [0:0]
|
||||
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
|
||||
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
|
||||
-A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE
|
||||
-A DOCKER -i docker0 -j RETURN
|
||||
COMMIT
|
||||
# Completed on Sat Jun 1 23:43:50 2019
|
||||
# Generated by iptables-save v1.6.1 on Sat Jun 1 23:43:50 2019
|
||||
*filter
|
||||
:INPUT ACCEPT [651:514108]
|
||||
:FORWARD DROP [70:4612]
|
||||
:OUTPUT ACCEPT [590:63846]
|
||||
:DOCKER - [0:0]
|
||||
:DOCKER-ISOLATION-STAGE-1 - [0:0]
|
||||
:DOCKER-ISOLATION-STAGE-2 - [0:0]
|
||||
:DOCKER-USER - [0:0]
|
||||
-A FORWARD -j DOCKER-USER
|
||||
-A FORWARD -j DOCKER-ISOLATION-STAGE-1
|
||||
-A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||
-A FORWARD -o docker0 -j DOCKER
|
||||
-A FORWARD -i docker0 ! -o docker0 -j ACCEPT
|
||||
-A FORWARD -i docker0 -o docker0 -j ACCEPT
|
||||
-A DOCKER-ISOLATION-STAGE-1 -i docker0 ! -o docker0 -j DOCKER-ISOLATION-STAGE-2
|
||||
-A DOCKER-ISOLATION-STAGE-1 -j RETURN
|
||||
-A DOCKER-ISOLATION-STAGE-2 -o docker0 -j DROP
|
||||
-A DOCKER-ISOLATION-STAGE-2 -j RETURN
|
||||
-A DOCKER-USER -j RETURN
|
||||
COMMIT
|
||||
# Completed on Sat Jun 1 23:43:50 2019
|
||||
```
|
||||
|
||||
Create **newtables** file as below.
|
||||
|
||||
```diff
|
||||
$ diff -u oldtables newtables
|
||||
--- oldtables 2019-06-01 23:43:50.354974226 +0900
|
||||
+++ newtables 2019-06-01 23:44:16.110931684 +0900
|
||||
@@ -8,6 +8,7 @@
|
||||
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
|
||||
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
|
||||
-A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE
|
||||
+-A POSTROUTING -s 45.45.0.0/16 ! -o pgwtun -j MASQUERADE
|
||||
-A DOCKER -i docker0 -j RETURN
|
||||
COMMIT
|
||||
# Completed on Sat Jun 1 23:43:50 2019
|
||||
@@ -26,6 +27,10 @@
|
||||
-A FORWARD -o docker0 -j DOCKER
|
||||
-A FORWARD -i docker0 ! -o docker0 -j ACCEPT
|
||||
-A FORWARD -i docker0 -o docker0 -j ACCEPT
|
||||
+-A FORWARD -o pgwtun -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||
+-A FORWARD -o pgwtun -j DOCKER
|
||||
+-A FORWARD -i pgwtun ! -o pgwtun -j ACCEPT
|
||||
+-A FORWARD -i pgwtun -o pgwtun -j ACCEPT
|
||||
-A DOCKER-ISOLATION-STAGE-1 -i docker0 ! -o docker0 -j DOCKER-ISOLATION-STAGE-2
|
||||
-A DOCKER-ISOLATION-STAGE-1 -j RETURN
|
||||
-A DOCKER-ISOLATION-STAGE-2 -o docker0 -j DROP
|
||||
```
|
||||
|
||||
And then, apply **newtables** as below.
|
||||
```
|
||||
$ sudo iptables-restore < newtables
|
||||
```
|
||||
|
||||
The above operation is the same as described in the following manuals.
|
||||
```
|
||||
### Check IP Tables
|
||||
$ sudo iptables -L
|
||||
Chain INPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain FORWARD (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain OUTPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
### Check NAT Tables
|
||||
$ sudo iptables -L -t nat
|
||||
Chain PREROUTING (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain INPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain OUTPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
Chain POSTROUTING (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
|
||||
### Enable IPv4 Forwarding
|
||||
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
|
||||
|
||||
### Add NAT Rule
|
||||
$ sudo iptables -t nat -A POSTROUTING -s 45.45.0.0/16 ! -o pgwtun -j MASQUERADE
|
||||
```
|
||||
|
||||
#### How to use a different APN for each PGW
|
||||
|
||||
By default, MME selects the PGW as the first PGW node. To use a different APN for each PGW, specify gtpc.apn as the APN name. If the HSS uses WebUI to set the PGW IP for each UE, you can use a specific PGW node for each UE.
|
||||
|
||||
See the following example.
|
||||
|
||||
```
|
||||
### For reference, see `nextepc.conf`
|
||||
#------------------------ MME --------------------------
|
||||
#
|
||||
# o Two PGW are defined. 127.0.0.3:2123 is used.
|
||||
# [fe80::3%lo]:2123 is ignored.
|
||||
# gtpc:
|
||||
# - addr: 127.0.0.3
|
||||
# - addr: fe80::3%lo
|
||||
#
|
||||
# o One PGW is defined. if prefer_ipv4 is not true,
|
||||
# [fe80::3%lo] is selected.
|
||||
# gtpc:
|
||||
# - addr:
|
||||
# - 127.0.0.3
|
||||
# - fe80::3%lo
|
||||
#
|
||||
# o Two PGW are defined with a different APN.
|
||||
# - Note that if PGW IP for UE is configured in HSS,
|
||||
# the following configurion for this UE is ignored.
|
||||
# gtpc:
|
||||
# - addr: 127.0.0.3
|
||||
# apn: internet
|
||||
# - addr: 127.0.0.5
|
||||
# apn: volte
|
||||
#
|
||||
# o If APN is omitted, the default APN uses the first PGW node.
|
||||
# gtpc:
|
||||
# - addr: 127.0.0.3
|
||||
# - addr: 127.0.0.5
|
||||
# apn: volte
|
||||
#
|
||||
```
|
||||
|
||||
The IP address of the UE can also use a different UE pool depending on the APN.
|
||||
|
||||
```
|
||||
### For reference, see `nextepc.conf`
|
||||
#
|
||||
# <UE Pool>
|
||||
#
|
||||
# o IPv4 Pool
|
||||
# $ sudo ip addr add 45.45.0.1/16 dev pgwtun
|
||||
#
|
||||
# ue_pool:
|
||||
# addr: 45.45.0.1/16
|
||||
#
|
||||
# o IPv4/IPv6 Pool
|
||||
# $ sudo ip addr add 45.45.0.1/16 dev pgwtun
|
||||
# $ sudo ip addr add cafe:1::1/64 dev pgwtun
|
||||
#
|
||||
# ue_pool:
|
||||
# - addr: 45.45.0.1/16
|
||||
# - addr: cafe:1::1/64
|
||||
#
|
||||
#
|
||||
# o Specific APN(e.g 'volte') uses 45.46.0.1/16, cafe:2::1/64
|
||||
# All other APNs use 45.45.0.1/16, cafe:1::1/64
|
||||
# $ sudo ip addr add 45.45.0.1/16 dev pgwtun
|
||||
# $ sudo ip addr add 45.46.0.1/16 dev pgwtun
|
||||
# $ sudo ip addr add cafe:1::1/64 dev pgwtun
|
||||
# $ sudo ip addr add cafe:2::1/64 dev pgwtun
|
||||
#
|
||||
# ue_pool:
|
||||
# - addr: 45.45.0.1/16
|
||||
# - addr: cafe:1::1/64
|
||||
# - addr: 45.46.0.1/16
|
||||
# apn: volte
|
||||
# - addr: cafe:2::1/64
|
||||
# apn: volte
|
||||
#
|
||||
# o Multiple Devices (default: pgwtun)
|
||||
# $ sudo ip addr add 45.45.0.1/16 dev pgwtun
|
||||
# $ sudo ip addr add cafe:1::1/64 dev pgwtun2
|
||||
# $ sudo ip addr add 45.46.0.1/16 dev pgwtun3
|
||||
# $ sudo ip addr add cafe:2::1/64 dev pgwtun3
|
||||
#
|
||||
# ue_pool:
|
||||
# - addr: 45.45.0.1/16
|
||||
# - addr: cafe:1::1/64
|
||||
# dev: pgwtun2
|
||||
# - addr: 45.46.0.1/16
|
||||
# apn: volte
|
||||
# dev: pgwtun3
|
||||
# - addr: cafe:2::1/64
|
||||
# apn: volte
|
||||
# dev: pgwtun3
|
||||
#
|
||||
```
|
||||
|
||||
#### How to connect MongoDB server
|
||||
|
||||
If you do not start MongoDB, you will get the following error:
|
||||
|
||||
@@ -8,4 +8,4 @@ tags:
|
||||
- Release
|
||||
---
|
||||
|
||||
- Assets -- [v0.1.0.tar.gz](https://github.com/acetcom/nextepc/archive/v0.1.0.tar.gz)
|
||||
- Assets -- [v0.1.0.tar.gz](https://github.com/open5gs/nextepc/archive/v0.1.0.tar.gz)
|
||||
|
||||
@@ -8,5 +8,5 @@ tags:
|
||||
- Release
|
||||
---
|
||||
|
||||
- Fix the bug related to Mongo C Driver. [[More Info](https://github.com/acetcom/nextepc/commit/4245502ae287df9c457621b3f4cccb519c4d4878)]
|
||||
- Assets -- [v0.1.1.tar.gz](https://github.com/acetcom/nextepc/archive/v0.1.1.tar.gz)
|
||||
- Fix the bug related to Mongo C Driver. [[More Info](https://github.com/open5gs/nextepc/commit/4245502ae287df9c457621b3f4cccb519c4d4878)]
|
||||
- Assets -- [v0.1.1.tar.gz](https://github.com/open5gs/nextepc/archive/v0.1.1.tar.gz)
|
||||
|
||||
@@ -11,4 +11,4 @@ tags:
|
||||
- Publish Debian/Ubuntu Package
|
||||
- Support FreeBSD and Mac OS X"
|
||||
|
||||
- Assets -- [v0.2.0.tar.gz](https://github.com/acetcom/nextepc/archive/v0.2.0.tar.gz)
|
||||
- Assets -- [v0.2.0.tar.gz](https://github.com/open5gs/nextepc/archive/v0.2.0.tar.gz)
|
||||
|
||||
@@ -11,4 +11,4 @@ tags:
|
||||
- IPv6 Support (Linux Only)
|
||||
- Change Configuration File (JSON -> YAML)
|
||||
|
||||
- Assets -- [v0.3.0.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.0.tar.gz)
|
||||
- Assets -- [v0.3.0.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.0.tar.gz)
|
||||
|
||||
@@ -8,5 +8,5 @@ tags:
|
||||
- Release
|
||||
---
|
||||
|
||||
- Add Authentication Synch Failure ([#11](https://github.com/acetcom/nextepc/issues/11)) -- [eric80s](https://github.com/eric80s)
|
||||
- Assets -- [v0.3.1.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.1.tar.gz)
|
||||
- Add Authentication Synch Failure ([#11](https://github.com/open5gs/nextepc/issues/11)) -- [eric80s](https://github.com/eric80s)
|
||||
- Assets -- [v0.3.1.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.1.tar.gz)
|
||||
|
||||
@@ -10,11 +10,11 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
---
|
||||
|
||||
#### New
|
||||
- Docker support ([#16](https://github.com/acetcom/nextepc/issues/16)) -- [amilenovic](https://github.com/amilenovic)
|
||||
- Docker support ([#16](https://github.com/open5gs/nextepc/issues/16)) -- [amilenovic](https://github.com/amilenovic)
|
||||
|
||||
#### Bug fixes
|
||||
- Fix the BUG for MAC failure of authentication failure -- [#17](https://github.com/acetcom/nextepc/issues/17) from [razaborg](https://github.com/razaborg)
|
||||
- Fix the BUG for EPS attach type of Attach accept -- [#12](https://github.com/acetcom/nextepc/issues/12) from [pcminitech](https://github.com/pcminitech)
|
||||
- Fix the BUG for MAC failure of authentication failure -- [#17](https://github.com/open5gs/nextepc/issues/17) from [razaborg](https://github.com/razaborg)
|
||||
- Fix the BUG for EPS attach type of Attach accept -- [#12](https://github.com/open5gs/nextepc/issues/12) from [pcminitech](https://github.com/pcminitech)
|
||||
|
||||
Download -- [v0.3.3.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.3.tar.gz)
|
||||
Download -- [v0.3.3.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.3.tar.gz)
|
||||
{: .notice--info}
|
||||
|
||||
@@ -10,11 +10,11 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
---
|
||||
|
||||
#### New
|
||||
- Support Network Name ([#22](https://github.com/acetcom/nextepc/pull/22)) -- [medeiros405](https://github.com/medeiros405)
|
||||
- Support Network Name ([#22](https://github.com/open5gs/nextepc/pull/22)) -- [medeiros405](https://github.com/medeiros405)
|
||||
|
||||
#### Bug fixes
|
||||
- Fix the BUG for security capabilities mismatch ([#27](https://github.com/acetcom/nextepc/issues/27)) -- [wayne43290](https://github.com/wayne43290)
|
||||
- Fix the BUG that SGW process is dead during paging process ([#18](https://github.com/acetcom/nextepc/issues/18)) -- [jackson040407](https://github.com/jackson040407)
|
||||
- Fix the BUG for security capabilities mismatch ([#27](https://github.com/open5gs/nextepc/issues/27)) -- [wayne43290](https://github.com/wayne43290)
|
||||
- Fix the BUG that SGW process is dead during paging process ([#18](https://github.com/open5gs/nextepc/issues/18)) -- [jackson040407](https://github.com/jackson040407)
|
||||
|
||||
Download -- [v0.3.5.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.5.tar.gz)
|
||||
Download -- [v0.3.5.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.5.tar.gz)
|
||||
{: .notice--info}
|
||||
|
||||
@@ -8,8 +8,8 @@ tags:
|
||||
- Release
|
||||
---
|
||||
|
||||
- Support eNB/MME Configuration Transfer, Error Indication ([#29](https://github.com/acetcom/nextepc/issues/29)) -- [wayne43290](https://github.com/wayne43290)
|
||||
- Increase SCTP recv buffer : 2048->8192 ([#35](https://github.com/acetcom/nextepc/issues/35)) -- [EugeneBogush](https://github.com/EugeneBogush)
|
||||
- Support eNB/MME Configuration Transfer, Error Indication ([#29](https://github.com/open5gs/nextepc/issues/29)) -- [wayne43290](https://github.com/wayne43290)
|
||||
- Increase SCTP recv buffer : 2048->8192 ([#35](https://github.com/open5gs/nextepc/issues/35)) -- [EugeneBogush](https://github.com/EugeneBogush)
|
||||
|
||||
Download -- [v0.3.6.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.6.tar.gz)
|
||||
Download -- [v0.3.6.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.6.tar.gz)
|
||||
{: .notice--info}
|
||||
|
||||
@@ -8,5 +8,5 @@ tags:
|
||||
- Release
|
||||
---
|
||||
|
||||
Download -- [v0.3.7.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.7.tar.gz)
|
||||
Download -- [v0.3.7.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.7.tar.gz)
|
||||
{: .notice--info}
|
||||
|
||||
@@ -13,11 +13,11 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
- Support NAS encryption(EEA1/EEA2/EEA3)
|
||||
|
||||
#### Bug fixes
|
||||
- Confirm with 36.412 requirement of SCTP stream id ([#54](https://github.com/acetcom/nextepc/issues/54)) -- [brchiu](https://github.com/brchiu)
|
||||
- Fix to set correct timezone in UE ([#61](https://github.com/acetcom/nextepc/pull/61)) -- [medeiros405](https://github.com/medeiros405)
|
||||
- Fix to change MME's integrity order ([#64](https://github.com/acetcom/nextepc/issues/64)) -- [kewinrausch](https://github.com/kewinrausch)
|
||||
- Fix the bug for tracking area update ([#29](https://github.com/acetcom/nextepc/issues/29)) -- [wayne43290](https://github.com/wayne43290)
|
||||
- Fix the bug for indirect tunnel ([#29](https://github.com/acetcom/nextepc/issues/29)) -- [wayne43290](https://github.com/wayne43290)
|
||||
- Confirm with 36.412 requirement of SCTP stream id ([#54](https://github.com/open5gs/nextepc/issues/54)) -- [brchiu](https://github.com/brchiu)
|
||||
- Fix to set correct timezone in UE ([#61](https://github.com/open5gs/nextepc/pull/61)) -- [medeiros405](https://github.com/medeiros405)
|
||||
- Fix to change MME's integrity order ([#64](https://github.com/open5gs/nextepc/issues/64)) -- [kewinrausch](https://github.com/kewinrausch)
|
||||
- Fix the bug for tracking area update ([#29](https://github.com/open5gs/nextepc/issues/29)) -- [wayne43290](https://github.com/wayne43290)
|
||||
- Fix the bug for indirect tunnel ([#29](https://github.com/open5gs/nextepc/issues/29)) -- [wayne43290](https://github.com/wayne43290)
|
||||
|
||||
Download -- [v0.3.9.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.9.tar.gz)
|
||||
Download -- [v0.3.9.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.9.tar.gz)
|
||||
{: .notice--info}
|
||||
|
||||
@@ -10,12 +10,12 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
---
|
||||
|
||||
#### Bug fixes
|
||||
- Renew freeDiameter Certificate ([#93](https://github.com/acetcom/nextepc/issues/93), [#94](https://github.com/acetcom/nextepc/issues/94)) -- [Ravi-t](https://github.com/Ravi-t), [hchenji](https://github.com/hchenji)
|
||||
- Fix TLV uint32 bug ([#73](https://github.com/acetcom/nextepc/pull/73)) -- [giuliol](https://github.com/giuliol)
|
||||
- Add TRACE for IP address of connected UEs ([#71](https://github.com/acetcom/nextepc/issues/71)) -- [pgupta408](https://github.com/Ravi-t)
|
||||
- Show reason string for YAML parser error ([#40](https://github.com/acetcom/nextepc/issues/40)) -- [Raw1mage](https://github.com/Raw1mage)
|
||||
- Renew freeDiameter Certificate ([#93](https://github.com/open5gs/nextepc/issues/93), [#94](https://github.com/open5gs/nextepc/issues/94)) -- [Ravi-t](https://github.com/Ravi-t), [hchenji](https://github.com/hchenji)
|
||||
- Fix TLV uint32 bug ([#73](https://github.com/open5gs/nextepc/pull/73)) -- [giuliol](https://github.com/giuliol)
|
||||
- Add TRACE for IP address of connected UEs ([#71](https://github.com/open5gs/nextepc/issues/71)) -- [pgupta408](https://github.com/Ravi-t)
|
||||
- Show reason string for YAML parser error ([#40](https://github.com/open5gs/nextepc/issues/40)) -- [Raw1mage](https://github.com/Raw1mage)
|
||||
- Fix compile error for GCC 8.1
|
||||
- Fix compile error for Mongo-C-Driver 1.11
|
||||
|
||||
Download -- [v0.3.10.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.10.tar.gz)
|
||||
Download -- [v0.3.10.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.10.tar.gz)
|
||||
{: .notice--info}
|
||||
|
||||
@@ -10,19 +10,19 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
---
|
||||
|
||||
#### Enhancements
|
||||
- Support 4-bytes RES in NAS Auth ([#147](https://github.com/acetcom/nextepc/issues/147)) -- [Ranjjiitsingh](https://github.com/Ranjjiitsingh)
|
||||
- Add SGW selection mode ([#100](https://github.com/acetcom/nextepc/pull/100)) -- [TerryAlu](https://github.com/TerryAlu)
|
||||
- Support 4-bytes RES in NAS Auth ([#147](https://github.com/open5gs/nextepc/issues/147)) -- [Ranjjiitsingh](https://github.com/Ranjjiitsingh)
|
||||
- Add SGW selection mode ([#100](https://github.com/open5gs/nextepc/pull/100)) -- [TerryAlu](https://github.com/TerryAlu)
|
||||
|
||||
#### Bug fixes
|
||||
- Increase packet memory buffer ([#161](https://github.com/acetcom/nextepc/issues/161)) -- [mathieuxilan](https://github.com/mathieuxilan)
|
||||
- Fix setting END-ID to 0 ([#156](https://github.com/acetcom/nextepc/issues/156)) -- [hypercloud2017](https://github.com/hypercloud2017)
|
||||
- Fix incorrect timezone in NAS & GTP ([#140](https://github.com/acetcom/nextepc/issues/140)) -- [EugeneBogush](https://github.com/EugeneBogush)
|
||||
- Increase packet memory buffer ([#161](https://github.com/open5gs/nextepc/issues/161)) -- [mathieuxilan](https://github.com/mathieuxilan)
|
||||
- Fix setting END-ID to 0 ([#156](https://github.com/open5gs/nextepc/issues/156)) -- [hypercloud2017](https://github.com/hypercloud2017)
|
||||
- Fix incorrect timezone in NAS & GTP ([#140](https://github.com/open5gs/nextepc/issues/140)) -- [EugeneBogush](https://github.com/EugeneBogush)
|
||||
|
||||
#### Miscellaneous
|
||||
- nas_message.py: Fix copy+paste error([#159](https://github.com/acetcom/nextepc/issues/159)) -- [laf0rge](https://github.com/laf0rge)
|
||||
- Fix missing 'break' statement ([#129](https://github.com/acetcom/nextepc/pull/129)) -- [EugeneBogush](https://github.com/EugeneBogush)
|
||||
- Add missing C namespace ([#109](https://github.com/acetcom/nextepc/pull/109)) -- [brchiu](https://github.com/brchiu)
|
||||
- nas_message.py: Fix copy+paste error([#159](https://github.com/open5gs/nextepc/issues/159)) -- [laf0rge](https://github.com/laf0rge)
|
||||
- Fix missing 'break' statement ([#129](https://github.com/open5gs/nextepc/pull/129)) -- [EugeneBogush](https://github.com/EugeneBogush)
|
||||
- Add missing C namespace ([#109](https://github.com/open5gs/nextepc/pull/109)) -- [brchiu](https://github.com/brchiu)
|
||||
- Refine EXIT routine for daemon process
|
||||
|
||||
Download -- [v0.3.11.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.11.tar.gz)
|
||||
Download -- [v0.3.11.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.11.tar.gz)
|
||||
{: .notice--info}
|
||||
|
||||
20
docs/_posts/2019-04-29-release-v0.4.0.md
Normal file
20
docs/_posts/2019-04-29-release-v0.4.0.md
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "v0.4.0 - Integration with OGSLib"
|
||||
date: 2019-04-29 23:44:00 +0900
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
- News
|
||||
- Release
|
||||
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
---
|
||||
|
||||
#### Enhancements
|
||||
- Integration with OGSLib
|
||||
- High CPU usage on idle ([#87](https://github.com/open5gs/nextepc/issues/87)) -- [hchenji](https://github.com/hchenji)
|
||||
|
||||
#### Bug fixes
|
||||
- The problem related to MNC of LENGTH 3 ([#163](https://github.com/open5gs/nextepc/issues/163)) -- [Avi-Dekra](https://github.com/Avi-Dekra)
|
||||
|
||||
Download -- [v0.4.0.tar.gz](https://github.com/open5gs/nextepc/archive/v0.4.0.tar.gz)
|
||||
{: .notice--info}
|
||||
24
docs/_posts/2019-05-18-release-v0.4.1.md
Normal file
24
docs/_posts/2019-05-18-release-v0.4.1.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: "v0.4.1 - Bug fixes & minor changes"
|
||||
date: 2019-05-18 19:06:00 +0900
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
- News
|
||||
- Release
|
||||
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
---
|
||||
|
||||
#### Minor changes
|
||||
- Rearrange the initialization order [[2d74383](https://github.com/open5gs/nextepc/commit/2d7438313d7426ca3ad4591f090b7f8564257fb7)]
|
||||
- Remove ____DATE____ and ____TIME____ from all source code to make the same binary. [[c8ed909](https://github.com/open5gs/nextepc/commit/c8ed909f4680225490ac23d2d56e7d8f8112d6f6)]
|
||||
- Improve sanity checks when queues cannot be pushed [[bc180c3](https://github.com/open5gs/nextepc/commit/bc180c3ffc431a06a49e0de1af71098fd91d561b)]
|
||||
- Update document to correct typo ([#176](https://github.com/open5gs/nextepc/issues/176)) -- [iman432](https://github.com/iman432)
|
||||
- Add UE address to LOG ([#178](https://github.com/open5gs/nextepc/pull/178)) -- [medeiros405](https://github.com/medeiros405)
|
||||
|
||||
#### Bug fixes
|
||||
- Fix CentOS compilation errors and segmentation fault in test programs ([#175](https://github.com/open5gs/nextepc/issues/175)) -- [fefer](https://github.com/fefer)
|
||||
- Modify the test program on MacOSX [ab81e38](https://github.com/open5gs/nextepc/commit/ab81e384879fdf51c667344fc8be912254dbec75)
|
||||
|
||||
Download -- [v0.4.1.tar.gz](https://github.com/open5gs/nextepc/archive/v0.4.1.tar.gz)
|
||||
{: .notice--info}
|
||||
20
docs/_posts/2019-05-28-release-v0.4.2.md
Normal file
20
docs/_posts/2019-05-28-release-v0.4.2.md
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "v0.4.2 - Support a different APN for each PGW"
|
||||
date: 2019-05-28 21:13:00 +0900
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
- News
|
||||
- Release
|
||||
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
---
|
||||
|
||||
#### Enhancement
|
||||
- Support a different APN for each PGW ([#183](https://github.com/open5gs/nextepc/issues/183))
|
||||
- Attach Reject for an invalid APN name ([#187](https://github.com/open5gs/nextepc/issues/187)) -- [ravens](https://github.com/ravens)
|
||||
|
||||
#### Bug fixes
|
||||
- Fix the PIDFile path of the systemd service ([#182](https://github.com/open5gs/nextepc/issues/182)) -- [smoein](https://github.com/smoein)
|
||||
|
||||
Download -- [v0.4.2.tar.gz](https://github.com/open5gs/nextepc/archive/v0.4.2.tar.gz)
|
||||
{: .notice--info}
|
||||
21
docs/_posts/2019-06-22-release-v0.4.3.md
Normal file
21
docs/_posts/2019-06-22-release-v0.4.3.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "v0.4.3 - Enable SCTP_NODELAY"
|
||||
date: 2019-06-22 16:42:00 +0900
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
- News
|
||||
- Release
|
||||
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
---
|
||||
|
||||
#### Enhancement
|
||||
- Adjust the size of memory pool for SGW buffering ([#190](https://github.com/open5gs/nextepc/issues/190)) -- [lezixiao](https://github.com/lezixiao)
|
||||
|
||||
#### Bug fixes
|
||||
- Enable SCTP_NODELAY and Fix the assertion ([#198](https://github.com/open5gs/nextepc/issues/198)) -- [lezixiao](https://github.com/lezixiao)
|
||||
- Fix the assertion of handling a freeDiameter session ([#195](https://github.com/open5gs/nextepc/issues/195)) -- [lezixiao](https://github.com/lezixiao)
|
||||
- Fix PGW coredump when GTP-U packet cannot find BEARER by TEID ([#194](https://github.com/open5gs/nextepc/issues/194)) -- [lezixiao](https://github.com/lezixiao)
|
||||
|
||||
Download -- [v0.4.3.tar.gz](https://github.com/open5gs/nextepc/archive/v0.4.3.tar.gz)
|
||||
{: .notice--info}
|
||||
22
docs/_posts/2019-06-30-release-v0.4.4.md
Normal file
22
docs/_posts/2019-06-30-release-v0.4.4.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: "v0.4.4 - The Multiple Attachment for same IMSI"
|
||||
date: 2019-06-30 22:48:00 +0900
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
- News
|
||||
- Release
|
||||
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
---
|
||||
|
||||
#### Bug fixes
|
||||
- Move enb_ostream_id from mme_ue to enb_ue context ([#206](https://github.com/open5gs/nextepc/issues/206)) -- [lezixiao](https://github.com/lezixiao)
|
||||
- Fix the MME crash EMM status following Initial Context Setup Response ([#205](https://github.com/open5gs/nextepc/issues/205)) -- [lezixiao](https://github.com/lezixiao)
|
||||
- Fix the SGW crash for "Context Not Found" ([#204](https://github.com/open5gs/nextepc/issues/204)) -- [lezixiao](https://github.com/lezixiao)
|
||||
- Fix the Multiple Attachment for same IMSI ([#203](https://github.com/open5gs/nextepc/issues/203)) -- [lezixiao](https://github.com/lezixiao)
|
||||
- Add Handler of the Service Request and TAU Request in Security-mode state ([#202](https://github.com/open5gs/nextepc/issues/202)) -- [lezixiao](https://github.com/lezixiao)
|
||||
- Fix Service reject handler ([#201](https://github.com/open5gs/nextepc/issues/201)) -- [lezixiao](https://github.com/lezixiao)
|
||||
- Clear resources when SCTP-send failed ([#200](https://github.com/open5gs/nextepc/issues/200)) -- [lezixiao](https://github.com/lezixiao)
|
||||
|
||||
Download -- [v0.4.4.tar.gz](https://github.com/open5gs/nextepc/archive/v0.4.4.tar.gz)
|
||||
{: .notice--info}
|
||||
27
docs/_posts/2019-07-11-release-v0.5.0.md
Normal file
27
docs/_posts/2019-07-11-release-v0.5.0.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
title: "v0.5.0 - CS Fallback Supported"
|
||||
date: 2019-07-12 00:17:00 +0900
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
- News
|
||||
- Release
|
||||
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
---
|
||||
|
||||
#### New Features
|
||||
- CS Fallback Supported
|
||||
|
||||
#### Enhancements
|
||||
- package naming doesn't follow usual package naming conventions ([OGSLIB-#1](https://github.com/open5gs/ogslib/issues/1)) -- [laf0rge](https://github.com/laf0rge)
|
||||
|
||||
#### Standard Compliant
|
||||
- Missing mandatory IE in GTPv2 ([#215](https://github.com/open5gs/nextepc/issues/215)) -- [tasai511](https://github.com/tasai511)
|
||||
|
||||
#### Bug fixes
|
||||
- Fix Security Command Reject ([#214](https://github.com/open5gs/nextepc/issues/214)) -- [lezixiao](https://github.com/lezixiao)
|
||||
- docker-compose build fails, missing ogslib-dev ([#211](https://github.com/open5gs/nextepc/issues/211)) -- [mrlnc](https://github.com/mrlnc)
|
||||
- freeDiameter: Fix compilation of SCTP_SEND_FAILED_EVENT ([#211](https://github.com/open5gs/nextepc/pull/211)) -- [laf0rge](https://github.com/laf0rge)
|
||||
|
||||
Download -- [v0.5.0.tar.gz](https://github.com/open5gs/nextepc/archive/v0.5.0.tar.gz)
|
||||
{: .notice--info}
|
||||
Binary file not shown.
@@ -10,7 +10,7 @@
|
||||
#
|
||||
|
||||
PACKAGE="nextepc"
|
||||
VERSION="0.3.9"
|
||||
VERSION="0.5.1"
|
||||
|
||||
print_status() {
|
||||
echo
|
||||
|
||||
@@ -1127,12 +1127,11 @@ ASN_MODULE_CFLAGS=
|
||||
pkglib_LTLIBRARIES=libasn1c.la
|
||||
libasn1c_la_SOURCES= \
|
||||
$(ASN_MODULE_SRCS) $(ASN_MODULE_HDRS) \
|
||||
s1ap_asn1c.h s1ap_message.h \
|
||||
s1ap_decoder.c s1ap_encoder.c s1ap_free.c \
|
||||
s1ap-asn1c.h s1ap-message.h \
|
||||
s1ap-decoder.c s1ap-encoder.c s1ap-free.c \
|
||||
$(NULL)
|
||||
|
||||
libasn1c_la_DEPENDENCIES = \
|
||||
@OGSCORE_LIBS@ \
|
||||
$(top_srcdir)/lib/base/libbase.la \
|
||||
$(NULL)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "s1ap_message.h"
|
||||
#include "s1ap-message.h"
|
||||
|
||||
#undef OGS_LOG_DOMAIN
|
||||
#define OGS_LOG_DOMAIN __base_s1ap_domain
|
||||
@@ -35,9 +35,9 @@ int s1ap_decode_pdu(s1ap_message_t *message, ogs_pkbuf_t *pkbuf)
|
||||
dec_ret = aper_decode(NULL, &asn_DEF_S1AP_S1AP_PDU, (void **)&message,
|
||||
pkbuf->data, pkbuf->len, 0, 0);
|
||||
|
||||
if (dec_ret.code != RC_OK)
|
||||
{
|
||||
ogs_error("Failed to decode S1AP-PDU[%d]", dec_ret.code);
|
||||
if (dec_ret.code != RC_OK) {
|
||||
ogs_warn("Failed to decode S1AP-PDU[code:%d,consumed:%d]",
|
||||
dec_ret.code, dec_ret.consumed);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "s1ap_message.h"
|
||||
#include "s1ap-message.h"
|
||||
|
||||
#undef OGS_LOG_DOMAIN
|
||||
#define OGS_LOG_DOMAIN __base_s1ap_domain
|
||||
@@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "s1ap_message.h"
|
||||
#include "s1ap-message.h"
|
||||
|
||||
#undef OGS_LOG_DOMAIN
|
||||
#define OGS_LOG_DOMAIN __base_s1ap_domain
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "ogs-core.h"
|
||||
#include "base/types.h"
|
||||
#include "base/context.h"
|
||||
#include "s1ap_asn1c.h"
|
||||
#include "s1ap-asn1c.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -35,7 +35,7 @@ extern "C" {
|
||||
ogs_assert((__dATA)); \
|
||||
if ((__dATA)->buf) \
|
||||
{ \
|
||||
ogs_free((__dATA)->buf); \
|
||||
FREEMEM((__dATA)->buf); \
|
||||
(__dATA)->buf = NULL; \
|
||||
(__dATA)->size = 0; \
|
||||
} \
|
||||
@@ -47,7 +47,7 @@ extern "C" {
|
||||
ogs_assert((__dST)); \
|
||||
S1AP_CLEAR_DATA(__dST); \
|
||||
(__dST)->size = (__sRC)->size; \
|
||||
(__dST)->buf = ogs_calloc((__dST)->size, sizeof(uint8_t)); \
|
||||
(__dST)->buf = CALLOC((__dST)->size, sizeof(uint8_t)); \
|
||||
memcpy((__dST)->buf, (__sRC)->buf, (__dST)->size); \
|
||||
} while(0)
|
||||
|
||||
@@ -9,7 +9,6 @@ libbase_la_SOURCES = \
|
||||
$(NULL)
|
||||
|
||||
libbase_la_DEPENDENCIES = \
|
||||
@OGSCORE_LIBS@ \
|
||||
$(NULL)
|
||||
|
||||
libbase_la_LIBADD = \
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
#define PLMN_ID_DIGIT2(x) (((x) / 10) % 10)
|
||||
#define PLMN_ID_DIGIT3(x) ((x) % 10)
|
||||
|
||||
uint32_t plmn_id_hexdump(plmn_id_t *plmn_id)
|
||||
uint32_t plmn_id_hexdump(void *plmn_id)
|
||||
{
|
||||
uint32_t hex;
|
||||
ogs_assert(plmn_id);
|
||||
memcpy(&hex, plmn_id, sizeof *plmn_id);
|
||||
memcpy(&hex, plmn_id, sizeof(plmn_id_t));
|
||||
hex = ntohl(hex) >> 8;
|
||||
return hex;
|
||||
}
|
||||
@@ -64,19 +64,15 @@ void *plmn_id_build(plmn_id_t *plmn_id,
|
||||
return plmn_id;
|
||||
}
|
||||
|
||||
int apn_build(char *dst, char *src, int length)
|
||||
int fqdn_build(char *dst, char *src, int length)
|
||||
{
|
||||
int i = 0, j = 0;
|
||||
|
||||
for (i = 0, j = 0; i < length; i++, j++)
|
||||
{
|
||||
if (src[i] == '.')
|
||||
{
|
||||
for (i = 0, j = 0; i < length; i++, j++) {
|
||||
if (src[i] == '.') {
|
||||
dst[i-j] = j;
|
||||
j = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
dst[i+1] = src[i];
|
||||
}
|
||||
}
|
||||
@@ -85,13 +81,12 @@ int apn_build(char *dst, char *src, int length)
|
||||
return length+1;
|
||||
}
|
||||
|
||||
int apn_parse(char *dst, char *src, int length)
|
||||
int fqdn_parse(char *dst, char *src, int length)
|
||||
{
|
||||
int i = 0, j = 0;
|
||||
uint8_t len = 0;
|
||||
|
||||
do
|
||||
{
|
||||
do {
|
||||
len = src[i++];
|
||||
memcpy(&dst[j], &src[i], len);
|
||||
|
||||
@@ -102,7 +97,7 @@ int apn_parse(char *dst, char *src, int length)
|
||||
dst[j++] = '.';
|
||||
else
|
||||
dst[j] = 0;
|
||||
} while(i < length);
|
||||
} while (i < length);
|
||||
|
||||
return j;
|
||||
}
|
||||
@@ -125,8 +120,7 @@ int pco_parse(pco_t *pco, void *data, int data_len)
|
||||
pco->configuration_protocol = source->configuration_protocol;
|
||||
size++;
|
||||
|
||||
while(size < data_len && i < MAX_NUM_OF_PROTOCOL_OR_CONTAINER_ID)
|
||||
{
|
||||
while(size < data_len && i < MAX_NUM_OF_PROTOCOL_OR_CONTAINER_ID) {
|
||||
pco_id_t *id = &pco->ids[i];
|
||||
ogs_assert(size + sizeof(id->id) <= data_len);
|
||||
memcpy(&id->id, data + size, sizeof(id->id));
|
||||
@@ -164,8 +158,7 @@ int pco_build(void *data, int data_len, pco_t *pco)
|
||||
size += 1;
|
||||
|
||||
ogs_assert(target.num_of_id <= MAX_NUM_OF_PROTOCOL_OR_CONTAINER_ID);
|
||||
for (i = 0; i < target.num_of_id; i++)
|
||||
{
|
||||
for (i = 0; i < target.num_of_id; i++) {
|
||||
pco_id_t *id = &target.ids[i];
|
||||
|
||||
ogs_assert(size + sizeof(id->id) <= data_len);
|
||||
@@ -184,4 +177,3 @@ int pco_build(void *data, int data_len, pco_t *pco)
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,47 +29,38 @@ extern "C" {
|
||||
#define S1AP_SCTP_PORT 36412
|
||||
#define GTPV2_C_UDP_PORT 2123
|
||||
#define GTPV1_U_UDP_PORT 2152
|
||||
#define SGSAP_SCTP_PORT 29118
|
||||
|
||||
#define SCTP_S1AP_PPID 18
|
||||
#define SCTP_X2AP_PPID 27
|
||||
#define SCTP_SGSAP_PPID 0
|
||||
|
||||
#define MAX_NUM_OF_SGW 32
|
||||
#define MAX_NUM_OF_PGW 32
|
||||
|
||||
#define MAX_NUM_OF_ENB 128
|
||||
#define MAX_NUM_OF_UE 128
|
||||
#define MAX_NUM_OF_SESS 4
|
||||
#define MAX_NUM_OF_BEARER 4
|
||||
#define MAX_NUM_OF_SESS 4 /* Num of APN(Session) per UE */
|
||||
#define MAX_NUM_OF_BEARER 4 /* Num of Bearer per APN(Session) */
|
||||
#define MAX_NUM_OF_TUNNEL 3 /* Num of Tunnel per Bearer */
|
||||
#define MAX_NUM_OF_PF 16 /* Num of Packet Filter per Bearer */
|
||||
|
||||
#define MAX_POOL_OF_UE (MAX_NUM_OF_ENB * MAX_NUM_OF_UE)
|
||||
#define MAX_POOL_OF_SESS (MAX_POOL_OF_UE * MAX_NUM_OF_SESS)
|
||||
#define MAX_POOL_OF_BEARER (MAX_POOL_OF_SESS * MAX_NUM_OF_BEARER)
|
||||
#define MAX_POOL_OF_TUNNEL (MAX_POOL_OF_BEARER * MAX_NUM_OF_TUNNEL)
|
||||
#define MAX_POOL_OF_PF (MAX_POOL_OF_BEARER * MAX_NUM_OF_PF)
|
||||
#define MAX_POOL_OF_DIAMETER_SESS (MAX_POOL_OF_UE * MAX_NUM_OF_SESS)
|
||||
|
||||
#define MAX_NUM_OF_HOSTNAME 16
|
||||
#define MAX_NUM_OF_PCC_RULE 8
|
||||
#define MAX_NUM_OF_FLOW 8 /* Num of Flow per PCC Rule */
|
||||
#define MAX_NUM_OF_PACKET_FILTER 16 /* Num of Packet Filter per Bearer */
|
||||
|
||||
#define MAX_SDU_LEN 8192
|
||||
#define PLMN_ID_LEN 3
|
||||
#define MAX_SDU_LEN 8192
|
||||
#define PLMN_ID_LEN 3
|
||||
|
||||
#define BCD_TO_BUFFER_LEN(x) (((x)+1)/2)
|
||||
#define MAX_IMSI_BCD_LEN 15
|
||||
#define MAX_IMSI_LEN BCD_TO_BUFFER_LEN(MAX_IMSI_BCD_LEN)
|
||||
#define BCD_TO_BUFFER_LEN(x) (((x)+1)/2)
|
||||
#define MAX_IMSI_BCD_LEN 15
|
||||
#define MAX_IMSI_LEN BCD_TO_BUFFER_LEN(MAX_IMSI_BCD_LEN)
|
||||
|
||||
#define RAND_LEN 16
|
||||
#define AUTN_LEN 16
|
||||
#define AUTS_LEN 14
|
||||
#define MAX_RES_LEN 16
|
||||
#define RAND_LEN 16
|
||||
#define AUTN_LEN 16
|
||||
#define AUTS_LEN 14
|
||||
#define MAX_RES_LEN 16
|
||||
|
||||
#define MAX_APN_LEN 100
|
||||
#define MAX_PCO_LEN 251
|
||||
#define MAX_FILEPATH_LEN 256
|
||||
#define MAX_APN_LEN 100
|
||||
#define MAX_PCO_LEN 251
|
||||
#define MAX_FILEPATH_LEN 256
|
||||
#define MAX_FQDN_LEN 256
|
||||
|
||||
#define NEXT_ID(__id, __min, __max) \
|
||||
((__id) = ((__id) == (__max) ? (__min) : ((__id) + 1)))
|
||||
@@ -82,7 +73,7 @@ extern "C" {
|
||||
|
||||
/**********************************
|
||||
* PLMN_ID Structure */
|
||||
typedef struct _plmn_id_t {
|
||||
typedef struct plmn_id_s {
|
||||
ED2(uint8_t mcc2:4;,
|
||||
uint8_t mcc1:4;)
|
||||
ED2(uint8_t mnc1:4;,
|
||||
@@ -91,7 +82,7 @@ ED2(uint8_t mnc3:4;,
|
||||
uint8_t mnc2:4;)
|
||||
} __attribute__ ((packed)) plmn_id_t;
|
||||
|
||||
uint32_t plmn_id_hexdump(plmn_id_t *plmn_id);
|
||||
uint32_t plmn_id_hexdump(void *plmn_id);
|
||||
|
||||
uint16_t plmn_id_mcc(plmn_id_t *plmn_id);
|
||||
uint16_t plmn_id_mnc(plmn_id_t *plmn_id);
|
||||
@@ -102,12 +93,12 @@ void *plmn_id_build(plmn_id_t *plmn_id,
|
||||
|
||||
#define MAX_NUM_OF_TAI 16
|
||||
|
||||
typedef struct _tai_t {
|
||||
typedef struct tai_s {
|
||||
plmn_id_t plmn_id;
|
||||
uint16_t tac;
|
||||
} __attribute__ ((packed)) tai_t;
|
||||
|
||||
typedef struct _e_cgi_t {
|
||||
typedef struct e_cgi_s {
|
||||
plmn_id_t plmn_id;
|
||||
uint32_t cell_id; /* 28 bit */
|
||||
} __attribute__ ((packed)) e_cgi_t;
|
||||
@@ -119,7 +110,7 @@ typedef struct _e_cgi_t {
|
||||
#define IPV4_LEN 4
|
||||
#define IPV6_LEN 16
|
||||
#define IPV4V6_LEN 20
|
||||
typedef struct _ip_t {
|
||||
typedef struct ip_s {
|
||||
union {
|
||||
uint32_t addr;
|
||||
uint8_t addr6[IPV6_LEN];
|
||||
@@ -139,7 +130,7 @@ ED3(uint8_t ipv4:1;,
|
||||
#define PAA_IPV4_LEN 5
|
||||
#define PAA_IPV6_LEN 18
|
||||
#define PAA_IPV4V6_LEN 22
|
||||
typedef struct _paa_t {
|
||||
typedef struct paa_s {
|
||||
/* 8.34 PDN Type */
|
||||
#define GTP_PDN_TYPE_IPV4 1
|
||||
#define GTP_PDN_TYPE_IPV6 2
|
||||
@@ -174,14 +165,14 @@ ED2(uint8_t spare:5;,
|
||||
|
||||
#define MAX_BIT_RATE 10000000000UL
|
||||
|
||||
typedef struct _bitrate_t {
|
||||
typedef struct bitrate_s {
|
||||
uint64_t downlink; /* bits per seconds */
|
||||
uint64_t uplink; /* bits per seconds */
|
||||
} bitrate_t;
|
||||
|
||||
/**********************************
|
||||
* QoS Structure */
|
||||
typedef struct _qos_t {
|
||||
typedef struct qos_s {
|
||||
#define PDN_QCI_1 1
|
||||
#define PDN_QCI_2 2
|
||||
#define PDN_QCI_3 3
|
||||
@@ -195,21 +186,21 @@ typedef struct _qos_t {
|
||||
#define PDN_QCI_66 66
|
||||
#define PDN_QCI_69 69
|
||||
#define PDN_QCI_70 70
|
||||
uint8_t qci;
|
||||
uint8_t qci;
|
||||
|
||||
struct {
|
||||
/* Values 1 to 8 should only be assigned for services that are
|
||||
* authorized to receive prioritized treatment within an operator domain.
|
||||
* Values 9 to 15 may be assigned to resources that are authorized
|
||||
* by the home network and thus applicable when a UE is roaming. */
|
||||
uint8_t priority_level;
|
||||
uint8_t priority_level;
|
||||
|
||||
#define PDN_PRE_EMPTION_CAPABILITY_ENABLED 0
|
||||
#define PDN_PRE_EMPTION_CAPABILITY_DISABLED 1
|
||||
uint8_t pre_emption_capability;
|
||||
uint8_t pre_emption_capability;
|
||||
#define PDN_PRE_EMPTION_VULNERABILITY_ENABLED 0
|
||||
#define PDN_PRE_EMPTION_VULNERABILITY_DISABLED 1
|
||||
uint8_t pre_emption_vulnerability;
|
||||
uint8_t pre_emption_vulnerability;
|
||||
} arp;
|
||||
|
||||
bitrate_t mbr; /* Maxmimum Bit Rate (MBR) */
|
||||
@@ -220,7 +211,7 @@ typedef struct _qos_t {
|
||||
* Flow Structure */
|
||||
#define FLOW_DOWNLINK_ONLY 1
|
||||
#define FLOW_UPLINK_ONLY 2
|
||||
typedef struct _flow_t {
|
||||
typedef struct flow_s {
|
||||
uint8_t direction;
|
||||
char *description;
|
||||
} flow_t;
|
||||
@@ -237,7 +228,7 @@ typedef struct _flow_t {
|
||||
|
||||
/**********************************
|
||||
* PCC Rule Structure */
|
||||
typedef struct _pcc_rule_t {
|
||||
typedef struct pcc_rule_s {
|
||||
#define PCC_RULE_TYPE_INSTALL 1
|
||||
#define PCC_RULE_TYPE_REMOVE 2
|
||||
uint8_t type;
|
||||
@@ -279,14 +270,14 @@ typedef struct _pcc_rule_t {
|
||||
|
||||
/**********************************
|
||||
* PDN Structure */
|
||||
typedef struct _pdn_t {
|
||||
uint32_t context_identifier;
|
||||
char apn[MAX_APN_LEN+1];
|
||||
typedef struct pdn_s {
|
||||
uint32_t context_identifier;
|
||||
char apn[MAX_APN_LEN+1];
|
||||
#define HSS_PDN_TYPE_IPV4 0
|
||||
#define HSS_PDN_TYPE_IPV6 1
|
||||
#define HSS_PDN_TYPE_IPV4V6 2
|
||||
#define HSS_PDN_TYPE_IPV4_OR_IPV6 3
|
||||
int pdn_type;
|
||||
int pdn_type;
|
||||
|
||||
qos_t qos;
|
||||
bitrate_t ambr; /* APN-AMBR */
|
||||
@@ -295,8 +286,8 @@ typedef struct _pdn_t {
|
||||
ip_t pgw_ip;
|
||||
} pdn_t;
|
||||
|
||||
int apn_build(char *dst, char *src, int len);
|
||||
int apn_parse(char *dst, char *src, int len);
|
||||
int fqdn_build(char *dst, char *src, int len);
|
||||
int fqdn_parse(char *dst, char *src, int len);
|
||||
|
||||
/**************************************************
|
||||
* Protocol Configuration Options Structure
|
||||
@@ -314,28 +305,28 @@ int apn_parse(char *dst, char *src, int len);
|
||||
#define PCO_ID_P_CSCF_IPV4_ADDRESS_REQUEST 0x000c
|
||||
#define PCO_ID_DNS_SERVER_IPV4_ADDRESS_REQUEST 0x000d
|
||||
#define PCO_ID_IPV4_LINK_MTU_REQUEST 0x0010
|
||||
typedef struct _pco_ipcp_options_t {
|
||||
typedef struct pco_ipcp_options_s {
|
||||
uint8_t type;
|
||||
uint8_t len;
|
||||
uint32_t addr;
|
||||
} __attribute__ ((packed)) pco_ipcp_options_t;
|
||||
|
||||
#define PCO_MAX_NUM_OF_IPCO_OPTIONS 4
|
||||
typedef struct _pco_ipcp_t {
|
||||
typedef struct pco_ipcp_s {
|
||||
uint8_t code;
|
||||
uint8_t identifier;
|
||||
uint16_t len;
|
||||
pco_ipcp_options_t options[PCO_MAX_NUM_OF_IPCO_OPTIONS];
|
||||
} __attribute__ ((packed)) pco_ipcp_t;
|
||||
|
||||
typedef struct _pco_id_t {
|
||||
typedef struct pco_id_s {
|
||||
uint16_t id;
|
||||
uint8_t len;
|
||||
void *data;
|
||||
} pco_id_t;
|
||||
|
||||
#define MAX_NUM_OF_PROTOCOL_OR_CONTAINER_ID 8
|
||||
typedef struct _pco_t {
|
||||
typedef struct pco_s {
|
||||
ED3(uint8_t ext:1;,
|
||||
uint8_t spare:4;,
|
||||
uint8_t configuration_protocol:3;)
|
||||
|
||||
@@ -18,21 +18,20 @@
|
||||
pkglib_LTLIBRARIES = libfd.la
|
||||
|
||||
libfd_la_SOURCES = \
|
||||
fd_message.h fd_logger.h fd_lib.h \
|
||||
libapp_sip.c fd_message.c fd_logger.c fd_config.c fd_init.c \
|
||||
fd-message.h fd-logger.h fd-lib.h \
|
||||
libapp_sip.c fd-message.c fd-logger.c fd-config.c fd-init.c \
|
||||
\
|
||||
s6a/s6a_dict.h s6a/s6a_message.h \
|
||||
s6a/dict_init.c \
|
||||
s6a/s6a-dict.h s6a/s6a-message.h \
|
||||
s6a/dict-init.c \
|
||||
\
|
||||
gx/gx_dict.h gx/gx_message.h \
|
||||
gx/dict_init.c gx/gx_message.c \
|
||||
gx/gx-dict.h gx/gx-message.h \
|
||||
gx/dict-init.c gx/gx-message.c \
|
||||
\
|
||||
rx/rx_dict.h rx/rx_message.h \
|
||||
rx/dict_init.c rx/rx_message.c \
|
||||
rx/rx-dict.h rx/rx-message.h \
|
||||
rx/dict-init.c rx/rx-message.c \
|
||||
$(NULL)
|
||||
|
||||
libfd_la_DEPENDENCIES = \
|
||||
@OGSCORE_LIBS@ \
|
||||
$(top_srcdir)/lib/@FREEDIAMETER_DIR@/libfdcore/libfdcore.la \
|
||||
$(top_srcdir)/lib/@FREEDIAMETER_DIR@/libfdproto/libfdproto.la \
|
||||
$(top_srcdir)/lib/base/libbase.la \
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "fd_lib.h"
|
||||
#include "fd-lib.h"
|
||||
|
||||
#undef OGS_LOG_DOMAIN
|
||||
#define OGS_LOG_DOMAIN __base_fd_domain
|
||||
@@ -77,8 +77,8 @@ static int fd_config_apply(fd_config_t *fd_config)
|
||||
memset(&fddpi, 0, sizeof(fddpi));
|
||||
fddpi.config.pic_flags.persist = PI_PRST_ALWAYS;
|
||||
fddpi.config.pic_flags.pro3 = PI_P3_IP;
|
||||
fddpi.config.pic_flags.pro4 = PI_P4_TCP;
|
||||
fddpi.config.pic_flags.alg = PI_ALGPREF_TCP;
|
||||
fddpi.config.pic_flags.pro4 = PI_P4_DEFAULT;
|
||||
fddpi.config.pic_flags.alg = PI_ALGPREF_SCTP;
|
||||
fddpi.config.pic_flags.sec |= PI_SEC_NONE;
|
||||
|
||||
fddpi.config.pic_port = fd_config->conn[i].port;
|
||||
@@ -16,8 +16,9 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "fd_logger.h"
|
||||
#include "fd_lib.h"
|
||||
|
||||
#include "fd-logger.h"
|
||||
#include "fd-lib.h"
|
||||
|
||||
#undef OGS_LOG_DOMAIN
|
||||
#define OGS_LOG_DOMAIN __base_fd_domain
|
||||
@@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __FD_LIB_H__
|
||||
#define __FD_LIB_H__
|
||||
#ifndef FD_LIB_H
|
||||
#define FD_LIB_H
|
||||
|
||||
#include "ogs-core.h"
|
||||
|
||||
@@ -27,16 +27,16 @@
|
||||
|
||||
#include "base/context.h"
|
||||
|
||||
#include "fd_message.h"
|
||||
#include "fd_logger.h"
|
||||
#include "fd-message.h"
|
||||
#include "fd-logger.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
/* This is default diameter configuration if there is no config file
|
||||
* The Configuration : No TLS, Only TCP */
|
||||
typedef struct _fd_config_t {
|
||||
typedef struct fd_config_s {
|
||||
/* Diameter Identity of the local peer (FQDN -- ASCII) */
|
||||
const char *cnf_diamid;
|
||||
/* Diameter realm of the local peer, default to realm part of cnf_diamid */
|
||||
@@ -81,6 +81,6 @@ int fd_avp_search_avp ( struct avp * groupedavp,
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* ! __FD_LIB_H__ */
|
||||
#endif /* FD_LIB_H */
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "ogs-core.h"
|
||||
#include "base/context.h"
|
||||
#include "fd_logger.h"
|
||||
#include "fd-logger.h"
|
||||
|
||||
#undef OGS_LOG_DOMAIN
|
||||
#define OGS_LOG_DOMAIN __base_fd_domain
|
||||
@@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __FD_LOGGER_H__
|
||||
#define __FD_LOGGER_H__
|
||||
#ifndef FD_LOGGER_H
|
||||
#define FD_LOGGER_H
|
||||
|
||||
#include "ogs-core.h"
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
struct fd_logger_t {
|
||||
|
||||
@@ -65,6 +65,6 @@ void fd_logger_unregister();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* ! __FD_LOGGER_H__ */
|
||||
#endif /* FD_LOGGER_H */
|
||||
@@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "fd_message.h"
|
||||
#include "fd-message.h"
|
||||
|
||||
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
|
||||
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
|
||||
@@ -17,15 +17,15 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __FD_MESSAGE_H__
|
||||
#define __FD_MESSAGE_H__
|
||||
#ifndef FD_MESSAGE_H
|
||||
#define FD_MESSAGE_H
|
||||
|
||||
#include "freeDiameter/freeDiameter-host.h"
|
||||
#include "freeDiameter/libfdcore.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#define FD_AVP_CODE_FRAME_IP_ADDRESS 8
|
||||
#define FD_AVP_CODE_FRAME_IPV6_PREFIX 97
|
||||
@@ -73,6 +73,6 @@ int fd_message_vendor_specific_appid_set(struct msg *msg, uint32_t app_id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* ! __FD_MESSAGE_H__ */
|
||||
#endif /* FD_MESSAGE_H */
|
||||
@@ -18,7 +18,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gx_dict.h"
|
||||
#include "gx-dict.h"
|
||||
|
||||
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
|
||||
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
|
||||
@@ -17,15 +17,15 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GX_DICT_H__
|
||||
#define __GX_DICT_H__
|
||||
#ifndef GX_DICT_H
|
||||
#define GX_DICT_H
|
||||
|
||||
#include "freeDiameter/freeDiameter-host.h"
|
||||
#include "freeDiameter/libfdcore.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#define GX_APPLICATION_ID 16777238
|
||||
|
||||
@@ -130,6 +130,6 @@ int gx_dict_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* __GX_DICT_H__ */
|
||||
#endif /* GX_DICT_H */
|
||||
@@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gx_message.h"
|
||||
#include "gx-message.h"
|
||||
|
||||
void gx_message_free(gx_message_t *gx_message)
|
||||
{
|
||||
@@ -17,19 +17,19 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GX_MESSAGE_H__
|
||||
#define __GX_MESSAGE_H__
|
||||
#ifndef GX_MESSAGE_H
|
||||
#define GX_MESSAGE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#include "base/types.h"
|
||||
|
||||
typedef struct _gx_message_t {
|
||||
#define GX_CMD_CODE_CREDIT_CONTROL 272
|
||||
#define GX_CMD_RE_AUTH 258
|
||||
uint16_t cmd_code;
|
||||
uint16_t cmd_code;
|
||||
|
||||
/* Experimental-Result-Codes */
|
||||
#define GX_DIAMETER_ERROR_LATE_OVERLAPPING_REQUEST 5453
|
||||
@@ -42,13 +42,13 @@ typedef struct _gx_message_t {
|
||||
#define GX_DIAMETER_ERROR_CONFLICTING_REQUEST 5147
|
||||
#define GX_DIAMETER_ADC_RULE_EVENT 5148
|
||||
#define GX_DIAMETER_ERROR_NBIFOM_NOT_AUTHORIZED 5149
|
||||
uint32_t result_code;
|
||||
uint32_t result_code;
|
||||
|
||||
#define GX_CC_REQUEST_TYPE_INITIAL_REQUEST 1
|
||||
#define GX_CC_REQUEST_TYPE_UPDATE_REQUEST 2
|
||||
#define GX_CC_REQUEST_TYPE_TERMINATION_REQUEST 3
|
||||
#define GX_CC_REQUEST_TYPE_EVENT_REQUEST 4
|
||||
uint32_t cc_request_type;
|
||||
uint32_t cc_request_type;
|
||||
|
||||
pdn_t pdn;
|
||||
pcc_rule_t pcc_rule[MAX_NUM_OF_PCC_RULE];
|
||||
@@ -59,6 +59,6 @@ void gx_message_free(gx_message_t *gx_message);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* __GX_MESSAGE_H__ */
|
||||
#endif /* GX_MESSAGE_H */
|
||||
@@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "rx_dict.h"
|
||||
#include "rx-dict.h"
|
||||
|
||||
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
|
||||
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
|
||||
@@ -17,15 +17,15 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __RX_DICT_H__
|
||||
#define __RX_DICT_H__
|
||||
#ifndef RX_DICT_H
|
||||
#define RX_DICT_H
|
||||
|
||||
#include "freeDiameter/freeDiameter-host.h"
|
||||
#include "freeDiameter/libfdcore.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#define RX_APPLICATION_ID 16777236
|
||||
|
||||
@@ -126,6 +126,6 @@ int rx_dict_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* __RX_DICT_H__ */
|
||||
#endif /* RX_DICT_H */
|
||||
@@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "rx_message.h"
|
||||
#include "rx-message.h"
|
||||
|
||||
void rx_message_free(rx_message_t *rx_message)
|
||||
{
|
||||
@@ -17,12 +17,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __RX_MESSAGE_H__
|
||||
#define __RX_MESSAGE_H__
|
||||
#ifndef RX_MESSAGE_H
|
||||
#define RX_MESSAGE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#include "base/types.h"
|
||||
|
||||
@@ -85,6 +85,6 @@ void rx_message_free(rx_message_t *rx_message);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* __RX_MESSAGE_H__ */
|
||||
#endif /* RX_MESSAGE_H */
|
||||
@@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "s6a_dict.h"
|
||||
#include "s6a-dict.h"
|
||||
|
||||
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
|
||||
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
|
||||
@@ -17,15 +17,15 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __S6A_LIB_H__
|
||||
#define __S6A_LIB_H__
|
||||
#ifndef S6A_DICT_H
|
||||
#define S6A_DICT_H
|
||||
|
||||
#include "freeDiameter/freeDiameter-host.h"
|
||||
#include "freeDiameter/libfdcore.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#define S6A_APPLICATION_ID 16777251
|
||||
|
||||
@@ -107,6 +107,6 @@ int s6a_dict_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* ! __S6A_LIB_H__ */
|
||||
#endif /* S6A_DICT_H */
|
||||
@@ -17,23 +17,23 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __S6A_MESSAGE_H__
|
||||
#define __S6A_MESSAGE_H__
|
||||
#ifndef S6A_MESSAGE_H
|
||||
#define S6A_MESSAGE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#include "ogs-crypt.h"
|
||||
|
||||
#include "base/types.h"
|
||||
|
||||
typedef struct _e_utran_vector_t {
|
||||
uint8_t xres[MAX_RES_LEN];
|
||||
uint8_t xres_len;
|
||||
uint8_t kasme[OGS_SHA256_DIGEST_SIZE];
|
||||
uint8_t rand[RAND_LEN];
|
||||
uint8_t autn[AUTN_LEN];
|
||||
uint8_t xres[MAX_RES_LEN];
|
||||
uint8_t xres_len;
|
||||
uint8_t kasme[OGS_SHA256_DIGEST_SIZE];
|
||||
uint8_t rand[RAND_LEN];
|
||||
uint8_t autn[AUTN_LEN];
|
||||
} e_utran_vector_t;
|
||||
|
||||
typedef struct _s6a_aia_message_t {
|
||||
@@ -48,19 +48,21 @@ typedef struct _s6a_subscription_data_t {
|
||||
#define HSS_ACCESS_RESTRICTION_WB_E_UTRAN_NOT_ALLOWED (1<<4)
|
||||
#define HSS_ACCESS_RESTRICTION_HO_TO_NON_3GPP_ACCESS_NOT_ALLOWED (1<<5)
|
||||
#define HSS_ACCESS_RESTRICTION_NB_IOT_NOT_ALLOWED (1<<6)
|
||||
uint32_t access_restriction_data;
|
||||
uint32_t access_restriction_data;
|
||||
#define HSS_SUBSCRIBER_STATUS_SERVICE_GRANTED 0
|
||||
#define HSS_SUBSCRIBER_STATUS_OPERATOR_DETERMINED_BARRING 1
|
||||
uint32_t subscriber_status;
|
||||
uint32_t subscriber_status;
|
||||
#define HSS_NETWORK_ACCESS_MODE_PACKET_AND_CIRCUIT 0
|
||||
#define HSS_NETWORK_ACCESS_MODE_RESERVED 1
|
||||
#define HSS_NETWORK_ACCESS_MODE_ONLY_PACKET 2
|
||||
uint32_t network_access_mode;
|
||||
uint32_t network_access_mode;
|
||||
|
||||
bitrate_t ambr; /* UE-AMBR */
|
||||
uint32_t subscribed_rau_tau_timer; /* unit : minutes */
|
||||
|
||||
uint32_t context_identifier; /* default APN */
|
||||
#define HSS_RAU_TAU_DEFAULT_TIME (12*60) /* 12 min */
|
||||
uint32_t subscribed_rau_tau_timer; /* unit : seconds */
|
||||
|
||||
uint32_t context_identifier; /* default APN */
|
||||
pdn_t pdn[MAX_NUM_OF_SESS];
|
||||
int num_of_pdn;
|
||||
} s6a_subscription_data_t;
|
||||
@@ -68,14 +70,14 @@ typedef struct _s6a_subscription_data_t {
|
||||
typedef struct _s6a_ula_message_t {
|
||||
#define S6A_ULA_FLAGS_SEPARATION_INDICATION (0)
|
||||
#define S6A_ULA_FLAGS_MME_REGISTERED_FOR_SMS (1)
|
||||
uint32_t ula_flags;
|
||||
uint32_t ula_flags;
|
||||
s6a_subscription_data_t subscription_data;
|
||||
} s6a_ula_message_t;
|
||||
|
||||
typedef struct _s6a_message_t {
|
||||
#define S6A_CMD_CODE_UPDATE_LOCATION 316
|
||||
#define S6A_CMD_CODE_AUTHENTICATION_INFORMATION 318
|
||||
uint16_t cmd_code;
|
||||
uint16_t cmd_code;
|
||||
|
||||
/* Experimental Result Code */
|
||||
#define S6A_DIAMETER_AUTHENTICATION_DATA_UNAVAILABLE 4181
|
||||
@@ -85,7 +87,7 @@ typedef struct _s6a_message_t {
|
||||
#define S6A_DIAMETER_ERROR_RAT_NOT_ALLOWED 5421
|
||||
#define S6A_DIAMETER_ERROR_EQUIPMENT_UNKNOWN 5422
|
||||
#define S6A_DIAMETER_ERROR_UNKOWN_SERVING_NODE 5423
|
||||
uint32_t result_code;
|
||||
uint32_t result_code;
|
||||
|
||||
s6a_aia_message_t aia_message;
|
||||
s6a_ula_message_t ula_message;
|
||||
@@ -93,6 +95,6 @@ typedef struct _s6a_message_t {
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* __S6A_MESSAGE_H__ */
|
||||
#endif /* S6A_MESSAGE_H */
|
||||
@@ -48,7 +48,8 @@
|
||||
/* #define OLD_SCTP_SOCKET_API */
|
||||
|
||||
/* Automatically fallback to old API if some of the new symbols are not defined */
|
||||
#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_RECVRCVINFO)) || (!defined(SCTP_SNDINFO)))
|
||||
#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_RECVRCVINFO)) || (!defined(SCTP_SNDINFO)) || \
|
||||
(!defined(SCTP_SEND_FAILED_EVENT)) || (!defined(SCTP_NOTIFICATIONS_STOPPED_EVENT)) )
|
||||
# define OLD_SCTP_SOCKET_API
|
||||
#endif
|
||||
|
||||
@@ -1100,10 +1101,12 @@ ssize_t fd_sctp_sendstrv(struct cnxctx * conn, uint16_t strid, const struct iove
|
||||
hdr->cmsg_type = SCTP_SNDRCV;
|
||||
sndrcv = (struct sctp_sndrcvinfo *)CMSG_DATA(hdr);
|
||||
sndrcv->sinfo_stream = strid;
|
||||
sndrcv->sinfo_ppid = htonl(46);
|
||||
#else /* OLD_SCTP_SOCKET_API */
|
||||
hdr->cmsg_type = SCTP_SNDINFO;
|
||||
sndinf = (struct sctp_sndinfo *)CMSG_DATA(hdr);
|
||||
sndinf->snd_sid = strid;
|
||||
sndinf->snd_ppid = htonl(46);
|
||||
#endif /* OLD_SCTP_SOCKET_API */
|
||||
/* note : we could store other data also, for example in .sinfo_ppid for remote peer or in .sinfo_context for errors. */
|
||||
|
||||
|
||||
@@ -18,14 +18,13 @@
|
||||
pkglib_LTLIBRARIES = libgtp.la
|
||||
|
||||
libgtp_la_SOURCES = \
|
||||
gtp_tlv.h gtp_message.h gtp_types.h gtp_conv.h \
|
||||
gtp_node.h gtp_path.h gtp_xact.h \
|
||||
gtp_tlv.c gtp_message.c gtp_types.c gtp_conv.c \
|
||||
gtp_node.c gtp_path.c gtp_xact.c \
|
||||
gtp-tlv.h gtp-message.h gtp-types.h gtp-conv.h \
|
||||
gtp-node.h gtp-path.h gtp-xact.h \
|
||||
gtp-tlv.c gtp-message.c gtp-types.c gtp-conv.c \
|
||||
gtp-node.c gtp-path.c gtp-xact.c \
|
||||
$(NULL)
|
||||
|
||||
libgtp_la_DEPENDENCIES = \
|
||||
@OGSCORE_LIBS@ \
|
||||
$(top_srcdir)/lib/base/libbase.la \
|
||||
$(NULL)
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gtp_message.h"
|
||||
#include "gtp_types.h"
|
||||
#include "gtp_conv.h"
|
||||
#include "gtp-message.h"
|
||||
#include "gtp-types.h"
|
||||
#include "gtp-conv.h"
|
||||
|
||||
void gtp_bearers_in_create_indirect_tunnel_request(
|
||||
tlv_bearer_context_t *bearers[][GTP_MAX_NUM_OF_INDIRECT_TUNNEL],
|
||||
@@ -66,13 +66,13 @@ int gtp_f_teid_to_sockaddr(
|
||||
|
||||
addr = ogs_calloc(1, sizeof(ogs_sockaddr_t));
|
||||
ogs_assert(addr);
|
||||
addr->c_sa_family = AF_INET;
|
||||
addr->c_sa_port = htons(port);
|
||||
addr->ogs_sa_family = AF_INET;
|
||||
addr->ogs_sin_port = htons(port);
|
||||
|
||||
addr6 = ogs_calloc(1, sizeof(ogs_sockaddr_t));
|
||||
ogs_assert(addr6);
|
||||
addr6->c_sa_family = AF_INET6;
|
||||
addr6->c_sa_port = htons(port);
|
||||
addr6->ogs_sa_family = AF_INET6;
|
||||
addr6->ogs_sin_port = htons(port);
|
||||
|
||||
if (f_teid->ipv4 && f_teid->ipv6)
|
||||
{
|
||||
@@ -17,17 +17,17 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTP_CONV_H__
|
||||
#define __GTP_CONV_H__
|
||||
#ifndef GTP_CONV_H
|
||||
#define GTP_CONV_H
|
||||
|
||||
#include "ogs-core.h"
|
||||
|
||||
typedef struct ogs_sockaddr_s ogs_sockaddr_t;
|
||||
typedef struct _tlv_bearer_context_t tlv_bearer_context_t;
|
||||
typedef struct _gtp_create_indirect_data_forwarding_tunnel_request_t gtp_create_indirect_data_forwarding_tunnel_request_t;
|
||||
typedef struct _gtp_create_indirect_data_forwarding_tunnel_response_t gtp_create_indirect_data_forwarding_tunnel_response_t;
|
||||
typedef struct _gtp_f_teid_t gtp_f_teid_t;
|
||||
typedef struct _ip_t ip_t;
|
||||
typedef struct tlv_bearer_context_s tlv_bearer_context_t;
|
||||
typedef struct gtp_create_indirect_data_forwarding_tunnel_request_s gtp_create_indirect_data_forwarding_tunnel_request_t;
|
||||
typedef struct gtp_create_indirect_data_forwarding_tunnel_response_s gtp_create_indirect_data_forwarding_tunnel_response_t;
|
||||
typedef struct gtp_f_teid_s gtp_f_teid_t;
|
||||
typedef struct ip_s ip_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -54,5 +54,5 @@ int gtp_ip_to_f_teid(ip_t *ip, gtp_f_teid_t *f_teid, int *len);
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GTP_CONV_H__ */
|
||||
#endif /* GTP_CONV_H */
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* This file had been created by gtp_tlv.py script v0.1.0
|
||||
* This file had been created by gtp-tlv.py script v0.1.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2019-03-06 12:20:52.446761 by acetcom
|
||||
* Created on: 2019-07-06 22:50:27.017552 by acetcom
|
||||
* from 29274-d80.docx
|
||||
******************************************************************************/
|
||||
|
||||
#include "gtp_message.h"
|
||||
#include "gtp-message.h"
|
||||
|
||||
tlv_desc_t tlv_desc_imsi_0 =
|
||||
{
|
||||
1174
lib/gtp/gtp-message.h
Normal file
1174
lib/gtp/gtp-message.h
Normal file
File diff suppressed because it is too large
Load Diff
137
lib/gtp/gtp-node.c
Normal file
137
lib/gtp/gtp-node.c
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gtp-conv.h"
|
||||
#include "gtp-node.h"
|
||||
#include "gtp-xact.h"
|
||||
|
||||
static OGS_POOL(pool, gtp_node_t);
|
||||
|
||||
int gtp_node_init(void)
|
||||
{
|
||||
ogs_pool_init(&pool, base_self()->gtp.node.pool);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
int gtp_node_final(void)
|
||||
{
|
||||
ogs_pool_final(&pool);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
gtp_node_t *gtp_node_new(ogs_sockaddr_t *addr)
|
||||
{
|
||||
gtp_node_t *node = NULL;
|
||||
|
||||
ogs_assert(addr);
|
||||
|
||||
ogs_pool_alloc(&pool, &node);
|
||||
ogs_assert(node);
|
||||
memset(node, 0, sizeof(gtp_node_t));
|
||||
|
||||
node->addr = addr;
|
||||
|
||||
ogs_list_init(&node->local_list);
|
||||
ogs_list_init(&node->remote_list);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
void gtp_node_free(gtp_node_t *node)
|
||||
{
|
||||
ogs_assert(node);
|
||||
|
||||
if (node->sock)
|
||||
ogs_sock_destroy(node->sock);
|
||||
|
||||
gtp_xact_delete_all(node);
|
||||
|
||||
ogs_freeaddrinfo(node->addr);
|
||||
ogs_pool_free(&pool, node);
|
||||
}
|
||||
|
||||
gtp_node_t *gtp_node_add(ogs_list_t *list, gtp_f_teid_t *f_teid,
|
||||
uint16_t port, int no_ipv4, int no_ipv6, int prefer_ipv4)
|
||||
{
|
||||
int rv;
|
||||
gtp_node_t *node = NULL;
|
||||
ogs_sockaddr_t *addr = NULL;
|
||||
|
||||
ogs_assert(list);
|
||||
ogs_assert(f_teid);
|
||||
ogs_assert(port);
|
||||
|
||||
rv = gtp_f_teid_to_sockaddr(f_teid, port, &addr);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
rv = ogs_filter_ip_version(&addr, no_ipv4, no_ipv6, prefer_ipv4);
|
||||
ogs_assert(addr);
|
||||
|
||||
rv = ogs_socknode_fill_scope_id_in_local(addr);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
node = gtp_node_new(addr);
|
||||
ogs_assert(node);
|
||||
|
||||
rv = gtp_f_teid_to_ip(f_teid, &node->ip);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
ogs_list_add(list, node);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
void gtp_node_remove(ogs_list_t *list, gtp_node_t *node)
|
||||
{
|
||||
ogs_assert(node);
|
||||
|
||||
ogs_list_remove(list, node);
|
||||
|
||||
gtp_node_free(node);
|
||||
}
|
||||
|
||||
void gtp_node_remove_all(ogs_list_t *list)
|
||||
{
|
||||
gtp_node_t *node = NULL, *next_node = NULL;
|
||||
|
||||
ogs_list_for_each_safe(list, next_node, node)
|
||||
gtp_node_remove(list, node);
|
||||
}
|
||||
|
||||
gtp_node_t *gtp_node_find(ogs_list_t *list, gtp_f_teid_t *f_teid)
|
||||
{
|
||||
int rv;
|
||||
gtp_node_t *node = NULL;
|
||||
ip_t ip;
|
||||
|
||||
ogs_assert(list);
|
||||
ogs_assert(f_teid);
|
||||
|
||||
rv = gtp_f_teid_to_ip(f_teid, &ip);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
ogs_list_for_each(list, node)
|
||||
{
|
||||
if (memcmp(&node->ip, &ip, ip.len) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
@@ -17,14 +17,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTP_NODE_H__
|
||||
#define __GTP_NODE_H__
|
||||
#ifndef GTP_NODE_H
|
||||
#define GTP_NODE_H
|
||||
|
||||
#include "gtp_types.h"
|
||||
#include "gtp-types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#define SETUP_GTP_NODE(__cTX, __gNODE) \
|
||||
do { \
|
||||
@@ -36,10 +36,10 @@ extern "C" {
|
||||
/**
|
||||
* This structure represents the commonalities of GTP node such as MME, SGW,
|
||||
* PGW gateway. Some of members may not be used by the specific type of node */
|
||||
typedef struct _gtp_node_t {
|
||||
typedef struct gtp_node_s {
|
||||
ogs_lnode_t node; /* A node of list_t */
|
||||
|
||||
ogs_sockaddr_t *sa_list; /* Socket Address List */
|
||||
ogs_sockaddr_t *addr; /* Socket Address List */
|
||||
|
||||
ogs_sock_t *sock; /* Socket instance */
|
||||
ip_t ip; /* Socket Address */
|
||||
@@ -52,20 +52,19 @@ typedef struct _gtp_node_t {
|
||||
int gtp_node_init(void);
|
||||
int gtp_node_final(void);
|
||||
|
||||
int gtp_create_node(gtp_node_t **node,
|
||||
ogs_sockaddr_t *all_list, int no_ipv4, int no_ipv6, int prefer_ipv4);
|
||||
int gtp_delete_node(gtp_node_t *node);
|
||||
gtp_node_t *gtp_node_new(ogs_sockaddr_t *addr);
|
||||
void gtp_node_free(gtp_node_t *node);
|
||||
|
||||
gtp_node_t *gtp_add_node(
|
||||
gtp_node_t *gtp_node_add(
|
||||
ogs_list_t *list, gtp_f_teid_t *f_teid,
|
||||
uint16_t port, int no_ipv4, int no_ipv6, int prefer_ipv4);
|
||||
int gtp_remove_node(ogs_list_t *list, gtp_node_t *node);
|
||||
int gtp_remove_all_nodes(ogs_list_t *list);
|
||||
void gtp_node_remove(ogs_list_t *list, gtp_node_t *node);
|
||||
void gtp_node_remove_all(ogs_list_t *list);
|
||||
|
||||
gtp_node_t *gtp_find_node(ogs_list_t *list, gtp_f_teid_t *f_teid);
|
||||
gtp_node_t *gtp_node_find(ogs_list_t *list, gtp_f_teid_t *f_teid);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* __GTP_NODE_H__ */
|
||||
#endif /* GTP_NODE_H */
|
||||
@@ -17,39 +17,25 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gtp_message.h"
|
||||
#include "gtp_conv.h"
|
||||
#include "gtp_node.h"
|
||||
#include "gtp-message.h"
|
||||
#include "gtp-conv.h"
|
||||
#include "gtp-node.h"
|
||||
|
||||
#include "gtp_path.h"
|
||||
#include "gtp-path.h"
|
||||
|
||||
int gtp_server(ogs_socknode_t *snode)
|
||||
ogs_sock_t *gtp_server(ogs_socknode_t *node)
|
||||
{
|
||||
char buf[OGS_ADDRSTRLEN];
|
||||
ogs_assert(snode);
|
||||
ogs_sock_t *gtp;
|
||||
ogs_assert(node);
|
||||
|
||||
snode->sock = ogs_udp_server(snode->list);
|
||||
ogs_assert(snode->sock);
|
||||
gtp = ogs_udp_server(node);
|
||||
ogs_assert(gtp);
|
||||
|
||||
ogs_info("gtp_server() [%s]:%d",
|
||||
OGS_ADDR(snode->list, buf), OGS_PORT(snode->list));
|
||||
OGS_ADDR(node->addr, buf), OGS_PORT(node->addr));
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
int gtp_client(gtp_node_t *gnode)
|
||||
{
|
||||
char buf[OGS_ADDRSTRLEN];
|
||||
ogs_assert(gnode);
|
||||
|
||||
gnode->sock = ogs_udp_client(gnode->sa_list);
|
||||
ogs_assert(gnode->sock);
|
||||
memcpy(&gnode->conn, &gnode->sock->remote_addr, sizeof gnode->conn);
|
||||
|
||||
ogs_info("gtp_client() [%s]:%d",
|
||||
OGS_ADDR(gnode->sa_list, buf), OGS_PORT(gnode->sa_list));
|
||||
|
||||
return OGS_OK;
|
||||
return gtp;
|
||||
}
|
||||
|
||||
int gtp_connect(ogs_sock_t *ipv4, ogs_sock_t *ipv6, gtp_node_t *gnode)
|
||||
@@ -59,20 +45,18 @@ int gtp_connect(ogs_sock_t *ipv4, ogs_sock_t *ipv6, gtp_node_t *gnode)
|
||||
|
||||
ogs_assert(ipv4 || ipv6);
|
||||
ogs_assert(gnode);
|
||||
ogs_assert(gnode->sa_list);
|
||||
ogs_assert(gnode->addr);
|
||||
|
||||
addr = gnode->sa_list;
|
||||
while(addr)
|
||||
{
|
||||
addr = gnode->addr;
|
||||
while (addr) {
|
||||
ogs_sock_t *sock = NULL;
|
||||
|
||||
if (addr->c_sa_family == AF_INET) sock = ipv4;
|
||||
else if (addr->c_sa_family == AF_INET6) sock = ipv6;
|
||||
if (addr->ogs_sa_family == AF_INET) sock = ipv4;
|
||||
else if (addr->ogs_sa_family == AF_INET6) sock = ipv6;
|
||||
else
|
||||
ogs_assert_if_reached();
|
||||
|
||||
if (sock)
|
||||
{
|
||||
if (sock) {
|
||||
ogs_info("gtp_connect() [%s]:%d",
|
||||
OGS_ADDR(addr, buf), OGS_PORT(addr));
|
||||
|
||||
@@ -84,11 +68,10 @@ int gtp_connect(ogs_sock_t *ipv4, ogs_sock_t *ipv6, gtp_node_t *gnode)
|
||||
addr = addr->next;
|
||||
}
|
||||
|
||||
if (addr == NULL)
|
||||
{
|
||||
if (addr == NULL) {
|
||||
ogs_log_message(OGS_LOG_WARN, ogs_socket_errno,
|
||||
"gtp_connect() [%s]:%d failed",
|
||||
OGS_ADDR(gnode->sa_list, buf), OGS_PORT(gnode->sa_list));
|
||||
OGS_ADDR(gnode->addr, buf), OGS_PORT(gnode->addr));
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
@@ -100,8 +83,7 @@ ogs_sock_t *gtp_local_sock_first(ogs_list_t *list)
|
||||
ogs_socknode_t *snode = NULL;
|
||||
|
||||
ogs_assert(list);
|
||||
ogs_list_for_each(list, snode)
|
||||
{
|
||||
ogs_list_for_each(list, snode) {
|
||||
if (snode->sock)
|
||||
return snode->sock;
|
||||
}
|
||||
@@ -114,8 +96,7 @@ ogs_sockaddr_t *gtp_local_addr_first(ogs_list_t *list)
|
||||
ogs_socknode_t *snode = NULL;
|
||||
|
||||
ogs_assert(list);
|
||||
ogs_list_for_each(list, snode)
|
||||
{
|
||||
ogs_list_for_each(list, snode) {
|
||||
ogs_sock_t *sock = snode->sock;
|
||||
ogs_assert(snode->sock);
|
||||
|
||||
@@ -125,83 +106,6 @@ ogs_sockaddr_t *gtp_local_addr_first(ogs_list_t *list)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int gtp_recv(ogs_socket_t fd, ogs_pkbuf_t **pkbuf)
|
||||
{
|
||||
ssize_t size;
|
||||
|
||||
ogs_assert(fd != INVALID_SOCKET);
|
||||
|
||||
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
||||
#if DEPRECATED
|
||||
if ((*pkbuf) == NULL)
|
||||
{
|
||||
char tmp_buf[MAX_SDU_LEN];
|
||||
|
||||
ogs_error("Can't allocate pkbuf");
|
||||
|
||||
/* Read data from socket to exit from select */
|
||||
ogs_recv(fd, tmp_buf, MAX_SDU_LEN, 0);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
#endif
|
||||
ogs_pkbuf_put(*pkbuf, MAX_SDU_LEN);
|
||||
|
||||
size = ogs_recv(fd, (*pkbuf)->data, (*pkbuf)->len, 0);
|
||||
if (size <= 0)
|
||||
{
|
||||
ogs_pkbuf_free((*pkbuf));
|
||||
ogs_error("ogs_recv failed");
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
ogs_pkbuf_trim(*pkbuf, size);
|
||||
|
||||
return OGS_OK;;
|
||||
}
|
||||
}
|
||||
|
||||
int gtp_recvfrom(ogs_socket_t fd, ogs_pkbuf_t **pkbuf, ogs_sockaddr_t *from)
|
||||
{
|
||||
ssize_t size;
|
||||
|
||||
ogs_assert(fd != INVALID_SOCKET);
|
||||
ogs_assert(from);
|
||||
|
||||
*pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
||||
#if DEPRECATED
|
||||
if ((*pkbuf) == NULL)
|
||||
{
|
||||
char tmp_buf[MAX_SDU_LEN];
|
||||
|
||||
ogs_error("Can't allocate pkbuf");
|
||||
|
||||
/* Read data from socket to exit from select */
|
||||
ogs_recv(fd, tmp_buf, MAX_SDU_LEN, 0);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
#endif
|
||||
ogs_pkbuf_put(*pkbuf, MAX_SDU_LEN);
|
||||
|
||||
size = ogs_recvfrom(fd, (*pkbuf)->data, (*pkbuf)->len, 0, from);
|
||||
if (size <= 0)
|
||||
{
|
||||
ogs_pkbuf_free((*pkbuf));
|
||||
ogs_error("ogs_recvfrom() failed");
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
ogs_pkbuf_trim(*pkbuf, size);
|
||||
|
||||
return OGS_OK;;
|
||||
}
|
||||
}
|
||||
|
||||
int gtp_send(gtp_node_t *gnode, ogs_pkbuf_t *pkbuf)
|
||||
{
|
||||
ssize_t sent;
|
||||
@@ -213,8 +117,7 @@ int gtp_send(gtp_node_t *gnode, ogs_pkbuf_t *pkbuf)
|
||||
ogs_assert(sock);
|
||||
|
||||
sent = ogs_send(sock->fd, pkbuf->data, pkbuf->len, 0);
|
||||
if (sent < 0 || sent != pkbuf->len)
|
||||
{
|
||||
if (sent < 0 || sent != pkbuf->len) {
|
||||
ogs_error("ogs_send() failed");
|
||||
return OGS_ERROR;
|
||||
}
|
||||
@@ -236,8 +139,7 @@ int gtp_sendto(gtp_node_t *gnode, ogs_pkbuf_t *pkbuf)
|
||||
ogs_assert(conn);
|
||||
|
||||
sent = ogs_sendto(sock->fd, pkbuf->data, pkbuf->len, 0, conn);
|
||||
if (sent < 0 || sent != pkbuf->len)
|
||||
{
|
||||
if (sent < 0 || sent != pkbuf->len) {
|
||||
ogs_error("ogs_send() failed");
|
||||
return OGS_ERROR;
|
||||
}
|
||||
@@ -257,13 +159,11 @@ ogs_pkbuf_t *gtp_handle_echo_req(ogs_pkbuf_t *pkb)
|
||||
|
||||
gtph = (gtp_header_t *)pkb->data;
|
||||
/* Check GTP version. Now only support GTPv1(version = 1) */
|
||||
if ((gtph->flags >> 5) != 1)
|
||||
{
|
||||
if ((gtph->flags >> 5) != 1) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (gtph->type != GTPU_MSGTYPE_ECHO_REQ)
|
||||
{
|
||||
if (gtph->type != GTPU_MSGTYPE_ECHO_REQ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -282,31 +182,24 @@ ogs_pkbuf_t *gtp_handle_echo_req(ogs_pkbuf_t *pkb)
|
||||
gtph_resp->teid = 0;
|
||||
idx = 8;
|
||||
|
||||
if (gtph->flags & (GTPU_FLAGS_PN | GTPU_FLAGS_S))
|
||||
{
|
||||
if (gtph->flags & (GTPU_FLAGS_PN | GTPU_FLAGS_S)) {
|
||||
length += 4;
|
||||
if (gtph->flags & GTPU_FLAGS_S)
|
||||
{
|
||||
if (gtph->flags & GTPU_FLAGS_S) {
|
||||
/* sequence exists */
|
||||
gtph_resp->flags |= GTPU_FLAGS_S;
|
||||
*((uint8_t *)pkb_resp->data + idx) = *((uint8_t *)pkb->data + idx);
|
||||
*((uint8_t *)pkb_resp->data + idx + 1) =
|
||||
*((uint8_t *)pkb->data + idx + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
*((uint8_t *)pkb_resp->data + idx) = 0;
|
||||
*((uint8_t *)pkb_resp->data + idx + 1) = 0;
|
||||
}
|
||||
idx += 2;
|
||||
if (gtph->flags & GTPU_FLAGS_PN)
|
||||
{
|
||||
if (gtph->flags & GTPU_FLAGS_PN) {
|
||||
/* sequence exists */
|
||||
gtph_resp->flags |= GTPU_FLAGS_PN;
|
||||
*((uint8_t *)pkb_resp->data + idx) = *((uint8_t *)pkb->data + idx);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
*((uint8_t *)pkb_resp->data + idx) = 0;
|
||||
}
|
||||
idx++;
|
||||
@@ -17,24 +17,21 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTP_PATH_H__
|
||||
#define __GTP_PATH_H__
|
||||
#ifndef GTP_PATH_H
|
||||
#define GTP_PATH_H
|
||||
|
||||
typedef struct _gtp_node_t gtp_node_t;
|
||||
typedef struct gtp_node_s gtp_node_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
int gtp_server(ogs_socknode_t *snode);
|
||||
int gtp_client(gtp_node_t *gnode);
|
||||
ogs_sock_t *gtp_server(ogs_socknode_t *node);
|
||||
int gtp_connect(ogs_sock_t *ipv4, ogs_sock_t *ipv6, gtp_node_t *gnode);
|
||||
|
||||
ogs_sock_t *gtp_local_sock_first(ogs_list_t *list);
|
||||
ogs_sockaddr_t *gtp_local_addr_first(ogs_list_t *list);
|
||||
|
||||
int gtp_recv(ogs_socket_t fd, ogs_pkbuf_t **pkbuf);
|
||||
int gtp_recvfrom(ogs_socket_t fd, ogs_pkbuf_t **pkbuf, ogs_sockaddr_t *from);
|
||||
int gtp_send(gtp_node_t *gnode, ogs_pkbuf_t *pkbuf);
|
||||
int gtp_sendto(gtp_node_t *gnode, ogs_pkbuf_t *pkbuf);
|
||||
|
||||
@@ -42,6 +39,6 @@ ogs_pkbuf_t *gtp_handle_echo_req(ogs_pkbuf_t *pkt);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* __GTP_PATH_H__ */
|
||||
#endif /* GTP_PATH_H */
|
||||
@@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gtp_tlv.h"
|
||||
#include "gtp-tlv.h"
|
||||
|
||||
tlv_desc_t tlv_desc_more1 = { TLV_MORE, "More", 0, 1, 0, 0, { NULL } };
|
||||
tlv_desc_t tlv_desc_more2 = { TLV_MORE, "More", 0, 2, 0, 0, { NULL } };
|
||||
@@ -31,113 +31,107 @@ tlv_desc_t tlv_desc_more8 = { TLV_MORE, "More", 0, 8, 0, 0, { NULL } };
|
||||
static ogs_tlv_t* tlv_add_leaf(
|
||||
ogs_tlv_t *parent_tlv, ogs_tlv_t *tlv, tlv_desc_t *desc, void *msg)
|
||||
{
|
||||
switch (desc->ctype)
|
||||
switch (desc->ctype) {
|
||||
case TLV_UINT8:
|
||||
case TLV_INT8:
|
||||
{
|
||||
case TLV_UINT8:
|
||||
case TLV_INT8:
|
||||
{
|
||||
tlv_uint8_t *v = (tlv_uint8_t *)msg;
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, 1, desc->instance, (uint8_t*)&v->u8);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, 1, desc->instance, (uint8_t*)&v->u8);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
case TLV_UINT16:
|
||||
{
|
||||
tlv_uint16_t *v = (tlv_uint16_t *)msg;
|
||||
tlv_uint8_t *v = (tlv_uint8_t *)msg;
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, 1, desc->instance, &v->u8);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv, desc->type, 1, desc->instance, &v->u8);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
case TLV_UINT16:
|
||||
{
|
||||
tlv_uint16_t *v = (tlv_uint16_t *)msg;
|
||||
|
||||
v->u16 = htons(v->u16);
|
||||
v->u16 = htons(v->u16);
|
||||
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, 2, desc->instance, (uint8_t*)&v->u16);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, 2, desc->instance, (uint8_t*)&v->u16);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
case TLV_UINT24:
|
||||
case TLV_INT24:
|
||||
{
|
||||
tlv_uint24_t *v = (tlv_uint24_t *)msg;
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, 2, desc->instance, &v->u16);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv, desc->type, 2, desc->instance, &v->u16);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
case TLV_UINT24:
|
||||
case TLV_INT24:
|
||||
{
|
||||
tlv_uint24_t *v = (tlv_uint24_t *)msg;
|
||||
|
||||
v->u24 = v->u24 << 8;
|
||||
v->u24 = htonl(v->u24);
|
||||
v->u24 = v->u24 << 8;
|
||||
v->u24 = htonl(v->u24);
|
||||
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, 3, desc->instance, (uint8_t*)&v->u24);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, 3, desc->instance, (uint8_t*)&v->u24);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
case TLV_UINT32:
|
||||
case TLV_INT32:
|
||||
{
|
||||
tlv_uint32_t *v = (tlv_uint32_t *)msg;
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, 3, desc->instance, &v->u24);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv, desc->type, 3, desc->instance, &v->u24);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
case TLV_UINT32:
|
||||
case TLV_INT32:
|
||||
{
|
||||
tlv_uint32_t *v = (tlv_uint32_t *)msg;
|
||||
|
||||
v->u32 = htonl(v->u32);
|
||||
v->u32 = htonl(v->u32);
|
||||
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, 4, desc->instance, (uint8_t*)&v->u32);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, 4, desc->instance, (uint8_t*)&v->u32);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
case TLV_FIXED_STR:
|
||||
{
|
||||
tlv_octet_t *v = (tlv_octet_t *)msg;
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, 4, desc->instance, &v->u32);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, 4, desc->instance, &v->u32);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
case TLV_FIXED_STR:
|
||||
{
|
||||
tlv_octet_t *v = (tlv_octet_t *)msg;
|
||||
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, desc->length, desc->instance, v->data);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, desc->length, desc->instance, v->data);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
case TLV_VAR_STR:
|
||||
{
|
||||
tlv_octet_t *v = (tlv_octet_t *)msg;
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, desc->length, desc->instance, v->data);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, desc->length, desc->instance, v->data);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
case TLV_VAR_STR:
|
||||
{
|
||||
tlv_octet_t *v = (tlv_octet_t *)msg;
|
||||
|
||||
ogs_assert(v->len > 0);
|
||||
ogs_assert(v->len > 0);
|
||||
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, v->len, desc->instance, v->data);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, v->len, desc->instance, v->data);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
case TLV_NULL:
|
||||
{
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, 0, desc->instance, NULL);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, 0, desc->instance, NULL);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
ogs_assert_if_reached();
|
||||
break;
|
||||
}
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, v->len, desc->instance, v->data);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, v->len, desc->instance, v->data);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
case TLV_NULL:
|
||||
{
|
||||
if (parent_tlv)
|
||||
tlv = ogs_tlv_embed(parent_tlv,
|
||||
desc->type, 0, desc->instance, NULL);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, 0, desc->instance, NULL);
|
||||
ogs_assert(tlv);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
break;
|
||||
}
|
||||
|
||||
return tlv;
|
||||
@@ -164,21 +158,17 @@ static uint32_t tlv_add_compound(ogs_tlv_t **root, ogs_tlv_t *parent_tlv,
|
||||
*root = NULL;
|
||||
|
||||
for (i = 0, desc = parent_desc->child_descs[i]; desc != NULL;
|
||||
i++, desc = parent_desc->child_descs[i])
|
||||
{
|
||||
i++, desc = parent_desc->child_descs[i]) {
|
||||
next_desc = parent_desc->child_descs[i+1];
|
||||
if (next_desc != NULL && next_desc->ctype == TLV_MORE)
|
||||
{
|
||||
if (next_desc != NULL && next_desc->ctype == TLV_MORE) {
|
||||
int offset2 = offset;
|
||||
for (j = 0; j < next_desc->length; j++)
|
||||
{
|
||||
for (j = 0; j < next_desc->length; j++) {
|
||||
presence_p = (tlv_presence_t *)(p + offset2);
|
||||
|
||||
if (*presence_p == 0)
|
||||
break;
|
||||
|
||||
if (desc->ctype == TLV_COMPOUND)
|
||||
{
|
||||
if (desc->ctype == TLV_COMPOUND) {
|
||||
ogs_trace("BUILD %sC#%d [%s] T:%d I:%d (vsz=%d) off:%p ",
|
||||
indent, i, desc->name, desc->type, desc->instance,
|
||||
desc->vsize, p + offset2);
|
||||
@@ -193,9 +183,7 @@ static uint32_t tlv_add_compound(ogs_tlv_t **root, ogs_tlv_t *parent_tlv,
|
||||
p + offset2 + sizeof(tlv_presence_t), depth + 1);
|
||||
ogs_assert(r > 0 && emb_tlv);
|
||||
count += 1 + r;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ogs_trace("BUILD %sL#%d [%s] T:%d L:%d I:%d "
|
||||
"(cls:%d vsz:%d) off:%p ",
|
||||
indent, i, desc->name, desc->type, desc->length,
|
||||
@@ -214,15 +202,11 @@ static uint32_t tlv_add_compound(ogs_tlv_t **root, ogs_tlv_t *parent_tlv,
|
||||
}
|
||||
offset += desc->vsize * next_desc->length;
|
||||
i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
presence_p = (tlv_presence_t *)(p + offset);
|
||||
|
||||
if (*presence_p)
|
||||
{
|
||||
if (desc->ctype == TLV_COMPOUND)
|
||||
{
|
||||
if (*presence_p) {
|
||||
if (desc->ctype == TLV_COMPOUND) {
|
||||
ogs_trace("BUILD %sC#%d [%s] T:%d I:%d (vsz=%d) off:%p ",
|
||||
indent, i, desc->name, desc->type, desc->instance,
|
||||
desc->vsize, p + offset);
|
||||
@@ -237,9 +221,7 @@ static uint32_t tlv_add_compound(ogs_tlv_t **root, ogs_tlv_t *parent_tlv,
|
||||
p + offset + sizeof(tlv_presence_t), depth + 1);
|
||||
ogs_assert(r > 0 && emb_tlv);
|
||||
count += 1 + r;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ogs_trace("BUILD %sL#%d [%s] T:%d L:%d I:%d "
|
||||
"(cls:%d vsz:%d) off:%p ",
|
||||
indent, i, desc->name, desc->type, desc->length,
|
||||
@@ -300,22 +282,17 @@ static tlv_desc_t* tlv_find_desc(uint8_t *desc_index,
|
||||
ogs_assert(tlv);
|
||||
|
||||
for (i = 0, desc = parent_desc->child_descs[i]; desc != NULL;
|
||||
i++, desc = parent_desc->child_descs[i])
|
||||
{
|
||||
if (desc->type == tlv->type && desc->instance == tlv->instance)
|
||||
{
|
||||
i++, desc = parent_desc->child_descs[i]) {
|
||||
if (desc->type == tlv->type && desc->instance == tlv->instance) {
|
||||
*desc_index = i;
|
||||
*tlv_offset = offset;
|
||||
break;
|
||||
}
|
||||
|
||||
if (desc->ctype == TLV_MORE)
|
||||
{
|
||||
if (desc->ctype == TLV_MORE) {
|
||||
ogs_assert(prev_desc && prev_desc->ctype != TLV_MORE);
|
||||
offset += prev_desc->vsize * (desc->length - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
offset += desc->vsize;
|
||||
}
|
||||
|
||||
@@ -331,101 +308,99 @@ static int tlv_parse_leaf(void *msg, tlv_desc_t *desc, ogs_tlv_t *tlv)
|
||||
ogs_assert(desc);
|
||||
ogs_assert(tlv);
|
||||
|
||||
switch (desc->ctype)
|
||||
switch (desc->ctype) {
|
||||
case TLV_UINT8:
|
||||
case TLV_INT8:
|
||||
{
|
||||
case TLV_UINT8:
|
||||
case TLV_INT8:
|
||||
{
|
||||
tlv_uint8_t *v = (tlv_uint8_t *)msg;
|
||||
tlv_uint8_t *v = (tlv_uint8_t *)msg;
|
||||
|
||||
if (tlv->length != 1)
|
||||
{
|
||||
ogs_error("Invalid TLV length %d. It should be 1", tlv->length);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
v->u8 = *(uint8_t*)(tlv->value);
|
||||
break;
|
||||
}
|
||||
case TLV_UINT16:
|
||||
case TLV_INT16:
|
||||
if (tlv->length != 1)
|
||||
{
|
||||
tlv_uint16_t *v = (tlv_uint16_t *)msg;
|
||||
|
||||
if (tlv->length != 2)
|
||||
{
|
||||
ogs_error("Invalid TLV length %d. It should be 2", tlv->length);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
v->u16 = ((((uint8_t*)tlv->value)[0]<< 8)&0xff00) |
|
||||
((((uint8_t*)tlv->value)[1] )&0x00ff);
|
||||
break;
|
||||
ogs_error("Invalid TLV length %d. It should be 1", tlv->length);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
case TLV_UINT24:
|
||||
case TLV_INT24:
|
||||
v->u8 = *(uint8_t*)(tlv->value);
|
||||
break;
|
||||
}
|
||||
case TLV_UINT16:
|
||||
case TLV_INT16:
|
||||
{
|
||||
tlv_uint16_t *v = (tlv_uint16_t *)msg;
|
||||
|
||||
if (tlv->length != 2)
|
||||
{
|
||||
tlv_uint24_t *v = (tlv_uint24_t *)msg;
|
||||
|
||||
if (tlv->length != 3)
|
||||
{
|
||||
ogs_error("Invalid TLV length %d. It should be 3", tlv->length);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
v->u24 = ((((uint8_t*)tlv->value)[0]<<16)&0x00ff0000) |
|
||||
((((uint8_t*)tlv->value)[1]<< 8)&0x0000ff00) |
|
||||
((((uint8_t*)tlv->value)[2] )&0x000000ff);
|
||||
break;
|
||||
ogs_error("Invalid TLV length %d. It should be 2", tlv->length);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
case TLV_UINT32:
|
||||
case TLV_INT32:
|
||||
v->u16 = ((((uint8_t*)tlv->value)[0]<< 8)&0xff00) |
|
||||
((((uint8_t*)tlv->value)[1] )&0x00ff);
|
||||
break;
|
||||
}
|
||||
case TLV_UINT24:
|
||||
case TLV_INT24:
|
||||
{
|
||||
tlv_uint24_t *v = (tlv_uint24_t *)msg;
|
||||
|
||||
if (tlv->length != 3)
|
||||
{
|
||||
tlv_uint32_t *v = (tlv_uint32_t *)msg;
|
||||
|
||||
if (tlv->length != 4)
|
||||
{
|
||||
ogs_error("Invalid TLV length %d. It should be 4", tlv->length);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
v->u32 = ((((uint8_t*)tlv->value)[0]<<24)&0xff000000) |
|
||||
((((uint8_t*)tlv->value)[1]<<16)&0x00ff0000) |
|
||||
((((uint8_t*)tlv->value)[2]<< 8)&0x0000ff00) |
|
||||
((((uint8_t*)tlv->value)[3] )&0x000000ff);
|
||||
break;
|
||||
ogs_error("Invalid TLV length %d. It should be 3", tlv->length);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
case TLV_FIXED_STR:
|
||||
v->u24 = ((((uint8_t*)tlv->value)[0]<<16)&0x00ff0000) |
|
||||
((((uint8_t*)tlv->value)[1]<< 8)&0x0000ff00) |
|
||||
((((uint8_t*)tlv->value)[2] )&0x000000ff);
|
||||
break;
|
||||
}
|
||||
case TLV_UINT32:
|
||||
case TLV_INT32:
|
||||
{
|
||||
tlv_uint32_t *v = (tlv_uint32_t *)msg;
|
||||
|
||||
if (tlv->length != 4)
|
||||
{
|
||||
tlv_octet_t *v = (tlv_octet_t *)msg;
|
||||
|
||||
if (tlv->length != desc->length)
|
||||
{
|
||||
ogs_error("Invalid TLV length %d. It should be %d",
|
||||
tlv->length, desc->length);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
v->data = tlv->value;
|
||||
v->len = tlv->length;
|
||||
break;
|
||||
ogs_error("Invalid TLV length %d. It should be 4", tlv->length);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
case TLV_VAR_STR:
|
||||
v->u32 = ((((uint8_t*)tlv->value)[0]<<24)&0xff000000) |
|
||||
((((uint8_t*)tlv->value)[1]<<16)&0x00ff0000) |
|
||||
((((uint8_t*)tlv->value)[2]<< 8)&0x0000ff00) |
|
||||
((((uint8_t*)tlv->value)[3] )&0x000000ff);
|
||||
break;
|
||||
}
|
||||
case TLV_FIXED_STR:
|
||||
{
|
||||
tlv_octet_t *v = (tlv_octet_t *)msg;
|
||||
|
||||
if (tlv->length != desc->length)
|
||||
{
|
||||
tlv_octet_t *v = (tlv_octet_t *)msg;
|
||||
ogs_error("Invalid TLV length %d. It should be %d",
|
||||
tlv->length, desc->length);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
v->data = tlv->value;
|
||||
v->len = tlv->length;
|
||||
break;
|
||||
v->data = tlv->value;
|
||||
v->len = tlv->length;
|
||||
break;
|
||||
}
|
||||
case TLV_VAR_STR:
|
||||
{
|
||||
tlv_octet_t *v = (tlv_octet_t *)msg;
|
||||
|
||||
v->data = tlv->value;
|
||||
v->len = tlv->length;
|
||||
break;
|
||||
}
|
||||
case TLV_NULL:
|
||||
{
|
||||
if (tlv->length != 0) {
|
||||
ogs_error("Invalid TLV length %d. It should be 0", tlv->length);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
case TLV_NULL:
|
||||
{
|
||||
if (tlv->length != 0)
|
||||
{
|
||||
ogs_error("Invalid TLV length %d. It should be 0", tlv->length);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
break;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
break;
|
||||
}
|
||||
|
||||
return OGS_OK;
|
||||
@@ -452,11 +427,9 @@ static int tlv_parse_compound(void *msg, tlv_desc_t *parent_desc,
|
||||
indent[depth*2] = 0;
|
||||
|
||||
tlv = parent_tlv;
|
||||
while(tlv)
|
||||
{
|
||||
while (tlv) {
|
||||
desc = tlv_find_desc(&index, &offset, parent_desc, tlv);
|
||||
if (desc == NULL)
|
||||
{
|
||||
if (desc == NULL) {
|
||||
ogs_error("Unexpected TLV type:%d", tlv->type);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
@@ -465,19 +438,15 @@ static int tlv_parse_compound(void *msg, tlv_desc_t *parent_desc,
|
||||
|
||||
/* Multiple of the same type TLV may be included */
|
||||
next_desc = parent_desc->child_descs[index+1];
|
||||
if (next_desc != NULL && next_desc->ctype == TLV_MORE)
|
||||
{
|
||||
for (j = 0; j < next_desc->length; j++)
|
||||
{
|
||||
if (next_desc != NULL && next_desc->ctype == TLV_MORE) {
|
||||
for (j = 0; j < next_desc->length; j++) {
|
||||
presence_p = (tlv_presence_t *)(p + offset + desc->vsize * j);
|
||||
if (*presence_p == 0)
|
||||
{
|
||||
if (*presence_p == 0) {
|
||||
offset += desc->vsize * j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j == next_desc->length)
|
||||
{
|
||||
if (j == next_desc->length) {
|
||||
ogs_fatal("Multiple of the same type TLV need more room");
|
||||
ogs_assert_if_reached();
|
||||
tlv = tlv->next;
|
||||
@@ -485,11 +454,9 @@ static int tlv_parse_compound(void *msg, tlv_desc_t *parent_desc,
|
||||
}
|
||||
}
|
||||
|
||||
if (desc->ctype == TLV_COMPOUND)
|
||||
{
|
||||
if (desc->ctype == TLV_COMPOUND) {
|
||||
emb_tlv = ogs_tlv_parse_embedded_block(tlv, mode);
|
||||
if (emb_tlv == NULL)
|
||||
{
|
||||
if (emb_tlv == NULL) {
|
||||
ogs_error("Error while parse TLV");
|
||||
return OGS_ERROR;
|
||||
}
|
||||
@@ -502,24 +469,20 @@ static int tlv_parse_compound(void *msg, tlv_desc_t *parent_desc,
|
||||
|
||||
rv = tlv_parse_compound(
|
||||
p + offset, desc, emb_tlv, depth + 1, mode);
|
||||
if (rv != OGS_OK)
|
||||
{
|
||||
if (rv != OGS_OK) {
|
||||
ogs_error("Can't parse compound TLV");
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
*presence_p = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ogs_trace("PARSE %sL#%d [%s] T:%d L:%d I:%d "
|
||||
"(cls:%d vsz:%d) off:%p ",
|
||||
indent, i++, desc->name, desc->type, desc->length,
|
||||
desc->instance, desc->ctype, desc->vsize, p + offset);
|
||||
|
||||
rv = tlv_parse_leaf(p + offset, desc, tlv);
|
||||
if (rv != OGS_OK)
|
||||
{
|
||||
if (rv != OGS_OK) {
|
||||
ogs_error("Can't parse leaf TLV");
|
||||
return OGS_ERROR;
|
||||
}
|
||||
@@ -546,8 +509,7 @@ int tlv_parse_msg(void *msg, tlv_desc_t *desc, ogs_pkbuf_t *pkbuf, int mode)
|
||||
ogs_assert(desc->child_descs[0]);
|
||||
|
||||
root = ogs_tlv_parse_block(pkbuf->len, pkbuf->data, mode);
|
||||
if (root == NULL)
|
||||
{
|
||||
if (root == NULL) {
|
||||
ogs_error("Can't parse TLV message");
|
||||
return OGS_ERROR;
|
||||
}
|
||||
@@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTP_TLV_H__
|
||||
#define __GTP_TLV_H__
|
||||
#ifndef GTP_TLV_H
|
||||
#define GTP_TLV_H
|
||||
|
||||
#include "ogs-core.h"
|
||||
|
||||
@@ -50,7 +50,7 @@ typedef enum {
|
||||
TLV_MESSAGE,
|
||||
} tlv_type_e;
|
||||
|
||||
typedef struct _tlv_desc_t {
|
||||
typedef struct tlv_desc_s {
|
||||
tlv_type_e ctype;
|
||||
char *name;
|
||||
uint16_t type;
|
||||
@@ -72,49 +72,49 @@ extern tlv_desc_t tlv_desc_more8;
|
||||
typedef uint64_t tlv_presence_t;
|
||||
|
||||
/* 8-bit Unsigned integer */
|
||||
typedef struct _tlv_uint8_t {
|
||||
typedef struct tlv_uint8_s {
|
||||
tlv_presence_t presence;
|
||||
uint8_t u8;
|
||||
} tlv_uint8_t;
|
||||
|
||||
/* 16-bit Unsigned integer */
|
||||
typedef struct _tlv_uint16_t {
|
||||
typedef struct tlv_uint16_s {
|
||||
tlv_presence_t presence;
|
||||
uint16_t u16;
|
||||
} tlv_uint16_t;
|
||||
|
||||
/* 24-bit Unsigned integer */
|
||||
typedef struct _tlv_uint24_t {
|
||||
typedef struct tlv_uint24_s {
|
||||
tlv_presence_t presence;
|
||||
uint32_t u24; /* Only 3 bytes valid */
|
||||
} tlv_uint24_t;
|
||||
|
||||
/* 32-bit Unsigned integer */
|
||||
typedef struct _tlv_uint32_t {
|
||||
typedef struct tlv_uint32_s {
|
||||
tlv_presence_t presence;
|
||||
uint32_t u32;
|
||||
} tlv_uint32_t;
|
||||
|
||||
/* 8-bit Signed integer */
|
||||
typedef struct _tlv_int8_t {
|
||||
typedef struct tlv_int8_s {
|
||||
tlv_presence_t presence;
|
||||
int8_t i8;
|
||||
} tlv_int8_t;
|
||||
|
||||
/* 16-bit Signed integer */
|
||||
typedef struct _tlv_int16t {
|
||||
typedef struct tlv_int16_s {
|
||||
tlv_presence_t presence;
|
||||
int16_t i16;
|
||||
} tlv_int16_t;
|
||||
|
||||
/* 24-bit Signed integer */
|
||||
typedef struct _tlv_int24_t {
|
||||
typedef struct tlv_int24_s {
|
||||
tlv_presence_t presence;
|
||||
int32_t i24; /* Only 3 bytes valid */
|
||||
} tlv_int24_t;
|
||||
|
||||
/* 32-bit Signed integer */
|
||||
typedef struct _tlv_int32_t {
|
||||
typedef struct tlv_int32_s {
|
||||
tlv_presence_t presence;
|
||||
int32_t i32;
|
||||
} tlv_int32_t;
|
||||
@@ -142,14 +142,14 @@ typedef struct _tlv_int32_t {
|
||||
(__dST)->data = ogs_calloc((__dST)->len, sizeof(uint8_t)); \
|
||||
memcpy((__dST)->data, (__sRC)->data, (__dST)->len); \
|
||||
} while(0)
|
||||
typedef struct _tlv_octet_t {
|
||||
typedef struct tlv_octet_s {
|
||||
tlv_presence_t presence;
|
||||
void *data;
|
||||
uint32_t len;
|
||||
} tlv_octet_t;
|
||||
|
||||
/* No value */
|
||||
typedef struct _tlv_null {
|
||||
typedef struct tlv_null_s {
|
||||
tlv_presence_t presence;
|
||||
} tlv_null_t;
|
||||
|
||||
@@ -161,4 +161,4 @@ int tlv_parse_msg(void *msg, tlv_desc_t *desc, ogs_pkbuf_t *pkbuf, int mode);
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GTP_TLV_H__ */
|
||||
#endif /* GTP_TLV_H */
|
||||
@@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gtp_types.h"
|
||||
#include "gtp_message.h"
|
||||
#include "gtp-types.h"
|
||||
#include "gtp-message.h"
|
||||
|
||||
/* 8.13 Protocol Configuration Options (PCO)
|
||||
* 10.5.6.3 Protocol configuration options in 3GPP TS 24.008 */
|
||||
@@ -17,21 +17,19 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTP_TYPES_H__
|
||||
#define __GTP_TYPES_H__
|
||||
#ifndef GTP_TYPES_H
|
||||
#define GTP_TYPES_H
|
||||
|
||||
#include "base/types.h"
|
||||
#include "base/context.h"
|
||||
#include "gtp_tlv.h"
|
||||
#include "gtp-tlv.h"
|
||||
|
||||
#undef OGS_LOG_DOMAIN
|
||||
#define OGS_LOG_DOMAIN __base_gtp_domain
|
||||
|
||||
typedef struct c_sockaddr_t c_sockaddr_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
/* 8.4 Cause */
|
||||
#define GTP_CAUSE_LOCAL_DETACH 2
|
||||
@@ -112,7 +110,7 @@ extern "C" {
|
||||
#define GTP_CAUSE_MULTIPLE_ACCESSES_TO_A_PDN_CONNECTION_NOT_ALLOWED 126
|
||||
#define GTP_CAUSE_REQUEST_REJECTED_DUE_TO_UE_CAPABILITY 127
|
||||
|
||||
typedef struct _gtp_cause_t {
|
||||
typedef struct gtp_cause_s {
|
||||
uint8_t value;
|
||||
ED4(uint8_t spare:5;,
|
||||
uint8_t pce:1;,
|
||||
@@ -121,13 +119,13 @@ ED4(uint8_t spare:5;,
|
||||
} __attribute__ ((packed)) gtp_cause_t;
|
||||
|
||||
/* 8.7 Aggregate Maximum Bit Rate (AMBR) */
|
||||
typedef struct _gtp_ambr_t {
|
||||
typedef struct gtp_ambr_s {
|
||||
uint32_t uplink;
|
||||
uint32_t downlink;
|
||||
} __attribute__ ((packed)) gtp_ambr_t;
|
||||
|
||||
/* 8.12 Indication */
|
||||
typedef struct _gtp_indication_t {
|
||||
typedef struct gtp_indication_s {
|
||||
ED8(uint8_t daf:1;,
|
||||
uint8_t dtf:1;,
|
||||
uint8_t hi:1;,
|
||||
@@ -172,7 +170,7 @@ ED8(uint8_t spare1:1;,
|
||||
|
||||
/* 8.15 Bearer Quality of Service (Bearer QoS) */
|
||||
#define GTP_BEARER_QOS_LEN 22
|
||||
typedef struct _gtp_bearer_qos_t {
|
||||
typedef struct gtp_bearer_qos_s {
|
||||
ED5(uint8_t spare1:1;,
|
||||
/* See 3GPP TS 29.212[29], clause 5.3.46 Pre-emption-Capability AVP. */
|
||||
uint8_t pre_emption_capability:1;,
|
||||
@@ -215,7 +213,7 @@ int16_t gtp_build_bearer_qos(
|
||||
#define GTP_MAX_TRAFFIC_FLOW_TEMPLATE 255
|
||||
|
||||
#define GTP_MAX_NUM_OF_PACKET_FILTER_COMPONENT 16
|
||||
typedef struct _gtp_tft_t {
|
||||
typedef struct gtp_tft_s {
|
||||
union {
|
||||
struct {
|
||||
#define GTP_TFT_CODE_IGNORE_THIS_IE 0
|
||||
@@ -287,30 +285,30 @@ int16_t gtp_build_tft(
|
||||
|
||||
/* 8.21 User Location Information (ULI) */
|
||||
#define GTP_MAX_ULI_LEN sizeof(gtp_uli_t)
|
||||
typedef struct _gtp_uli_cgi_t {
|
||||
typedef struct gtp_uli_cgi_s {
|
||||
plmn_id_t plmn_id;
|
||||
uint16_t lac;
|
||||
uint16_t ci;
|
||||
} __attribute__ ((packed)) gtp_uli_cgi_t;
|
||||
|
||||
typedef struct _gtp_uli_sai_t {
|
||||
typedef struct gtp_uli_sai_s {
|
||||
plmn_id_t plmn_id;
|
||||
uint16_t lac;
|
||||
uint16_t sac;
|
||||
} __attribute__ ((packed)) gtp_uli_sai_t;
|
||||
|
||||
typedef struct _gtp_uli_rai_t {
|
||||
typedef struct gtp_uli_rai_s {
|
||||
plmn_id_t plmn_id;
|
||||
uint16_t lac;
|
||||
uint16_t rac;
|
||||
} __attribute__ ((packed)) gtp_uli_rai_t;
|
||||
|
||||
typedef struct _gtp_uli_lai_t {
|
||||
typedef struct gtp_uli_lai_s {
|
||||
plmn_id_t plmn_id;
|
||||
uint16_t lac;
|
||||
} __attribute__ ((packed)) gtp_uli_lai_t;
|
||||
|
||||
typedef struct _gtp_uli_t {
|
||||
typedef struct gtp_uli_s {
|
||||
struct {
|
||||
ED7(uint8_t spare:2;,
|
||||
uint8_t lai:1;,
|
||||
@@ -378,7 +376,7 @@ int16_t gtp_build_uli(
|
||||
#define GTP_F_TEID_IPV4_LEN IPV4_LEN+GTP_F_TEID_HDR_LEN
|
||||
#define GTP_F_TEID_IPV6_LEN IPV6_LEN+GTP_F_TEID_HDR_LEN
|
||||
#define GTP_F_TEID_IPV4V6_LEN IPV4V6_LEN+GTP_F_TEID_HDR_LEN
|
||||
typedef struct _gtp_f_teid_t {
|
||||
typedef struct gtp_f_teid_s {
|
||||
ED3(uint8_t ipv4:1;,
|
||||
uint8_t ipv6:1;,
|
||||
uint8_t interface_type:6;)
|
||||
@@ -406,7 +404,7 @@ ED3(uint8_t ipv4:1;,
|
||||
* This field uses the same format as the Timezone field used in the
|
||||
* TP-Service-Centre-Time-Stamp, which is defined in 3GPP TS 23.040 [90],
|
||||
* and its value shall be set as defined in 3GPP TS 22.042 */
|
||||
typedef struct _gtp_ue_timezone_t {
|
||||
typedef struct gtp_ue_timezone_s {
|
||||
#define GTP_TIME_TO_BCD(x) TIME_TO_BCD(x)
|
||||
/* The Time Zone indicates the difference, expressed in quarters of an hour,
|
||||
* between the local time and GMT. In the first of the two semi-octets,
|
||||
@@ -436,7 +434,7 @@ ED2(uint8_t spare:6;,
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* __GTP_TYPES_H__ */
|
||||
#endif /* GTP_TYPES_H */
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gtp_message.h"
|
||||
#include "gtp_node.h"
|
||||
#include "gtp_path.h"
|
||||
#include "gtp-message.h"
|
||||
#include "gtp-node.h"
|
||||
#include "gtp-path.h"
|
||||
|
||||
#include "gtp_xact.h"
|
||||
#include "gtp-xact.h"
|
||||
|
||||
#define GTP_MIN_XACT_ID 1
|
||||
#define GTP_MAX_XACT_ID 0x800000
|
||||
@@ -183,42 +183,36 @@ int gtp_xact_update_tx(gtp_xact_t *xact,
|
||||
OGS_PORT(&xact->gnode->conn));
|
||||
|
||||
stage = gtp_xact_get_stage(hdesc->type, xact->xid);
|
||||
if (xact->org == GTP_LOCAL_ORIGINATOR)
|
||||
{
|
||||
switch(stage)
|
||||
{
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
ogs_assert(xact->step == 0);
|
||||
break;
|
||||
if (xact->org == GTP_LOCAL_ORIGINATOR) {
|
||||
switch (stage) {
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
ogs_assert(xact->step == 0);
|
||||
break;
|
||||
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
ogs_assert_if_reached();
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
ogs_assert_if_reached();
|
||||
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
ogs_assert(xact->step == 2);
|
||||
break;
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
ogs_assert(xact->step == 2);
|
||||
break;
|
||||
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
}
|
||||
else if (xact->org == GTP_REMOTE_ORIGINATOR)
|
||||
{
|
||||
switch(stage)
|
||||
{
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
ogs_assert_if_reached();
|
||||
} else if (xact->org == GTP_REMOTE_ORIGINATOR) {
|
||||
switch (stage) {
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
ogs_assert_if_reached();
|
||||
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
ogs_assert(xact->step == 1);
|
||||
break;
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
ogs_assert(xact->step == 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
|
||||
|
||||
@@ -258,138 +252,124 @@ int gtp_xact_update_rx(gtp_xact_t *xact, uint8_t type)
|
||||
OGS_PORT(&xact->gnode->conn));
|
||||
|
||||
stage = gtp_xact_get_stage(type, xact->xid);
|
||||
if (xact->org == GTP_LOCAL_ORIGINATOR)
|
||||
{
|
||||
switch(stage)
|
||||
{
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
ogs_assert_if_reached();
|
||||
if (xact->org == GTP_LOCAL_ORIGINATOR) {
|
||||
switch (stage) {
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
ogs_assert_if_reached();
|
||||
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
if (xact->seq[1].type == type)
|
||||
{
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
if (xact->seq[1].type == type) {
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
|
||||
ogs_assert(xact->step == 2 || xact->step == 3);
|
||||
ogs_assert(xact->step == 2 || xact->step == 3);
|
||||
|
||||
pkbuf = xact->seq[2].pkbuf;
|
||||
if (pkbuf)
|
||||
{
|
||||
if (xact->tm_holding)
|
||||
ogs_timer_start(
|
||||
xact->tm_holding, GTP_T3_DUPLICATED_DURATION);
|
||||
pkbuf = xact->seq[2].pkbuf;
|
||||
if (pkbuf) {
|
||||
if (xact->tm_holding)
|
||||
ogs_timer_start(
|
||||
xact->tm_holding, GTP_T3_DUPLICATED_DURATION);
|
||||
|
||||
ogs_warn("[%d] %s Request Duplicated. Retransmit!"
|
||||
" for step %d type %d peer [%s]:%d",
|
||||
xact->xid,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ?
|
||||
"LOCAL " : "REMOTE",
|
||||
xact->step, type,
|
||||
OGS_ADDR(&xact->gnode->conn,
|
||||
buf),
|
||||
OGS_PORT(&xact->gnode->conn));
|
||||
rv = gtp_sendto(xact->gnode, pkbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
ogs_warn("[%d] %s Request Duplicated. Discard!"
|
||||
" for step %d type %d peer [%s]:%d",
|
||||
xact->xid,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ?
|
||||
"LOCAL " : "REMOTE",
|
||||
xact->step, type,
|
||||
OGS_ADDR(&xact->gnode->conn,
|
||||
buf),
|
||||
OGS_PORT(&xact->gnode->conn));
|
||||
}
|
||||
|
||||
return OGS_RETRY;
|
||||
ogs_warn("[%d] %s Request Duplicated. Retransmit!"
|
||||
" for step %d type %d peer [%s]:%d",
|
||||
xact->xid,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ?
|
||||
"LOCAL " : "REMOTE",
|
||||
xact->step, type,
|
||||
OGS_ADDR(&xact->gnode->conn,
|
||||
buf),
|
||||
OGS_PORT(&xact->gnode->conn));
|
||||
rv = gtp_sendto(xact->gnode, pkbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
} else {
|
||||
ogs_warn("[%d] %s Request Duplicated. Discard!"
|
||||
" for step %d type %d peer [%s]:%d",
|
||||
xact->xid,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ?
|
||||
"LOCAL " : "REMOTE",
|
||||
xact->step, type,
|
||||
OGS_ADDR(&xact->gnode->conn,
|
||||
buf),
|
||||
OGS_PORT(&xact->gnode->conn));
|
||||
}
|
||||
|
||||
ogs_assert(xact->step == 1);
|
||||
return OGS_RETRY;
|
||||
}
|
||||
|
||||
if (xact->tm_holding)
|
||||
ogs_timer_start(
|
||||
xact->tm_holding, GTP_T3_DUPLICATED_DURATION);
|
||||
ogs_assert(xact->step == 1);
|
||||
|
||||
break;
|
||||
if (xact->tm_holding)
|
||||
ogs_timer_start(
|
||||
xact->tm_holding, GTP_T3_DUPLICATED_DURATION);
|
||||
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
ogs_assert(xact->step == 1);
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
ogs_assert(xact->step == 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
}
|
||||
else if (xact->org == GTP_REMOTE_ORIGINATOR)
|
||||
{
|
||||
switch(stage)
|
||||
{
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
if (xact->seq[0].type == type)
|
||||
{
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
} else if (xact->org == GTP_REMOTE_ORIGINATOR) {
|
||||
switch (stage) {
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
if (xact->seq[0].type == type) {
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
|
||||
ogs_assert(xact->step == 1 || xact->step == 2);
|
||||
ogs_assert(xact->step == 1 || xact->step == 2);
|
||||
|
||||
pkbuf = xact->seq[1].pkbuf;
|
||||
if (pkbuf)
|
||||
{
|
||||
if (xact->tm_holding)
|
||||
ogs_timer_start(
|
||||
xact->tm_holding, GTP_T3_DUPLICATED_DURATION);
|
||||
pkbuf = xact->seq[1].pkbuf;
|
||||
if (pkbuf) {
|
||||
if (xact->tm_holding)
|
||||
ogs_timer_start(
|
||||
xact->tm_holding, GTP_T3_DUPLICATED_DURATION);
|
||||
|
||||
ogs_warn("[%d] %s Request Duplicated. Retransmit!"
|
||||
" for step %d type %d peer [%s]:%d",
|
||||
xact->xid,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ?
|
||||
"LOCAL " : "REMOTE",
|
||||
xact->step, type,
|
||||
OGS_ADDR(&xact->gnode->conn,
|
||||
buf),
|
||||
OGS_PORT(&xact->gnode->conn));
|
||||
rv = gtp_sendto(xact->gnode, pkbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
ogs_warn("[%d] %s Request Duplicated. Discard!"
|
||||
" for step %d type %d peer [%s]:%d",
|
||||
xact->xid,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ?
|
||||
"LOCAL " : "REMOTE",
|
||||
xact->step, type,
|
||||
OGS_ADDR(&xact->gnode->conn,
|
||||
buf),
|
||||
OGS_PORT(&xact->gnode->conn));
|
||||
}
|
||||
|
||||
return OGS_RETRY;
|
||||
ogs_warn("[%d] %s Request Duplicated. Retransmit!"
|
||||
" for step %d type %d peer [%s]:%d",
|
||||
xact->xid,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ?
|
||||
"LOCAL " : "REMOTE",
|
||||
xact->step, type,
|
||||
OGS_ADDR(&xact->gnode->conn,
|
||||
buf),
|
||||
OGS_PORT(&xact->gnode->conn));
|
||||
rv = gtp_sendto(xact->gnode, pkbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
} else {
|
||||
ogs_warn("[%d] %s Request Duplicated. Discard!"
|
||||
" for step %d type %d peer [%s]:%d",
|
||||
xact->xid,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ?
|
||||
"LOCAL " : "REMOTE",
|
||||
xact->step, type,
|
||||
OGS_ADDR(&xact->gnode->conn,
|
||||
buf),
|
||||
OGS_PORT(&xact->gnode->conn));
|
||||
}
|
||||
|
||||
ogs_assert(xact->step == 0);
|
||||
if (xact->tm_holding)
|
||||
ogs_timer_start(
|
||||
xact->tm_holding, GTP_T3_DUPLICATED_DURATION);
|
||||
return OGS_RETRY;
|
||||
}
|
||||
|
||||
break;
|
||||
ogs_assert(xact->step == 0);
|
||||
if (xact->tm_holding)
|
||||
ogs_timer_start(
|
||||
xact->tm_holding, GTP_T3_DUPLICATED_DURATION);
|
||||
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
ogs_assert_if_reached();
|
||||
break;
|
||||
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
ogs_assert(xact->step == 2);
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
ogs_assert_if_reached();
|
||||
|
||||
/* continue */
|
||||
break;
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
ogs_assert(xact->step == 2);
|
||||
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
/* continue */
|
||||
break;
|
||||
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
|
||||
if (xact->tm_response)
|
||||
@@ -426,68 +406,58 @@ int gtp_xact_commit(gtp_xact_t *xact)
|
||||
type = xact->seq[xact->step-1].type;
|
||||
stage = gtp_xact_get_stage(type, xact->xid);
|
||||
|
||||
if (xact->org == GTP_LOCAL_ORIGINATOR)
|
||||
{
|
||||
switch(stage)
|
||||
{
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
{
|
||||
ogs_assert(xact->step == 1);
|
||||
if (xact->org == GTP_LOCAL_ORIGINATOR) {
|
||||
switch (stage) {
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
ogs_assert(xact->step == 1);
|
||||
|
||||
if (xact->tm_response)
|
||||
ogs_timer_start(
|
||||
xact->tm_response, GTP_T3_RESPONSE_DURATION);
|
||||
if (xact->tm_response)
|
||||
ogs_timer_start(
|
||||
xact->tm_response, GTP_T3_RESPONSE_DURATION);
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
ogs_assert_if_reached();
|
||||
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
ogs_assert(xact->step == 2 || xact->step == 3);
|
||||
if (xact->step == 2) {
|
||||
gtp_xact_delete(xact);
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
ogs_assert_if_reached();
|
||||
break;
|
||||
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
ogs_assert(xact->step == 2 || xact->step == 3);
|
||||
if (xact->step == 2)
|
||||
{
|
||||
gtp_xact_delete(xact);
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
}
|
||||
else if (xact->org == GTP_REMOTE_ORIGINATOR)
|
||||
{
|
||||
switch(stage)
|
||||
{
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
ogs_assert_if_reached();
|
||||
} else if (xact->org == GTP_REMOTE_ORIGINATOR) {
|
||||
switch (stage) {
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
ogs_assert_if_reached();
|
||||
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
ogs_assert(xact->step == 2);
|
||||
if (xact->tm_response)
|
||||
ogs_timer_start(
|
||||
xact->tm_response, GTP_T3_RESPONSE_DURATION);
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
ogs_assert(xact->step == 2);
|
||||
if (xact->tm_response)
|
||||
ogs_timer_start(
|
||||
xact->tm_response, GTP_T3_RESPONSE_DURATION);
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
ogs_assert(xact->step == 2 || xact->step == 3);
|
||||
if (xact->step == 3)
|
||||
{
|
||||
gtp_xact_delete(xact);
|
||||
return OGS_OK;
|
||||
}
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
ogs_assert(xact->step == 2 || xact->step == 3);
|
||||
if (xact->step == 3) {
|
||||
gtp_xact_delete(xact);
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
|
||||
pkbuf = xact->seq[xact->step-1].pkbuf;
|
||||
@@ -515,8 +485,7 @@ static void response_timeout(void *data)
|
||||
OGS_ADDR(&xact->gnode->conn, buf),
|
||||
OGS_PORT(&xact->gnode->conn));
|
||||
|
||||
if (--xact->response_rcount > 0)
|
||||
{
|
||||
if (--xact->response_rcount > 0) {
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
|
||||
if (xact->tm_response)
|
||||
@@ -525,14 +494,11 @@ static void response_timeout(void *data)
|
||||
pkbuf = xact->seq[xact->step-1].pkbuf;
|
||||
ogs_assert(pkbuf);
|
||||
|
||||
if (gtp_sendto(xact->gnode, pkbuf) != OGS_OK)
|
||||
{
|
||||
if (gtp_sendto(xact->gnode, pkbuf) != OGS_OK) {
|
||||
ogs_error("gtp_sendto() failed");
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ogs_warn("[%d] %s No Reponse. Give up! "
|
||||
"for step %d type %d peer [%s]:%d",
|
||||
xact->xid,
|
||||
@@ -565,13 +531,10 @@ static void holding_timeout(void *data)
|
||||
OGS_ADDR(&xact->gnode->conn, buf),
|
||||
OGS_PORT(&xact->gnode->conn));
|
||||
|
||||
if (--xact->holding_rcount > 0)
|
||||
{
|
||||
if (--xact->holding_rcount > 0) {
|
||||
if (xact->tm_holding)
|
||||
ogs_timer_start(xact->tm_holding, GTP_T3_DUPLICATED_DURATION);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ogs_debug("[%d] %s Delete Transaction "
|
||||
"for step %d type %d peer [%s]:%d",
|
||||
xact->xid,
|
||||
@@ -606,8 +569,7 @@ int gtp_xact_receive(
|
||||
OGS_PORT(&gnode->conn));
|
||||
|
||||
rv = gtp_xact_update_rx(new, h->type);
|
||||
if (rv != OGS_OK)
|
||||
{
|
||||
if (rv != OGS_OK) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -625,47 +587,46 @@ static gtp_xact_stage_t gtp_xact_get_stage(uint8_t type, uint32_t xid)
|
||||
{
|
||||
gtp_xact_stage_t stage = GTP_XACT_UNKNOWN_STAGE;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case GTP_CREATE_SESSION_REQUEST_TYPE:
|
||||
case GTP_MODIFY_BEARER_REQUEST_TYPE:
|
||||
case GTP_DELETE_SESSION_REQUEST_TYPE:
|
||||
case GTP_MODIFY_BEARER_COMMAND_TYPE:
|
||||
case GTP_DELETE_BEARER_COMMAND_TYPE:
|
||||
case GTP_BEARER_RESOURCE_COMMAND_TYPE:
|
||||
case GTP_RELEASE_ACCESS_BEARERS_REQUEST_TYPE:
|
||||
case GTP_CREATE_INDIRECT_DATA_FORWARDING_TUNNEL_REQUEST_TYPE:
|
||||
case GTP_DELETE_INDIRECT_DATA_FORWARDING_TUNNEL_REQUEST_TYPE:
|
||||
case GTP_DOWNLINK_DATA_NOTIFICATION_TYPE:
|
||||
switch (type) {
|
||||
case GTP_CREATE_SESSION_REQUEST_TYPE:
|
||||
case GTP_MODIFY_BEARER_REQUEST_TYPE:
|
||||
case GTP_DELETE_SESSION_REQUEST_TYPE:
|
||||
case GTP_MODIFY_BEARER_COMMAND_TYPE:
|
||||
case GTP_DELETE_BEARER_COMMAND_TYPE:
|
||||
case GTP_BEARER_RESOURCE_COMMAND_TYPE:
|
||||
case GTP_RELEASE_ACCESS_BEARERS_REQUEST_TYPE:
|
||||
case GTP_CREATE_INDIRECT_DATA_FORWARDING_TUNNEL_REQUEST_TYPE:
|
||||
case GTP_DELETE_INDIRECT_DATA_FORWARDING_TUNNEL_REQUEST_TYPE:
|
||||
case GTP_DOWNLINK_DATA_NOTIFICATION_TYPE:
|
||||
stage = GTP_XACT_INITIAL_STAGE;
|
||||
break;
|
||||
case GTP_CREATE_BEARER_REQUEST_TYPE:
|
||||
case GTP_UPDATE_BEARER_REQUEST_TYPE:
|
||||
case GTP_DELETE_BEARER_REQUEST_TYPE:
|
||||
if (xid & GTP_MAX_XACT_ID)
|
||||
stage = GTP_XACT_INTERMEDIATE_STAGE;
|
||||
else
|
||||
stage = GTP_XACT_INITIAL_STAGE;
|
||||
break;
|
||||
case GTP_CREATE_BEARER_REQUEST_TYPE:
|
||||
case GTP_UPDATE_BEARER_REQUEST_TYPE:
|
||||
case GTP_DELETE_BEARER_REQUEST_TYPE:
|
||||
if (xid & GTP_MAX_XACT_ID)
|
||||
stage = GTP_XACT_INTERMEDIATE_STAGE;
|
||||
else
|
||||
stage = GTP_XACT_INITIAL_STAGE;
|
||||
break;
|
||||
case GTP_CREATE_SESSION_RESPONSE_TYPE:
|
||||
case GTP_MODIFY_BEARER_RESPONSE_TYPE:
|
||||
case GTP_DELETE_SESSION_RESPONSE_TYPE:
|
||||
case GTP_MODIFY_BEARER_FAILURE_INDICATION_TYPE:
|
||||
case GTP_DELETE_BEARER_FAILURE_INDICATION_TYPE:
|
||||
case GTP_BEARER_RESOURCE_FAILURE_INDICATION_TYPE:
|
||||
case GTP_CREATE_BEARER_RESPONSE_TYPE:
|
||||
case GTP_UPDATE_BEARER_RESPONSE_TYPE:
|
||||
case GTP_DELETE_BEARER_RESPONSE_TYPE:
|
||||
case GTP_RELEASE_ACCESS_BEARERS_RESPONSE_TYPE:
|
||||
case GTP_CREATE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE:
|
||||
case GTP_DELETE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE:
|
||||
case GTP_DOWNLINK_DATA_NOTIFICATION_ACKNOWLEDGE_TYPE:
|
||||
stage = GTP_XACT_FINAL_STAGE;
|
||||
break;
|
||||
break;
|
||||
case GTP_CREATE_SESSION_RESPONSE_TYPE:
|
||||
case GTP_MODIFY_BEARER_RESPONSE_TYPE:
|
||||
case GTP_DELETE_SESSION_RESPONSE_TYPE:
|
||||
case GTP_MODIFY_BEARER_FAILURE_INDICATION_TYPE:
|
||||
case GTP_DELETE_BEARER_FAILURE_INDICATION_TYPE:
|
||||
case GTP_BEARER_RESOURCE_FAILURE_INDICATION_TYPE:
|
||||
case GTP_CREATE_BEARER_RESPONSE_TYPE:
|
||||
case GTP_UPDATE_BEARER_RESPONSE_TYPE:
|
||||
case GTP_DELETE_BEARER_RESPONSE_TYPE:
|
||||
case GTP_RELEASE_ACCESS_BEARERS_RESPONSE_TYPE:
|
||||
case GTP_CREATE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE:
|
||||
case GTP_DELETE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE:
|
||||
case GTP_DOWNLINK_DATA_NOTIFICATION_ACKNOWLEDGE_TYPE:
|
||||
stage = GTP_XACT_FINAL_STAGE;
|
||||
break;
|
||||
|
||||
default:
|
||||
ogs_error("Not implemented GTPv2 Message Type(%d)", type);
|
||||
break;
|
||||
default:
|
||||
ogs_error("Not implemented GTPv2 Message Type(%d)", type);
|
||||
break;
|
||||
}
|
||||
|
||||
return stage;
|
||||
@@ -681,35 +642,26 @@ gtp_xact_t *gtp_xact_find_by_xid(
|
||||
|
||||
ogs_assert(gnode);
|
||||
|
||||
switch(gtp_xact_get_stage(type, xid))
|
||||
{
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
{
|
||||
switch (gtp_xact_get_stage(type, xid)) {
|
||||
case GTP_XACT_INITIAL_STAGE:
|
||||
list = &gnode->remote_list;
|
||||
break;
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
list = &gnode->local_list;
|
||||
break;
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
if (xid & GTP_MAX_XACT_ID)
|
||||
list = &gnode->remote_list;
|
||||
break;
|
||||
}
|
||||
case GTP_XACT_INTERMEDIATE_STAGE:
|
||||
{
|
||||
else
|
||||
list = &gnode->local_list;
|
||||
break;
|
||||
}
|
||||
case GTP_XACT_FINAL_STAGE:
|
||||
{
|
||||
if (xid & GTP_MAX_XACT_ID)
|
||||
list = &gnode->remote_list;
|
||||
else
|
||||
list = &gnode->local_list;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
break;
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
|
||||
ogs_assert(list);
|
||||
ogs_list_for_each(list, xact)
|
||||
{
|
||||
if (xact->xid == xid)
|
||||
{
|
||||
ogs_list_for_each(list, xact) {
|
||||
if (xact->xid == xid) {
|
||||
ogs_debug("[%d] %s Find peer [%s]:%d",
|
||||
xact->xid,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ? "LOCAL " : "REMOTE",
|
||||
@@ -17,21 +17,21 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTP_XACT_H__
|
||||
#define __GTP_XACT_H__
|
||||
#ifndef GTP_XACT_H
|
||||
#define GTP_XACT_H
|
||||
|
||||
#include "gtp_message.h"
|
||||
#include "gtp-message.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
typedef struct _gtp_node_t gtp_node_t;
|
||||
typedef struct gtp_node_s gtp_node_t;
|
||||
|
||||
/**
|
||||
* Transaction context
|
||||
*/
|
||||
typedef struct _gtp_xact_t {
|
||||
typedef struct gtp_xact_s {
|
||||
ogs_lnode_t node; /**< A node of list */
|
||||
ogs_index_t index;
|
||||
|
||||
@@ -57,7 +57,7 @@ typedef struct _gtp_xact_t {
|
||||
ogs_timer_t *tm_holding; /**< Timer waiting for holding message */
|
||||
uint8_t holding_rcount;
|
||||
|
||||
struct _gtp_xact_t *assoc_xact; /**< Associated transaction */
|
||||
struct gtp_xact_s *assoc_xact; /**< Associated transaction */
|
||||
|
||||
#define GTP_XACT_STORE_SESSION(xact, session) \
|
||||
do { \
|
||||
@@ -95,6 +95,6 @@ void gtp_xact_deassociate(gtp_xact_t *xact1, gtp_xact_t *xact2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* __GTP_XACT_H__ */
|
||||
#endif /* GTP_XACT_H */
|
||||
@@ -20,7 +20,7 @@
|
||||
/*******************************************************************************
|
||||
* This file had been created by gtp_tlv.py script v0.1.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2019-03-06 12:20:52.420255 by acetcom
|
||||
* Created on: 2019-05-28 16:37:12.761642 by acetcom
|
||||
* from 29274-d80.docx
|
||||
******************************************************************************/
|
||||
|
||||
@@ -37,7 +37,7 @@ extern "C" {
|
||||
#define GTPV1U_HEADER_LEN 8
|
||||
#define GTPV2C_HEADER_LEN 12
|
||||
#define GTP_TEID_LEN 4
|
||||
typedef struct _gtp_header_t {
|
||||
typedef struct gtp_header_s {
|
||||
union {
|
||||
struct {
|
||||
ED4(uint8_t version:3;,
|
||||
@@ -590,7 +590,7 @@ typedef tlv_octet_t tlv_serving_plmn_rate_control_t;
|
||||
typedef tlv_octet_t tlv_counter_t;
|
||||
|
||||
/* Structure for Group Infomration Element */
|
||||
typedef struct _tlv_bearer_context_t {
|
||||
typedef struct tlv_bearer_context_s {
|
||||
tlv_presence_t presence;
|
||||
tlv_ebi_t eps_bearer_id;
|
||||
tlv_bearer_tft_t tft;
|
||||
@@ -619,11 +619,11 @@ typedef struct _tlv_bearer_context_t {
|
||||
tlv_packet_flow_id_t packet_flow_id;
|
||||
} tlv_bearer_context_t;
|
||||
|
||||
typedef struct _tlv_pdn_connection_t {
|
||||
typedef struct tlv_pdn_connection_s {
|
||||
tlv_presence_t presence;
|
||||
} tlv_pdn_connection_t;
|
||||
|
||||
typedef struct _tlv_overload_control_information_t {
|
||||
typedef struct tlv_overload_control_information_s {
|
||||
tlv_presence_t presence;
|
||||
tlv_sequence_number_t overload_control_sequence_number;
|
||||
tlv_metric_t overload_reduction_metric;
|
||||
@@ -631,20 +631,20 @@ typedef struct _tlv_overload_control_information_t {
|
||||
tlv_apn_t list_of_access_point_name;
|
||||
} tlv_overload_control_information_t;
|
||||
|
||||
typedef struct _tlv_load_control_information_t {
|
||||
typedef struct tlv_load_control_information_s {
|
||||
tlv_presence_t presence;
|
||||
tlv_sequence_number_t load_control_sequence_number;
|
||||
tlv_metric_t load_metric;
|
||||
tlv_apn_and_relative_capacity_t list_of_apn_and_relative_capacity;
|
||||
} tlv_load_control_information_t;
|
||||
|
||||
typedef struct _tlv_remote_ue_context_t {
|
||||
typedef struct tlv_remote_ue_context_s {
|
||||
tlv_presence_t presence;
|
||||
tlv_remote_user_id_t remote_user_id;
|
||||
tlv_remote_ue_ip_information_t remote_ue_ip_information;
|
||||
} tlv_remote_ue_context_t;
|
||||
|
||||
typedef struct _tlv_scef_pdn_connection_t {
|
||||
typedef struct tlv_scef_pdn_connection_s {
|
||||
tlv_presence_t presence;
|
||||
tlv_apn_t apn;
|
||||
tlv_ebi_t default_eps_bearer_id;
|
||||
@@ -652,17 +652,17 @@ typedef struct _tlv_scef_pdn_connection_t {
|
||||
} tlv_scef_pdn_connection_t;
|
||||
|
||||
/* Structure for Message */
|
||||
typedef struct _gtp_echo_request_t {
|
||||
typedef struct gtp_echo_request_s {
|
||||
tlv_recovery_t recovery;
|
||||
tlv_node_features_t sending_node_features;
|
||||
} gtp_echo_request_t;
|
||||
|
||||
typedef struct _gtp_echo_response_t {
|
||||
typedef struct gtp_echo_response_s {
|
||||
tlv_recovery_t recovery;
|
||||
tlv_node_features_t sending_node_features;
|
||||
} gtp_echo_response_t;
|
||||
|
||||
typedef struct _gtp_create_session_request_t {
|
||||
typedef struct gtp_create_session_request_s {
|
||||
tlv_imsi_t imsi;
|
||||
tlv_msisdn_t msisdn;
|
||||
tlv_mei_t me_identity;
|
||||
@@ -723,7 +723,7 @@ typedef struct _gtp_create_session_request_t {
|
||||
tlv_port_number_t ue_tcp_port;
|
||||
} gtp_create_session_request_t;
|
||||
|
||||
typedef struct _gtp_create_session_response_t {
|
||||
typedef struct gtp_create_session_response_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_change_reporting_action_t change_reporting_action_;
|
||||
tlv_csg_information_reporting_action_t csg_information_reporting_action;
|
||||
@@ -759,7 +759,7 @@ typedef struct _gtp_create_session_response_t {
|
||||
tlv_epco_t extended_protocol_configuration_options;
|
||||
} gtp_create_session_response_t;
|
||||
|
||||
typedef struct _gtp_modify_bearer_request_t {
|
||||
typedef struct gtp_modify_bearer_request_s {
|
||||
tlv_mei_t me_identity;
|
||||
tlv_uli_t user_location_information;
|
||||
tlv_serving_network_t serving_network;
|
||||
@@ -790,7 +790,7 @@ typedef struct _gtp_modify_bearer_request_t {
|
||||
tlv_counter_t mo_exception_data_counter;
|
||||
} gtp_modify_bearer_request_t;
|
||||
|
||||
typedef struct _gtp_modify_bearer_response_t {
|
||||
typedef struct gtp_modify_bearer_response_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_msisdn_t msisdn;
|
||||
tlv_ebi_t linked_eps_bearer_id;
|
||||
@@ -818,7 +818,7 @@ typedef struct _gtp_modify_bearer_response_t {
|
||||
tlv_charging_id_t pdn_connection_charging_id;
|
||||
} gtp_modify_bearer_response_t;
|
||||
|
||||
typedef struct _gtp_delete_session_request_t {
|
||||
typedef struct gtp_delete_session_request_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_ebi_t linked_eps_bearer_id;
|
||||
tlv_uli_t user_location_information;
|
||||
@@ -842,7 +842,7 @@ typedef struct _gtp_delete_session_request_t {
|
||||
tlv_port_number_t ue_tcp_port;
|
||||
} gtp_delete_session_request_t;
|
||||
|
||||
typedef struct _gtp_delete_session_response_t {
|
||||
typedef struct gtp_delete_session_response_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_recovery_t recovery;
|
||||
tlv_pco_t protocol_configuration_options;
|
||||
@@ -855,7 +855,7 @@ typedef struct _gtp_delete_session_response_t {
|
||||
tlv_epco_t extended_protocol_configuration_options;
|
||||
} gtp_delete_session_response_t;
|
||||
|
||||
typedef struct _gtp_modify_bearer_command_t {
|
||||
typedef struct gtp_modify_bearer_command_s {
|
||||
tlv_ambr_t apn_aggregate_maximum_bit_rate;
|
||||
tlv_bearer_context_t bearer_context;
|
||||
tlv_overload_control_information_t mme_s4_sgsn_s_overload_control_information;
|
||||
@@ -864,7 +864,7 @@ typedef struct _gtp_modify_bearer_command_t {
|
||||
tlv_f_teid_t sender_f_teid_for_control_plane;
|
||||
} gtp_modify_bearer_command_t;
|
||||
|
||||
typedef struct _gtp_modify_bearer_failure_indication_t {
|
||||
typedef struct gtp_modify_bearer_failure_indication_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_recovery_t recovery;
|
||||
tlv_indication_t indication_flags;
|
||||
@@ -872,7 +872,7 @@ typedef struct _gtp_modify_bearer_failure_indication_t {
|
||||
tlv_overload_control_information_t sgw_s_overload_control_information;
|
||||
} gtp_modify_bearer_failure_indication_t;
|
||||
|
||||
typedef struct _gtp_delete_bearer_command_t {
|
||||
typedef struct gtp_delete_bearer_command_s {
|
||||
tlv_bearer_context_t bearer_contexts;
|
||||
tlv_uli_t user_location_information;
|
||||
tlv_uli_timestamp_t uli_timestamp;
|
||||
@@ -882,7 +882,7 @@ typedef struct _gtp_delete_bearer_command_t {
|
||||
tlv_f_teid_t sender_f_teid_for_control_plane;
|
||||
} gtp_delete_bearer_command_t;
|
||||
|
||||
typedef struct _gtp_delete_bearer_failure_indication_t {
|
||||
typedef struct gtp_delete_bearer_failure_indication_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_bearer_context_t bearer_context;
|
||||
tlv_recovery_t recovery;
|
||||
@@ -891,13 +891,13 @@ typedef struct _gtp_delete_bearer_failure_indication_t {
|
||||
tlv_overload_control_information_t sgw_s_overload_control_information;
|
||||
} gtp_delete_bearer_failure_indication_t;
|
||||
|
||||
typedef struct _gtp_downlink_data_notification_failure_indication_t {
|
||||
typedef struct gtp_downlink_data_notification_failure_indication_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_node_type_t originating_node;
|
||||
tlv_imsi_t imsi;
|
||||
} gtp_downlink_data_notification_failure_indication_t;
|
||||
|
||||
typedef struct _gtp_create_bearer_request_t {
|
||||
typedef struct gtp_create_bearer_request_s {
|
||||
tlv_pti_t procedure_transaction_id;
|
||||
tlv_ebi_t linked_eps_bearer_id;
|
||||
tlv_pco_t protocol_configuration_options;
|
||||
@@ -917,7 +917,7 @@ typedef struct _gtp_create_bearer_request_t {
|
||||
tlv_f_container_t nbifom_container;
|
||||
} gtp_create_bearer_request_t;
|
||||
|
||||
typedef struct _gtp_create_bearer_response_t {
|
||||
typedef struct gtp_create_bearer_response_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_bearer_context_t bearer_contexts;
|
||||
tlv_recovery_t recovery;
|
||||
@@ -940,7 +940,7 @@ typedef struct _gtp_create_bearer_response_t {
|
||||
tlv_port_number_t ue_tcp_port;
|
||||
} gtp_create_bearer_response_t;
|
||||
|
||||
typedef struct _gtp_update_bearer_request_t {
|
||||
typedef struct gtp_update_bearer_request_s {
|
||||
tlv_bearer_context_t bearer_contexts;
|
||||
tlv_pti_t procedure_transaction_id;
|
||||
tlv_pco_t protocol_configuration_options;
|
||||
@@ -960,7 +960,7 @@ typedef struct _gtp_update_bearer_request_t {
|
||||
tlv_f_container_t nbifom_container;
|
||||
} gtp_update_bearer_request_t;
|
||||
|
||||
typedef struct _gtp_update_bearer_response_t {
|
||||
typedef struct gtp_update_bearer_response_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_bearer_context_t bearer_contexts;
|
||||
tlv_pco_t protocol_configuration_options;
|
||||
@@ -985,7 +985,7 @@ typedef struct _gtp_update_bearer_response_t {
|
||||
tlv_port_number_t ue_tcp_port;
|
||||
} gtp_update_bearer_response_t;
|
||||
|
||||
typedef struct _gtp_delete_bearer_request_t {
|
||||
typedef struct gtp_delete_bearer_request_s {
|
||||
tlv_ebi_t linked_eps_bearer_id;
|
||||
tlv_ebi_t eps_bearer_ids;
|
||||
tlv_bearer_context_t failed_bearer_contexts;
|
||||
@@ -1004,7 +1004,7 @@ typedef struct _gtp_delete_bearer_request_t {
|
||||
tlv_epco_t extended_protocol_configuration_options;
|
||||
} gtp_delete_bearer_request_t;
|
||||
|
||||
typedef struct _gtp_delete_bearer_response_t {
|
||||
typedef struct gtp_delete_bearer_response_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_ebi_t linked_eps_bearer_id;
|
||||
tlv_bearer_context_t bearer_contexts;
|
||||
@@ -1030,7 +1030,7 @@ typedef struct _gtp_delete_bearer_response_t {
|
||||
tlv_port_number_t ue_tcp_port ;
|
||||
} gtp_delete_bearer_response_t;
|
||||
|
||||
typedef struct _gtp_create_indirect_data_forwarding_tunnel_request_t {
|
||||
typedef struct gtp_create_indirect_data_forwarding_tunnel_request_s {
|
||||
tlv_imsi_t imsi;
|
||||
tlv_mei_t me_identity;
|
||||
tlv_indication_t indication_flags;
|
||||
@@ -1049,7 +1049,7 @@ typedef struct _gtp_create_indirect_data_forwarding_tunnel_request_t {
|
||||
tlv_recovery_t recovery;
|
||||
} gtp_create_indirect_data_forwarding_tunnel_request_t;
|
||||
|
||||
typedef struct _gtp_create_indirect_data_forwarding_tunnel_response_t {
|
||||
typedef struct gtp_create_indirect_data_forwarding_tunnel_response_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_f_teid_t sender_f_teid_for_control_plane;
|
||||
tlv_bearer_context_t bearer_context_0;
|
||||
@@ -1066,21 +1066,21 @@ typedef struct _gtp_create_indirect_data_forwarding_tunnel_response_t {
|
||||
tlv_recovery_t recovery;
|
||||
} gtp_create_indirect_data_forwarding_tunnel_response_t;
|
||||
|
||||
typedef struct _gtp_delete_indirect_data_forwarding_tunnel_request_t {
|
||||
typedef struct gtp_delete_indirect_data_forwarding_tunnel_request_s {
|
||||
} gtp_delete_indirect_data_forwarding_tunnel_request_t;
|
||||
|
||||
typedef struct _gtp_delete_indirect_data_forwarding_tunnel_response_t {
|
||||
typedef struct gtp_delete_indirect_data_forwarding_tunnel_response_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_recovery_t recovery;
|
||||
} gtp_delete_indirect_data_forwarding_tunnel_response_t;
|
||||
|
||||
typedef struct _gtp_release_access_bearers_request_t {
|
||||
typedef struct gtp_release_access_bearers_request_s {
|
||||
tlv_ebi_t list_of_rabs;
|
||||
tlv_node_type_t originating_node;
|
||||
tlv_indication_t indication_flags;
|
||||
} gtp_release_access_bearers_request_t;
|
||||
|
||||
typedef struct _gtp_release_access_bearers_response_t {
|
||||
typedef struct gtp_release_access_bearers_response_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_recovery_t recovery;
|
||||
tlv_indication_t indication_flags;
|
||||
@@ -1088,7 +1088,7 @@ typedef struct _gtp_release_access_bearers_response_t {
|
||||
tlv_overload_control_information_t sgw_s_overload_control_information;
|
||||
} gtp_release_access_bearers_response_t;
|
||||
|
||||
typedef struct _gtp_downlink_data_notification_t {
|
||||
typedef struct gtp_downlink_data_notification_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_ebi_t eps_bearer_id;
|
||||
tlv_arp_t allocation_retention_priority;
|
||||
@@ -1100,7 +1100,7 @@ typedef struct _gtp_downlink_data_notification_t {
|
||||
tlv_paging_and_service_information_t paging_and_service_information;
|
||||
} gtp_downlink_data_notification_t;
|
||||
|
||||
typedef struct _gtp_downlink_data_notification_acknowledge_t {
|
||||
typedef struct gtp_downlink_data_notification_acknowledge_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_delay_value_t data_notification_delay;
|
||||
tlv_recovery_t recovery;
|
||||
@@ -1110,7 +1110,7 @@ typedef struct _gtp_downlink_data_notification_acknowledge_t {
|
||||
tlv_integer_number_t dl_buffering_suggested_packet_count;
|
||||
} gtp_downlink_data_notification_acknowledge_t;
|
||||
|
||||
typedef struct _gtp_modify_access_bearers_request_t {
|
||||
typedef struct gtp_modify_access_bearers_request_s {
|
||||
tlv_indication_t indication_flags;
|
||||
tlv_f_teid_t sender_f_teid_for_control_plane;
|
||||
tlv_delay_value_t delay_downlink_packet_notification_request;
|
||||
@@ -1119,7 +1119,7 @@ typedef struct _gtp_modify_access_bearers_request_t {
|
||||
tlv_recovery_t recovery;
|
||||
} gtp_modify_access_bearers_request_t;
|
||||
|
||||
typedef struct _gtp_modify_access_bearers_response_t {
|
||||
typedef struct gtp_modify_access_bearers_response_s {
|
||||
tlv_cause_t cause;
|
||||
tlv_bearer_context_t bearer_contexts_modified;
|
||||
tlv_bearer_context_t bearer_contexts_marked_for_removal;
|
||||
@@ -1129,7 +1129,7 @@ typedef struct _gtp_modify_access_bearers_response_t {
|
||||
tlv_overload_control_information_t sgw_s_overload_control_information;
|
||||
} gtp_modify_access_bearers_response_t;
|
||||
|
||||
typedef struct _gtp_message_t {
|
||||
typedef struct gtp_message_s {
|
||||
gtp_header_t h;
|
||||
union {
|
||||
gtp_echo_request_t echo_request;
|
||||
|
||||
@@ -1,181 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gtp_conv.h"
|
||||
#include "gtp_node.h"
|
||||
#include "gtp_xact.h"
|
||||
|
||||
static OGS_POOL(pool, gtp_node_t);
|
||||
|
||||
int gtp_node_init(void)
|
||||
{
|
||||
ogs_pool_init(&pool, base_self()->gtp.node.pool);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
int gtp_node_final(void)
|
||||
{
|
||||
ogs_pool_final(&pool);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
int gtp_create_node(gtp_node_t **node,
|
||||
ogs_sockaddr_t *all_list, int no_ipv4, int no_ipv6, int prefer_ipv4)
|
||||
{
|
||||
int rv;
|
||||
gtp_node_t *new_node = NULL;
|
||||
ogs_sockaddr_t *preferred_list = NULL;
|
||||
|
||||
ogs_assert(all_list);
|
||||
|
||||
rv = ogs_copyaddrinfo(&preferred_list, all_list);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
if (no_ipv4 == 1)
|
||||
{
|
||||
rv = ogs_filteraddrinfo(&preferred_list, AF_INET6);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
}
|
||||
if (no_ipv6 == 1)
|
||||
{
|
||||
rv = ogs_filteraddrinfo(&preferred_list, AF_INET);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
}
|
||||
if (prefer_ipv4 == 1)
|
||||
{
|
||||
rv = ogs_sortaddrinfo(&preferred_list, AF_INET);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = ogs_sortaddrinfo(&preferred_list, AF_INET6);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
}
|
||||
|
||||
if (preferred_list)
|
||||
{
|
||||
ogs_pool_alloc(&pool, &new_node);
|
||||
ogs_assert(new_node);
|
||||
memset(new_node, 0, sizeof(gtp_node_t));
|
||||
|
||||
new_node->sa_list = preferred_list;
|
||||
|
||||
ogs_list_init(&new_node->local_list);
|
||||
ogs_list_init(&new_node->remote_list);
|
||||
}
|
||||
|
||||
*node = new_node;
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
int gtp_delete_node(gtp_node_t *node)
|
||||
{
|
||||
ogs_assert(node);
|
||||
|
||||
if (node->sock)
|
||||
ogs_sock_destroy(node->sock);
|
||||
|
||||
gtp_xact_delete_all(node);
|
||||
|
||||
ogs_freeaddrinfo(node->sa_list);
|
||||
ogs_pool_free(&pool, node);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
gtp_node_t *gtp_add_node(ogs_list_t *list, gtp_f_teid_t *f_teid,
|
||||
uint16_t port, int no_ipv4, int no_ipv6, int prefer_ipv4)
|
||||
{
|
||||
int rv;
|
||||
gtp_node_t *node = NULL;
|
||||
ogs_sockaddr_t *sa_list = NULL;
|
||||
|
||||
ogs_assert(list);
|
||||
ogs_assert(f_teid);
|
||||
ogs_assert(port);
|
||||
|
||||
rv = gtp_f_teid_to_sockaddr(f_teid, port, &sa_list);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
rv = gtp_create_node(&node, sa_list, no_ipv4, no_ipv6, prefer_ipv4);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
if (node == NULL)
|
||||
{
|
||||
ogs_error("Invalid Parameter : "
|
||||
"port[%d], no_ipv4[%d], no_ipv6[%d], prefer_ipv4[%d]",
|
||||
port, no_ipv4, no_ipv6, prefer_ipv4);
|
||||
return NULL;
|
||||
}
|
||||
ogs_list_add(list, node);
|
||||
|
||||
rv = gtp_f_teid_to_ip(f_teid, &node->ip);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
rv = ogs_sock_fill_scope_id_in_local(node->sa_list);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
ogs_freeaddrinfo(sa_list);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
int gtp_remove_node(ogs_list_t *list, gtp_node_t *node)
|
||||
{
|
||||
int rv;
|
||||
ogs_assert(node);
|
||||
|
||||
ogs_list_remove(list, node);
|
||||
|
||||
rv = gtp_delete_node(node);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int gtp_remove_all_nodes(ogs_list_t *list)
|
||||
{
|
||||
gtp_node_t *node = NULL, *next_node = NULL;
|
||||
|
||||
ogs_list_for_each_safe(list, next_node, node)
|
||||
gtp_remove_node(list, node);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
gtp_node_t *gtp_find_node(ogs_list_t *list, gtp_f_teid_t *f_teid)
|
||||
{
|
||||
int rv;
|
||||
gtp_node_t *node = NULL;
|
||||
ip_t ip;
|
||||
|
||||
ogs_assert(list);
|
||||
ogs_assert(f_teid);
|
||||
|
||||
rv = gtp_f_teid_to_ip(f_teid, &ip);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
ogs_list_for_each(list, node)
|
||||
{
|
||||
if (memcmp(&node->ip, &ip, ip.len) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
@@ -13,4 +13,4 @@ user@host ~/Documents/git/nextepc/lib/gtp/support$ \
|
||||
|
||||
* Generate TLV support files
|
||||
user@host ~/Documents/git/nextepc/lib/s1ap/support$ \
|
||||
python gtp_tlv.py -f 29274-d80.docx -o ..
|
||||
python gtp-tlv.py -f 29274-d80.docx -o ..
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user