mirror of
https://github.com/open5gs/open5gs.git
synced 2025-10-30 11:33:39 +00:00
Compare commits
286 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c7371db7f | ||
|
|
a6f9ad52cb | ||
|
|
e2f94753b7 | ||
|
|
9d8203eb68 | ||
|
|
9079ab216d | ||
|
|
4eb26c4012 | ||
|
|
4b7721ba48 | ||
|
|
197a16bca8 | ||
|
|
fe5f2320b3 | ||
|
|
715d2b7922 | ||
|
|
56ff495e7b | ||
|
|
d8d2f9836d | ||
|
|
58af53a6cd | ||
|
|
2db2558624 | ||
|
|
967f40f216 | ||
|
|
58105c9b1e | ||
|
|
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 | ||
|
|
825978d2af | ||
|
|
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
|
||||
|
||||
|
||||
96
debian/changelog
vendored
96
debian/changelog
vendored
@@ -1,3 +1,99 @@
|
||||
nextepc (0.5.2) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 11 Aug 2019 11:17:35 +0000
|
||||
|
||||
nextepc (0.5.1~xenial) xenial; urgency=medium
|
||||
|
||||
* SMSoSG Supported
|
||||
* Many BUGS Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 30 Jul 2019 22:42:27 +0900
|
||||
|
||||
nextepc (0.5.1~bionic) bionic; urgency=medium
|
||||
|
||||
* SMSoSG Supported
|
||||
* Many BUGS Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 30 Jul 2019 22:41:14 +0900
|
||||
|
||||
nextepc (0.5.1) unstable; urgency=medium
|
||||
|
||||
* SMSoSG Supported
|
||||
* Many BUGS Fixed
|
||||
|
||||
-- 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
|
||||
|
||||
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 (>= 1.2.1),
|
||||
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 && \
|
||||
|
||||
@@ -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)
|
||||
@@ -165,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`.
|
||||
|
||||
|
||||
@@ -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 ```
|
||||
|
||||
767
docs/_docs/guide/04-setting-up-kamailio-IMS.md
Normal file
767
docs/_docs/guide/04-setting-up-kamailio-IMS.md
Normal file
@@ -0,0 +1,767 @@
|
||||
---
|
||||
title: Setting up Kamailio IMS
|
||||
head_inline: "<style> .blue { color: blue; } </style>"
|
||||
---
|
||||
|
||||
Setting up Kamailio IMS in OpenStack VM and connecting P-CSCF of Kamailio IMS with PCRF of NextEPC (Running on another OpenStak VM) - Install from deb packages
|
||||
{: .blue}
|
||||
|
||||
|
||||
#### 1. Start from Bionic Ubuntu cloud image
|
||||
#### 2. Use the following Cloud init config while spawning an instance
|
||||
|
||||
```
|
||||
#cloud-config
|
||||
disable_root: 0
|
||||
ssh_pwauth: True
|
||||
users:
|
||||
- name: root
|
||||
chpasswd:
|
||||
list: |
|
||||
root:admin
|
||||
expire: False
|
||||
runcmd:
|
||||
- sed -i -e '/^#PermitRootLogin/s/^.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
|
||||
- systemctl restart sshd
|
||||
```
|
||||
|
||||
This removes all existing cloud users and allows only root user and sets a password
|
||||
{: .notice--warning}
|
||||
|
||||
#### 3. Install following packages
|
||||
|
||||
```
|
||||
$ apt update && apt upgrade -y && apt install -y mysql-server tcpdump screen ntp ntpdate git-core dkms gcc flex bison libmysqlclient-dev make \
|
||||
libssl-dev libcurl4-openssl-dev libxml2-dev libpcre3-dev bash-completion g++ autoconf rtpproxy libmnl-dev \
|
||||
libsctp-dev ipsec-tools
|
||||
```
|
||||
|
||||
#### 4. Install all required Kamailio packages (v5.2)
|
||||
|
||||
```
|
||||
$ wget -O- http://deb.kamailio.org/kamailiodebkey.gpg | sudo apt-key add -
|
||||
$ add-apt-repository 'deb http://deb.kamailio.org/kamailio52 bionic main'
|
||||
$ apt install -y kamailio kamailio-mysql-modules kamailio-ims-modules kamailio-presence-modules kamailio-tls-modules kamailio-xml-modules kamailio-xmlrpc-modules
|
||||
```
|
||||
|
||||
#### 5. Create necessary folders for kamailio pid files and set ownership
|
||||
|
||||
Create the directory for pid file:
|
||||
|
||||
```
|
||||
$ mkdir -p /var/run/kamailio
|
||||
$ mkdir -p /var/run/kamailio_icscf
|
||||
$ mkdir -p /var/run/kamailio_pcscf
|
||||
$ mkdir -p /var/run/kamailio_scscf
|
||||
```
|
||||
|
||||
Default setting is to run Kamailio as user kamailio and group kamailio. For that you need to create the user:
|
||||
|
||||
```
|
||||
$ adduser --quiet --system --group --disabled-password \
|
||||
--shell /bin/false --gecos "Kamailio" \
|
||||
--home /var/run/kamailio kamailio
|
||||
|
||||
$ adduser --quiet --system --group --disabled-password \
|
||||
--shell /bin/false --gecos "Kamailio" \
|
||||
--home /var/run/kamailio_icscf kamailio
|
||||
|
||||
$ adduser --quiet --system --group --disabled-password \
|
||||
--shell /bin/false --gecos "Kamailio" \
|
||||
--home /var/run/kamailio_pcscf kamailio
|
||||
|
||||
$ adduser --quiet --system --group --disabled-password \
|
||||
--shell /bin/false --gecos "Kamailio" \
|
||||
--home /var/run/kamailio_scscf kamailio
|
||||
```
|
||||
|
||||
Set ownership:
|
||||
|
||||
```
|
||||
$ chown kamailio:kamailio /var/run/kamailio
|
||||
$ chown kamailio:kamailio /var/run/kamailio_icscf
|
||||
$ chown kamailio:kamailio /var/run/kamailio_pcscf
|
||||
$ chown kamailio:kamailio /var/run/kamailio_scscf
|
||||
```
|
||||
|
||||
#### 6. Clone Kamailio repository and checkout 5.2 version of repository
|
||||
|
||||
```
|
||||
$ mkdir -p /usr/local/src/kamailio-5.2
|
||||
$ cd /usr/local/src/kamailio-5.2/
|
||||
$ git clone git://git.kamailio.org/kamailio kamailio
|
||||
$ cd kamailio
|
||||
$ git checkout -b 5.2 origin/5.2
|
||||
```
|
||||
|
||||
#### 7. Edit /etc/hosts file for hostname resolution
|
||||
|
||||
Edit the /etc/hosts file as follows:
|
||||
|
||||
In the below example ims-deb is the hostname of the machine, PCRF is running in 10.4.128.11/172.24.15.3 (Floating IP) machine and IMS running at 10.4.128.7/172.24.15.21 (Floating IP)
|
||||
|
||||
Notice the change in PCRF address resolution (It should be the machine IP where PCRF is running)
|
||||
{: .notice--warning}
|
||||
|
||||
```
|
||||
root@ims-deb:~# cat /etc/hosts
|
||||
127.0.0.1 localhost
|
||||
127.0.1.1 ims-deb
|
||||
10.4.128.7 hss.mnc096.mcc262.3gppnetwork.org mnc096.mcc262.3gppnetwork.org
|
||||
10.4.128.7 icscf.mnc096.mcc262.3gppnetwork.org mnc096.mcc262.3gppnetwork.org
|
||||
10.4.128.7 pcscf.mnc096.mcc262.3gppnetwork.org mnc096.mcc262.3gppnetwork.org
|
||||
10.4.128.7 scscf.mnc096.mcc262.3gppnetwork.org mnc096.mcc262.3gppnetwork.org
|
||||
172.24.15.3 pcrf.mnc096.mcc262.3gppnetwork.org mnc096.mcc262.3gppnetwork.org
|
||||
|
||||
# The following lines are desirable for IPv6 capable hosts
|
||||
::1 ip6-localhost ip6-loopback
|
||||
fe00::0 ip6-localnet
|
||||
ff00::0 ip6-mcastprefix
|
||||
ff02::1 ip6-allnodes
|
||||
ff02::2 ip6-allrouters
|
||||
ff02::3 ip6-allhosts
|
||||
```
|
||||
|
||||
After editing the file, save it and reboot the machine
|
||||
{: .notice--info}
|
||||
|
||||
|
||||
#### 8. Populate MySQL database using kamctlrc command
|
||||
|
||||
Edit SIP_DOMAIN and DBENGINE in the /etc/kamailio/kamctlrc configuration file (Used by kamctl and kamdbctl tools).
|
||||
|
||||
Set the SIP_DOMAIN to your SIP service domain (or IP address if you don't have a DNS hostname associated with your SIP service).
|
||||
Set the DBENGINE to be MYSQL and adjust other setting as you want. Finally, uncomment both SIP_DOMAIN and DBENGINE.
|
||||
|
||||
In example above, the following values are set for SIP_DOMAIN and DBENGINE
|
||||
|
||||
```
|
||||
SIP_DOMAIN=mnc096.mcc262.3gppnetwork.org
|
||||
DBENGINE=MYSQL
|
||||
```
|
||||
|
||||
You can change other values in kamctlrc file. Once you are done updating kamctlrc file, run the script to create the database used by Kamailio:
|
||||
|
||||
```
|
||||
$ kamdbctl create
|
||||
```
|
||||
|
||||
When prompted for mysql root user password enter the root password if its is set or else leave it blank i.e. Press Enter
|
||||
{: .notice--info}
|
||||
|
||||
check database manually;
|
||||
```
|
||||
$ mysql
|
||||
<mysql> show databases;
|
||||
<mysql> use kamailio;
|
||||
<mysql> show tables;
|
||||
<mysql> select * from subscriber;
|
||||
```
|
||||
|
||||
No Subscribers are added yet
|
||||
|
||||
The kamdbctl will add two users in MySQL user tables:
|
||||
```
|
||||
- kamailio - (with default password 'kamailiorw') - user which has full access rights to 'kamailio' database
|
||||
- kamailioro - (with default password 'kamailioro') - user which has read-only access rights to 'kamailio' database
|
||||
```
|
||||
|
||||
#### 9. Edit /etc/default/rtpproxy file as follows:
|
||||
|
||||
```
|
||||
# Defaults for rtpproxy
|
||||
|
||||
# The control socket.
|
||||
#CONTROL_SOCK="unix:/var/run/rtpproxy/rtpproxy.sock"
|
||||
# To listen on an UDP socket, uncomment this line:
|
||||
CONTROL_SOCK=udp:127.0.0.1:22222
|
||||
|
||||
# Additional options that are passed to the daemon.
|
||||
EXTRA_OPTS="-l 172.24.15.21 -d DBUG:LOG_LOCAL0"
|
||||
```
|
||||
|
||||
here, `-l <PUBLIC_IP>`
|
||||
|
||||
Then run,
|
||||
|
||||
```
|
||||
$ systemctl restart rtpproxy
|
||||
```
|
||||
|
||||
#### 10. Edit configuration file to fit your requirements for the VoIP platform, you have to edit the /etc/kamailio/kamailio.cfg configuration file
|
||||
|
||||
Follow the instruction in the comments to enable usage of MySQL. Basically you have to add several lines at the top of config file, like:
|
||||
|
||||
```
|
||||
#!define WITH_MYSQL
|
||||
#!define WITH_AUTH
|
||||
#!define WITH_USRLOCDB
|
||||
#!define WITH_NAT (Include this if client and/or SIP server is behind a NAT)
|
||||
|
||||
(uncomment this line and enter the DNS domain created above)
|
||||
alias="mnc096.mcc262.3gppnetwork.org"
|
||||
|
||||
(uncomment this line, 10.4.128.7 is the internal IP and 172.24.15.21 is the Public/Floating IP)
|
||||
listen=udp:10.4.128.7:5060 advertise 172.24.15.21:5060
|
||||
```
|
||||
|
||||
Further down, we will need to modify the rtpproxy_sock value to match the CONTROL_SOCK option we set for RTPProxy in /etc/default/rtpproxy
|
||||
```
|
||||
modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:22222")
|
||||
```
|
||||
|
||||
If you changed the password for the 'kamailio' user of MySQL, you have to update the value for 'DBURL' parameters.
|
||||
|
||||
#### 11. Run Kamailio SIP server
|
||||
|
||||
```
|
||||
$ systemctl start kamailio
|
||||
```
|
||||
|
||||
#### 12. A quick check for the basic working of SIP server can be done as follows:
|
||||
|
||||
Create new subscriber accounts. A new account can be added using `kamctl` tool via `kamctl add <username> <password>`
|
||||
(When asked for entering MySQL password for user 'kamailio@localhost': type 'kamailiorw', as provided in kamailio.cfg)
|
||||
|
||||
```
|
||||
$ kamctl add test testpasswd
|
||||
$ kamctl add test2 testpasswd
|
||||
```
|
||||
|
||||
Setting on OnePlus phones
|
||||
|
||||
- Connect to a network through which SIP server is reachable (either Wi-Fi or LTE)
|
||||
- Goto phone dialer and select the "Settings" in the menu on top right corner
|
||||
- Then select "Call settings"
|
||||
- Configure SIP accounts in phones as added above using kamctl:
|
||||
|
||||
In Phone 1:
|
||||
|
||||
```
|
||||
Username: test
|
||||
Password: testpasswd
|
||||
Server: mnc096.mcc262.3gppnetwork.org (Created DNS Domain Name or IP to which IMS components are bound to, visible interface IP address)
|
||||
Optional Settings:
|
||||
Authentication username: test
|
||||
Outbound proxy address: 172.24.15.21 (Floating IP of VM in case of OpenStack or else no need to fill in case of physical machine)
|
||||
Transport type: UDP
|
||||
```
|
||||
|
||||
In Phone 2:
|
||||
|
||||
```
|
||||
Username: test2
|
||||
Password: testpasswd
|
||||
Server: mnc096.mcc262.3gppnetwork.org (Created DNS Domain Name or IP to which IMS components are bound to, visible interface IP address)
|
||||
Optional Settings:
|
||||
Authentication username: test2
|
||||
Outbound proxy address: 172.24.15.21 (Floating IP of VM in case of OpenStack or else no need to fill in case of physical machine)
|
||||
Transport type: UDP
|
||||
```
|
||||
|
||||
- Set "Receive incoming calls" option to enabled state in both phones
|
||||
- Set "Use SIP calling" to "For all calls"
|
||||
- Add a new contact as follows:
|
||||
|
||||
In Phone 1:
|
||||
|
||||
Select "more" option
|
||||
|
||||
```
|
||||
Name: SIP Contact test2 (Any arbitary name)
|
||||
SIP: test2@mnc096.mcc262.3gppnetwork.org (Created DNS Domain Name or IP to which IMS components are bound to, visible interface IP address)
|
||||
```
|
||||
|
||||
Save and exit
|
||||
|
||||
In Phone 2:
|
||||
|
||||
Select "more" option
|
||||
|
||||
```
|
||||
Name: SIP Contact test (Any arbitary name)
|
||||
SIP: test@mnc096.mcc262.3gppnetwork.org (Created DNS Domain Name or IP to which IMS components are bound to, visible interface IP address)
|
||||
```
|
||||
|
||||
Save and exit
|
||||
|
||||
- Now try calling from either phone
|
||||
|
||||
#### 13. Create new mysql database for pcscf, scscf and icscf, populate databases and grant permissions to respective users identified by a password
|
||||
|
||||
```
|
||||
$ mysql
|
||||
<mysql> CREATE DATABASE `pcscf`;
|
||||
<mysl> CREATE DATABASE `scscf`;
|
||||
<mysl> CREATE DATABASE `icscf`;
|
||||
```
|
||||
|
||||
In all of the below steps, when prompted for mysql root user password, leave it blank i.e. Press Enter
|
||||
|
||||
```
|
||||
$ cd /usr/local/src/kamailio-5.2/kamailio/utils/kamctl/mysql
|
||||
$ mysql -u root -p pcscf < standard-create.sql
|
||||
$ mysql -u root -p pcscf < presence-create.sql
|
||||
$ mysql -u root -p pcscf < ims_usrloc_pcscf-create.sql
|
||||
$ mysql -u root -p pcscf < ims_dialog-create.sql
|
||||
|
||||
$ mysql -u root -p scscf < standard-create.sql
|
||||
$ mysql -u root -p scscf < presence-create.sql
|
||||
$ mysql -u root -p scscf < ims_usrloc_scscf-create.sql
|
||||
$ mysql -u root -p scscf < ims_dialog-create.sql
|
||||
$ mysql -u root -p scscf < ims_charging_create.sql
|
||||
|
||||
$ cd /usr/local/src/kamailio-5.2/kamailio/misc/examples/ims/icscf
|
||||
$ mysql -u root -p icscf < icscf.sql
|
||||
```
|
||||
|
||||
Verify that following tables are present in respective databases by logging into mysql
|
||||
|
||||
```
|
||||
+-----------------+
|
||||
| Tables_in_pcscf |
|
||||
+-----------------+
|
||||
| active_watchers |
|
||||
| dialog_in |
|
||||
| dialog_out |
|
||||
| dialog_vars |
|
||||
| location |
|
||||
| presentity |
|
||||
| pua |
|
||||
| version |
|
||||
| watchers |
|
||||
| xcap |
|
||||
+-----------------+
|
||||
|
||||
+-----------------+
|
||||
| Tables_in_scscf |
|
||||
+-----------------+
|
||||
| active_watchers |
|
||||
| contact |
|
||||
| dialog_in |
|
||||
| dialog_out |
|
||||
| dialog_vars |
|
||||
| impu |
|
||||
| impu_contact |
|
||||
| impu_subscriber |
|
||||
| presentity |
|
||||
| pua |
|
||||
| ro_session |
|
||||
| subscriber |
|
||||
| version |
|
||||
| watchers |
|
||||
| xcap |
|
||||
+-----------------+
|
||||
|
||||
+---------------------+
|
||||
| Tables_in_icscf |
|
||||
+---------------------+
|
||||
| nds_trusted_domains |
|
||||
| s_cscf |
|
||||
| s_cscf_capabilities |
|
||||
+---------------------+
|
||||
```
|
||||
|
||||
```
|
||||
<mysql> grant delete,insert,select,update on pcscf.* to pcscf@localhost identified by 'heslo';
|
||||
<mysql> grant delete,insert,select,update on scscf.* to scscf@localhost identified by 'heslo';
|
||||
<mysl> grant delete,insert,select,update on icscf.* to icscf@localhost identified by 'heslo';
|
||||
<mysl> grant delete,insert,select,update on icscf.* to provisioning@localhost identified by 'provi';
|
||||
```
|
||||
|
||||
#### 14. Copy pcscf, icscf and scscf configuration files to /etc/ folder and edit accordingly
|
||||
|
||||
```
|
||||
$ cd /usr/local/src/kamailio-5.2/kamailio/misc/examples/ims/
|
||||
$ cp -r icscf/ /etc/kamailio_icscf
|
||||
$ cp -r pcscf/ /etc/kamailio_pcscf
|
||||
$ cp -r scscf/ /etc/kamailio_scscf
|
||||
```
|
||||
|
||||
Rename files in these folder kamailio_pcscf, kamailio_icscf and kamailio_scscf by removing .sample part from the configuration files.
|
||||
|
||||
And, rename kamailio.cfg in respective folder as follows: kamailio_pcscf.cfg, kamailio_icscf.cfg and kamailio_scscf.cfg
|
||||
|
||||
Edit the configuration files as per your deployment needs
|
||||
|
||||
### I-CSCF
|
||||
|
||||
Changes required in icscf.cfg:
|
||||
|
||||
```
|
||||
# SIP / UDP
|
||||
listen=udp:10.4.128.7:4060
|
||||
|
||||
alias=icscf.mnc096.mcc262.3gppnetwork.org
|
||||
|
||||
#!define NETWORKNAME "mnc096.mcc262.3gppnetwork.org"
|
||||
#!define HOSTNAME "icscf.mnc096.mcc262.3gppnetwork.org"
|
||||
|
||||
#!define DB_URL "mysql://icscf:heslo@localhost/icscf"
|
||||
```
|
||||
|
||||
Changes required in icscf.xml:
|
||||
|
||||
```
|
||||
FQDN="icscf.mnc096.mcc262.3gppnetwork.org"
|
||||
Realm="mnc096.mcc262.3gppnetwork.org"
|
||||
|
||||
<Peer FQDN="hss.mnc096.mcc262.3gppnetwork.org" Realm="mnc096.mcc262.3gppnetwork.org" port="3868"/>
|
||||
|
||||
<Acceptor port="3869" bind="10.4.128.7"/>
|
||||
|
||||
<DefaultRoute FQDN="hss.mnc096.mcc262.3gppnetwork.org" metric="10"/>
|
||||
```
|
||||
|
||||
Changes required in kamailio_icscf.cfg:
|
||||
|
||||
```
|
||||
# ------------------ module loading ----------------------------------
|
||||
mpath="/usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/:/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/:/usr/lib/x86_64-linux-gnu/kamailio/modules/"
|
||||
```
|
||||
|
||||
To perform a quick test edit the /etc/default/kamailio file, by changing the configuration file parameter as follows:
|
||||
|
||||
```
|
||||
# Config file
|
||||
CFGFILE=/etc/kamailio_icscf/kamailio_icscf.cfg
|
||||
```
|
||||
|
||||
After altering the above file, execute below command
|
||||
|
||||
```
|
||||
$ systemctl restart kamailio.service
|
||||
```
|
||||
|
||||
And, check that there are no error by viewing logs using the below command
|
||||
|
||||
```
|
||||
$ journalctl -f --unit kamailio
|
||||
```
|
||||
|
||||
### P-CSCF
|
||||
|
||||
Edit the DNS domain names, DB URL and IP addresses at all places in the pcscf.cfg, pcscf.xml files accordingly
|
||||
|
||||
Changes required in pcscf.cfg:
|
||||
|
||||
```
|
||||
# SIP / UDP
|
||||
listen=udp:10.4.128.7:5060
|
||||
|
||||
#!define IPSEC_LISTEN_ADDR "10.4.128.7"
|
||||
|
||||
alias=pcscf.mnc096.mcc262.3gppnetwork.org
|
||||
|
||||
#!define PCSCF_URL "sip:pcscf.mnc096.mcc262.3gppnetwork.org"
|
||||
|
||||
#!subst "/NETWORKNAME/mnc096.mcc262.3gppnetwork.org/"
|
||||
#!subst "/HOSTNAME/pcscf.mnc096.mcc262.3gppnetwork.org/"
|
||||
|
||||
#!define DB_URL "mysql://pcscf:heslo@localhost/pcscf"
|
||||
|
||||
#!define SQLOPS_DBURL "pcscf=>mysql://pcscf:heslo@localhost/pcscf"
|
||||
|
||||
##!define TRF_FUNCTION "trf.mnc096.mcc262.3gppnetwork.org"
|
||||
|
||||
#!define WITH_RX
|
||||
#!define WITH_RX_REG
|
||||
#!define WITH_RX_CALL
|
||||
|
||||
#!define WITH_IPSEC
|
||||
```
|
||||
|
||||
Changes required in pcscf.xml:
|
||||
|
||||
```
|
||||
FQDN="pcscf.mnc096.mcc262.3gppnetwork.org"
|
||||
|
||||
Realm="mnc096.mcc262.3gppnetwork.org"
|
||||
|
||||
<Peer FQDN="pcrf.mnc096.mcc262.3gppnetwork.org" Realm="mnc096.mcc262.3gppnetwork.org" port="3868"/>
|
||||
|
||||
<Acceptor port="3871" bind="10.4.128.7"/>
|
||||
|
||||
<DefaultRoute FQDN="pcrf.mnc096.mcc262.3gppnetwork.org" metric="10"/>
|
||||
```
|
||||
|
||||
Changes required in kamailio_pcscf.cfg:
|
||||
|
||||
```
|
||||
# ------------------ module loading ----------------------------------
|
||||
mpath="/usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/:/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/:/usr/lib/x86_64-linux-gnu/kamailio/modules/"
|
||||
|
||||
# AVP's required for Fail-Over-Support:
|
||||
#modparam("dispatcher", "dst_avp", "$avp(DISPATCHER_DST_AVP)")
|
||||
#modparam("dispatcher", "grp_avp", "$avp(DISPATCHER_GRP_AVP)")
|
||||
#modparam("dispatcher", "cnt_avp", "$avp(DISPATCHER_CNT_AVP)")
|
||||
#modparam("dispatcher", "sock_avp", "$avp(DISPATCHER_SOCK_AVP)")
|
||||
|
||||
#modparam("ims_usrloc_pcscf", "hashing_type", 2)
|
||||
```
|
||||
|
||||
Changes required in dispatcher.list:
|
||||
|
||||
```
|
||||
# SBC's
|
||||
2 sip:10.4.128.7:5070
|
||||
```
|
||||
|
||||
To perform a quick test edit the /etc/default/kamailio file, by changing the configuration file parameter as follows:
|
||||
|
||||
```
|
||||
# Config file
|
||||
CFGFILE=/etc/kamailio_pcscf/kamailio_pcscf.cfg
|
||||
```
|
||||
|
||||
After altering the above file, execute below command
|
||||
|
||||
```
|
||||
$ systemctl restart kamailio.service
|
||||
```
|
||||
|
||||
And, check that there are no error by viewing logs using the below command (Ignore the rtpengine related for now, as we will install in next step)
|
||||
|
||||
```
|
||||
$ journalctl -f --unit kamailio
|
||||
```
|
||||
|
||||
### S-CSCF
|
||||
|
||||
Edit the DNS domain names, DB URL and IP addresses at all places in the scscf.cfg, scscf.xml files accordingly
|
||||
|
||||
Changes required in scscf.cfg:
|
||||
|
||||
```
|
||||
# SIP / UDP
|
||||
listen=udp:10.4.128.7:6060
|
||||
|
||||
#!define NETWORKNAME "mnc096.mcc262.3gppnetwork.org"
|
||||
#!define HOSTNAME "scscf.mnc096.mcc262.3gppnetwork.org"
|
||||
#!define URI "sip:scscf.mnc096.mcc262.3gppnetwork.org:6060"
|
||||
|
||||
alias=scscf.mnc096.mcc262.3gppnetwork.org
|
||||
|
||||
# ENUM-Server to query:
|
||||
#!define ENUM_SUFFIX "mnc096.mcc262.3gppnetwork.org."
|
||||
|
||||
#!define DB_URL "mysql://scscf:heslo@localhost/scscf"
|
||||
|
||||
#!define RO_MNC "96"
|
||||
```
|
||||
|
||||
Changes required in scscf.xml:
|
||||
|
||||
```
|
||||
FQDN="scscf.mnc096.mcc262.3gppnetwork.org"
|
||||
|
||||
Realm="mnc096.mcc262.3gppnetwork.org"
|
||||
|
||||
<Peer FQDN="hss.mnc096.mcc262.3gppnetwork.org" Realm="mnc096.mcc262.3gppnetwork.org" port="3868"/>
|
||||
|
||||
<Acceptor port="3870" bind="10.4.128.7"/>
|
||||
|
||||
<DefaultRoute FQDN="hss.mnc096.mcc262.3gppnetwork.org" metric="10"/>
|
||||
```
|
||||
|
||||
Changes required in kamailio_scscf.cfg:
|
||||
|
||||
```
|
||||
# ------------------ module loading ----------------------------------
|
||||
mpath="/usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/:/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/:/usr/lib/x86_64-linux-gnu/kamailio/modules/"
|
||||
|
||||
# AVP's required for Fail-Over-Support:
|
||||
#modparam("dispatcher", "dst_avp", "$avp(DISPATCHER_DST_AVP)")
|
||||
#modparam("dispatcher", "grp_avp", "$avp(DISPATCHER_GRP_AVP)")
|
||||
#modparam("dispatcher", "cnt_avp", "$avp(DISPATCHER_CNT_AVP)")
|
||||
#modparam("dispatcher", "sock_avp", "$avp(DISPATCHER_SOCK_AVP)")
|
||||
```
|
||||
|
||||
Changes required in dispatcher.list: Not sure what to do hence comment out as follows
|
||||
|
||||
```
|
||||
# ng-voice Interconnect
|
||||
#1 sip:sbc-1.ng-voice.com
|
||||
#1 sip:sbc-2.ng-voice.com
|
||||
```
|
||||
|
||||
To perform a quick test edit the /etc/default/kamailio file, by changing the configuration file parameter as follows:
|
||||
|
||||
```
|
||||
# Config file
|
||||
CFGFILE=/etc/kamailio_scscf/kamailio_scscf.cfg
|
||||
```
|
||||
|
||||
After altering the above file, execute below command
|
||||
|
||||
```
|
||||
$ systemctl restart kamailio.service
|
||||
```
|
||||
|
||||
And, check that there are no error by viewing logs using the below command
|
||||
|
||||
```
|
||||
$ journalctl -f --unit kamailio
|
||||
```
|
||||
|
||||
Can run S-CSCF as follows: `kamailio -f kamailio_scscf.cfg`
|
||||
|
||||
|
||||
#### 15. Install RTPEngine
|
||||
|
||||
Check for dependencies, install dependencies and build .deb packages
|
||||
|
||||
```
|
||||
$ export DEB_BUILD_PROFILES="pkg.ngcp-rtpengine.nobcg729"
|
||||
$ apt install dpkg-dev
|
||||
$ git clone https://github.com/sipwise/rtpengine
|
||||
$ cd rtpengine && git checkout mr7.4.1
|
||||
$ dpkg-checkbuilddeps
|
||||
```
|
||||
The above command checks for dependencies and give you a list of dependencies which are missing in the system. The below list is the result of this command
|
||||
|
||||
```
|
||||
$ apt install debhelper default-libmysqlclient-dev gperf iptables-dev libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libbencode-perl libcrypt-openssl-rsa-perl libcrypt-rijndael-perl libdigest-crc-perl libdigest-hmac-perl libevent-dev libhiredis-dev libio-multiplex-perl libio-socket-inet6-perl libiptc-dev libjson-glib-dev libnet-interface-perl libpcap0.8-dev libsocket6-perl libspandsp-dev libswresample-dev libsystemd-dev libxmlrpc-core-c3-dev markdown dkms module-assistant keyutils libnfsidmap2 libtirpc1 nfs-common rpcbind
|
||||
```
|
||||
|
||||
After installing dependencies run the below command again and verify that no dependencies are left out
|
||||
|
||||
```
|
||||
$ dpkg-checkbuilddeps
|
||||
```
|
||||
|
||||
This should just return back to shell with no output if all depedencies are met
|
||||
|
||||
```
|
||||
$ dpkg-buildpackage -uc -us
|
||||
$ cd ..
|
||||
$ dpkg -i *.deb
|
||||
$ cp /etc/rtpengine/rtpengine.sample.conf /etc/rtpengine/rtpengine.conf
|
||||
```
|
||||
|
||||
Edit this file as follows under "[rtpengine]":
|
||||
|
||||
```
|
||||
interface = 10.4.128.7!172.24.15.21
|
||||
```
|
||||
|
||||
Port on which rtpengine binds i.e. listen_ng parameter is udp port 2223. This should be updated in kamailio_pcscf.cfg file at modparam(rtpengine ...
|
||||
|
||||
```
|
||||
# ----- rtpproxy params -----
|
||||
modparam("rtpengine", "rtpengine_sock", "1 == udp:localhost:2223")
|
||||
```
|
||||
|
||||
```
|
||||
$ cp /etc/rtpengine/rtpengine-recording.sample.conf /etc/rtpengine/rtpengine-recording.conf
|
||||
$ mkdir /var/spool/rtpengine
|
||||
$ systemctl restart ngcp-rtpengine-daemon.service ngcp-rtpengine-recording-daemon.service ngcp-rtpengine-recording-nfs-mount.service
|
||||
$ systemctl enable ngcp-rtpengine-daemon.service ngcp-rtpengine-recording-daemon.service ngcp-rtpengine-recording-nfs-mount.service
|
||||
|
||||
$ systemctl stop rtpproxy
|
||||
$ systemctl disable rtpproxy
|
||||
$ systemctl mask rtpproxy
|
||||
```
|
||||
|
||||
#### 16. Running I-CSCF, P-CSCF and S-CSCF as separate systemctl process
|
||||
|
||||
First, stop the default kamailio SIP server
|
||||
|
||||
```
|
||||
$ systemctl stop kamailio
|
||||
$ systemctl disable kamailio
|
||||
$ systemctl mask kamailio
|
||||
```
|
||||
|
||||
Copy the init file each of the process you need
|
||||
|
||||
```
|
||||
$ cp /etc/init.d/kamailio /etc/init.d/kamailio_icscf
|
||||
$ cp /etc/init.d/kamailio /etc/init.d/kamailio_pcscf
|
||||
$ cp /etc/init.d/kamailio /etc/init.d/kamailio_scscf
|
||||
```
|
||||
|
||||
Changes required in /etc/init.d/kamailio_icscf
|
||||
|
||||
```
|
||||
NAME="kamailio_icscf"
|
||||
CFGFILE=/etc/$NAME/kamailio_icscf.cfg
|
||||
```
|
||||
|
||||
Changes required in /etc/init.d/kamailio_pcscf
|
||||
|
||||
```
|
||||
NAME="kamailio_pcscf"
|
||||
CFGFILE=/etc/$NAME/kamailio_pcscf.cfg
|
||||
```
|
||||
|
||||
Changes required in /etc/init.d/kamailio_scscf
|
||||
|
||||
```
|
||||
NAME="kamailio_scscf"
|
||||
CFGFILE=/etc/$NAME/kamailio_scscf.cfg
|
||||
```
|
||||
|
||||
```
|
||||
$ cd /etc/default/
|
||||
$ cp kamailio kamailio_icscf
|
||||
$ cp kamailio kamailio_pcscf
|
||||
$ cp kamailio kamailio_scscf
|
||||
```
|
||||
|
||||
Changes required in /etc/default/kamailio_icscf
|
||||
|
||||
```
|
||||
CFGFILE=/etc/kamailio_icscf/kamailio_icscf.cfg
|
||||
|
||||
RUN_KAMAILIO=yes
|
||||
```
|
||||
|
||||
Changes required in /etc/default/kamailio_pcscf
|
||||
|
||||
```
|
||||
CFGFILE=/etc/kamailio_pcscf/kamailio_pcscf.cfg
|
||||
|
||||
RUN_KAMAILIO=yes
|
||||
```
|
||||
|
||||
Changes required in /etc/default/kamailio_scscf
|
||||
|
||||
```
|
||||
CFGFILE=/etc/kamailio_scscf/kamailio_scscf.cfg
|
||||
|
||||
RUN_KAMAILIO=yes
|
||||
```
|
||||
|
||||
Finally,
|
||||
|
||||
```
|
||||
$ systemctl start kamailio_icscf kamailio_pcscf kamailio_scscf
|
||||
```
|
||||
|
||||
#### 17. Ensure NextEPC PCRF of the Core Network is configured to use IMS
|
||||
|
||||
In nextepc.conf, add the floating IP of the VM running P-CSCF as shown below
|
||||
|
||||
```
|
||||
pcscf:
|
||||
- 172.24.15.21
|
||||
```
|
||||
|
||||
And, make sure to run NextEPC with Realm as created above "mnc096.mcc262.3gppnetwork.org" so that when a connection request from P-SCSF to PCRF with a FQDN pcrf.mnc096.mcc262.3gppnetwork.org it should be resolved as localhost of the NextEPC machine
|
||||
{: .notice--warning}
|
||||
|
||||
- To change Realm in All-in-One NextEPC configuration
|
||||
|
||||
```
|
||||
$ cd ~/nextepc/install/etc/nextepc/freediameter
|
||||
```
|
||||
|
||||
- And, change all the configuration files in freediameter folder (hss.conf, mme.conf, pcrf.conf, pgw.conf) to have desired Domain Name
|
||||
- Copy make_certs.sh from ~/nextepc/support/freeDiameter/ to ~/nextepc/install/etc/nextepc/freediameter
|
||||
- Modify Domain Names in make_certs.sh and Generate the certificates using make_certs.sh
|
||||
- Insert additional "ConnectPeer" entry in ~/nextepc/install/etc/nextepc/freediameter/pcrf.conf to connect to P-CSCF as show below
|
||||
|
||||
```
|
||||
ConnectPeer = "pcscf.mnc096.mcc262.3gppnetwork.org" { ConnectTo = "172.24.15.21"; Port=3871; No_TLS; NO_SCTP; };
|
||||
```
|
||||
@@ -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
|
||||
|
||||
@@ -65,7 +65,7 @@ Sun May 26 14:26:12 2019
|
||||
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 recognised then we can expect to print "Card inserted".
|
||||
- If SIM card reader is recognized then we can expect to print "Card inserted".
|
||||
|
||||
###### Get the code of PySIM with installing dependency:
|
||||
|
||||
@@ -86,7 +86,7 @@ SMSP: ffffffffffffffffffffffffffffffffffffffffffffffffe1ffffffffffffffffffffffff
|
||||
...
|
||||
```
|
||||
|
||||
###### Program your SIM card¶ like the followings:
|
||||
###### 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
|
||||
@@ -199,7 +199,7 @@ K : B1233463AB9BC2AD2DB1830EB6417E7B
|
||||
OPc : 625150E2A943E3353DD23554101CAFD4
|
||||
```
|
||||
|
||||
If you programmed USIM using a card reader like me, you should use the following information.
|
||||
If you programmed USIM using a card reader like me, you should use your SIM information.
|
||||
```
|
||||
MCC/MNC : 310/789
|
||||
IMSI : 310789012345301
|
||||
@@ -283,15 +283,10 @@ $ sudo systemctl restart nextepc-mmed
|
||||
$ sudo systemctl restart nextepc-sgwd
|
||||
```
|
||||
|
||||
If your phone can connect to internet, you must run the following commands in NextEPC-PGW installed host.
|
||||
If your phone can connect to internet, you must run the following command in NextEPC-PGW installed host.
|
||||
|
||||
###### Enable IPv4 Forward:
|
||||
```
|
||||
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
|
||||
```
|
||||
|
||||
###### Check IP Tables:
|
||||
```
|
||||
```bash
|
||||
### Check IP Tables
|
||||
$ sudo iptables -L
|
||||
Chain INPUT (policy ACCEPT)
|
||||
target prot opt source destination
|
||||
@@ -302,6 +297,7 @@ 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
|
||||
@@ -314,17 +310,15 @@ 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
|
||||
```
|
||||
|
||||
- There is nothing on the table. It is in very good condition. If there is somthing in the table, you will need to take some special action. (For example, disable docker service and reboot the machine)
|
||||
|
||||
###### If your IP tables is clean, Add IP/NAT Table like the followings:
|
||||
```
|
||||
$ sudo iptables -t nat -A POSTROUTING -o 'interface-name' -j MASQUERADE
|
||||
$ sudo iptables -I INPUT -i pgwtun -j ACCEPT
|
||||
```
|
||||
|
||||
**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
|
||||
@@ -416,7 +410,7 @@ Setting Sampling frequency 11.52 MHz
|
||||
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.
|
||||
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
|
||||
|
||||
@@ -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,8 @@ 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)
|
||||
- [Setting up Kamailio IMS](guide/04-setting-up-kamailio-IMS)
|
||||
|
||||
- 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:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "v0.4.1 - Stable version of v0.4.x"
|
||||
title: "v0.4.1 - Bug fixes & minor changes"
|
||||
date: 2019-05-18 19:06:00 +0900
|
||||
categories:
|
||||
- Release
|
||||
|
||||
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}
|
||||
122
docs/_posts/2019-07-30-release-v0.5.1.md
Normal file
122
docs/_posts/2019-07-30-release-v0.5.1.md
Normal file
@@ -0,0 +1,122 @@
|
||||
---
|
||||
title: "v0.5.1 - SMS over SG Supported"
|
||||
date: 2019-07-30 22:20:00 +0900
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
- News
|
||||
- Release
|
||||
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
---
|
||||
|
||||
#### New Features
|
||||
- SMS over SG Support
|
||||
|
||||
#### Solving the CS Fallback Issue
|
||||
- CS Fallback Configuration Changes ([#224](https://github.com/open5gs/nextepc/issues/224), [#225](https://github.com/open5gs/nextepc/issues/225), [#231](https://github.com/open5gs/nextepc/issues/231)) -- [medeiros405](https://github.com/medeiros405)
|
||||
|
||||
1. Single MSC/VLR(127.0.0.2)
|
||||
```
|
||||
sgsap:
|
||||
addr: 127.0.0.2
|
||||
map:
|
||||
tai:
|
||||
plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
tac: 4130
|
||||
lai:
|
||||
plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
lac: 43690
|
||||
map:
|
||||
tai:
|
||||
plmn_id:
|
||||
mcc: 002
|
||||
mnc: 02
|
||||
tac: 4132
|
||||
lai:
|
||||
plmn_id:
|
||||
mcc: 002
|
||||
mnc: 02
|
||||
lac: 43692
|
||||
```
|
||||
|
||||
2. Multiple MSC/VLR
|
||||
|
||||
```
|
||||
sgsap:
|
||||
- addr: 127.0.0.2
|
||||
port: 29119
|
||||
map:
|
||||
tai:
|
||||
plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
tac: 4131
|
||||
lai:
|
||||
plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
lac: 43691
|
||||
map:
|
||||
tai:
|
||||
plmn_id:
|
||||
mcc: 002
|
||||
mnc: 02
|
||||
tac: 4132
|
||||
lai:
|
||||
plmn_id:
|
||||
mcc: 002
|
||||
mnc: 02
|
||||
lac: 43692
|
||||
- addr
|
||||
- 127.0.0.3
|
||||
- fe80::2%lo
|
||||
map:
|
||||
tai:
|
||||
plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
tac: 4132
|
||||
lai:
|
||||
plmn_id:
|
||||
mcc: 002
|
||||
mnc: 02
|
||||
lac: 43692
|
||||
- name: msc.open5gs.org
|
||||
map:
|
||||
tai:
|
||||
plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
tac: 4133
|
||||
lai:
|
||||
plmn_id:
|
||||
mcc: 002
|
||||
mnc: 02
|
||||
lac: 43693
|
||||
```
|
||||
|
||||
- UEContextModifcationRequest does not have both CSFallbackIndicator and SecurityCapabilities ([#223](https://github.com/open5gs/nextepc/pull/223)) -- [medeiros405](https://github.com/medeiros405)
|
||||
- NextEPC crash in MT-Fallback with fixing the BUG of ogs_realloc() ([ogslib:#4](https://github.com/open5gs/ogslib/issues/4))
|
||||
- Add Paging Reject
|
||||
|
||||
#### Enhancements
|
||||
- Fix Diameter spec-compliant related issue ([#240](https://github.com/open5gs/nextepc/pull/240)) -- [laf0rge](https://github.com/laf0rge)
|
||||
- Prefer to use SCTP in Diameter ([#235](https://github.com/open5gs/nextepc/pull/235)) -- [laf0rge](https://github.com/laf0rge)
|
||||
- Set Diameter SCTP PPID to 46 ([#234](https://github.com/open5gs/nextepc/issues/234)) -- [laf0rge](https://github.com/laf0rge)
|
||||
- MME protects SecurityModeComplete that is not integrity ([#226](https://github.com/open5gs/nextepc/issues/226)) -- [laf0rge](https://github.com/laf0rge)
|
||||
- Add Guard timer in EMM state machine ([#220](https://github.com/open5gs/nextepc/pull/220)) -- [laf0rge](https://github.com/laf0rge)
|
||||
- mme-kdf: Ensure input arguments(kasme, ..) are read-only and 'const' ([#230](https://github.com/open5gs/nextepc/pull/230)) -- [laf0rge](https://github.com/laf0rge)
|
||||
|
||||
|
||||
#### Bug fixes
|
||||
- Fix the problem of releasing Dedicated Bearer ([#180](https://github.com/open5gs/nextepc/issues/180)) -- [lezixiao](https://github.com/lezixiao)
|
||||
- Fix the MME crash if UE indicates only EIA0 ([#222](https://github.com/open5gs/nextepc/pull/222)) -- [laf0rge](https://github.com/laf0rge)
|
||||
- Sending ErrorIndication if S1AP decoding is failed ([#218](https://github.com/open5gs/nextepc/pull/218), [#219](https://github.com/open5gs/nextepc/pull/219)) -- [laf0rge](https://github.com/laf0rge)
|
||||
|
||||
|
||||
Download -- [v0.5.1.tar.gz](https://github.com/open5gs/nextepc/archive/v0.5.1.tar.gz)
|
||||
{: .notice--info}
|
||||
Binary file not shown.
@@ -10,7 +10,7 @@
|
||||
#
|
||||
|
||||
PACKAGE="nextepc"
|
||||
VERSION="0.4.2"
|
||||
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)))
|
||||
@@ -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);
|
||||
@@ -295,8 +286,8 @@ typedef struct pdn_s {
|
||||
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
|
||||
@@ -334,7 +325,7 @@ typedef struct pco_id_s {
|
||||
void *data;
|
||||
} pco_id_t;
|
||||
|
||||
#define MAX_NUM_OF_PROTOCOL_OR_CONTAINER_ID 8
|
||||
#define MAX_NUM_OF_PROTOCOL_OR_CONTAINER_ID 16
|
||||
typedef struct pco_s {
|
||||
ED3(uint8_t ext:1;,
|
||||
uint8_t spare:4;,
|
||||
|
||||
@@ -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,12 +27,12 @@
|
||||
|
||||
#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 */
|
||||
@@ -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 */
|
||||
@@ -70,6 +70,18 @@ LT_INIT([dlopen pic-only disable-static])
|
||||
dnl Checks for compile flag
|
||||
dnl AX_CHECK_COMPILE_FLAG([-Wno-format-truncation],[CFLAGS="$CFLAGS -Wno-format-truncation"])
|
||||
|
||||
if test "x$LEX" != "xflex"; then
|
||||
AC_MSG_ERROR([flex program is needed to build freeDiameter, please install flex.])
|
||||
fi
|
||||
|
||||
if test "x$YACC" = "xyacc"; then
|
||||
# AC_PROG_YACC only checks for yacc replacements, not for yacc itself
|
||||
AC_CHECK_PROG([YACC_FOUND], [yacc], [yes], [no])
|
||||
if test "x$YACC_FOUND" = "xno"; then
|
||||
AC_MSG_ERROR([A yacc program is needed to build freeDiameter, please install bison.])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Check Endian
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
|
||||
@@ -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,8 +17,8 @@
|
||||
* 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"
|
||||
|
||||
@@ -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-05-28 16:37:12.779763 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
@@ -17,9 +17,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gtp_conv.h"
|
||||
#include "gtp_node.h"
|
||||
#include "gtp_xact.h"
|
||||
#include "gtp-conv.h"
|
||||
#include "gtp-node.h"
|
||||
#include "gtp-xact.h"
|
||||
|
||||
static OGS_POOL(pool, gtp_node_t);
|
||||
|
||||
@@ -36,45 +36,17 @@ int gtp_node_final(void)
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
gtp_node_t *gtp_create_node(
|
||||
ogs_sockaddr_t *all_list, int no_ipv4, int no_ipv6, int prefer_ipv4)
|
||||
gtp_node_t *gtp_node_new(ogs_sockaddr_t *addr)
|
||||
{
|
||||
int rv;
|
||||
gtp_node_t *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);
|
||||
}
|
||||
|
||||
ogs_assert(preferred_list);
|
||||
ogs_assert(addr);
|
||||
|
||||
ogs_pool_alloc(&pool, &node);
|
||||
ogs_assert(node);
|
||||
memset(node, 0, sizeof(gtp_node_t));
|
||||
|
||||
node->sa_list = preferred_list;
|
||||
node->addr = addr;
|
||||
|
||||
ogs_list_init(&node->local_list);
|
||||
ogs_list_init(&node->remote_list);
|
||||
@@ -82,7 +54,7 @@ gtp_node_t *gtp_create_node(
|
||||
return node;
|
||||
}
|
||||
|
||||
int gtp_delete_node(gtp_node_t *node)
|
||||
void gtp_node_free(gtp_node_t *node)
|
||||
{
|
||||
ogs_assert(node);
|
||||
|
||||
@@ -91,64 +63,59 @@ int gtp_delete_node(gtp_node_t *node)
|
||||
|
||||
gtp_xact_delete_all(node);
|
||||
|
||||
ogs_freeaddrinfo(node->sa_list);
|
||||
ogs_freeaddrinfo(node->addr);
|
||||
ogs_pool_free(&pool, node);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
gtp_node_t *gtp_add_node(ogs_list_t *list, gtp_f_teid_t *f_teid,
|
||||
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 *sa_list = 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, &sa_list);
|
||||
rv = gtp_f_teid_to_sockaddr(f_teid, port, &addr);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
node = gtp_create_node(sa_list, no_ipv4, no_ipv6, prefer_ipv4);
|
||||
ogs_list_add(list, node);
|
||||
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);
|
||||
|
||||
rv = ogs_sock_fill_scope_id_in_local(node->sa_list);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
ogs_freeaddrinfo(sa_list);
|
||||
ogs_list_add(list, node);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
int gtp_remove_node(ogs_list_t *list, gtp_node_t *node)
|
||||
void gtp_node_remove(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;
|
||||
gtp_node_free(node);
|
||||
}
|
||||
|
||||
int gtp_remove_all_nodes(ogs_list_t *list)
|
||||
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_remove_node(list, node);
|
||||
|
||||
return OGS_OK;
|
||||
gtp_node_remove(list, node);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
int rv;
|
||||
gtp_node_t *node = NULL;
|
||||
@@ -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 { \
|
||||
@@ -39,7 +39,7 @@ extern "C" {
|
||||
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_s {
|
||||
int gtp_node_init(void);
|
||||
int gtp_node_final(void);
|
||||
|
||||
gtp_node_t *gtp_create_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_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"
|
||||
|
||||
@@ -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,19 +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
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
/* 8.4 Cause */
|
||||
#define GTP_CAUSE_LOCAL_DETACH 2
|
||||
@@ -434,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,14 +17,14 @@
|
||||
* 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_s gtp_node_t;
|
||||
|
||||
@@ -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 */
|
||||
@@ -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