Compare commits

...

309 Commits

Author SHA1 Message Date
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
Sukchan Lee
94797e7d7a Update debian package 2019-05-28 20:05:07 +09:00
Sukchan Lee
581f4feb97 struct name update 2019-05-28 17:46:19 +09:00
Sukchan Lee
7c1c320141 gtp interface update 2019-05-28 14:47:06 +09:00
Sukchan Lee
244770de65 mistypo 2019-05-28 11:36:23 +09:00
Sukchan Lee
68ac111bd5 update document 2019-05-26 17:18:56 +09:00
Sukchan Lee
56556195a9 Document update 2019-05-26 17:15:14 +09:00
Sukchan Lee
9be8d1fd00 change new struct definition 2019-05-26 16:10:06 +09:00
Sukchan Lee
cdffdcaa78 update it 2019-05-26 15:27:09 +09:00
Sukchan Lee
ed803b27cb Update it 2019-05-26 12:57:29 +09:00
Sukchan Lee
314642fe1a Update it 2019-05-26 12:22:43 +09:00
Sukchan Lee
d58ddcb3ae Fix the crash error (#187) 2019-05-25 19:39:37 +09:00
Sukchan Lee
60277dcf05 Enable all s1ap message test 2019-05-19 20:26:33 +09:00
Sukchan Lee
77b8656dc3 Fix the PIDFile of the systemd service file (#182) 2019-05-19 00:42:16 +09:00
Sukchan Lee
0f892f6e84 Support a different APN for each PGW (#183) 2019-05-19 00:24:15 +09:00
Sukchan Lee
8ae096f77e Document: Fix the method of uninstalling nextepc 2019-05-18 21:08:25 +09:00
Sukchan Lee
6c99b7c187 Release Notes - v0.4.1 2019-05-18 19:32:14 +09:00
Sukchan Lee
fe68841456 Update debian changelog for ubuntu(bionic) 2019-05-18 09:59:30 +00:00
Sukchan Lee
314a1cd4be Update debian changelog for ubuntu(xenial) 2019-05-18 09:58:03 +00:00
Sukchan Lee
179df88c32 Update debian changelog 2019-05-18 08:19:39 +00:00
Sukchan Lee
bc180c3ffc Improve sanity check for queue-push fail 2019-05-06 23:13:26 +09:00
Sukchan Lee
ab81e38487 Fix the ./testsimple crash in MacOSX 2019-05-06 22:49:58 +09:00
Sukchan Lee
2d7438313d Change initialization sequence 2019-05-06 20:43:50 +09:00
Sukchan Lee
bb67705a66 BUGFIX: if SCTP uses SEQPACKET, sock should not use hash key. 2019-05-06 19:22:43 +09:00
Sukchan Lee
f097364d52 Merge branch 'master' of https://github.com/open5gs/nextepc 2019-05-03 12:43:17 +00:00
Sukchan Lee
0992fbe7f3 Fix the bug of segmentation fault in test program (#175) 2019-05-03 12:41:57 +00:00
Sukchan Lee
9bef56806e Merge pull request #178 from medeiros405/master
Change in the Log about the address use for the UE.
2019-05-03 12:27:37 +10:00
medeiros405
2ef9718209 Change in the Log about the address use for the UE. 2019-05-02 21:40:10 -03: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
Sukchan Lee
d744893fba Update document to fix the WebUI installation URL (#176) 2019-05-02 16:34:05 +10:00
Sukchan Lee
0291d97dd5 Update document for changing debian repository 2019-05-01 18:13:21 +09:00
Sukchan Lee
a5f764544f Remove net-select in debian docker 2019-05-01 17:43:42 +09:00
Sukchan Lee
39766bc379 Merge branch 'master' of https://github.com/open5gs/nextepc 2019-05-01 17:25:29 +09:00
Sukchan Lee
bf1c6c00fe change fedora latest version 2019-05-01 17:24:59 +09:00
Sukchan Lee
c8ed909f46 Remove __DATE__/__TIME due to reproduce same binary 2019-05-01 07:56:46 +00:00
Sukchan Lee
49adabdc70 Fix the compile error for CentOS (#175) 2019-04-30 21:22:35 +00:00
Sukchan Lee
e5523342d4 Set submodule to ogslib master 2019-05-01 00:22:43 +09:00
Sukchan Lee
08efe857a0 Merge branch 'master' of https://github.com/open5gs/nextepc 2019-04-30 15:19:03 +00:00
Sukchan Lee
aec51b399a add xenial package 2019-04-30 15:18:50 +00:00
Sukchan Lee
ce2590d6fc fix the warning 2019-04-30 00:04:43 +09:00
Sukchan Lee
157d5fd739 Update NEWS document 2019-04-29 23:47:33 +09:00
Medeiros405
16aa960b1e Small fix to set correct timezone in UE. 2018-05-13 00:27:39 -03:00
431 changed files with 25405 additions and 14860 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

100
debian/changelog vendored
View File

@@ -1,8 +1,102 @@
nextepc (0.4.0-5~ubuntu) bionic; urgency=medium
nextepc (0.5.1) unstable; urgency=medium
* Integration with OGSLIB
* SMSoSG Supported
* Many BUGS Fixed
-- Sukchan Lee <acetcom@gmail.com> Mon, 29 Apr 2019 14:30:15 +0000
-- Sukchan Lee <acetcom@gmail.com> Tue, 30 Jul 2019 21:34:15 +0900
nextepc (0.5.0-1~bionic) bionic; urgency=medium
* CSFB Supported
* OGSLib package name changed
-- Sukchan Lee <acetcom@gmail.com> Thu, 11 Jul 2019 15:34:08 +0000
nextepc (0.5.0-1~xenial) xenial; urgency=medium
* CSFB Supported
* OGSLib package name changed
-- Sukchan Lee <acetcom@gmail.com> Thu, 11 Jul 2019 15:09:05 +0000
nextepc (0.5.0) unstable; urgency=medium
* CSFB Supported
* OGSLib package name changed
-- Sukchan Lee <acetcom@gmail.com> Thu, 11 Jul 2019 22:26:35 +0900
nextepc (0.4.4~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 30 Jun 2019 13:23:15 +0000
nextepc (0.4.4~xenial) xenial; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 30 Jun 2019 13:21:59 +0000
nextepc (0.4.4) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 30 Jun 2019 12:05:12 +0000
nextepc (0.4.3~xenial) xenial; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 22 Jun 2019 06:57:10 +0000
nextepc (0.4.3~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 22 Jun 2019 06:55:56 +0000
nextepc (0.4.3) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 22 Jun 2019 03:30:10 +0000
nextepc (0.4.2~xenial) xenial; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Tue, 28 May 2019 20:11:51 +0900
nextepc (0.4.2~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Tue, 28 May 2019 20:09:02 +0900
nextepc (0.4.2) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Tue, 28 May 2019 20:04:53 +0900
nextepc (0.4.1~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 18 May 2019 09:59:17 +0000
nextepc (0.4.1~xenial) xenial; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 18 May 2019 09:57:44 +0000
nextepc (0.4.1) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 18 May 2019 08:18:59 +0000
nextepc (0.4.0) unstable; urgency=medium

2
debian/control vendored
View File

@@ -12,7 +12,7 @@ Build-Depends: debhelper (>= 9),
libtool,
flex,
bison,
ogslib-dev (>= 1.0.0),
libogslib-dev,
libgnutls28-dev,
libgcrypt-dev,
libssl-dev,

2
debian/rules vendored
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

@@ -5,14 +5,14 @@ FROM ${dist}:${tag}
MAINTAINER Sukchan Lee <acetcom@gmail.com>
ARG tag=stable
RUN apt-get update && \
apt-get install -y netselect-apt && \
apt-get clean && \
if [ "x$tag" = "xlatest" ]; then \
netselect-apt -o /etc/apt/sources.list; \
else \
netselect-apt ${tag} -o /etc/apt/sources.list; \
fi
#RUN apt-get update && \
# apt-get install -y netselect-apt && \
# apt-get clean && \
# if [ "x$tag" = "xlatest" ]; then \
# netselect-apt -o /etc/apt/sources.list; \
# else \
# netselect-apt ${tag} -o /etc/apt/sources.list; \
# fi
RUN apt-get update && \
apt-get upgrade -y && \

View File

@@ -1 +1 @@
27
29

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)
@@ -31,7 +31,7 @@ $ sudo apt-key add Release.key
In Debian 9.0(stretch), you can install it as follows:
```bash
$ sudo sh -c "echo 'deb https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_9.0/ ./' > /etc/apt/sources.list.d/open5gs.list"
$ sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_9.0/ ./' > /etc/apt/sources.list.d/open5gs.list"
$ sudo apt update
$ sudo apt install nextepc
```
@@ -39,12 +39,12 @@ $ sudo apt install nextepc
Other Linux distributions can be installed by changing the path.
```
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_9.0/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Raspbian_9.0/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_16.04/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_17.10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_18.04/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_18.10/
http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_9.0/
http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Raspbian_9.0/
http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_16.04/
http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_17.10/
http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_18.04/
http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_18.10/
```
[Martin Hauke](https://build.opensuse.org/user/show/mnhauke) packaged NextEPC for *openSUSE* on [OBS](https://build.opensuse.org/package/show/home:mnhauke:nextepc/nextepc).
@@ -119,8 +119,9 @@ $ sudo systemctl restart nextepc-sgwd
1. *Debian and Ubuntu* based Linux distributions can install [Node.js](https://nodejs.org/) as follows:
```bash
$ sudo apt update
$ sudo apt install curl
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
$ sudo apt install nodejs
```
@@ -133,7 +134,7 @@ $ sudo systemctl restart nextepc-sgwd
You can now install WebUI of NextEPC.
```bash
$ curl -sL {{ site.url }}/static/webui/install | sudo -E bash -
$ curl -sL {{ site.url }}{{ site.baseurl }}/assets/webui/install | sudo -E bash -
```
### Register Subscriber Information
@@ -164,17 +165,44 @@ To add subscriber information, you can do WebUI operations in the following orde
If your phone can connect to internet, you must run the following command in NextEPC-PGW installed host.
```bash
### Check IP Tables
$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
### Check NAT Tables
$ sudo iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
### Enable IPv4 Forwarding
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
$ sudo iptables -t nat -A POSTROUTING -o 'interface-name' -j MASQUERADE
$ sudo iptables -I INPUT -i pgwtun -j ACCEPT
### Add NAT Rule
$ sudo iptables -t nat -A POSTROUTING -s 45.45.0.0/16 ! -o pgwtun -j MASQUERADE
```
**Note:** In the above command, you should replace `'interface-name'` with your interface name that can connect to the internet. (For example, `enp0s25`, `wls3`, and so on).
**Note:** For the first time, it is a good condition if you do not have any rules in the IP/NAT tables. If a program such as docker has already set up a rule, you will need to add a rule differently.
{: .notice--danger}
### Turn on your eNodeB and Phone
---
- Connect your eNodeB to the IP of your server via the standard S1AP port of SCTP 36412 (for MME)
- You can see actual traffic through wireshark -- [[srsenb.pcapng]]({{ site.url }}{{ site.baseurl }}/assets/pcapng/srsenb.pcapng).
- You can view the log at `/var/log/nextepc/*.log`.
@@ -216,7 +244,8 @@ How to remove NextEPC package:
1. On *Ubuntu*:
```bash
$ sudo apt purge nextepc*
$ sudo apt purge nextepc
$ sudo apt autoremove
```
2. On *openSUSE*:

View File

@@ -186,7 +186,7 @@ Arguments:
```bash
$ sudo apt install curl
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
$ sudo apt install nodejs
```
@@ -231,13 +231,39 @@ To add subscriber information, you can do WebUI operations in the following orde
If your phone can connect to internet, you must run the following command in NextEPC-PGW installed host.
```bash
### Check IP Tables
$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
### Check NAT Tables
$ sudo iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
### Enable IPv4 Forwarding
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
$ sudo iptables -t nat -A POSTROUTING -o 'interface-name' -j MASQUERADE
$ sudo iptables -I INPUT -i pgwtun -j ACCEPT
### Add NAT Rule
$ sudo iptables -t nat -A POSTROUTING -s 45.45.0.0/16 ! -o pgwtun -j MASQUERADE
```
**Note:** In the above command, you should replace `'interface-name'` with your interface name that can connect to the internet. (For example, `enp0s25`, `wls3`, and so on).
{: .notice--danger}
**Note:** It is a good condition if you do not have any rules in the IP/NAT tables. If a program such as docker has already set up a rule, you will need to add a rule differently.
### Turn on your eNodeB and Phone
---

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

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

@@ -10,28 +10,105 @@ This post is the perfect starting point for learning to build your own LTE netwo
First, you have to prepare USRP B200/B210 to run srsENB. However, please keep in mind that you would still need a fairly high-end PC (at least dual-core i5, better quad-core i7) with USB 3.0 to attach the USRP B200/B210.
Also, for USRP B200/B210 you will need a GPS antenna for clock synchronization. It is good to have a window near your desk where you can put the small GPS patch antenna. In my case, a 1 to 2 meters antenna cable is used between desk/computer and the window.
For USRP B200/B210, you can use a GPS antenna for clock synchronization. Of course, it can work without a GPS antenna, but if you have that antenna, it's a good to have a window near your desk where you can put the small GPS patch antenna. In my case, a 1 to 2 meters antenna cable is used between desk/computer and the window.
For stable operation of USRP B200/B210, I used 10Mhz GPS-DO(GPS disciplined oscillator). Of course, a USIM card(sysmoUSIM-SJS1) was also inserted into the phone.
This document will be described with the following equipment.
- i5-8500 PC with Ubuntu 18.04(bionic)
- USRP B200/B210 with USB 3.0
- iPhone XS
- sysmoUSIM-SJS1
- 10Mhz GPS-DO(Optional)
### Overall Physical Setup
---
Setup your devices in the following order:
If you want to use GPS antenna, setup your devices in the following order:
1. GPS antenna near window
2. GPS antenna connected to "GPS ANT" connector of GPS-DO (SMA)
3. 10MHz output (BNC) of GPS-DO connected to 10MHz input of USRP (SMA)
4. GPS input of USRP open/unused!
5. 1PPS input of USRP open/unused!
6. 4x Small Antennas connected to USRP Rx/Tx ports (RF-A/RF-B)
7. USRP powered via power supply or over USB
8. USRP USB port connected to your PC
9. GPS-DO powered via power supply
6. GPS-DO powered via power supply
**Note:** When the GPS-DO acquires a lock on the GPS signal, a **GREEN** LED is displayed. GPS takes time to function normally. You also need to wait for the **RED** LED(ALARM) to turn off.
{: .notice--warning}
Then, setup the USRP B200/B210 as below:
1. **4x Small Antennas** should be connected to USRP Rx/Tx ports (RF-A/RF-B)
2. USRP powered via power supply or over **USB 3.0**
3. USRP **USB 3.0** port connected to your PC
### USIM Setup
---
Bascially, you can learn how to use it in the [sysmoUSIM manual](https://www.sysmocom.de/manuals/sysmousim-manual.pdf) or on the [official homepage of pysim project](http://osmocom.org/projects/pysim/wiki). Let's take a quickstart guide for this experiment.
###### Install dependencies:
```
$ sudo apt-get install pcscd pcsc-tools libccid libpcsclite-dev python-pyscard
```
- Connect SIM card reader to your computer and insert programmable SIM card to the reader.
###### Check the status of connection by entering the following command:
```
$ pcsc_scan
PC/SC device scanner
V 1.5.2 (c) 2001-2017, Ludovic Rousseau <ludovic.rousseau@free.fr>
Using reader plug'n play mechanism
Scanning present readers...
0: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card Reader] 00
Sun May 26 14:26:12 2019
Reader 0: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card Re
Card state: Card inserted,
ATR: 3B 9F 96 80 1F C7 80 31 A0 73 BE 21 13 67 43 20 07 18 00 00 01 A5
...
```
- If SIM card reader is recognized then we can expect to print "Card inserted".
###### Get the code of PySIM with installing dependency:
```
$ sudo apt-get install python-pyscard python-serial python-pip
$ pip install pytlv
$ git clone git://git.osmocom.org/pysim
```
###### Read your SIM card:
```
$ ./pySim-read.py -p0 or ./pySim-read.py -p1
Using PC/SC reader (dev=0) interface
Reading ...
ICCID: 8988211000000213010
IMSI: 310789012345301
SMSP: ffffffffffffffffffffffffffffffffffffffffffffffffe1ffffffffffffffffffffffff
...
```
###### Program your SIM card like the followings:
```
./pySim-prog.py -p 0 -n NextEPC -a 62416296 -s 8988211000000213010 -i 310789012345301 -x 310 -y 789 -k 82E9053A1882085FF2C020359938DAE9 -o BFD5771AAF4F6728E9BC6EF2C2533BDB
Using PC/SC reader (dev=0) interface
Insert card now (or CTRL-C to cancel)
Autodetected card type: sysmoUSIM-SJS1
Generated card parameters :
> Name : NextEPC
> SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000
> ICCID : 8988211000000213010
> MCC/MNC : 310/789
> IMSI : 310789012345301
> Ki : 82E9053A1882085FF2C020359938DAE9
> OPC : BFD5771AAF4F6728E9BC6EF2C2533BDB
> ACC : None
Programming ...
Done !
```
**Note:** You should use your ADM value to program USIM card, not my ADM(-a 62416296).
{: .notice--warning}
### Installation
---
@@ -93,7 +170,7 @@ $ sudo apt install nextepc
The following shows how to install the Web UI of NextEPC.
```bash
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
$ sudo apt install nodejs
$ curl -sL http://nextepc.org/static/webui/install | sudo -E bash -
```
@@ -116,11 +193,20 @@ IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1
Here's my subscriber information from above.
```
MCC/MNC : 901/70
IMSI : 901700000017408
K : B1233463AB9BC2AD2DB1830EB6417E7B
OPc : 625150E2A943E3353DD23554101CAFD4
```
If you programmed USIM using a card reader like me, you should use your SIM information.
```
MCC/MNC : 310/789
IMSI : 310789012345301
K : 82E9053A1882085FF2C020359938DAE9
OPc : BFD5771AAF4F6728E9BC6EF2C2533BDB
```
Connect to `http://localhost:3000` and login with **admin** account.
> Username : admin
@@ -150,8 +236,8 @@ diff -u mme.conf.old mme.conf
plmn_id:
- mcc: 001
- mnc: 01
+ mcc: 901
+ mnc: 70
+ mcc: 310
+ mnc: 789
mme_gid: 2
mme_code: 1
tai:
@@ -159,8 +245,8 @@ diff -u mme.conf.old mme.conf
- mcc: 001
- mnc: 01
- tac: 12345
+ mcc: 901
+ mnc: 70
+ mcc: 310
+ mnc: 789
+ tac: 7
security:
integrity_order : [ EIA1, EIA2, EIA0 ]
@@ -172,7 +258,7 @@ S1AP/GTP-C IP address, PLMN ID, TAC are changed as follows.
```
S1AP address : 127.0.1.100 - srsENB default value
GTP-C address : 127.0.1.100 - Use loopback interface
PLMN ID : MNC(901), MCC(70) - sysmoUSIM default value
PLMN ID : MNC(310), MCC(789) - Programmed USIM with a card reader
TAC : 7 - srsENB default value
```
@@ -200,12 +286,39 @@ $ sudo systemctl restart nextepc-sgwd
If your phone can connect to internet, you must run the following command in NextEPC-PGW installed host.
```bash
### Check IP Tables
$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
### Check NAT Tables
$ sudo iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
### Enable IPv4 Forwarding
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
$ sudo iptables -t nat -A POSTROUTING -o 'interface-name' -j MASQUERADE
$ sudo iptables -I INPUT -i pgwtun -j ACCEPT
### Add NAT Rule
$ sudo iptables -t nat -A POSTROUTING -s 45.45.0.0/16 ! -o pgwtun -j MASQUERADE
```
**Note:** In the above command, you should replace `'interface-name'` with your interface name that can connect to the internet. (For example, `enp0s25`, `wls3`, and so on).
**Note:** For the first time, it is a good condition if you do not have any rules in the IP/NAT tables. If a program such as docker has already set up a rule, you will need to add a rule differently.
{: .notice--danger}
#### 2. srsENB
@@ -229,8 +342,8 @@ You should check your phone frequency. If your phone does not support Band-3, yo
tac = 0x0007
-mcc = 001
-mnc = 01
+mcc = 901
+mnc = 70
+mcc = 310
+mnc = 789
mme_addr = 127.0.1.100
gtp_bind_addr = 127.0.1.1
s1c_bind_addr = 127.0.1.1
@@ -253,11 +366,20 @@ You should check your phone frequency. If your phone does not support Band-3, yo
PLMN ID, DL EARFCN, and Device Argument are updated as belows.
```
PLMN ID : MNC(901), MCC(70) sysmoUSIM default value
PLMN ID : MNC(310), MCC(789) programmed USIM with a card reader
DL EARFCN : Band-3 - from your Phone
Device Argument : Clock source from external GPS-DO
```
If you do not use the GPS-DO, you should use:
```diff
#device_name = auto
-#device_args = auto
+device_args = auto
#time_adv_nsamples = auto
#burst_preamble_us = auto
```
Now, run the srsENB as follows:
```bash
@@ -272,7 +394,7 @@ Reading configuration file ./enb.conf...
Opening USRP with args: "",master_clock_rate=30.72e6
-- Detected Device: B200
-- Loading FPGA image: /usr/share/uhd/images/usrp_b200_fpga.bin... done
-- Operating over USB 3.
-- Operating over 'USB 2'.
-- Detecting internal GPSDO.... 'No GPSDO found'
-- Initialize CODEC control...
-- Initialize Radio control...
@@ -287,8 +409,9 @@ Setting Sampling frequency 11.52 MHz
==== eNodeB started ===
Type <t> to view trace
```
If you see the `No GPSDO found`, please exit the program with Ctrl-C.
And also, if you see the `USB 2`, it will not be working properly.
The following console output is the correct result of srsENB.
```bash
linux; GNU C++ version 6.2.0 20161027; Boost_106200; UHD_003.009.005-0-unknow

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,7 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
- User's Guide
- [Quickstart](guide/01-quickstart)
- [Building nextepc from Sources](guide/02-building-nextepc-from-sources)
- [Splitting Network Elements](guide/03-splitting-network-elements)
- Tutorials
- [Your First LTE](tutorial/01-your-first-lte)

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

@@ -8,4 +8,4 @@ tags:
- Release
---
- Assets -- [v0.1.0.tar.gz](https://github.com/acetcom/nextepc/archive/v0.1.0.tar.gz)
- Assets -- [v0.1.0.tar.gz](https://github.com/open5gs/nextepc/archive/v0.1.0.tar.gz)

View File

@@ -8,5 +8,5 @@ tags:
- Release
---
- Fix the bug related to Mongo C Driver. [[More Info](https://github.com/acetcom/nextepc/commit/4245502ae287df9c457621b3f4cccb519c4d4878)]
- Assets -- [v0.1.1.tar.gz](https://github.com/acetcom/nextepc/archive/v0.1.1.tar.gz)
- Fix the bug related to Mongo C Driver. [[More Info](https://github.com/open5gs/nextepc/commit/4245502ae287df9c457621b3f4cccb519c4d4878)]
- Assets -- [v0.1.1.tar.gz](https://github.com/open5gs/nextepc/archive/v0.1.1.tar.gz)

View File

@@ -11,4 +11,4 @@ tags:
- Publish Debian/Ubuntu Package
- Support FreeBSD and Mac OS X"
- Assets -- [v0.2.0.tar.gz](https://github.com/acetcom/nextepc/archive/v0.2.0.tar.gz)
- Assets -- [v0.2.0.tar.gz](https://github.com/open5gs/nextepc/archive/v0.2.0.tar.gz)

View File

@@ -11,4 +11,4 @@ tags:
- IPv6 Support (Linux Only)
- Change Configuration File (JSON -> YAML)
- Assets -- [v0.3.0.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.0.tar.gz)
- Assets -- [v0.3.0.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.0.tar.gz)

View File

@@ -8,5 +8,5 @@ tags:
- Release
---
- Add Authentication Synch Failure ([#11](https://github.com/acetcom/nextepc/issues/11)) -- [eric80s](https://github.com/eric80s)
- Assets -- [v0.3.1.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.1.tar.gz)
- Add Authentication Synch Failure ([#11](https://github.com/open5gs/nextepc/issues/11)) -- [eric80s](https://github.com/eric80s)
- Assets -- [v0.3.1.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.1.tar.gz)

View File

@@ -10,11 +10,11 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### New
- Docker support ([#16](https://github.com/acetcom/nextepc/issues/16)) -- [amilenovic](https://github.com/amilenovic)
- Docker support ([#16](https://github.com/open5gs/nextepc/issues/16)) -- [amilenovic](https://github.com/amilenovic)
#### Bug fixes
- Fix the BUG for MAC failure of authentication failure -- [#17](https://github.com/acetcom/nextepc/issues/17) from [razaborg](https://github.com/razaborg)
- Fix the BUG for EPS attach type of Attach accept -- [#12](https://github.com/acetcom/nextepc/issues/12) from [pcminitech](https://github.com/pcminitech)
- Fix the BUG for MAC failure of authentication failure -- [#17](https://github.com/open5gs/nextepc/issues/17) from [razaborg](https://github.com/razaborg)
- Fix the BUG for EPS attach type of Attach accept -- [#12](https://github.com/open5gs/nextepc/issues/12) from [pcminitech](https://github.com/pcminitech)
Download -- [v0.3.3.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.3.tar.gz)
Download -- [v0.3.3.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.3.tar.gz)
{: .notice--info}

View File

@@ -10,11 +10,11 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### New
- Support Network Name ([#22](https://github.com/acetcom/nextepc/pull/22)) -- [medeiros405](https://github.com/medeiros405)
- Support Network Name ([#22](https://github.com/open5gs/nextepc/pull/22)) -- [medeiros405](https://github.com/medeiros405)
#### Bug fixes
- Fix the BUG for security capabilities mismatch ([#27](https://github.com/acetcom/nextepc/issues/27)) -- [wayne43290](https://github.com/wayne43290)
- Fix the BUG that SGW process is dead during paging process ([#18](https://github.com/acetcom/nextepc/issues/18)) -- [jackson040407](https://github.com/jackson040407)
- Fix the BUG for security capabilities mismatch ([#27](https://github.com/open5gs/nextepc/issues/27)) -- [wayne43290](https://github.com/wayne43290)
- Fix the BUG that SGW process is dead during paging process ([#18](https://github.com/open5gs/nextepc/issues/18)) -- [jackson040407](https://github.com/jackson040407)
Download -- [v0.3.5.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.5.tar.gz)
Download -- [v0.3.5.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.5.tar.gz)
{: .notice--info}

View File

@@ -8,8 +8,8 @@ tags:
- Release
---
- Support eNB/MME Configuration Transfer, Error Indication ([#29](https://github.com/acetcom/nextepc/issues/29)) -- [wayne43290](https://github.com/wayne43290)
- Increase SCTP recv buffer : 2048->8192 ([#35](https://github.com/acetcom/nextepc/issues/35)) -- [EugeneBogush](https://github.com/EugeneBogush)
- Support eNB/MME Configuration Transfer, Error Indication ([#29](https://github.com/open5gs/nextepc/issues/29)) -- [wayne43290](https://github.com/wayne43290)
- Increase SCTP recv buffer : 2048->8192 ([#35](https://github.com/open5gs/nextepc/issues/35)) -- [EugeneBogush](https://github.com/EugeneBogush)
Download -- [v0.3.6.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.6.tar.gz)
Download -- [v0.3.6.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.6.tar.gz)
{: .notice--info}

View File

@@ -8,5 +8,5 @@ tags:
- Release
---
Download -- [v0.3.7.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.7.tar.gz)
Download -- [v0.3.7.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.7.tar.gz)
{: .notice--info}

View File

@@ -13,11 +13,11 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
- Support NAS encryption(EEA1/EEA2/EEA3)
#### Bug fixes
- Confirm with 36.412 requirement of SCTP stream id ([#54](https://github.com/acetcom/nextepc/issues/54)) -- [brchiu](https://github.com/brchiu)
- Fix to set correct timezone in UE ([#61](https://github.com/acetcom/nextepc/pull/61)) -- [medeiros405](https://github.com/medeiros405)
- Fix to change MME's integrity order ([#64](https://github.com/acetcom/nextepc/issues/64)) -- [kewinrausch](https://github.com/kewinrausch)
- Fix the bug for tracking area update ([#29](https://github.com/acetcom/nextepc/issues/29)) -- [wayne43290](https://github.com/wayne43290)
- Fix the bug for indirect tunnel ([#29](https://github.com/acetcom/nextepc/issues/29)) -- [wayne43290](https://github.com/wayne43290)
- Confirm with 36.412 requirement of SCTP stream id ([#54](https://github.com/open5gs/nextepc/issues/54)) -- [brchiu](https://github.com/brchiu)
- Fix to set correct timezone in UE ([#61](https://github.com/open5gs/nextepc/pull/61)) -- [medeiros405](https://github.com/medeiros405)
- Fix to change MME's integrity order ([#64](https://github.com/open5gs/nextepc/issues/64)) -- [kewinrausch](https://github.com/kewinrausch)
- Fix the bug for tracking area update ([#29](https://github.com/open5gs/nextepc/issues/29)) -- [wayne43290](https://github.com/wayne43290)
- Fix the bug for indirect tunnel ([#29](https://github.com/open5gs/nextepc/issues/29)) -- [wayne43290](https://github.com/wayne43290)
Download -- [v0.3.9.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.9.tar.gz)
Download -- [v0.3.9.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.9.tar.gz)
{: .notice--info}

View File

@@ -10,12 +10,12 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### Bug fixes
- Renew freeDiameter Certificate ([#93](https://github.com/acetcom/nextepc/issues/93), [#94](https://github.com/acetcom/nextepc/issues/94)) -- [Ravi-t](https://github.com/Ravi-t), [hchenji](https://github.com/hchenji)
- Fix TLV uint32 bug ([#73](https://github.com/acetcom/nextepc/pull/73)) -- [giuliol](https://github.com/giuliol)
- Add TRACE for IP address of connected UEs ([#71](https://github.com/acetcom/nextepc/issues/71)) -- [pgupta408](https://github.com/Ravi-t)
- Show reason string for YAML parser error ([#40](https://github.com/acetcom/nextepc/issues/40)) -- [Raw1mage](https://github.com/Raw1mage)
- Renew freeDiameter Certificate ([#93](https://github.com/open5gs/nextepc/issues/93), [#94](https://github.com/open5gs/nextepc/issues/94)) -- [Ravi-t](https://github.com/Ravi-t), [hchenji](https://github.com/hchenji)
- Fix TLV uint32 bug ([#73](https://github.com/open5gs/nextepc/pull/73)) -- [giuliol](https://github.com/giuliol)
- Add TRACE for IP address of connected UEs ([#71](https://github.com/open5gs/nextepc/issues/71)) -- [pgupta408](https://github.com/Ravi-t)
- Show reason string for YAML parser error ([#40](https://github.com/open5gs/nextepc/issues/40)) -- [Raw1mage](https://github.com/Raw1mage)
- Fix compile error for GCC 8.1
- Fix compile error for Mongo-C-Driver 1.11
Download -- [v0.3.10.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.10.tar.gz)
Download -- [v0.3.10.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.10.tar.gz)
{: .notice--info}

View File

@@ -10,19 +10,19 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### Enhancements
- Support 4-bytes RES in NAS Auth ([#147](https://github.com/acetcom/nextepc/issues/147)) -- [Ranjjiitsingh](https://github.com/Ranjjiitsingh)
- Add SGW selection mode ([#100](https://github.com/acetcom/nextepc/pull/100)) -- [TerryAlu](https://github.com/TerryAlu)
- Support 4-bytes RES in NAS Auth ([#147](https://github.com/open5gs/nextepc/issues/147)) -- [Ranjjiitsingh](https://github.com/Ranjjiitsingh)
- Add SGW selection mode ([#100](https://github.com/open5gs/nextepc/pull/100)) -- [TerryAlu](https://github.com/TerryAlu)
#### Bug fixes
- Increase packet memory buffer ([#161](https://github.com/acetcom/nextepc/issues/161)) -- [mathieuxilan](https://github.com/mathieuxilan)
- Fix setting END-ID to 0 ([#156](https://github.com/acetcom/nextepc/issues/156)) -- [hypercloud2017](https://github.com/hypercloud2017)
- Fix incorrect timezone in NAS & GTP ([#140](https://github.com/acetcom/nextepc/issues/140)) -- [EugeneBogush](https://github.com/EugeneBogush)
- Increase packet memory buffer ([#161](https://github.com/open5gs/nextepc/issues/161)) -- [mathieuxilan](https://github.com/mathieuxilan)
- Fix setting END-ID to 0 ([#156](https://github.com/open5gs/nextepc/issues/156)) -- [hypercloud2017](https://github.com/hypercloud2017)
- Fix incorrect timezone in NAS & GTP ([#140](https://github.com/open5gs/nextepc/issues/140)) -- [EugeneBogush](https://github.com/EugeneBogush)
#### Miscellaneous
- nas_message.py: Fix copy+paste error([#159](https://github.com/acetcom/nextepc/issues/159)) -- [laf0rge](https://github.com/laf0rge)
- Fix missing 'break' statement ([#129](https://github.com/acetcom/nextepc/pull/129)) -- [EugeneBogush](https://github.com/EugeneBogush)
- Add missing C namespace ([#109](https://github.com/acetcom/nextepc/pull/109)) -- [brchiu](https://github.com/brchiu)
- nas_message.py: Fix copy+paste error([#159](https://github.com/open5gs/nextepc/issues/159)) -- [laf0rge](https://github.com/laf0rge)
- Fix missing 'break' statement ([#129](https://github.com/open5gs/nextepc/pull/129)) -- [EugeneBogush](https://github.com/EugeneBogush)
- Add missing C namespace ([#109](https://github.com/open5gs/nextepc/pull/109)) -- [brchiu](https://github.com/brchiu)
- Refine EXIT routine for daemon process
Download -- [v0.3.11.tar.gz](https://github.com/acetcom/nextepc/archive/v0.3.11.tar.gz)
Download -- [v0.3.11.tar.gz](https://github.com/open5gs/nextepc/archive/v0.3.11.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,20 @@
---
title: "v0.4.0 - Integration with OGSLib"
date: 2019-04-29 23:44:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### Enhancements
- Integration with OGSLib
- High CPU usage on idle ([#87](https://github.com/open5gs/nextepc/issues/87)) -- [hchenji](https://github.com/hchenji)
#### Bug fixes
- The problem related to MNC of LENGTH 3 ([#163](https://github.com/open5gs/nextepc/issues/163)) -- [Avi-Dekra](https://github.com/Avi-Dekra)
Download -- [v0.4.0.tar.gz](https://github.com/open5gs/nextepc/archive/v0.4.0.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,24 @@
---
title: "v0.4.1 - Bug fixes & minor changes"
date: 2019-05-18 19:06:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
---
#### Minor changes
- Rearrange the initialization order [[2d74383](https://github.com/open5gs/nextepc/commit/2d7438313d7426ca3ad4591f090b7f8564257fb7)]
- Remove ____DATE____ and ____TIME____ from all source code to make the same binary. [[c8ed909](https://github.com/open5gs/nextepc/commit/c8ed909f4680225490ac23d2d56e7d8f8112d6f6)]
- Improve sanity checks when queues cannot be pushed [[bc180c3](https://github.com/open5gs/nextepc/commit/bc180c3ffc431a06a49e0de1af71098fd91d561b)]
- Update document to correct typo ([#176](https://github.com/open5gs/nextepc/issues/176)) -- [iman432](https://github.com/iman432)
- Add UE address to LOG ([#178](https://github.com/open5gs/nextepc/pull/178)) -- [medeiros405](https://github.com/medeiros405)
#### Bug fixes
- Fix CentOS compilation errors and segmentation fault in test programs ([#175](https://github.com/open5gs/nextepc/issues/175)) -- [fefer](https://github.com/fefer)
- Modify the test program on MacOSX [ab81e38](https://github.com/open5gs/nextepc/commit/ab81e384879fdf51c667344fc8be912254dbec75)
Download -- [v0.4.1.tar.gz](https://github.com/open5gs/nextepc/archive/v0.4.1.tar.gz)
{: .notice--info}

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}

Binary file not shown.

View File

@@ -10,7 +10,7 @@
#
PACKAGE="nextepc"
VERSION="0.3.9"
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)))
@@ -82,7 +73,7 @@ extern "C" {
/**********************************
* PLMN_ID Structure */
typedef struct _plmn_id_t {
typedef struct plmn_id_s {
ED2(uint8_t mcc2:4;,
uint8_t mcc1:4;)
ED2(uint8_t mnc1:4;,
@@ -91,7 +82,7 @@ ED2(uint8_t mnc3:4;,
uint8_t mnc2:4;)
} __attribute__ ((packed)) plmn_id_t;
uint32_t plmn_id_hexdump(plmn_id_t *plmn_id);
uint32_t plmn_id_hexdump(void *plmn_id);
uint16_t plmn_id_mcc(plmn_id_t *plmn_id);
uint16_t plmn_id_mnc(plmn_id_t *plmn_id);
@@ -102,12 +93,12 @@ void *plmn_id_build(plmn_id_t *plmn_id,
#define MAX_NUM_OF_TAI 16
typedef struct _tai_t {
typedef struct tai_s {
plmn_id_t plmn_id;
uint16_t tac;
} __attribute__ ((packed)) tai_t;
typedef struct _e_cgi_t {
typedef struct e_cgi_s {
plmn_id_t plmn_id;
uint32_t cell_id; /* 28 bit */
} __attribute__ ((packed)) e_cgi_t;
@@ -119,7 +110,7 @@ typedef struct _e_cgi_t {
#define IPV4_LEN 4
#define IPV6_LEN 16
#define IPV4V6_LEN 20
typedef struct _ip_t {
typedef struct ip_s {
union {
uint32_t addr;
uint8_t addr6[IPV6_LEN];
@@ -139,7 +130,7 @@ ED3(uint8_t ipv4:1;,
#define PAA_IPV4_LEN 5
#define PAA_IPV6_LEN 18
#define PAA_IPV4V6_LEN 22
typedef struct _paa_t {
typedef struct paa_s {
/* 8.34 PDN Type */
#define GTP_PDN_TYPE_IPV4 1
#define GTP_PDN_TYPE_IPV6 2
@@ -174,14 +165,14 @@ ED2(uint8_t spare:5;,
#define MAX_BIT_RATE 10000000000UL
typedef struct _bitrate_t {
typedef struct bitrate_s {
uint64_t downlink; /* bits per seconds */
uint64_t uplink; /* bits per seconds */
} bitrate_t;
/**********************************
* QoS Structure */
typedef struct _qos_t {
typedef struct qos_s {
#define PDN_QCI_1 1
#define PDN_QCI_2 2
#define PDN_QCI_3 3
@@ -195,21 +186,21 @@ typedef struct _qos_t {
#define PDN_QCI_66 66
#define PDN_QCI_69 69
#define PDN_QCI_70 70
uint8_t qci;
uint8_t qci;
struct {
/* Values 1 to 8 should only be assigned for services that are
* authorized to receive prioritized treatment within an operator domain.
* Values 9 to 15 may be assigned to resources that are authorized
* by the home network and thus applicable when a UE is roaming. */
uint8_t priority_level;
uint8_t priority_level;
#define PDN_PRE_EMPTION_CAPABILITY_ENABLED 0
#define PDN_PRE_EMPTION_CAPABILITY_DISABLED 1
uint8_t pre_emption_capability;
uint8_t pre_emption_capability;
#define PDN_PRE_EMPTION_VULNERABILITY_ENABLED 0
#define PDN_PRE_EMPTION_VULNERABILITY_DISABLED 1
uint8_t pre_emption_vulnerability;
uint8_t pre_emption_vulnerability;
} arp;
bitrate_t mbr; /* Maxmimum Bit Rate (MBR) */
@@ -220,7 +211,7 @@ typedef struct _qos_t {
* Flow Structure */
#define FLOW_DOWNLINK_ONLY 1
#define FLOW_UPLINK_ONLY 2
typedef struct _flow_t {
typedef struct flow_s {
uint8_t direction;
char *description;
} flow_t;
@@ -237,7 +228,7 @@ typedef struct _flow_t {
/**********************************
* PCC Rule Structure */
typedef struct _pcc_rule_t {
typedef struct pcc_rule_s {
#define PCC_RULE_TYPE_INSTALL 1
#define PCC_RULE_TYPE_REMOVE 2
uint8_t type;
@@ -279,14 +270,14 @@ typedef struct _pcc_rule_t {
/**********************************
* PDN Structure */
typedef struct _pdn_t {
uint32_t context_identifier;
char apn[MAX_APN_LEN+1];
typedef struct pdn_s {
uint32_t context_identifier;
char apn[MAX_APN_LEN+1];
#define HSS_PDN_TYPE_IPV4 0
#define HSS_PDN_TYPE_IPV6 1
#define HSS_PDN_TYPE_IPV4V6 2
#define HSS_PDN_TYPE_IPV4_OR_IPV6 3
int pdn_type;
int pdn_type;
qos_t qos;
bitrate_t ambr; /* APN-AMBR */
@@ -295,8 +286,8 @@ typedef struct _pdn_t {
ip_t pgw_ip;
} pdn_t;
int apn_build(char *dst, char *src, int len);
int apn_parse(char *dst, char *src, int len);
int fqdn_build(char *dst, char *src, int len);
int fqdn_parse(char *dst, char *src, int len);
/**************************************************
* Protocol Configuration Options Structure
@@ -314,28 +305,28 @@ int apn_parse(char *dst, char *src, int len);
#define PCO_ID_P_CSCF_IPV4_ADDRESS_REQUEST 0x000c
#define PCO_ID_DNS_SERVER_IPV4_ADDRESS_REQUEST 0x000d
#define PCO_ID_IPV4_LINK_MTU_REQUEST 0x0010
typedef struct _pco_ipcp_options_t {
typedef struct pco_ipcp_options_s {
uint8_t type;
uint8_t len;
uint32_t addr;
} __attribute__ ((packed)) pco_ipcp_options_t;
#define PCO_MAX_NUM_OF_IPCO_OPTIONS 4
typedef struct _pco_ipcp_t {
typedef struct pco_ipcp_s {
uint8_t code;
uint8_t identifier;
uint16_t len;
pco_ipcp_options_t options[PCO_MAX_NUM_OF_IPCO_OPTIONS];
} __attribute__ ((packed)) pco_ipcp_t;
typedef struct _pco_id_t {
typedef struct pco_id_s {
uint16_t id;
uint8_t len;
void *data;
} pco_id_t;
#define MAX_NUM_OF_PROTOCOL_OR_CONTAINER_ID 8
typedef struct _pco_t {
typedef struct pco_s {
ED3(uint8_t ext:1;,
uint8_t spare:4;,
uint8_t configuration_protocol:3;)

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,16 +27,16 @@
#include "base/context.h"
#include "fd_message.h"
#include "fd_logger.h"
#include "fd-message.h"
#include "fd-logger.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif
/* This is default diameter configuration if there is no config file
* The Configuration : No TLS, Only TCP */
typedef struct _fd_config_t {
typedef struct fd_config_s {
/* Diameter Identity of the local peer (FQDN -- ASCII) */
const char *cnf_diamid;
/* Diameter realm of the local peer, default to realm part of cnf_diamid */
@@ -81,6 +81,6 @@ int fd_avp_search_avp ( struct avp * groupedavp,
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
#endif /* ! __FD_LIB_H__ */
#endif /* FD_LIB_H */

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

@@ -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,17 +17,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GTP_CONV_H__
#define __GTP_CONV_H__
#ifndef GTP_CONV_H
#define GTP_CONV_H
#include "ogs-core.h"
typedef struct ogs_sockaddr_s ogs_sockaddr_t;
typedef struct _tlv_bearer_context_t tlv_bearer_context_t;
typedef struct _gtp_create_indirect_data_forwarding_tunnel_request_t gtp_create_indirect_data_forwarding_tunnel_request_t;
typedef struct _gtp_create_indirect_data_forwarding_tunnel_response_t gtp_create_indirect_data_forwarding_tunnel_response_t;
typedef struct _gtp_f_teid_t gtp_f_teid_t;
typedef struct _ip_t ip_t;
typedef struct tlv_bearer_context_s tlv_bearer_context_t;
typedef struct gtp_create_indirect_data_forwarding_tunnel_request_s gtp_create_indirect_data_forwarding_tunnel_request_t;
typedef struct gtp_create_indirect_data_forwarding_tunnel_response_s gtp_create_indirect_data_forwarding_tunnel_response_t;
typedef struct gtp_f_teid_s gtp_f_teid_t;
typedef struct ip_s ip_t;
#ifdef __cplusplus
extern "C" {
@@ -54,5 +54,5 @@ int gtp_ip_to_f_teid(ip_t *ip, gtp_f_teid_t *f_teid, int *len);
}
#endif /* __cplusplus */
#endif /* __GTP_CONV_H__ */
#endif /* GTP_CONV_H */

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-03-06 12:20:52.446761 by acetcom
* Created on: 2019-07-06 22:50:27.017552 by acetcom
* from 29274-d80.docx
******************************************************************************/
#include "gtp_message.h"
#include "gtp-message.h"
tlv_desc_t tlv_desc_imsi_0 =
{

1174
lib/gtp/gtp-message.h Normal file

File diff suppressed because it is too large Load Diff

137
lib/gtp/gtp-node.c Normal file
View File

@@ -0,0 +1,137 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "gtp-conv.h"
#include "gtp-node.h"
#include "gtp-xact.h"
static OGS_POOL(pool, gtp_node_t);
int gtp_node_init(void)
{
ogs_pool_init(&pool, base_self()->gtp.node.pool);
return OGS_OK;
}
int gtp_node_final(void)
{
ogs_pool_final(&pool);
return OGS_OK;
}
gtp_node_t *gtp_node_new(ogs_sockaddr_t *addr)
{
gtp_node_t *node = NULL;
ogs_assert(addr);
ogs_pool_alloc(&pool, &node);
ogs_assert(node);
memset(node, 0, sizeof(gtp_node_t));
node->addr = addr;
ogs_list_init(&node->local_list);
ogs_list_init(&node->remote_list);
return node;
}
void gtp_node_free(gtp_node_t *node)
{
ogs_assert(node);
if (node->sock)
ogs_sock_destroy(node->sock);
gtp_xact_delete_all(node);
ogs_freeaddrinfo(node->addr);
ogs_pool_free(&pool, node);
}
gtp_node_t *gtp_node_add(ogs_list_t *list, gtp_f_teid_t *f_teid,
uint16_t port, int no_ipv4, int no_ipv6, int prefer_ipv4)
{
int rv;
gtp_node_t *node = NULL;
ogs_sockaddr_t *addr = NULL;
ogs_assert(list);
ogs_assert(f_teid);
ogs_assert(port);
rv = gtp_f_teid_to_sockaddr(f_teid, port, &addr);
ogs_assert(rv == OGS_OK);
rv = ogs_filter_ip_version(&addr, no_ipv4, no_ipv6, prefer_ipv4);
ogs_assert(addr);
rv = ogs_socknode_fill_scope_id_in_local(addr);
ogs_assert(rv == OGS_OK);
node = gtp_node_new(addr);
ogs_assert(node);
rv = gtp_f_teid_to_ip(f_teid, &node->ip);
ogs_assert(rv == OGS_OK);
ogs_list_add(list, node);
return node;
}
void gtp_node_remove(ogs_list_t *list, gtp_node_t *node)
{
ogs_assert(node);
ogs_list_remove(list, node);
gtp_node_free(node);
}
void gtp_node_remove_all(ogs_list_t *list)
{
gtp_node_t *node = NULL, *next_node = NULL;
ogs_list_for_each_safe(list, next_node, node)
gtp_node_remove(list, node);
}
gtp_node_t *gtp_node_find(ogs_list_t *list, gtp_f_teid_t *f_teid)
{
int rv;
gtp_node_t *node = NULL;
ip_t ip;
ogs_assert(list);
ogs_assert(f_teid);
rv = gtp_f_teid_to_ip(f_teid, &ip);
ogs_assert(rv == OGS_OK);
ogs_list_for_each(list, node)
{
if (memcmp(&node->ip, &ip, ip.len) == 0)
break;
}
return node;
}

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 { \
@@ -36,10 +36,10 @@ extern "C" {
/**
* This structure represents the commonalities of GTP node such as MME, SGW,
* PGW gateway. Some of members may not be used by the specific type of node */
typedef struct _gtp_node_t {
typedef struct gtp_node_s {
ogs_lnode_t node; /* A node of list_t */
ogs_sockaddr_t *sa_list; /* Socket Address List */
ogs_sockaddr_t *addr; /* Socket Address List */
ogs_sock_t *sock; /* Socket instance */
ip_t ip; /* Socket Address */
@@ -52,20 +52,19 @@ typedef struct _gtp_node_t {
int gtp_node_init(void);
int gtp_node_final(void);
int gtp_create_node(gtp_node_t **node,
ogs_sockaddr_t *all_list, int no_ipv4, int no_ipv6, int prefer_ipv4);
int gtp_delete_node(gtp_node_t *node);
gtp_node_t *gtp_node_new(ogs_sockaddr_t *addr);
void gtp_node_free(gtp_node_t *node);
gtp_node_t *gtp_add_node(
gtp_node_t *gtp_node_add(
ogs_list_t *list, gtp_f_teid_t *f_teid,
uint16_t port, int no_ipv4, int no_ipv6, int prefer_ipv4);
int gtp_remove_node(ogs_list_t *list, gtp_node_t *node);
int gtp_remove_all_nodes(ogs_list_t *list);
void gtp_node_remove(ogs_list_t *list, gtp_node_t *node);
void gtp_node_remove_all(ogs_list_t *list);
gtp_node_t *gtp_find_node(ogs_list_t *list, gtp_f_teid_t *f_teid);
gtp_node_t *gtp_node_find(ogs_list_t *list, gtp_f_teid_t *f_teid);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
#endif /* __GTP_NODE_H__ */
#endif /* GTP_NODE_H */

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_t gtp_node_t;
typedef struct gtp_node_s gtp_node_t;
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif
int gtp_server(ogs_socknode_t *snode);
int gtp_client(gtp_node_t *gnode);
ogs_sock_t *gtp_server(ogs_socknode_t *node);
int gtp_connect(ogs_sock_t *ipv4, ogs_sock_t *ipv6, gtp_node_t *gnode);
ogs_sock_t *gtp_local_sock_first(ogs_list_t *list);
ogs_sockaddr_t *gtp_local_addr_first(ogs_list_t *list);
int gtp_recv(ogs_socket_t fd, ogs_pkbuf_t **pkbuf);
int gtp_recvfrom(ogs_socket_t fd, ogs_pkbuf_t **pkbuf, ogs_sockaddr_t *from);
int gtp_send(gtp_node_t *gnode, ogs_pkbuf_t *pkbuf);
int gtp_sendto(gtp_node_t *gnode, ogs_pkbuf_t *pkbuf);
@@ -42,6 +39,6 @@ ogs_pkbuf_t *gtp_handle_echo_req(ogs_pkbuf_t *pkt);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
#endif /* __GTP_PATH_H__ */
#endif /* GTP_PATH_H */

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"
@@ -50,7 +50,7 @@ typedef enum {
TLV_MESSAGE,
} tlv_type_e;
typedef struct _tlv_desc_t {
typedef struct tlv_desc_s {
tlv_type_e ctype;
char *name;
uint16_t type;
@@ -72,49 +72,49 @@ extern tlv_desc_t tlv_desc_more8;
typedef uint64_t tlv_presence_t;
/* 8-bit Unsigned integer */
typedef struct _tlv_uint8_t {
typedef struct tlv_uint8_s {
tlv_presence_t presence;
uint8_t u8;
} tlv_uint8_t;
/* 16-bit Unsigned integer */
typedef struct _tlv_uint16_t {
typedef struct tlv_uint16_s {
tlv_presence_t presence;
uint16_t u16;
} tlv_uint16_t;
/* 24-bit Unsigned integer */
typedef struct _tlv_uint24_t {
typedef struct tlv_uint24_s {
tlv_presence_t presence;
uint32_t u24; /* Only 3 bytes valid */
} tlv_uint24_t;
/* 32-bit Unsigned integer */
typedef struct _tlv_uint32_t {
typedef struct tlv_uint32_s {
tlv_presence_t presence;
uint32_t u32;
} tlv_uint32_t;
/* 8-bit Signed integer */
typedef struct _tlv_int8_t {
typedef struct tlv_int8_s {
tlv_presence_t presence;
int8_t i8;
} tlv_int8_t;
/* 16-bit Signed integer */
typedef struct _tlv_int16t {
typedef struct tlv_int16_s {
tlv_presence_t presence;
int16_t i16;
} tlv_int16_t;
/* 24-bit Signed integer */
typedef struct _tlv_int24_t {
typedef struct tlv_int24_s {
tlv_presence_t presence;
int32_t i24; /* Only 3 bytes valid */
} tlv_int24_t;
/* 32-bit Signed integer */
typedef struct _tlv_int32_t {
typedef struct tlv_int32_s {
tlv_presence_t presence;
int32_t i32;
} tlv_int32_t;
@@ -142,14 +142,14 @@ typedef struct _tlv_int32_t {
(__dST)->data = ogs_calloc((__dST)->len, sizeof(uint8_t)); \
memcpy((__dST)->data, (__sRC)->data, (__dST)->len); \
} while(0)
typedef struct _tlv_octet_t {
typedef struct tlv_octet_s {
tlv_presence_t presence;
void *data;
uint32_t len;
} tlv_octet_t;
/* No value */
typedef struct _tlv_null {
typedef struct tlv_null_s {
tlv_presence_t presence;
} tlv_null_t;
@@ -161,4 +161,4 @@ int tlv_parse_msg(void *msg, tlv_desc_t *desc, ogs_pkbuf_t *pkbuf, int mode);
}
#endif /* __cplusplus */
#endif /* __GTP_TLV_H__ */
#endif /* GTP_TLV_H */

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,21 +17,19 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GTP_TYPES_H__
#define __GTP_TYPES_H__
#ifndef GTP_TYPES_H
#define GTP_TYPES_H
#include "base/types.h"
#include "base/context.h"
#include "gtp_tlv.h"
#include "gtp-tlv.h"
#undef OGS_LOG_DOMAIN
#define OGS_LOG_DOMAIN __base_gtp_domain
typedef struct c_sockaddr_t c_sockaddr_t;
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif
/* 8.4 Cause */
#define GTP_CAUSE_LOCAL_DETACH 2
@@ -112,7 +110,7 @@ extern "C" {
#define GTP_CAUSE_MULTIPLE_ACCESSES_TO_A_PDN_CONNECTION_NOT_ALLOWED 126
#define GTP_CAUSE_REQUEST_REJECTED_DUE_TO_UE_CAPABILITY 127
typedef struct _gtp_cause_t {
typedef struct gtp_cause_s {
uint8_t value;
ED4(uint8_t spare:5;,
uint8_t pce:1;,
@@ -121,13 +119,13 @@ ED4(uint8_t spare:5;,
} __attribute__ ((packed)) gtp_cause_t;
/* 8.7 Aggregate Maximum Bit Rate (AMBR) */
typedef struct _gtp_ambr_t {
typedef struct gtp_ambr_s {
uint32_t uplink;
uint32_t downlink;
} __attribute__ ((packed)) gtp_ambr_t;
/* 8.12 Indication */
typedef struct _gtp_indication_t {
typedef struct gtp_indication_s {
ED8(uint8_t daf:1;,
uint8_t dtf:1;,
uint8_t hi:1;,
@@ -172,7 +170,7 @@ ED8(uint8_t spare1:1;,
/* 8.15 Bearer Quality of Service (Bearer QoS) */
#define GTP_BEARER_QOS_LEN 22
typedef struct _gtp_bearer_qos_t {
typedef struct gtp_bearer_qos_s {
ED5(uint8_t spare1:1;,
/* See 3GPP TS 29.212[29], clause 5.3.46 Pre-emption-Capability AVP. */
uint8_t pre_emption_capability:1;,
@@ -215,7 +213,7 @@ int16_t gtp_build_bearer_qos(
#define GTP_MAX_TRAFFIC_FLOW_TEMPLATE 255
#define GTP_MAX_NUM_OF_PACKET_FILTER_COMPONENT 16
typedef struct _gtp_tft_t {
typedef struct gtp_tft_s {
union {
struct {
#define GTP_TFT_CODE_IGNORE_THIS_IE 0
@@ -287,30 +285,30 @@ int16_t gtp_build_tft(
/* 8.21 User Location Information (ULI) */
#define GTP_MAX_ULI_LEN sizeof(gtp_uli_t)
typedef struct _gtp_uli_cgi_t {
typedef struct gtp_uli_cgi_s {
plmn_id_t plmn_id;
uint16_t lac;
uint16_t ci;
} __attribute__ ((packed)) gtp_uli_cgi_t;
typedef struct _gtp_uli_sai_t {
typedef struct gtp_uli_sai_s {
plmn_id_t plmn_id;
uint16_t lac;
uint16_t sac;
} __attribute__ ((packed)) gtp_uli_sai_t;
typedef struct _gtp_uli_rai_t {
typedef struct gtp_uli_rai_s {
plmn_id_t plmn_id;
uint16_t lac;
uint16_t rac;
} __attribute__ ((packed)) gtp_uli_rai_t;
typedef struct _gtp_uli_lai_t {
typedef struct gtp_uli_lai_s {
plmn_id_t plmn_id;
uint16_t lac;
} __attribute__ ((packed)) gtp_uli_lai_t;
typedef struct _gtp_uli_t {
typedef struct gtp_uli_s {
struct {
ED7(uint8_t spare:2;,
uint8_t lai:1;,
@@ -378,7 +376,7 @@ int16_t gtp_build_uli(
#define GTP_F_TEID_IPV4_LEN IPV4_LEN+GTP_F_TEID_HDR_LEN
#define GTP_F_TEID_IPV6_LEN IPV6_LEN+GTP_F_TEID_HDR_LEN
#define GTP_F_TEID_IPV4V6_LEN IPV4V6_LEN+GTP_F_TEID_HDR_LEN
typedef struct _gtp_f_teid_t {
typedef struct gtp_f_teid_s {
ED3(uint8_t ipv4:1;,
uint8_t ipv6:1;,
uint8_t interface_type:6;)
@@ -406,7 +404,7 @@ ED3(uint8_t ipv4:1;,
* This field uses the same format as the Timezone field used in the
* TP-Service-Centre-Time-Stamp, which is defined in 3GPP TS 23.040 [90],
* and its value shall be set as defined in 3GPP TS 22.042 */
typedef struct _gtp_ue_timezone_t {
typedef struct gtp_ue_timezone_s {
#define GTP_TIME_TO_BCD(x) TIME_TO_BCD(x)
/* The Time Zone indicates the difference, expressed in quarters of an hour,
* between the local time and GMT. In the first of the two semi-octets,
@@ -436,7 +434,7 @@ ED2(uint8_t spare:6;,
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
#endif /* __GTP_TYPES_H__ */
#endif /* GTP_TYPES_H */

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,21 +17,21 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GTP_XACT_H__
#define __GTP_XACT_H__
#ifndef GTP_XACT_H
#define GTP_XACT_H
#include "gtp_message.h"
#include "gtp-message.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif
typedef struct _gtp_node_t gtp_node_t;
typedef struct gtp_node_s gtp_node_t;
/**
* Transaction context
*/
typedef struct _gtp_xact_t {
typedef struct gtp_xact_s {
ogs_lnode_t node; /**< A node of list */
ogs_index_t index;
@@ -57,7 +57,7 @@ typedef struct _gtp_xact_t {
ogs_timer_t *tm_holding; /**< Timer waiting for holding message */
uint8_t holding_rcount;
struct _gtp_xact_t *assoc_xact; /**< Associated transaction */
struct gtp_xact_s *assoc_xact; /**< Associated transaction */
#define GTP_XACT_STORE_SESSION(xact, session) \
do { \
@@ -95,6 +95,6 @@ void gtp_xact_deassociate(gtp_xact_t *xact1, gtp_xact_t *xact2);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
#endif /* __GTP_XACT_H__ */
#endif /* GTP_XACT_H */

View File

@@ -20,7 +20,7 @@
/*******************************************************************************
* This file had been created by gtp_tlv.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2019-03-06 12:20:52.420255 by acetcom
* Created on: 2019-05-28 16:37:12.761642 by acetcom
* from 29274-d80.docx
******************************************************************************/
@@ -37,7 +37,7 @@ extern "C" {
#define GTPV1U_HEADER_LEN 8
#define GTPV2C_HEADER_LEN 12
#define GTP_TEID_LEN 4
typedef struct _gtp_header_t {
typedef struct gtp_header_s {
union {
struct {
ED4(uint8_t version:3;,
@@ -590,7 +590,7 @@ typedef tlv_octet_t tlv_serving_plmn_rate_control_t;
typedef tlv_octet_t tlv_counter_t;
/* Structure for Group Infomration Element */
typedef struct _tlv_bearer_context_t {
typedef struct tlv_bearer_context_s {
tlv_presence_t presence;
tlv_ebi_t eps_bearer_id;
tlv_bearer_tft_t tft;
@@ -619,11 +619,11 @@ typedef struct _tlv_bearer_context_t {
tlv_packet_flow_id_t packet_flow_id;
} tlv_bearer_context_t;
typedef struct _tlv_pdn_connection_t {
typedef struct tlv_pdn_connection_s {
tlv_presence_t presence;
} tlv_pdn_connection_t;
typedef struct _tlv_overload_control_information_t {
typedef struct tlv_overload_control_information_s {
tlv_presence_t presence;
tlv_sequence_number_t overload_control_sequence_number;
tlv_metric_t overload_reduction_metric;
@@ -631,20 +631,20 @@ typedef struct _tlv_overload_control_information_t {
tlv_apn_t list_of_access_point_name;
} tlv_overload_control_information_t;
typedef struct _tlv_load_control_information_t {
typedef struct tlv_load_control_information_s {
tlv_presence_t presence;
tlv_sequence_number_t load_control_sequence_number;
tlv_metric_t load_metric;
tlv_apn_and_relative_capacity_t list_of_apn_and_relative_capacity;
} tlv_load_control_information_t;
typedef struct _tlv_remote_ue_context_t {
typedef struct tlv_remote_ue_context_s {
tlv_presence_t presence;
tlv_remote_user_id_t remote_user_id;
tlv_remote_ue_ip_information_t remote_ue_ip_information;
} tlv_remote_ue_context_t;
typedef struct _tlv_scef_pdn_connection_t {
typedef struct tlv_scef_pdn_connection_s {
tlv_presence_t presence;
tlv_apn_t apn;
tlv_ebi_t default_eps_bearer_id;
@@ -652,17 +652,17 @@ typedef struct _tlv_scef_pdn_connection_t {
} tlv_scef_pdn_connection_t;
/* Structure for Message */
typedef struct _gtp_echo_request_t {
typedef struct gtp_echo_request_s {
tlv_recovery_t recovery;
tlv_node_features_t sending_node_features;
} gtp_echo_request_t;
typedef struct _gtp_echo_response_t {
typedef struct gtp_echo_response_s {
tlv_recovery_t recovery;
tlv_node_features_t sending_node_features;
} gtp_echo_response_t;
typedef struct _gtp_create_session_request_t {
typedef struct gtp_create_session_request_s {
tlv_imsi_t imsi;
tlv_msisdn_t msisdn;
tlv_mei_t me_identity;
@@ -723,7 +723,7 @@ typedef struct _gtp_create_session_request_t {
tlv_port_number_t ue_tcp_port;
} gtp_create_session_request_t;
typedef struct _gtp_create_session_response_t {
typedef struct gtp_create_session_response_s {
tlv_cause_t cause;
tlv_change_reporting_action_t change_reporting_action_;
tlv_csg_information_reporting_action_t csg_information_reporting_action;
@@ -759,7 +759,7 @@ typedef struct _gtp_create_session_response_t {
tlv_epco_t extended_protocol_configuration_options;
} gtp_create_session_response_t;
typedef struct _gtp_modify_bearer_request_t {
typedef struct gtp_modify_bearer_request_s {
tlv_mei_t me_identity;
tlv_uli_t user_location_information;
tlv_serving_network_t serving_network;
@@ -790,7 +790,7 @@ typedef struct _gtp_modify_bearer_request_t {
tlv_counter_t mo_exception_data_counter;
} gtp_modify_bearer_request_t;
typedef struct _gtp_modify_bearer_response_t {
typedef struct gtp_modify_bearer_response_s {
tlv_cause_t cause;
tlv_msisdn_t msisdn;
tlv_ebi_t linked_eps_bearer_id;
@@ -818,7 +818,7 @@ typedef struct _gtp_modify_bearer_response_t {
tlv_charging_id_t pdn_connection_charging_id;
} gtp_modify_bearer_response_t;
typedef struct _gtp_delete_session_request_t {
typedef struct gtp_delete_session_request_s {
tlv_cause_t cause;
tlv_ebi_t linked_eps_bearer_id;
tlv_uli_t user_location_information;
@@ -842,7 +842,7 @@ typedef struct _gtp_delete_session_request_t {
tlv_port_number_t ue_tcp_port;
} gtp_delete_session_request_t;
typedef struct _gtp_delete_session_response_t {
typedef struct gtp_delete_session_response_s {
tlv_cause_t cause;
tlv_recovery_t recovery;
tlv_pco_t protocol_configuration_options;
@@ -855,7 +855,7 @@ typedef struct _gtp_delete_session_response_t {
tlv_epco_t extended_protocol_configuration_options;
} gtp_delete_session_response_t;
typedef struct _gtp_modify_bearer_command_t {
typedef struct gtp_modify_bearer_command_s {
tlv_ambr_t apn_aggregate_maximum_bit_rate;
tlv_bearer_context_t bearer_context;
tlv_overload_control_information_t mme_s4_sgsn_s_overload_control_information;
@@ -864,7 +864,7 @@ typedef struct _gtp_modify_bearer_command_t {
tlv_f_teid_t sender_f_teid_for_control_plane;
} gtp_modify_bearer_command_t;
typedef struct _gtp_modify_bearer_failure_indication_t {
typedef struct gtp_modify_bearer_failure_indication_s {
tlv_cause_t cause;
tlv_recovery_t recovery;
tlv_indication_t indication_flags;
@@ -872,7 +872,7 @@ typedef struct _gtp_modify_bearer_failure_indication_t {
tlv_overload_control_information_t sgw_s_overload_control_information;
} gtp_modify_bearer_failure_indication_t;
typedef struct _gtp_delete_bearer_command_t {
typedef struct gtp_delete_bearer_command_s {
tlv_bearer_context_t bearer_contexts;
tlv_uli_t user_location_information;
tlv_uli_timestamp_t uli_timestamp;
@@ -882,7 +882,7 @@ typedef struct _gtp_delete_bearer_command_t {
tlv_f_teid_t sender_f_teid_for_control_plane;
} gtp_delete_bearer_command_t;
typedef struct _gtp_delete_bearer_failure_indication_t {
typedef struct gtp_delete_bearer_failure_indication_s {
tlv_cause_t cause;
tlv_bearer_context_t bearer_context;
tlv_recovery_t recovery;
@@ -891,13 +891,13 @@ typedef struct _gtp_delete_bearer_failure_indication_t {
tlv_overload_control_information_t sgw_s_overload_control_information;
} gtp_delete_bearer_failure_indication_t;
typedef struct _gtp_downlink_data_notification_failure_indication_t {
typedef struct gtp_downlink_data_notification_failure_indication_s {
tlv_cause_t cause;
tlv_node_type_t originating_node;
tlv_imsi_t imsi;
} gtp_downlink_data_notification_failure_indication_t;
typedef struct _gtp_create_bearer_request_t {
typedef struct gtp_create_bearer_request_s {
tlv_pti_t procedure_transaction_id;
tlv_ebi_t linked_eps_bearer_id;
tlv_pco_t protocol_configuration_options;
@@ -917,7 +917,7 @@ typedef struct _gtp_create_bearer_request_t {
tlv_f_container_t nbifom_container;
} gtp_create_bearer_request_t;
typedef struct _gtp_create_bearer_response_t {
typedef struct gtp_create_bearer_response_s {
tlv_cause_t cause;
tlv_bearer_context_t bearer_contexts;
tlv_recovery_t recovery;
@@ -940,7 +940,7 @@ typedef struct _gtp_create_bearer_response_t {
tlv_port_number_t ue_tcp_port;
} gtp_create_bearer_response_t;
typedef struct _gtp_update_bearer_request_t {
typedef struct gtp_update_bearer_request_s {
tlv_bearer_context_t bearer_contexts;
tlv_pti_t procedure_transaction_id;
tlv_pco_t protocol_configuration_options;
@@ -960,7 +960,7 @@ typedef struct _gtp_update_bearer_request_t {
tlv_f_container_t nbifom_container;
} gtp_update_bearer_request_t;
typedef struct _gtp_update_bearer_response_t {
typedef struct gtp_update_bearer_response_s {
tlv_cause_t cause;
tlv_bearer_context_t bearer_contexts;
tlv_pco_t protocol_configuration_options;
@@ -985,7 +985,7 @@ typedef struct _gtp_update_bearer_response_t {
tlv_port_number_t ue_tcp_port;
} gtp_update_bearer_response_t;
typedef struct _gtp_delete_bearer_request_t {
typedef struct gtp_delete_bearer_request_s {
tlv_ebi_t linked_eps_bearer_id;
tlv_ebi_t eps_bearer_ids;
tlv_bearer_context_t failed_bearer_contexts;
@@ -1004,7 +1004,7 @@ typedef struct _gtp_delete_bearer_request_t {
tlv_epco_t extended_protocol_configuration_options;
} gtp_delete_bearer_request_t;
typedef struct _gtp_delete_bearer_response_t {
typedef struct gtp_delete_bearer_response_s {
tlv_cause_t cause;
tlv_ebi_t linked_eps_bearer_id;
tlv_bearer_context_t bearer_contexts;
@@ -1030,7 +1030,7 @@ typedef struct _gtp_delete_bearer_response_t {
tlv_port_number_t ue_tcp_port ;
} gtp_delete_bearer_response_t;
typedef struct _gtp_create_indirect_data_forwarding_tunnel_request_t {
typedef struct gtp_create_indirect_data_forwarding_tunnel_request_s {
tlv_imsi_t imsi;
tlv_mei_t me_identity;
tlv_indication_t indication_flags;
@@ -1049,7 +1049,7 @@ typedef struct _gtp_create_indirect_data_forwarding_tunnel_request_t {
tlv_recovery_t recovery;
} gtp_create_indirect_data_forwarding_tunnel_request_t;
typedef struct _gtp_create_indirect_data_forwarding_tunnel_response_t {
typedef struct gtp_create_indirect_data_forwarding_tunnel_response_s {
tlv_cause_t cause;
tlv_f_teid_t sender_f_teid_for_control_plane;
tlv_bearer_context_t bearer_context_0;
@@ -1066,21 +1066,21 @@ typedef struct _gtp_create_indirect_data_forwarding_tunnel_response_t {
tlv_recovery_t recovery;
} gtp_create_indirect_data_forwarding_tunnel_response_t;
typedef struct _gtp_delete_indirect_data_forwarding_tunnel_request_t {
typedef struct gtp_delete_indirect_data_forwarding_tunnel_request_s {
} gtp_delete_indirect_data_forwarding_tunnel_request_t;
typedef struct _gtp_delete_indirect_data_forwarding_tunnel_response_t {
typedef struct gtp_delete_indirect_data_forwarding_tunnel_response_s {
tlv_cause_t cause;
tlv_recovery_t recovery;
} gtp_delete_indirect_data_forwarding_tunnel_response_t;
typedef struct _gtp_release_access_bearers_request_t {
typedef struct gtp_release_access_bearers_request_s {
tlv_ebi_t list_of_rabs;
tlv_node_type_t originating_node;
tlv_indication_t indication_flags;
} gtp_release_access_bearers_request_t;
typedef struct _gtp_release_access_bearers_response_t {
typedef struct gtp_release_access_bearers_response_s {
tlv_cause_t cause;
tlv_recovery_t recovery;
tlv_indication_t indication_flags;
@@ -1088,7 +1088,7 @@ typedef struct _gtp_release_access_bearers_response_t {
tlv_overload_control_information_t sgw_s_overload_control_information;
} gtp_release_access_bearers_response_t;
typedef struct _gtp_downlink_data_notification_t {
typedef struct gtp_downlink_data_notification_s {
tlv_cause_t cause;
tlv_ebi_t eps_bearer_id;
tlv_arp_t allocation_retention_priority;
@@ -1100,7 +1100,7 @@ typedef struct _gtp_downlink_data_notification_t {
tlv_paging_and_service_information_t paging_and_service_information;
} gtp_downlink_data_notification_t;
typedef struct _gtp_downlink_data_notification_acknowledge_t {
typedef struct gtp_downlink_data_notification_acknowledge_s {
tlv_cause_t cause;
tlv_delay_value_t data_notification_delay;
tlv_recovery_t recovery;
@@ -1110,7 +1110,7 @@ typedef struct _gtp_downlink_data_notification_acknowledge_t {
tlv_integer_number_t dl_buffering_suggested_packet_count;
} gtp_downlink_data_notification_acknowledge_t;
typedef struct _gtp_modify_access_bearers_request_t {
typedef struct gtp_modify_access_bearers_request_s {
tlv_indication_t indication_flags;
tlv_f_teid_t sender_f_teid_for_control_plane;
tlv_delay_value_t delay_downlink_packet_notification_request;
@@ -1119,7 +1119,7 @@ typedef struct _gtp_modify_access_bearers_request_t {
tlv_recovery_t recovery;
} gtp_modify_access_bearers_request_t;
typedef struct _gtp_modify_access_bearers_response_t {
typedef struct gtp_modify_access_bearers_response_s {
tlv_cause_t cause;
tlv_bearer_context_t bearer_contexts_modified;
tlv_bearer_context_t bearer_contexts_marked_for_removal;
@@ -1129,7 +1129,7 @@ typedef struct _gtp_modify_access_bearers_response_t {
tlv_overload_control_information_t sgw_s_overload_control_information;
} gtp_modify_access_bearers_response_t;
typedef struct _gtp_message_t {
typedef struct gtp_message_s {
gtp_header_t h;
union {
gtp_echo_request_t echo_request;

View File

@@ -1,181 +0,0 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "gtp_conv.h"
#include "gtp_node.h"
#include "gtp_xact.h"
static OGS_POOL(pool, gtp_node_t);
int gtp_node_init(void)
{
ogs_pool_init(&pool, base_self()->gtp.node.pool);
return OGS_OK;
}
int gtp_node_final(void)
{
ogs_pool_final(&pool);
return OGS_OK;
}
int gtp_create_node(gtp_node_t **node,
ogs_sockaddr_t *all_list, int no_ipv4, int no_ipv6, int prefer_ipv4)
{
int rv;
gtp_node_t *new_node = NULL;
ogs_sockaddr_t *preferred_list = NULL;
ogs_assert(all_list);
rv = ogs_copyaddrinfo(&preferred_list, all_list);
ogs_assert(rv == OGS_OK);
if (no_ipv4 == 1)
{
rv = ogs_filteraddrinfo(&preferred_list, AF_INET6);
ogs_assert(rv == OGS_OK);
}
if (no_ipv6 == 1)
{
rv = ogs_filteraddrinfo(&preferred_list, AF_INET);
ogs_assert(rv == OGS_OK);
}
if (prefer_ipv4 == 1)
{
rv = ogs_sortaddrinfo(&preferred_list, AF_INET);
ogs_assert(rv == OGS_OK);
}
else
{
rv = ogs_sortaddrinfo(&preferred_list, AF_INET6);
ogs_assert(rv == OGS_OK);
}
if (preferred_list)
{
ogs_pool_alloc(&pool, &new_node);
ogs_assert(new_node);
memset(new_node, 0, sizeof(gtp_node_t));
new_node->sa_list = preferred_list;
ogs_list_init(&new_node->local_list);
ogs_list_init(&new_node->remote_list);
}
*node = new_node;
return OGS_OK;
}
int gtp_delete_node(gtp_node_t *node)
{
ogs_assert(node);
if (node->sock)
ogs_sock_destroy(node->sock);
gtp_xact_delete_all(node);
ogs_freeaddrinfo(node->sa_list);
ogs_pool_free(&pool, node);
return OGS_OK;
}
gtp_node_t *gtp_add_node(ogs_list_t *list, gtp_f_teid_t *f_teid,
uint16_t port, int no_ipv4, int no_ipv6, int prefer_ipv4)
{
int rv;
gtp_node_t *node = NULL;
ogs_sockaddr_t *sa_list = NULL;
ogs_assert(list);
ogs_assert(f_teid);
ogs_assert(port);
rv = gtp_f_teid_to_sockaddr(f_teid, port, &sa_list);
ogs_assert(rv == OGS_OK);
rv = gtp_create_node(&node, sa_list, no_ipv4, no_ipv6, prefer_ipv4);
ogs_assert(rv == OGS_OK);
if (node == NULL)
{
ogs_error("Invalid Parameter : "
"port[%d], no_ipv4[%d], no_ipv6[%d], prefer_ipv4[%d]",
port, no_ipv4, no_ipv6, prefer_ipv4);
return NULL;
}
ogs_list_add(list, node);
rv = gtp_f_teid_to_ip(f_teid, &node->ip);
ogs_assert(rv == OGS_OK);
rv = ogs_sock_fill_scope_id_in_local(node->sa_list);
ogs_assert(rv == OGS_OK);
ogs_freeaddrinfo(sa_list);
return node;
}
int gtp_remove_node(ogs_list_t *list, gtp_node_t *node)
{
int rv;
ogs_assert(node);
ogs_list_remove(list, node);
rv = gtp_delete_node(node);
ogs_assert(rv == OGS_OK);
return rv;
}
int gtp_remove_all_nodes(ogs_list_t *list)
{
gtp_node_t *node = NULL, *next_node = NULL;
ogs_list_for_each_safe(list, next_node, node)
gtp_remove_node(list, node);
return OGS_OK;
}
gtp_node_t *gtp_find_node(ogs_list_t *list, gtp_f_teid_t *f_teid)
{
int rv;
gtp_node_t *node = NULL;
ip_t ip;
ogs_assert(list);
ogs_assert(f_teid);
rv = gtp_f_teid_to_ip(f_teid, &ip);
ogs_assert(rv == OGS_OK);
ogs_list_for_each(list, node)
{
if (memcmp(&node->ip, &ip, ip.len) == 0)
break;
}
return node;
}

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