Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to R17 openapi #140

Open
wants to merge 31 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
bc9314f
fix: point to openapi-r17 package
tim1207 Jul 14, 2024
970c596
fix : add Name string to Route and fix some models
tim1207 Jul 17, 2024
c9ca57c
fix : fix models to r17
tim1207 Jul 29, 2024
acb6ebd
fix: change model in gmm handler and some sbi to r17
donald1218 Jul 30, 2024
82ddb4d
fix: change model in pcf_service to r17 openapi
donald1218 Jul 30, 2024
aad55de
fix: match models to r17 in sbi
tim1207 Aug 2, 2024
84f5a0c
fix: replace amf_service opanapi model and add RelocateUEContext
donald1218 Aug 3, 2024
7094541
fix: add snssaitoextsnssai and change openapi in nrf_service
donald1218 Aug 3, 2024
59c2189
fix: change ausf_service openapi models and consumer pd
donald1218 Aug 3, 2024
a9b22b5
fix: change smf_service openapi
donald1218 Aug 3, 2024
c0a3cc1
fix: change udm_service openapi models
donald1218 Aug 5, 2024
38695bd
fix: change opanapi model in notifier
donald1218 Aug 11, 2024
034f847
fix: add route name and new api
donald1218 Aug 11, 2024
6d0b47f
fix: change openapi in event_exposure and fix lint err
donald1218 Aug 15, 2024
257dcb6
fix: change openapi hash and remove unused code
donald1218 Sep 10, 2024
826e8a6
fix: remove unuse import and fix return error and type assertion smf …
donald1218 Sep 19, 2024
cebb3db
fix: searchnfinstance res nil
donald1218 Sep 19, 2024
c42d133
fix: fixed nrf_deregister err type error
donald1218 Oct 17, 2024
61c5fdc
fix: cotext.TODO() can't cancel
donald1218 Oct 17, 2024
d6ec27e
fix: lint error and miss nftype in searchnf
donald1218 Oct 17, 2024
db8f201
fix: error model type and check array len
donald1218 Oct 20, 2024
70637f4
fix: missing nf res in registernf and type assertion in smf and amfue…
donald1218 Oct 24, 2024
10fdeef
fix: update openapi hash
donald1218 Oct 25, 2024
8c2e532
fix: check the naming rules
tim1207 Oct 29, 2024
41c58a4
fix: remove unused var and misspell and update openapi hash
donald1218 Nov 6, 2024
44825f4
fix: update openapi hash and fix nil pointer bug
andy89923 Nov 7, 2024
c46c3ad
fix: update openapi hash
tim1207 Nov 13, 2024
34bbacd
fix: N1MessageNotifyProcedure multipart error
andy89923 Nov 16, 2024
84b6d72
fix: add type assertion and make the variable in camel case
tim1207 Nov 27, 2024
3980e4e
fix: fix lint err
tim1207 Nov 27, 2024
8f151e5
fix: add type assertion in all consumer service
tim1207 Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ module github.com/free5gc/amf
go 1.21

