Compare commits

..

286 Commits

Author SHA1 Message Date
Sukchan Lee
8c7371db7f Release v0.5.2 2019-08-11 11:19:05 +00:00
Sukchan Lee
a6f9ad52cb [#245] Add Configurable Memory Pool Size 2019-08-09 23:28:58 +09:00
Sukchan Lee
e2f94753b7 Merge pull request #244 from herlesupreeth/master
Edit IMS setup guide to install from deb packages
2019-08-07 00:09:01 +09:00
Supreeth Herle
9d8203eb68 Edit IMS setup guide to install from deb packages 2019-08-06 15:10:42 +02:00
Sukchan Lee
9079ab216d [#237] Add the IMS Guide 2019-08-05 23:04:02 +09:00
Sukchan Lee
4eb26c4012 Merge branch 'master' of https://github.com/open5gs/nextepc 2019-08-04 14:12:40 +09:00
Sukchan Lee
4b7721ba48 Relink ogslib 2019-08-04 14:12:25 +09:00
Sukchan Lee
197a16bca8 [#243] freeDiameter build fail for bison+flex 2019-08-03 23:14:17 +09:00
Sukchan Lee
fe5f2320b3 Fix the invalid IMSI format in volte test code 2019-08-03 22:12:24 +09:00
Sukchan Lee
715d2b7922 fix indentation 2019-08-03 22:08:20 +09:00
Sukchan Lee
56ff495e7b [#236] Fix the number of PCO 2019-08-02 20:41:33 +09:00
Sukchan Lee
d8d2f9836d Fix the SGsAP IPv6 configuration manual 2019-07-30 23:00:15 +09:00
Sukchan Lee
58af53a6cd Merge branch 'master' of https://github.com/open5gs/nextepc 2019-07-30 22:58:39 +09:00
Sukchan Lee
2db2558624 Document Update for v0.5.1 2019-07-30 22:58:17 +09:00
Sukchan Lee
967f40f216 Release v0.5.1 for Ubuntu(xenial) 2019-07-30 22:42:39 +09:00
Sukchan Lee
58105c9b1e Release v0.5.1 for Ubuntu(bionic) 2019-07-30 22:41:29 +09:00
Sukchan Lee
fdb7fbe368 Release v0.5.1 2019-07-30 21:35:04 +09:00
Sukchan Lee
d08a37f9bb WebUI version changes to v0.5.1 2019-07-30 21:05:23 +09:00
Sukchan Lee
8813e0a175 [#236] MME does mandate Subscribed-RAU-TAU-Timer 2019-07-30 20:58:45 +09:00
Sukchan Lee
dac2bd2e4f [#240] WebUI changes to apply default value 2019-07-30 20:51:50 +09:00
Sukchan Lee
4f9a2e94fc Merge pull request #240 from laf0rge/master
diameter spec compliance related fixes
2019-07-30 20:45:24 +09:00
Harald Welte
a7e2865ef0 hss: Subscribed-Periodic-RAU-TAU-Timer is in Subscriptio-Data
At least in version 11.8.0 Release 11 of 3GPP TS 29.272,
Subscribed-Periodic-RAU-TAU-Timer is only permitted inside
Subscription-Data.  Before this patch, the HSS encodes it outside, i.e.
on the "main" level of the DIAMETER AVP tree.

Related: #238
2019-07-30 00:34:55 +02:00
Harald Welte
7915773900 mme: Subscribed-Periodic-RAU-TAU-Timer is in Subscriptio-Data
At least in version 11.8.0 Release 11 of 3GPP TS 29.272,
Subscribed-Periodic-RAU-TAU-Timer is only permitted inside
Subscription-Data.  Before this patch, the MME expects it outside, i.e.
on the "main" level of the DIAMETER AVP tree.

Closes: #238
2019-07-30 00:31:33 +02:00
Harald Welte
8dca1eacd8 mme: Apply default values for Pre-Emption Capability + Vulnerability
Section 7.3.40 of 3GPP TS 29.272 states default values to be used if
those AVPs are not present in the DIAMETER message.

Closes: #239
2019-07-30 00:23:55 +02:00
Sukchan Lee
a3c5dcd190 [#231] Fix the NextEPC die in MT-Fallback 2019-07-28 15:09:23 +00:00
Sukchan Lee
50e2872ff4 [#234] Set SCTP PPID to 46
At this point, SCTP encryption is not supported.
So, PPID 46 is hard-corded.
2019-07-28 22:43:54 +09:00
Sukchan Lee
2109d7f9de [#235] Oops! Diameter SCTP is now enabled in Test 2019-07-28 22:32:44 +09:00
Sukchan Lee
470e66d37d [#235] TCP enabled for MacOSX 2019-07-28 20:18:51 +09:00
Sukchan Lee
f4647ca346 Merge pull request #235 from laf0rge/master
freeDiameter: Use SCTP-only by default, not TCP-only
2019-07-28 20:14:05 +09:00
Sukchan Lee
f5c5701b17 [#180] Fix EBI in the modify bearer request 2019-07-28 19:44:15 +09:00
Harald Welte
a8c14916a7 freeDiameter: Use SCTP-only by default, not TCP-only
The existing freeDiameter default config files for HSS, MME, PCRF and PGW
disabled SCTP and enabled TCP.  This is not in compliance with
3GPP TS 29.272 secition 7.1.5 which clearly states:
	"Diameter messages over the S6a, S6d, S13 and S13' interfaces shall
	 make use of SCTP IETF RFC 4960 [14]"
2019-07-28 12:41:52 +02:00
Sukchan Lee
709cce5c48 [#231] Add crash-test code 2019-07-25 22:20:18 +09:00
Sukchan Lee
dba1fcac5c Use asn1c library interface(CALLOC) for s1ap memory 2019-07-24 21:03:36 +09:00
Sukchan Lee
d791f0034d [SGsAP] add MM-INFORMATION-REQUEST(Discard by Option2) 2019-07-21 22:52:28 +09:00
Sukchan Lee
f19009c736 [#231] Hotfix for asn1c library
Workaround for asn1c library
- More than 9 ProtocolIE cannot be built from InitialContextSetupRequest
2019-07-21 22:39:23 +09:00
Sukchan Lee
82c4c0e1ec [#231] Wow! Succeed to replay crash in SIM 2019-07-21 21:57:36 +09:00
Sukchan Lee
adb48fbad6 For moving a work place 2019-07-21 21:04:10 +09:00
Sukchan Lee
78eeb1ad45 [#231] TAI-LAI configuration changed 2019-07-21 20:25:29 +09:00
Sukchan Lee
a40d1dd2af [#231] sgsap configuration is changed
sgsap:
      addr: 127.0.0.2
      map:
        tai:
          plmn_id:
            mcc: 001
            mnc: 01
          tac: 4131
        lai:
          plmn_id:
            mcc: 001
            mnc: 01
          lac: 43691
2019-07-21 20:06:08 +09:00
Sukchan Lee
46693cd351 [#231] update testsuite 2019-07-21 15:26:42 +09:00
Sukchan Lee
235121c82d [#231] Create simulator 2019-07-21 15:14:31 +09:00
Sukchan Lee
5e78b78166 [CSFB] Implement SGsAP UE-UNREACHABLE message 2019-07-21 13:08:21 +09:00
Sukchan Lee
9f4204ef8e [#227] Fix the crash when both EBT/PTI are 0 2019-07-21 12:20:26 +09:00
Sukchan Lee
60c0eff085 [#226] Protect Integrity in Security-mode Complete 2019-07-21 11:42:12 +09:00
Sukchan Lee
d9238e3036 [#220] fix RACE-CONDITION for MESSAGE and TIMER 2019-07-21 07:01:45 +09:00
Sukchan Lee
649b6ec5e9 Add comment 2019-07-21 01:09:03 +09:00
Sukchan Lee
ae3e59053d [#220] Timer for UE Context Release 2019-07-21 01:03:19 +09:00
Sukchan Lee
5ce04bcc6f [#220] T3489 done 2019-07-20 23:06:54 +09:00
Sukchan Lee
6a1f628e44 [#220] T3450 done 2019-07-20 22:30:53 +09:00
Sukchan Lee
b34dafcb09 [#220] T3470 done 2019-07-20 21:49:47 +09:00
Sukchan Lee
90290d236e [#220] T3460 done 2019-07-20 21:28:36 +09:00
Sukchan Lee
805869da4f [#220] Guard timer instance is created 2019-07-20 20:38:03 +09:00
Sukchan Lee
42f593d360 [TIMER] continue to refine code 2019-07-20 16:39:01 +09:00
Sukchan Lee
6dc66bce85 [TIMER] timer configuration is added 2019-07-20 16:25:09 +09:00
Sukchan Lee
f1c913129d [TIMER] Move SGSAP timer to the FSM 2019-07-20 15:34:41 +09:00
Sukchan Lee
8cf28d6e16 fix indentation 2019-07-20 15:20:52 +09:00
Sukchan Lee
c1c0b640f3 [TIMER] Move S1-Delayed-Send to the FSM 2019-07-20 15:16:46 +09:00
Sukchan Lee
9565967517 [TIMER] Move timer expiration work to the FSM 2019-07-20 13:07:40 +09:00
Sukchan Lee
a96398357f Update New OGSLib commit 2019-07-20 11:20:09 +09:00
Sukchan Lee
d6d824acb9 Merge pull request #230 from laf0rge/master
mme-kdf: Ensure input arguments (kasme, ..) are read-only and 'const'
2019-07-19 20:59:33 +09:00
Harald Welte
83e449ca63 mme-kdf: Ensure input arguments (kasme, ..) are read-only and 'const' 2019-07-18 11:20:14 +02:00
Sukchan Lee
a6e3affbec rename utils to mongodb 2019-07-16 09:14:53 +09:00
Nick
964e7ecebd Add files via upload
Basic Python Library / Class for adding / removing / reading data from NextEPC HSS (MongoDB)
2019-07-15 18:29:22 +10:00
Nick
cfd8df28c6 Create README.md
Added basic usage
2019-07-15 18:28:45 +10:00
Sukchan Lee
b642ca1491 Oops! Fix one more 2019-07-14 13:59:33 +09:00
Sukchan Lee
b9f7e9c409 fix new configuration (#225) 2019-07-14 13:48:14 +09:00
Sukchan Lee
3a5930650e Merge pull request #224 from medeiros405/master
Change in the config to allow different MCC/MNC in the LAI for CSFB
2019-07-14 13:26:22 +09:00
Romeu Medeiros
18ef1f65c3 Change in the config to allow different MCC/MNC in the LAI for CSFB 2019-07-14 01:18:29 -03:00
Sukchan Lee
99d91da6eb Clarify code for pull request (#223) 2019-07-14 11:00:11 +09:00
Sukchan Lee
79a952d910 Merge pull request #223 from medeiros405/master
Modification to correct UEContextModification for CSFB
2019-07-14 08:42:43 +09:00
Romeu Medeiros
a6fe0cb44f Changes to obey the 3GPP specification for CSFallback 2019-07-13 20:26:39 -03:00
medeiros405
3c4601a5e0 Merge branch 'master' of https://github.com/open5gs/nextepc
Update to original repository
2019-07-13 20:11:05 -03:00
Romeu Medeiros
7d79602eb1 Merge branch 'master' of https://github.com/medeiros405/nextepc 2019-07-13 20:08:25 -03:00
Sukchan Lee
942b9466ef Attach Reject if UE indicates only EIA0 (#222) 2019-07-13 23:47:24 +09:00
Sukchan Lee
f043ccd884 Update Document 2019-07-13 22:58:36 +09:00
Sukchan Lee
7d42465f4e [Done] SMS over SGs 2019-07-13 22:52:50 +09:00
Sukchan Lee
8e37f64c33 [SMS] MO-SMS Done 2019-07-13 14:51:35 +09:00
Sukchan Lee
663861d17b [SMS] Add MO-SMS 2019-07-13 11:51:28 +09:00
Sukchan Lee
bedd68573e [CSFB] Add Paging Reject 2019-07-12 23:18:17 +09:00
Sukchan Lee
9408bb6b4a Add Paging Reject 2019-07-12 18:33:42 +09:00
Sukchan Lee
f20a1a6e2b Add ErrorIndication for S1AP decode error (#218) 2019-07-12 16:22:40 +09:00
Sukchan Lee
74c1e1d481 Hotfix for ubuntu release 2019-07-11 15:34:19 +00:00
Sukchan Lee
fa07895b1e Change debian package 2019-07-11 15:30:40 +00:00
Sukchan Lee
610caf3af3 Ubuntu release patch 2019-07-11 15:26:36 +00:00
Sukchan Lee
3e51450b3c Date change 2019-07-12 00:17:29 +09:00
Sukchan Lee
80199a3c87 Update Document 2019-07-12 00:13:07 +09:00
Sukchan Lee
447fd902d2 Release v0.5.0 in Ubuntu(bionic) 2019-07-11 15:10:53 +00:00
Sukchan Lee
bfcaf15d5d Release v0.5.0 in Ubuntu(xenial) 2019-07-11 15:09:24 +00:00
Sukchan Lee
10d9159dc5 rename pkgconfig 2019-07-11 22:45:43 +09:00
Sukchan Lee
e03c1436fb Release v0.5.0 2019-07-11 22:26:56 +09:00
Sukchan Lee
aa4ea44c2c [OGSLIB] Use NEW Version v1.1.0 2019-07-11 22:25:20 +09:00
Sukchan Lee
e023be67e7 [OGSLIB] Use NEW version v1.1.0 2019-07-11 22:24:20 +09:00
Sukchan Lee
0a96d446b8 [Indentation] All source code changed 2019-07-11 22:22:22 +09:00
Sukchan Lee
97afc2db60 fix identation in HSS 2019-07-11 22:16:32 +09:00
Sukchan Lee
27d5208ea3 fix indentation in PGW 2019-07-11 22:09:30 +09:00
Sukchan Lee
7e08f7fc45 fix indentation in SGW 2019-07-11 22:01:52 +09:00
Sukchan Lee
19a01bdda4 Add CSFB TestSuite 2019-07-11 21:56:34 +09:00
Sukchan Lee
cb369daaea fix indentation in MME 2019-07-11 21:53:54 +09:00
Sukchan Lee
cd814afcff [CSFB] MT-Active-Test done 2019-07-11 21:39:44 +09:00
Sukchan Lee
de59488e2e [CSFB] MT-Active-Mode (Not Done) 2019-07-11 18:14:32 +09:00
Sukchan Lee
d9b7e966e1 [CSFB] Add MO in Active-mode 2019-07-10 22:04:52 +09:00
Sukchan Lee
9dbca85c1f [CSFB] Idle-mode done 2019-07-09 09:27:45 +09:00
Sukchan Lee
87cdd71582 Add Cause in Bearer IE (#215) 2019-07-08 23:08:15 +09:00
Sukchan Lee
0e1bd64646 fix indentation 2019-07-08 22:58:41 +09:00
Sukchan Lee
346e67b7de more sleep is needed in the test code 2019-07-08 22:42:10 +09:00
Sukchan Lee
ecfac8fe3b Add Delay for testcode 2019-07-08 22:20:25 +09:00
Sukchan Lee
40ae23aca4 Paging rollback 2019-07-08 21:44:03 +09:00
Sukchan Lee
979fd96a84 [CSFB] Fix the MacOSX 2019-07-08 21:03:39 +09:00
Sukchan Lee
16a8bea96b [CSFB] MT in idle-mode 2019-07-08 18:15:19 +09:00
Sukchan Lee
5e0c10bcb4 [CSFB] Rename test-name 2019-07-08 09:18:17 +09:00
Sukchan Lee
9863635342 [SGsAP] Add SGsAP-RESET-INDCIATON/ACK 2019-07-07 10:16:21 +09:00
Sukchan Lee
bc9cf078a5 [CSFB] Add MO-CSFB-Indication 2019-07-07 09:47:32 +09:00
Sukchan Lee
65cb21ce05 [SGsAP] clarify P_TMSI availablity 2019-07-06 23:30:05 +09:00
Sukchan Lee
0bbc5124e7 rename filename 2019-07-06 22:52:09 +09:00
Sukchan Lee
89ed2dda88 [SGsAP] TestCode for CS fallback in idle-mode 2019-07-06 22:45:15 +09:00
Sukchan Lee
a6eb646b76 [SGsAP] MO CS fallback in idle-mode 2019-07-06 22:16:13 +09:00
Sukchan Lee
5164b51607 [SGsAP] waiting for running the SCTP test server 2019-07-05 18:16:58 +09:00
Sukchan Lee
cc83c6a586 [SGsAP] DETACH-INDICATOIN/ACK is done 2019-07-05 18:13:32 +09:00
Sukchan Lee
a372bd2949 [SGsAP] Start to implement XXX-DETACH-INDICATION 2019-07-05 17:25:12 +09:00
Sukchan Lee
4f7aa2d5b7 [SGsAP] Location Update Reject 2019-07-05 15:55:07 +09:00
Sukchan Lee
334c678995 Fix the Security Command Reject (#214) 2019-07-04 22:48:26 +09:00
Sukchan Lee
0717b57465 Debian package name changed 2019-07-04 13:12:09 +00:00
Sukchan Lee
b440d59ce7 Update documentation 2019-07-04 20:30:58 +09:00
Nick
770d1cdba6 Reordered and updated MME details 2019-07-04 21:10:25 +10:00
Nick
cd2b420470 Created doc "NextEPC Splitting Network Elements"
Outlining basic requirements of each network element and interfaces and how to break up the network.
2019-07-04 21:09:05 +10:00
Sukchan Lee
f9f1ac7aac fix the docker-compose build error (#211) 2019-07-02 22:02:43 +09:00
Sukchan Lee
fd66c4023e Merge pull request #209 from laf0rge/master
freeDiameter: Fix compilation on Linux without SCTP_SEND_FAILED_EVENT
2019-07-02 15:15:52 +09:00
Harald Welte
6fc412dba7 fix 'no rule to make target "-L/usr/local/lib" compilation errors
When building (at least) on Debian unstable, I get the following type of errors:

make[4]: Entering directory '/space/home/laforge/projects/git/nextepc/lib/base'
make[4]: *** No rule to make target '-L/usr/local/lib', needed by 'libbase.la'.  Stop.

The cause seems to be that some target_DEPENDENCIES includes
@OGSCORE_LIBS@ or @OGSCRYPT_LIBS@, whcih both expand to "-L${libdir}
-lpthread -logscore-1.0" as per the pkg-config files.

I believe DEPENDENCIES should not list external library dependencies,
but only dependencies inside the repository.

Closes: #210
2019-07-02 13:58:40 +08:00
Harald Welte
95091210ff freeDiameter: Fix compilation on Linux without SCTP_SEND_FAILED_EVENT
The fallback to the old SCTP API must be made if either SCTP_SEND_FAILED_EVENT
or SCTP_NOTIFICATIONS_STOPPED_EVENT are undeclared.

This fixes building nextepc on e.g. Debian unstable.

Closes: #208
2019-07-02 13:42:33 +08:00
Sukchan Lee
9abc8575f6 fix the testcase error 2019-07-01 10:00:50 +09:00
Sukchan Lee
3ebe749bb2 Merge branch 'master' of https://github.com/open5gs/nextepc 2019-06-30 22:58:48 +09:00
Sukchan Lee
baa35843fc Update document for v0.4.4 2019-06-30 22:58:30 +09:00
Sukchan Lee
d9e0b0eeaf Release v0.4.4 in Ubuntu(bionic) 2019-06-30 13:24:00 +00:00
Sukchan Lee
6e5ab199af Release v0.4.4 in Ubuntu(xenial) 2019-06-30 13:22:19 +00:00
Sukchan Lee
e2af4473dd Release v0.4.4 2019-06-30 12:05:30 +00:00
Sukchan Lee
e704295811 fix the testsuite 2019-06-30 20:48:51 +09:00
Sukchan Lee
8e53e82913 fix identation 2019-06-30 20:46:15 +09:00
Sukchan Lee
db348156e2 fix indentation 2019-06-30 20:29:25 +09:00
Sukchan Lee
de8ae9823a Create Multiple Session for same IMSI (#203) 2019-06-30 12:46:02 +09:00
Sukchan Lee
16fdc0d989 Update identation 2019-06-30 12:14:04 +09:00
Sukchan Lee
971f41d951 Missing file (#203) 2019-06-29 16:04:25 +09:00
Sukchan Lee
7747a4e32a Change MME-UE-S1AP-ID and eNB-UE-S1AP-ID (#203) 2019-06-29 15:51:42 +09:00
Sukchan Lee
44710d3f63 Add simulator to solve (#203) problem 2019-06-29 15:40:52 +09:00
Sukchan Lee
a4d18c2d96 Move enb_ostream_id from mme_ue to enb_ue (#206) 2019-06-28 18:11:16 +09:00
Sukchan Lee
6901278816 Fix the setting of the SCTP ostream-id (#206) 2019-06-26 23:06:31 +09:00
Sukchan Lee
7492ec734b Oops! change github_username 2019-06-26 21:38:33 +09:00
Sukchan Lee
4af3fea81b Fix the MME crash (#205) 2019-06-26 20:52:28 +09:00
Sukchan Lee
148c109d05 Fix the SGW crash for "context not found" (#204) 2019-06-25 23:04:41 +09:00
Sukchan Lee
acd77a8ad6 Fix the MME crash (#203) 2019-06-25 10:55:00 +09:00
Sukchan Lee
f380af44c3 Fix the service reject handling (#201) 2019-06-24 09:44:05 +09:00
Sukchan Lee
5f8d609d0c Handle SR and TAU in security-mode state (#202) 2019-06-23 21:15:59 +09:00
Sukchan Lee
db83b1e004 fix identation 2019-06-23 20:43:23 +09:00
Sukchan Lee
fe15600e02 Remove S1 check in Downlink NAS transport (#201) 2019-06-23 20:17:44 +09:00
Sukchan Lee
9177ad4ee0 When STCP send failed, clear related context (#200) 2019-06-23 13:39:44 +09:00
Sukchan Lee
660ebc823f mme_sctp_event_push() interface introduced 2019-06-23 04:22:22 +00:00
Sukchan Lee
9d0b419085 Create new interface : s1ap_event_push() 2019-06-23 12:47:22 +09:00
Sukchan Lee
79cbd8fb24 Update document for Release v0.4.3 2019-06-22 16:51:28 +09:00
Sukchan Lee
f9ea5a9136 OGSLIB Version check >= 1.0.2 2019-06-22 07:10:23 +00:00
Sukchan Lee
6f65f9b5ec Release v0.4.3 in Ubuntu(Xenial) 2019-06-22 06:57:30 +00:00
Sukchan Lee
e688667b9f Release v0.4.3 in Ubuntu(Bionic) 2019-06-22 06:56:10 +00:00
Sukchan Lee
2ac74ef6ac Release v0.4.3 2019-06-22 04:05:09 +00:00
Sukchan Lee
aeedf01d6a Fix the package error 2019-06-22 03:53:03 +00:00
Sukchan Lee
8902411afe Release v0.4.3 2019-06-22 03:32:00 +00:00
Sukchan Lee
1a26354f29 Release v0.4.3 2019-06-22 03:30:34 +00:00
Sukchan Lee
712b9c8334 [SGsAP] Add TMSI-REALLOCATION-COMPLETE 2019-06-22 12:11:07 +09:00
Sukchan Lee
693afa922f [SGsAP] Location Update process is done 2019-06-22 11:16:22 +09:00
Sukchan Lee
058ebc747d Follow OGSlib updates 2019-06-22 10:14:01 +09:00
Sukchan Lee
5ca6d79590 Running ./tests/testcsfb without an installation 2019-06-22 09:24:46 +09:00
Sukchan Lee
652cfa70d5 [SGsAP] Basic operation done 2019-06-22 00:28:21 +09:00
Sukchan Lee
bbc594330b [SGsAP] update it 2019-06-21 18:23:29 +09:00
Sukchan Lee
c284ef7429 [SGsAP] build LOCATION-UPDATE-REQUEST 2019-06-20 21:22:51 +09:00
Sukchan Lee
95586eaf09 [SGsAP] Not tested 2019-06-20 18:20:32 +09:00
Sukchan Lee
eca47a2773 [SGsAP] update it 2019-06-19 18:04:57 +09:00
Sukchan Lee
0e0a69ed7c [SGsAP] server/client connected in test-code 2019-06-18 17:38:25 +09:00
Sukchan Lee
5ce95f94ee [SGsAP] contine to test code 2019-06-18 15:32:01 +09:00
Sukchan Lee
6b0561681f remove s1ap_recv() 2019-06-18 14:04:11 +09:00
Sukchan Lee
d0417d353a [SGsAP] fix the CSFB test 2019-06-17 12:51:25 +00:00
Sukchan Lee
4013d9203c [SGsAP] Add linger option in usrsctp 2019-06-17 21:40:34 +09:00
Sukchan Lee
fba54b09eb [SGsAP] fix the MacOSX 2019-06-17 20:56:52 +09:00
Sukchan Lee
8a711191b3 [SGsAP] add configuration and fix the testcode 2019-06-17 13:28:39 +09:00
Sukchan Lee
f53e80eec7 [SGsAP] fix the bug in handling memory 2019-06-17 10:36:44 +09:00
Sukchan Lee
fa454209a9 [SGsAP] continue to work 2019-06-16 23:33:23 +09:00
Sukchan Lee
7ee0b3324b [SGsAP] continue to work 2019-06-16 22:22:07 +09:00
Sukchan Lee
bfa526d221 [SGsAP] continue to work 2019-06-16 22:17:38 +09:00
Sukchan Lee
6816400247 [SGsAP] continue to work 2019-06-16 21:26:22 +09:00
Sukchan Lee
3b26983db9 fix identation 2019-06-16 19:09:31 +09:00
Sukchan Lee
eab4958a81 [SGsAP] client program in linux 2019-06-16 09:31:29 +00:00
Sukchan Lee
e2aa8ec198 [SGsAP] Client program 2019-06-16 18:20:40 +09:00
Sukchan Lee
ec7d9f2917 [SGsAP] continue to implement it 2019-06-16 17:33:45 +09:00
Sukchan Lee
0be339e52d [SGSAP] start this feature 2019-06-16 16:47:20 +09:00
Sukchan Lee
fa81c86e22 [CSFB] Create a state machine 2019-06-16 15:40:26 +09:00
Sukchan Lee
1f838c0f68 Move New Indentation with LINUX-style 2019-06-16 11:25:41 +09:00
Sukchan Lee
aa0001c78b more delay needed in MacOSX 2019-06-15 23:34:42 +09:00
Sukchan Lee
c49bda5173 CSFB Test framework done 2019-06-15 23:28:52 +09:00
Sukchan Lee
bb703243c6 Update gitignore 2019-06-15 21:19:38 +09:00
Sukchan Lee
f3a6620a65 CSFB test code update 2019-06-15 21:18:16 +09:00
Sukchan Lee
cb00bf848e Create CSFB test framework 2019-06-15 19:37:34 +09:00
Sukchan Lee
343c72b288 Option for NODELAY 2019-06-15 16:58:52 +09:00
Sukchan Lee
bcd784b1f0 Apply ogslib changes 2019-06-15 16:54:49 +09:00
Sukchan Lee
c855546d77 add delay for volte test 2019-06-15 16:21:18 +09:00
Sukchan Lee
f550919df1 more faster test code 2019-06-15 16:16:32 +09:00
Sukchan Lee
f6a8985267 remove delay in test code 2019-06-15 16:02:52 +09:00
Sukchan Lee
1542d70af6 nodelay for MacOSX 2019-06-15 15:37:05 +09:00
Sukchan Lee
3d154cc423 Apply ogslib changes 2019-06-15 15:21:34 +09:00
Sukchan Lee
fbc73230b0 enb_ue assertion is fixed (#198) 2019-06-15 00:11:30 +09:00
Sukchan Lee
55164b4a1f Turn on SCTP_NODELAY (#198) 2019-06-15 00:03:05 +09:00
Sukchan Lee
c52cf33c3c fix the bug (#195) 2019-06-14 18:10:59 +09:00
Sukchan Lee
eb0d8075ef Continue to fix the crash error (#195) 2019-06-14 17:04:04 +09:00
Sukchan Lee
d3476eca6d Fix PCRF Session Control (#195)
- If PCRF Session is NULL and CC-Request-Type is Terminate,
   the result code is DIAMETER_UNKNOWN_SESSION_ID
2019-06-14 16:55:16 +09:00
Sukchan Lee
9e3ebf9a16 fix the bug (#195), But more work is needed 2019-06-14 14:24:17 +09:00
Sukchan Lee
88217ff11e test framework for crash 2019-06-13 18:22:34 +09:00
Nick
a550cf5b1d Merge pull request #196 from open5gs/nick-docs-update
Update 01-quickstart.md
2019-06-12 19:31:03 +10:00
Nick
d7131dc2e1 Update 01-quickstart.md 2019-06-12 19:15:11 +10:00
Sukchan Lee
22c3d66bc3 More log for analyzing #195 2019-06-11 23:20:49 +09:00
Sukchan Lee
f28f3003c5 change code indentation 2019-06-11 23:16:54 +09:00
Sukchan Lee
c530e1cbcf Fix the bug (#194) 2019-06-11 22:39:23 +09:00
Sukchan Lee
3c61858f21 add missing file 2019-06-11 22:21:45 +09:00
Sukchan Lee
477f16ad0b rename project done 2019-06-11 22:10:47 +09:00
Sukchan Lee
75a18a30cf Add missing files 2019-06-11 18:28:57 +09:00
Sukchan Lee
a32465ed07 Rename library 2019-06-11 18:28:25 +09:00
Sukchan Lee
7bc245028a change directory name test to tests 2019-06-11 14:26:04 +09:00
Sukchan Lee
56567fec12 rename filename 2019-06-11 14:12:31 +09:00
Sukchan Lee
dc7f9d8e12 Change sample pcap from testing with my iphone-XS 2019-06-09 22:00:07 +09:00
Sukchan Lee
57af70fab9 refine GTP interface (#190) 2019-06-09 00:50:02 +09:00
Sukchan Lee
71f1b1cfa4 SGW packet buffer is changed to 65536 2019-06-09 00:03:53 +09:00
Sukchan Lee
60dc4402c6 gtp_path interface changes 2019-06-08 23:42:12 +09:00
Sukchan Lee
d4f00da662 continue to add a buffer configuration 2019-06-08 08:44:22 +09:00
Sukchan Lee
0ff388fb19 apply configuration related to MAX number 2019-06-07 15:19:09 +09:00
Sukchan Lee
ca742661f6 Add configuration related to memory support (#190) 2019-06-07 11:56:37 +09:00
Sukchan Lee
c849cc802c Add libusrsctp work-around for MacOSX 2019-06-06 23:25:32 +09:00
Sukchan Lee
4fc1e0e22c VLR configuration done 2019-06-05 22:23:45 +09:00
Sukchan Lee
d41ce4d8b1 ogs_socknode_new() interface changed 2019-06-05 22:07:37 +09:00
Sukchan Lee
8dc5211448 update it 2019-06-05 21:21:19 +09:00
Sukchan Lee
24da20bdc8 GTP interface changes 2019-06-05 21:13:18 +09:00
Sukchan Lee
70b2e51f79 Merge branch 'master' of https://github.com/open5gs/nextepc 2019-06-04 21:01:45 +09:00
Sukchan Lee
9e4d3cb824 add enb IP address to the log message 2019-06-04 21:01:23 +09:00
Sukchan Lee
10675caf89 Add SGsAP configuration 2019-06-02 21:55:24 +09:00
Sukchan Lee
fb1908410e rename s1ap filename 2019-06-02 11:35:44 +09:00
Sukchan Lee
b9c0feb40e Update configuration 2019-06-02 11:25:13 +09:00
Sukchan Lee
29a50892b5 Let me introduce SGSAP configuration 2019-06-02 11:09:01 +09:00
Sukchan Lee
f7ef0f3aab FAQ update 2019-06-02 00:50:46 +09:00
Sukchan Lee
5f4b42cbfc changes iptable usage 2019-06-02 00:32:32 +09:00
Sukchan Lee
681a7c87a4 usrsctp done 2019-06-01 21:30:13 +09:00
Sukchan Lee
a03df8d656 Document update for MacOSX 2019-06-01 19:53:57 +09:00
Sukchan Lee
a7053eb926 add workaround for MacOSX 2019-06-01 19:51:56 +09:00
Sukchan Lee
fe91a72271 fix the volte test in MacOSX 2019-06-01 19:49:06 +09:00
Sukchan Lee
5693c0c730 Merge branch 'socket' 2019-06-01 19:09:07 +09:00
Sukchan Lee
eb8b7e96d7 update ogslib 2019-06-01 19:08:53 +09:00
Sukchan Lee
85bedf1e35 this project is done 2019-06-01 19:04:34 +09:00
Sukchan Lee
8f8caf5177 remove USRSCTP macro in mme context 2019-06-01 09:57:29 +00:00
Sukchan Lee
756859d05c rename filename for s1ap-path 2019-06-01 09:52:38 +00:00
Sukchan Lee
d4023da087 continue to refine 2019-06-01 09:43:33 +00:00
Sukchan Lee
f384bdef3d fix the linux 2019-06-01 09:33:42 +00:00
Sukchan Lee
4cdc891898 rename source code 2019-06-01 18:20:02 +09:00
Sukchan Lee
7abd6b5ab9 continue to integrate MaxOSX 2019-06-01 18:19:00 +09:00
Sukchan Lee
8a7634d00c the MacOSX porting 2019-06-01 18:06:47 +09:00
Sukchan Lee
1f752e51e8 usrsctp work-around 2019-06-01 17:20:46 +09:00
Sukchan Lee
282936f215 support usrsctp 2019-06-01 16:59:38 +09:00
Sukchan Lee
60bfaa2c41 fix to compile MacOSX 2019-06-01 08:38:57 +09:00
Sukchan Lee
937f0319e3 handler type changes 2019-05-31 23:30:46 +09:00
Sukchan Lee
32c9c512d8 socknode includes pollset 2019-05-31 23:22:22 +09:00
Sukchan Lee
163bc4a040 update it 2019-05-31 13:55:05 +00:00
Sukchan Lee
58faa7bcac apply ogslib changes 2019-05-31 12:05:35 +00:00
Sukchan Lee
61d0573686 ogs_sockopt_t is added 2019-05-31 16:33:09 +09:00
Sukchan Lee
f0c84d3037 move s1ap_lksctp to ogs-lksctp 2019-05-31 14:05:45 +09:00
Sukchan Lee
69cfb3280c rename file 2019-05-31 13:58:08 +09:00
Sukchan Lee
d597912abb sctp configuration update 2019-05-31 11:34:49 +09:00
Sukchan Lee
34e2b4d44a add sctp configuration interface 2019-05-31 11:20:30 +09:00
Sukchan Lee
241efaf581 Change SCTP interface 2019-05-31 10:18:43 +09:00
Sukchan Lee
335e8513e9 fix the MacOSX 2019-05-30 21:51:25 +09:00
Sukchan Lee
cbb819f6b9 apply ogslib changes 2019-05-30 21:30:31 +09:00
Sukchan Lee
2267a59cc3 UDP interface is changed 2019-05-30 21:14:54 +09:00
Sukchan Lee
550be1cd95 apply ogslib interface changes 2019-05-30 20:14:19 +09:00
Sukchan Lee
338f359285 apply new ogslib interface 2019-05-30 19:58:27 +09:00
Sukchan Lee
3da632dd1e rename sa_family and sin_port 2019-05-30 13:50:53 +09:00
Sukchan Lee
8b782eb370 Merge branch 'master' into socket 2019-05-30 12:52:09 +09:00
Sukchan Lee
5bca0920b9 update code indentation 2019-05-29 21:27:22 +09:00
Sukchan Lee
bd1c505024 apply socknode interface changes 2019-05-29 21:05:42 +09:00
Sukchan Lee
1ed22fe7b2 Update document 2019-05-29 20:20:55 +09:00
Sukchan Lee
71367627a8 Fix mistypo 2019-05-29 20:17:12 +09:00
Sukchan Lee
88d0a53956 Release Notes - v0.4.2 2019-05-28 21:19:32 +09:00
Sukchan Lee
4d7b6c04c5 Fix errata for the document 2019-05-28 21:09:56 +09:00
Sukchan Lee
e032565991 Update debian changelog for ubuntu(xenial) 2019-05-28 20:12:02 +09:00
Sukchan Lee
f19f714136 Update debian changelog for ubuntu(bionic) 2019-05-28 20:09:15 +09:00
Romeu Medeiros
825978d2af Revert "Small fix to set correct timezone in UE."
This reverts commit 16aa960b1e.
2019-05-02 11:42:00 -03:00
Medeiros405
16aa960b1e Small fix to set correct timezone in UE. 2018-05-13 00:27:39 -03:00
406 changed files with 25163 additions and 13759 deletions

19
.gitignore vendored
View File

@@ -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

View File

@@ -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

View File

@@ -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
View File

@@ -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
View File

@@ -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
View File

@@ -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

View File

@@ -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 && \

View File

@@ -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

View File

@@ -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`.

View File

@@ -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
---

View 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 ```

View 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; };
```

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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:

View File

@@ -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

View 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}

View 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}

View 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}

View 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}

View 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.

View File

@@ -10,7 +10,7 @@
#
PACKAGE="nextepc"
VERSION="0.4.2"
VERSION="0.5.1"
print_status() {
echo

View File

@@ -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)

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -9,7 +9,6 @@ libbase_la_SOURCES = \
$(NULL)
libbase_la_DEPENDENCIES = \
@OGSCORE_LIBS@ \
$(NULL)
libbase_la_LIBADD = \

View File

@@ -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;
}

View File

@@ -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;,

View File

@@ -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 \

View File

@@ -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;

View File

@@ -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

View File

@@ -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 */

View File

@@ -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

View File

@@ -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 */

View File

@@ -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) );

View File

@@ -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 */

View File

@@ -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) );

View File

@@ -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 */

View File

@@ -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)
{

View File

@@ -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 */

View File

@@ -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) );

View File

@@ -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 */

View File

@@ -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)
{

View File

@@ -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 */

View File

@@ -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) );

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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

View File

@@ -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. */

View File

@@ -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)

View File

@@ -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)
{

View File

@@ -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 */

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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++;

View File

@@ -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 */

View File

@@ -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;
}

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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",

View File

@@ -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 */

View File

@@ -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