-
Notifications
You must be signed in to change notification settings - Fork 70
Modify for scp #52
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
base: main
Are you sure you want to change the base?
Modify for scp #52
Changes from all commits
dfdc927
eeead1e
a4a63fb
9b46c3d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -320,6 +320,10 @@ func (p *Processor) NFDeregisterProcedure(nfInstanceID string) *models.ProblemDe | |
| logger.NfmLog.Warningf("Can not delete NFCertPem file: %v: %v", nfCertPath, removeErr) | ||
| } | ||
| } | ||
| // Set SCP to unable | ||
| if nfInstanceType == models.NfType_SCP { | ||
| nrf_context.GetSelf().ModifyScpIpInfo(false, "", "", -1) | ||
| } | ||
| // Minus NF Register Conter | ||
| p.Context().DelNfRegister() | ||
| logger.NfmLog.Infof("NfDeregister Success: %v [%v]", nfInstanceType, nfInstanceID) | ||
|
|
@@ -469,6 +473,22 @@ func (p *Processor) NFRegisterProcedure( | |
| } | ||
| } | ||
|
|
||
| // Set scp uri for support indirect communication | ||
| // TODO: Support multiple SCP situation (This version only support for a single SCP) | ||
| if nfProfile.NfType == models.NfType_SCP && len(nfProfile.Ipv4Addresses) > 0 { | ||
| if len(nfProfile.Ipv4Addresses[0]) > 0 { | ||
|
Comment on lines
+478
to
+479
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two conditions can be merged to one |
||
| nrfSelf := nrf_context.GetSelf() | ||
| ScpIp := nfProfile.Ipv4Addresses[0] | ||
| ScpUri := "http://" + ScpIp + ":8000" // default port | ||
|
Comment on lines
+481
to
+482
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please check |
||
| nrfSelf.ModifyScpIpInfo(true, ScpUri, ScpIp, 8000) | ||
| logger.NfmLog.Infof("Update ScpUri: %v", ScpUri) | ||
| } else { | ||
| logger.NfmLog.Warnln("SCP registration request received but missing IP address.") | ||
| } | ||
| } else { | ||
| logger.NfmLog.Warnln("SCP registration request received but missing IP address.") | ||
| } | ||
|
|
||
| c.Writer.Header().Add("Location", locationHeaderValue) | ||
| c.JSON(http.StatusOK, putData) | ||
| return | ||
|
|
@@ -489,6 +509,23 @@ func (p *Processor) NFRegisterProcedure( | |
| return | ||
| } | ||
| } | ||
|
|
||
| // Set SCP uri for support indirect communication | ||
| // TODO: Support multiple SCP situation (This version only support for a single SCP) | ||
| if nfProfile.NfType == models.NfType_SCP && len(nfProfile.Ipv4Addresses) > 0 { | ||
| if len(nfProfile.Ipv4Addresses[0]) > 0 { | ||
|
Comment on lines
+515
to
+516
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two conditions can be merged into one |
||
| nrfSelf := nrf_context.GetSelf() | ||
| ScpIp := nfProfile.Ipv4Addresses[0] | ||
| ScpUri := "http://" + ScpIp + ":8000" // default port | ||
| nrfSelf.ModifyScpIpInfo(true, ScpUri, ScpIp, 8000) | ||
| logger.NfmLog.Infof("Receive SCP register request, ScpUri: %v", ScpUri) | ||
| } else { | ||
| logger.NfmLog.Warnln("SCP registration request received but missing IP address.") | ||
| } | ||
| } else { | ||
| logger.NfmLog.Warnln("SCP registration request received but missing IP address.") | ||
| } | ||
|
|
||
| c.Writer.Header().Add("Location", locationHeaderValue) | ||
|
|
||
| if factory.NrfConfig.GetOAuth() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.