require (
github.com/antihax/optional v1.0.0
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
github.com/davecgh/go-spew v1.1.1
github.com/free5gc/aper v1.0.5
github.com/free5gc/nas v1.1.4-0.20240807053650-6775d72a73b6
github.com/free5gc/ngap v1.0.9-0.20240414165820-453b0aa37228
github.com/free5gc/openapi v1.0.9-0.20240730084323-449098e08462
github.com/free5gc/aper v1.0.6-0.20240503143507-2c4c4780b98f
github.com/free5gc/nas v1.1.4-0.20240801045646-998afcbf3811
github.com/free5gc/ngap v1.0.9-0.20240801044503-4db04dae3900
github.com/free5gc/openapi v1.0.9-0.20240823100026-6a9f667e914f
github.com/free5gc/sctp v1.0.1
github.com/free5gc/util v1.0.6
github.com/gin-gonic/gin v1.9.1
Expand All @@ -27,20 +26,23 @@ require (

require (
github.com/aead/cmac v0.0.0-20160719120800-7af84192f0b1 // indirect
github.com/antonfisher/nested-logrus-formatter v1.3.1 // indirect
github.com/bytedance/sonic v1.11.5 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cloudwego/base64x v0.1.3 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.19.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/h2non/gock v1.2.0 // indirect
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
Expand All @@ -58,6 +60,11 @@ require (
github.com/tim-ywliu/nested-logrus-formatter v1.3.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/net v0.24.0 // indirect
Expand All @@ -66,6 +73,5 @@ require (
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/h2non/gock.v1 v1.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
45 changes: 29 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/aead/cmac v0.0.0-20160719120800-7af84192f0b1 h1:+JkXLHME8vLJafGhOH4aoV2Iu8bR55nU6iKMVfYVLjY=
github.com/aead/cmac v0.0.0-20160719120800-7af84192f0b1/go.mod h1:nuudZmJhzWtx2212z+pkuy7B6nkBqa+xwNXZHL1j8cg=
github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/antonfisher/nested-logrus-formatter v1.3.1 h1:NFJIr+pzwv5QLHTPyKz9UMEoHck02Q9L0FP13b/xSbQ=
github.com/antonfisher/nested-logrus-formatter v1.3.1/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/bytedance/sonic v1.11.5 h1:G00FYjjqll5iQ1PYXynbg/hyzqBqavH8Mo9/oTopd9k=
Expand All @@ -23,14 +19,16 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/free5gc/aper v1.0.5 h1:sUYFFmOXDLjyL4rU6zFnq81M4YluqP90Pso5e/J4UhA=
github.com/free5gc/aper v1.0.5/go.mod h1:ybHxhYnRqQ9wD4yB9r/3MZdbCYCjtqUyfLpSnJpwWd4=
github.com/free5gc/nas v1.1.4-0.20240807053650-6775d72a73b6 h1:c8Z+AlgG6CPlOKTpoDhEnTtpOWW+clCr+88Ybe0hyog=
github.com/free5gc/nas v1.1.4-0.20240807053650-6775d72a73b6/go.mod h1:uhfoCLa/HKa975hKfob3wmdUiFMU2omTIWiRtYgn6XQ=
github.com/free5gc/ngap v1.0.9-0.20240414165820-453b0aa37228 h1:47Wa0ZdDI1r+IXbU6sVnMxRd9zZ4sQjXZxIQPXpitDg=
github.com/free5gc/ngap v1.0.9-0.20240414165820-453b0aa37228/go.mod h1:d5u7tYsBwxmLr3zw7wyBruRjc/gbdsHVhmdGFnVmfBU=
github.com/free5gc/openapi v1.0.9-0.20240730084323-449098e08462 h1:bK9UWqOhoddpAW9RfZRp4DPZNnPfEUeHvo4I86YAuzA=
github.com/free5gc/openapi v1.0.9-0.20240730084323-449098e08462/go.mod h1:afeuEQ21QCQDxZHnFjCmYrq3gBi+cd/WDNSUbaMcILo=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/free5gc/aper v1.0.6-0.20240503143507-2c4c4780b98f h1:sO8FFwAq7feSw/vKN9ioY+fX1gNTXd6/xQOqaeclzsA=
github.com/free5gc/aper v1.0.6-0.20240503143507-2c4c4780b98f/go.mod h1:oh3dtNsje2W4/q3pfidMWQKXbXIehXK3t6CD9tXmHx0=
github.com/free5gc/nas v1.1.4-0.20240801045646-998afcbf3811 h1:S/4FPVGQm4xYNxRLd487hOfz/f7S5taPFO8MFLqjADo=
github.com/free5gc/nas v1.1.4-0.20240801045646-998afcbf3811/go.mod h1:mVpI5guYTI24b9/cqnzilfHZa5nQeiLAh39/pVz9WrI=
github.com/free5gc/ngap v1.0.9-0.20240801044503-4db04dae3900 h1:ZElji98JSdDEJuUtpHGuV0L+xCY5ePs3YolqVfDR9Ig=
github.com/free5gc/ngap v1.0.9-0.20240801044503-4db04dae3900/go.mod h1:HedQCbA/XoFgO3wnNSNhIpp5Dhv0f42lLMT/EiEyAQ0=
github.com/free5gc/openapi v1.0.9-0.20240823100026-6a9f667e914f h1:b//Fa0CvIDU7fufqMcrEgbVUqpubokK/lFgkTxN3fGM=
github.com/free5gc/openapi v1.0.9-0.20240823100026-6a9f667e914f/go.mod h1:aKw6uGzEibGDrn9++w4/JpWxaaUBo7GaqsvuFKU9fl4=
github.com/free5gc/sctp v1.0.1 h1:g8WDO97r8B9ubkT5Hyk9b4I1fZUOii9Z39gQ2eRaASo=
github.com/free5gc/sctp v1.0.1/go.mod h1:7QXfRWCmlkBGD0EIu3qL5o71bslfIakydz4h2QDZdjQ=
github.com/free5gc/util v1.0.6 h1:dBt9drcXtYKE/cY5XuQcuffgsYclPIpIArhSeS6M+DQ=
Expand All @@ -41,6 +39,11 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
Expand All @@ -53,13 +56,15 @@ github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g=
github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k=
github.com/h2non/gock v1.2.0 h1:K6ol8rfrRkUOefooBC8elXoaNGYkpp7y2qcxGG6BzUE=
github.com/h2non/gock v1.2.0/go.mod h1:tNhoxHYW2W42cYkYb1WqzdbYIieALC99kpYr7rH/BQk=
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
Expand Down Expand Up @@ -131,6 +136,16 @@ github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65E
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk=
github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0 h1:RtcvQ4iw3w9NBB5yRwgA4sSa82rfId7n4atVpvKx3bY=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0/go.mod h1:f/PbKbRd4cdUICWell6DmzvVJ7QrmBgFrRHjXmAXbK4=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
Expand All @@ -156,8 +171,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
2 changes: 1 addition & 1 deletion internal/context/3gpp_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const (
)

type CauseAll struct {
Cause *models.Cause
Cause *models.SmfPduSessionCause
NgapCause *models.NgApCause
Var5GmmCause *int32
}
63 changes: 36 additions & 27 deletions internal/context/amf_ue.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type AmfUe struct {
RetransmissionOfInitialNASMsg bool
RequestIdentityType uint8
/* Used for AMF relocation */
TargetAmfProfile *models.NfProfile
TargetAmfProfile *models.NrfNfDiscoveryNfProfile
TargetAmfUri string
/* Ue Identity */
PlmnId models.PlmnId
Expand All @@ -97,7 +97,6 @@ type AmfUe struct {
NudmSDMUri string
ContextValid bool
Reachability models.UeReachability
SubscribedData models.SubscribedData
SmfSelectionData *models.SmfSelectionSubscriptionData
UeContextInSmfData *models.UeContextInSmfData
TraceData *models.TraceData
Expand All @@ -121,7 +120,7 @@ type AmfUe struct {
PcfUri string
PolicyAssociationId string
AmPolicyUri string
AmPolicyAssociation *models.PolicyAssociation
AmPolicyAssociation *models.PcfAmPolicyControlPolicyAssociation
RequestTriggerLocationChange bool // true if AmPolicyAssociation.Trigger contains RequestTrigger_LOC_CH
/* UeContextForHandover */
HandoverNotifyUri string
Expand Down Expand Up @@ -204,7 +203,7 @@ type AmfUeEventSubscription struct {
Timestamp time.Time
AnyUe bool
RemainReports *int32
EventSubscription *models.AmfEventSubscription
EventSubscription *models.ExtAmfEventSubscription
}

type N1N2Message struct {
Expand Down Expand Up @@ -658,7 +657,7 @@ func (ue *AmfUe) RemoveAmPolicyAssociation() {
ue.PolicyAssociationId = ""
}

func (ue *AmfUe) CopyDataFromUeContextModel(ueContext models.UeContext) {
func (ue *AmfUe) CopyDataFromUeContextModel(ueContext *models.UeContext) {
if ueContext.Supi != "" {
ue.Supi = ueContext.Supi
ue.UnauthenticatedSupi = ueContext.SupiUnauthInd
Expand All @@ -684,9 +683,9 @@ func (ue *AmfUe) CopyDataFromUeContextModel(ueContext models.UeContext) {
if ue.AccessAndMobilitySubscriptionData == nil {
ue.AccessAndMobilitySubscriptionData = new(models.AccessAndMobilitySubscriptionData)
}
if ue.AccessAndMobilitySubscriptionData.SubscribedUeAmbr == nil {
ue.AccessAndMobilitySubscriptionData.SubscribedUeAmbr = new(models.AmbrRm)
}
// if ue.AccessAndMobilitySubscriptionData.SubscribedUeAmbr == nil {
// ue.AccessAndMobilitySubscriptionData.SubscribedUeAmbr = new(models.AmbrRm)
// }
donald1218 marked this conversation as resolved.
Show resolved Hide resolved

subAmbr := ue.AccessAndMobilitySubscriptionData.SubscribedUeAmbr
subAmbr.Uplink = ueContext.SubUeAmbr.Uplink
Expand Down Expand Up @@ -751,35 +750,45 @@ func (ue *AmfUe) CopyDataFromUeContextModel(ueContext models.UeContext) {

if len(ueContext.AmPolicyReqTriggerList) > 0 {
if ue.AmPolicyAssociation == nil {
ue.AmPolicyAssociation = new(models.PolicyAssociation)
ue.AmPolicyAssociation = new(models.PcfAmPolicyControlPolicyAssociation)
}
for _, trigger := range ueContext.AmPolicyReqTriggerList {
switch trigger {
case models.AmPolicyReqTrigger_LOCATION_CHANGE:
ue.AmPolicyAssociation.Triggers = append(ue.AmPolicyAssociation.Triggers, models.RequestTrigger_LOC_CH)
case models.AmPolicyReqTrigger_PRA_CHANGE:
ue.AmPolicyAssociation.Triggers = append(ue.AmPolicyAssociation.Triggers, models.RequestTrigger_PRA_CH)
case models.AmPolicyReqTrigger_SARI_CHANGE:
ue.AmPolicyAssociation.Triggers = append(ue.AmPolicyAssociation.Triggers, models.RequestTrigger_SERV_AREA_CH)
case models.AmPolicyReqTrigger_RFSP_INDEX_CHANGE:
ue.AmPolicyAssociation.Triggers = append(ue.AmPolicyAssociation.Triggers, models.RequestTrigger_RFSP_CH)
case models.PolicyReqTrigger_LOCATION_CHANGE:
ue.AmPolicyAssociation.Triggers = append(ue.AmPolicyAssociation.Triggers,
models.PcfAmPolicyControlRequestTrigger_LOC_CH)
case models.PolicyReqTrigger_PRA_CHANGE:
ue.AmPolicyAssociation.Triggers = append(ue.AmPolicyAssociation.Triggers,
models.PcfAmPolicyControlRequestTrigger_PRA_CH)
case models.PolicyReqTrigger_ALLOWED_NSSAI_CHANGE:
ue.AmPolicyAssociation.Triggers = append(ue.AmPolicyAssociation.Triggers,
models.PcfAmPolicyControlRequestTrigger_ALLOWED_NSSAI_CH)
case models.PolicyReqTrigger_NWDAF_DATA_CHANGE:
ue.AmPolicyAssociation.Triggers = append(ue.AmPolicyAssociation.Triggers,
models.PcfAmPolicyControlRequestTrigger_NWDAF_DATA_CH)
case models.PolicyReqTrigger_SMF_SELECT_CHANGE:
ue.AmPolicyAssociation.Triggers = append(ue.AmPolicyAssociation.Triggers,
models.PcfAmPolicyControlRequestTrigger_SMF_SELECT_CH)
case models.PolicyReqTrigger_ACCESS_TYPE_CHANGE:
ue.AmPolicyAssociation.Triggers = append(ue.AmPolicyAssociation.Triggers,
models.PcfAmPolicyControlRequestTrigger_ACCESS_TYPE_CH)
}
}
}

if len(ueContext.SessionContextList) > 0 {
for _, pduSessionContext := range ueContext.SessionContextList {
for index := range ueContext.SessionContextList {
smContext := SmContext{
pduSessionID: pduSessionContext.PduSessionId,
smContextRef: pduSessionContext.SmContextRef,
snssai: *pduSessionContext.SNssai,
dnn: pduSessionContext.Dnn,
accessType: pduSessionContext.AccessType,
hSmfID: pduSessionContext.HsmfId,
vSmfID: pduSessionContext.VsmfId,
nsInstance: pduSessionContext.NsInstance,
pduSessionID: ueContext.SessionContextList[index].PduSessionId,
smContextRef: ueContext.SessionContextList[index].SmContextRef,
snssai: *ueContext.SessionContextList[index].SNssai,
dnn: ueContext.SessionContextList[index].Dnn,
accessType: ueContext.SessionContextList[index].AccessType,
hSmfID: ueContext.SessionContextList[index].HsmfId,
vSmfID: ueContext.SessionContextList[index].VsmfId,
nsInstance: ueContext.SessionContextList[index].NsInstance,
}
ue.StoreSmContext(pduSessionContext.PduSessionId, &smContext)
ue.StoreSmContext(ueContext.SessionContextList[index].PduSessionId, &smContext)
}
}

Expand Down
Loading
Loading