From 357341cdbbe01f68bc55961ea0e2f1f93b6f4129 Mon Sep 17 00:00:00 2001 From: Brandon Lee Date: Wed, 9 Aug 2023 13:21:06 -0600 Subject: [PATCH] meson file changes --- configs/logrotate/meson.build | 2 +- configs/logrotate/nextepc.in | 14 ++ configs/newsyslog/meson.build | 2 +- configs/newsyslog/nextepc.conf.in | 16 ++ configs/nextepc/upf.yaml.in | 259 ++++++++++++++++++++++++++++++ meson.build | 4 +- src/amf/meson.build | 2 +- src/ausf/meson.build | 2 +- src/bsf/meson.build | 2 +- src/hss/meson.build | 2 +- src/mme/meson.build | 2 +- src/nrf/meson.build | 2 +- src/nssf/meson.build | 2 +- src/pcf/meson.build | 2 +- src/pcrf/meson.build | 2 +- src/scp/meson.build | 2 +- src/sgwc/meson.build | 2 +- src/sgwu/meson.build | 2 +- src/smf/meson.build | 2 +- src/udm/meson.build | 2 +- src/udr/meson.build | 2 +- src/upf/meson.build | 2 +- 22 files changed, 309 insertions(+), 20 deletions(-) create mode 100644 configs/logrotate/nextepc.in create mode 100644 configs/newsyslog/nextepc.conf.in create mode 100644 configs/nextepc/upf.yaml.in diff --git a/configs/logrotate/meson.build b/configs/logrotate/meson.build index 6c27ca954..3a84f6fd3 100644 --- a/configs/logrotate/meson.build +++ b/configs/logrotate/meson.build @@ -15,5 +15,5 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -file = 'open5gs' +file = 'nextepc' configure_file(input : file + '.in', output : file, configuration : conf_data) diff --git a/configs/logrotate/nextepc.in b/configs/logrotate/nextepc.in new file mode 100644 index 000000000..76afb1129 --- /dev/null +++ b/configs/logrotate/nextepc.in @@ -0,0 +1,14 @@ +@localstatedir@/log/nextepc/*.log { + daily + sharedscripts + missingok + compress + rotate 14 + create 640 nextepc nextepc + + postrotate + for i in nrfd scpd pcrfd hssd ausfd udmd udrd upfd sgwcd sgwud smfd mmed amfd; do + systemctl reload nextepc-$i + done + endscript +} diff --git a/configs/newsyslog/meson.build b/configs/newsyslog/meson.build index 12e30fe3d..fe5c412a5 100644 --- a/configs/newsyslog/meson.build +++ b/configs/newsyslog/meson.build @@ -15,5 +15,5 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -file = 'open5gs.conf' +file = 'nextepc.conf' configure_file(input : file + '.in', output : file, configuration : conf_data) diff --git a/configs/newsyslog/nextepc.conf.in b/configs/newsyslog/nextepc.conf.in new file mode 100644 index 000000000..ac0f14ef4 --- /dev/null +++ b/configs/newsyslog/nextepc.conf.in @@ -0,0 +1,16 @@ +# truncate rails logs every day at midnight, keep 14 previous logs, compress previous logs +# +# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] +@localstatedir@/log/nextepc/nrf.log 644 14 * $D0 GZ @localstatedir@/run/nextepc-nrfd/pid` +@localstatedir@/log/nextepc/scp.log 644 14 * $D0 GZ @localstatedir@/run/nextepc-scpd/pid` +@localstatedir@/log/nextepc/pcrf.log 644 14 * $D0 GZ @localstatedir@/run/nextepc-pcrfd/pid` +@localstatedir@/log/nextepc/hss.log 644 14 * $D0 GZ @localstatedir@/run/nextepc-hssd/pid` +@localstatedir@/log/nextepc/ausf.log 644 14 * $D0 GZ @localstatedir@/run/nextepc-ausfd/pid` +@localstatedir@/log/nextepc/udm.log 644 14 * $D0 GZ @localstatedir@/run/nextepc-udmd/pid` +@localstatedir@/log/nextepc/udr.log 644 14 * $D0 GZ @localstatedir@/run/nextepc-udrd/pid` +@localstatedir@/log/nextepc/upf.log 644 14 * $D0 GZ @localstatedir@/run/nextepc-upfd/pid` +@localstatedir@/log/nextepc/sgwc.log 644 14 * $D0 GZ @localstatedir@/run/nextepc-sgwcd/pid` +@localstatedir@/log/nextepc/sgwu.log 644 14 * $D0 GZ @localstatedir@/run/nextepc-sgwud/pid` +@localstatedir@/log/nextepc/smf.log 644 14 * $D0 GZ @localstatedir@/run/nextepc-smfd/pid` +@localstatedir@/log/nextepc/mme.log 644 14 * $D0 GZ @localstatedir@/run/nextepc-mmed/pid` +@localstatedir@/log/nextepc/amf.log 644 14 * $D0 GZ @localstatedir@/run/nextepc-amfd/pid` diff --git a/configs/nextepc/upf.yaml.in b/configs/nextepc/upf.yaml.in new file mode 100644 index 000000000..2ac588527 --- /dev/null +++ b/configs/nextepc/upf.yaml.in @@ -0,0 +1,259 @@ +# +# o Set INFO level to all domains +# - If `level` is omitted, the default level is INFO) +# - If `domain` is omitted, the all domain level is set from 'level' +# (Default values are used, so no configuration is required) +# +# o Set ERROR level to all domains +# - `level` can be set with none, fatal, error, warn, info, debug, trace +# logger: +# level: error +# +# o Set DEBUG level to mme and emm domains +# logger: +# level: debug +# domain: mme,emm +# +# o Set TRACE level to all domains +# logger: +# level: trace +# domain: core,sbi,ausf,event,tlv,mem,sock +# +logger: + file: @localstatedir@/log/nextepc/upf.log + +# +# +# +# o PFCP Server(127.0.0.7:8805, ::1:8805) +# upf: +# pfcp: +# - addr: 127.0.0.7 +# - addr: ::1 +# +# o PFCP-U Server(127.0.0.1:2152, [::1]:2152) +# upf: +# pfcp: +# name: localhost +# +# o PFCP Option (Default) +# - so_bindtodevice : NULL +# +# upf: +# pfcp: +# addr: 127.0.0.7 +# option: +# so_bindtodevice: vrf-blue +# +# o Provide custom PFCP address to be advertised to SMF in PFCP association +# request/respond +# upf: +# pfcp: +# - addr: 0.0.0.0 +# advertise: nextepc-smf.svc.local +# +# > +# +# o GTP-U Server(127.0.0.7:2152, [::1]:2152) +# upf: +# gtpu: +# - addr: 127.0.0.7 +# - addr: ::1 +# +# o GTP-U Server(127.0.0.1:2152, [::1]:2152) +# upf: +# gtpu: +# name: localhost +# +# o User Plane IP Resource information +# upf: +# gtpu: +# - addr: +# - 127.0.0.7 +# - ::1 +# teid_range_indication: 4 +# teid_range: 10 +# network_instance: internet +# source_interface: 0 +# - addr: 127.0.10.4 +# teid_range_indication: 4 +# teid_range: 5 +# network_instance: ims +# source_interface: 1 +# +# o Provide custom UPF GTP-U address to be advertised inside NGAP messages +# upf: +# gtpu: +# - addr: 10.4.128.21 +# advertise: 172.24.15.30 +# +# upf: +# gtpu: +# - addr: 10.4.128.21 +# advertise: +# - 127.0.0.1 +# - ::1 +# +# upf: +# gtpu: +# - addr: 10.4.128.21 +# advertise: upf1.5gc.mnc001.mcc001.3gppnetwork.org +# +# upf: +# gtpu: +# - dev: ens3 +# advertise: upf1.5gc.mnc001.mcc001.3gppnetwork.org +# +# o GTP-U Option (Default) +# - so_bindtodevice : NULL +# +# upf: +# gtpu: +# addr: 127.0.0.7 +# option: +# so_bindtodevice: vrf-blue +# +# +# +# Note that you need to setup your UE network using TUN device. +# (ogstun, ogstun2, ogstunX, ..) +# +# o IPv4 Pool +# $ sudo ip addr add 10.45.0.1/16 dev ogstun +# +# upf: +# subnet: +# addr: 10.45.0.1/16 +# +# o IPv4/IPv6 Pool +# $ sudo ip addr add 10.45.0.1/16 dev ogstun +# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun +# +# upf: +# subnet: +# - addr: 10.45.0.1/16 +# - addr: 2001:db8:cafe::1/48 +# +# +# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:db8:babe::1/48 +# All other APNs use 10.45.0.1/16, 2001:db8:cafe::1/48 +# $ sudo ip addr add 10.45.0.1/16 dev ogstun +# $ sudo ip addr add 10.46.0.1/16 dev ogstun +# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun +# $ sudo ip addr add 2001:db8:babe::1/48 dev ogstun +# +# ; If the UE has unknown DNN/APN(not internet/ims), SMF/UPF will crash. +# +# upf: +# subnet: +# - addr: 10.45.0.1/16 +# dnn: internet +# - addr: 2001:db8:cafe::1/48 +# dnn: internet +# - addr: 10.46.0.1/16 +# dnn: ims +# - addr: 2001:db8:babe::1/48 +# dnn: ims +# +# o Specific DNN/APN with the FALLBACK SUBNET(10.47.0.1/16) +# ; Note that put the FALLBACK SUBNET last to avoid SMF/UPF crash. +# +# upf: +# subnet: +# - addr: 10.45.0.1/16 +# dnn: internet +# - addr: 10.46.0.1/16 +# dnn: ims +# - addr: 10.50.0.1/16 ## FALLBACK SUBNET +# +# o Multiple Devices (default: ogstun) +# $ sudo ip addr add 10.45.0.1/16 dev ogstun +# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun2 +# $ sudo ip addr add 10.46.0.1/16 dev ogstun3 +# $ sudo ip addr add 2001:db8:babe::1/48 dev ogstun3 +# +# upf: +# subnet: +# - addr: 10.45.0.1/16 +# dnn: internet +# - addr: 2001:db8:cafe::1/48 +# dnn: internet +# dev: ogstun2 +# - addr: 10.46.0.1/16 +# dnn: ims +# dev: ogstun3 +# - addr: 2001:db8:babe::1/48 +# dnn: ims +# dev: ogstun3 +# +# +# +# o Metrics Server(http://:9090) +# upf: +# metrics: +# - addr: 0.0.0.0 +# port: 9090 +# +upf: + pfcp: + - addr: 127.0.0.7 + gtpu: + - addr: 192.168.5.12 + subnet: + - addr: 10.45.0.1/16 + - addr: 2001:db8:cafe::1/48 + metrics: + - addr: 127.0.0.7 + port: 9090 + +# +# > +# +# o PFCP Client(127.0.0.4:8805) +# smf: +# pfcp: +# addr: 127.0.0.4 +# +smf: + +# +# o Number of output streams per SCTP associations. +# parameter: +# sctp_streams: 30 +# +# o Disable use of IPv4 addresses (only IPv6) +# parameter: +# no_ipv4: true +# +# o Disable use of IPv6 addresses (only IPv4) +# parameter: +# no_ipv6: true +# +# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. +# parameter: +# prefer_ipv4: true +# +parameter: + +# +# o Maximum Number of UE +# max: +# ue: 1024 +# +# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) +# max: +# peer: 64 +# +max: + ue: 30000 + peer: 1020 + +# +# o Message Wait Duration (Default : 10,000 ms = 10 seconds) +# (Default values are used, so no configuration is required) +# +# o Message Wait Duration (3000 ms) +# time: +# message: +# duration: 3000 +time: diff --git a/meson.build b/meson.build index 33a71d230..f0bbd06da 100644 --- a/meson.build +++ b/meson.build @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -project('open5gs', 'c', 'cpp', +project('nextepc', 'c', 'cpp', version : '2.6.4', license : 'AGPL-3.0-or-later', meson_version : '>= 0.43.0', @@ -57,7 +57,7 @@ if clangtidy.found() != true endif meson.add_install_script(python3_exe, '-c', - mkdir_p.format(join_paths(localstatedir, 'log', 'open5gs'))) + mkdir_p.format(join_paths(localstatedir, 'log', 'nextepc'))) # Compiler flags if cc.get_id() == 'gcc' or cc.get_id() == 'clang' diff --git a/src/amf/meson.build b/src/amf/meson.build index 3ec5041e5..aeec719b6 100644 --- a/src/amf/meson.build +++ b/src/amf/meson.build @@ -84,7 +84,7 @@ amf_sources = files(''' ../main.c '''.split()) -executable('open5gs-amfd', +executable('nextepc-amfd', sources : amf_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/amf.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/ausf/meson.build b/src/ausf/meson.build index b8d75917e..17991533d 100644 --- a/src/ausf/meson.build +++ b/src/ausf/meson.build @@ -48,7 +48,7 @@ ausf_sources = files(''' ../main.c '''.split()) -executable('open5gs-ausfd', +executable('nextepc-ausfd', sources : ausf_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/ausf.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/bsf/meson.build b/src/bsf/meson.build index 619d9e8eb..1b6652b82 100644 --- a/src/bsf/meson.build +++ b/src/bsf/meson.build @@ -44,7 +44,7 @@ bsf_sources = files(''' ../main.c '''.split()) -executable('open5gs-bsfd', +executable('nextepc-bsfd', sources : bsf_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/bsf.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/hss/meson.build b/src/hss/meson.build index f2b6ce57c..ebd2b12d5 100644 --- a/src/hss/meson.build +++ b/src/hss/meson.build @@ -56,7 +56,7 @@ hss_sources = files(''' ../main.c '''.split()) -executable('open5gs-hssd', +executable('nextepc-hssd', sources : hss_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/hss.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/mme/meson.build b/src/mme/meson.build index 862d30992..72b7dbad8 100644 --- a/src/mme/meson.build +++ b/src/mme/meson.build @@ -105,7 +105,7 @@ mme_sources = files(''' ../main.c '''.split()) -executable('open5gs-mmed', +executable('nextepc-mmed', sources : mme_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/mme.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/nrf/meson.build b/src/nrf/meson.build index 342592a23..54d5666b9 100644 --- a/src/nrf/meson.build +++ b/src/nrf/meson.build @@ -44,7 +44,7 @@ nrf_sources = files(''' ../main.c '''.split()) -executable('open5gs-nrfd', +executable('nextepc-nrfd', sources : nrf_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/nrf.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/nssf/meson.build b/src/nssf/meson.build index b3767fd64..f69cee629 100644 --- a/src/nssf/meson.build +++ b/src/nssf/meson.build @@ -41,7 +41,7 @@ nssf_sources = files(''' ../main.c '''.split()) -executable('open5gs-nssfd', +executable('nextepc-nssfd', sources : nssf_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/nssf.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/pcf/meson.build b/src/pcf/meson.build index 43314578d..d727657bb 100644 --- a/src/pcf/meson.build +++ b/src/pcf/meson.build @@ -60,7 +60,7 @@ pcf_sources = files(''' ../main.c '''.split()) -executable('open5gs-pcfd', +executable('nextepc-pcfd', sources : pcf_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/pcf.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/pcrf/meson.build b/src/pcrf/meson.build index e265e8730..314e26786 100644 --- a/src/pcrf/meson.build +++ b/src/pcrf/meson.build @@ -46,7 +46,7 @@ pcrf_sources = files(''' ../main.c '''.split()) -executable('open5gs-pcrfd', +executable('nextepc-pcrfd', sources : pcrf_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/pcrf.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/scp/meson.build b/src/scp/meson.build index 15b2b33dc..6d962837e 100644 --- a/src/scp/meson.build +++ b/src/scp/meson.build @@ -41,7 +41,7 @@ scp_sources = files(''' ../main.c '''.split()) -executable('open5gs-scpd', +executable('nextepc-scpd', sources : scp_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/scp.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/sgwc/meson.build b/src/sgwc/meson.build index 41c4a5de7..05efb8dc4 100644 --- a/src/sgwc/meson.build +++ b/src/sgwc/meson.build @@ -57,7 +57,7 @@ sgwc_sources = files(''' ../main.c '''.split()) -executable('open5gs-sgwcd', +executable('nextepc-sgwcd', sources : sgwc_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/sgwc.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/sgwu/meson.build b/src/sgwu/meson.build index 6ef85c1b6..eb4b899fa 100644 --- a/src/sgwu/meson.build +++ b/src/sgwu/meson.build @@ -51,7 +51,7 @@ sgwu_sources = files(''' ../main.c '''.split()) -executable('open5gs-sgwud', +executable('nextepc-sgwud', sources : sgwu_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/sgwu.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/smf/meson.build b/src/smf/meson.build index 12599f3bc..7082baf57 100644 --- a/src/smf/meson.build +++ b/src/smf/meson.build @@ -136,7 +136,7 @@ smf_sources = files(''' ../main.c '''.split()) -executable('open5gs-smfd', +executable('nextepc-smfd', sources : smf_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/smf.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/udm/meson.build b/src/udm/meson.build index f1418f8c9..cd52d57a6 100644 --- a/src/udm/meson.build +++ b/src/udm/meson.build @@ -46,7 +46,7 @@ udm_sources = files(''' ../main.c '''.split()) -executable('open5gs-udmd', +executable('nextepc-udmd', sources : udm_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/udm.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/udr/meson.build b/src/udr/meson.build index ed8869f05..dc286447b 100644 --- a/src/udr/meson.build +++ b/src/udr/meson.build @@ -43,7 +43,7 @@ udr_sources = files(''' ../main.c '''.split()) -executable('open5gs-udrd', +executable('nextepc-udrd', sources : udr_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/udr.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc, diff --git a/src/upf/meson.build b/src/upf/meson.build index 81500689b..916e79b9f 100644 --- a/src/upf/meson.build +++ b/src/upf/meson.build @@ -109,7 +109,7 @@ upf_sources = files(''' ../main.c '''.split()) -executable('open5gs-upfd', +executable('nextepc-upfd', sources : upf_sources, c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/upf.yaml"'.format(open5gs_sysconfdir), include_directories : srcinc,