Skip to content

Commit

Permalink
Merge pull request #11 from free5gc/feat/snn
Browse files Browse the repository at this point in the history
Feat/snn
  • Loading branch information
ianchen0119 authored Sep 27, 2024
2 parents 72025a1 + e9aa98c commit 578edc9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions config/n3ue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ configuration:
IPSecIfaceAddr: 10.0.1.1 # IP address of Nwu interface (IKE) on N3IWF
IPsecInnerAddr: 10.0.0.1 # IP address of IPsec tunnel enpoint on N3IWF
N3UEInformation:
VisitedPLMN: # Optional
MCC: 208 # Mobile Country Code (3 digits string, digit: 0~9)
MNC: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
IMSI:
PLMNID: # Public Land Mobile Network ID
MCC: 208 # Mobile Country Code (3 digits string, digit: 0~9)
Expand Down
14 changes: 8 additions & 6 deletions internal/nwucp/handler/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ func SendPduSessionEstablishmentRequest(ue *security.RanUeContext,

func SendDeregistration() {
n3ueContext := context.N3UESelf()
mobileIdentity5GS := nasType.MobileIdentity5GS{
Len: n3ueContext.GUTI.Len,
Buffer: n3ueContext.GUTI.Octet[:],
}
deregistrationRequest := nasPacket.GetDeregistrationRequest(0x02, 0x01, 0x00, mobileIdentity5GS)
if n3ueContext.GUTI != nil {
mobileIdentity5GS := nasType.MobileIdentity5GS{
Len: n3ueContext.GUTI.Len,
Buffer: n3ueContext.GUTI.Octet[:],
}
deregistrationRequest := nasPacket.GetDeregistrationRequest(0x02, 0x01, 0x00, mobileIdentity5GS)

SendNasMsg(n3ueContext.RanUeContext, n3ueContext.N3IWFRanUe.TCPConnection, deregistrationRequest)
SendNasMsg(n3ueContext.RanUeContext, n3ueContext.N3IWFRanUe.TCPConnection, deregistrationRequest)
}
}
5 changes: 5 additions & 0 deletions pkg/factory/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ type N3UEInfo struct {
IPSecSaCpSPI uint32 `yaml:"IPSecSA3gppControlPlaneSPI" valid:"hexadecimal,required"`
SmPolicy []PolicyItem `yaml:"SmPolicy" valid:"required"`
Security Security `yaml:"Security" valid:"required"`
VisitedPlmn *PLMN `yaml:"VisitedPLMN" valid:"optional"`
}

func (i *N3UEInfo) validate() (bool, error) {
Expand Down Expand Up @@ -200,6 +201,10 @@ func (n *N3UEInfo) GetAMFID() ([]byte, error) {
func (n *N3UEInfo) GetSNN() string {
mcc := n.IMSI.PLMN.MCC
mnc := n.IMSI.PLMN.MNC
if n.VisitedPlmn != nil {
mcc = n.VisitedPlmn.MCC
mnc = n.VisitedPlmn.MNC
}
if len(n.IMSI.PLMN.MNC) == 2 {
mnc = "0" + mnc
}
Expand Down

0 comments on commit 578edc9

Please sign in to comment.