Skip to content

Commit

Permalink
Support to configure UP security (#11)
Browse files Browse the repository at this point in the history
* Support to configure UP security

* Support to enable or disable UP security
  • Loading branch information
ghj0504520 authored Oct 24, 2021
1 parent 1057fb2 commit b2332d9
Showing 1 changed file with 104 additions and 22 deletions.
126 changes: 104 additions & 22 deletions frontend/src/pages/Subscribers/components/SubscriberModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,57 @@ import _ from 'lodash';

let snssaiToString = (snssai) => snssai.sst.toString(16).padStart(2, '0').toUpperCase() + snssai.sd

function dnnConfigurationFromSliceConfiguration(dnnConfig){
if (dnnConfig.upSecurityChk === true) {
return {
"sscModes": {
"defaultSscMode": "SSC_MODE_1",
"allowedSscModes": ["SSC_MODE_2", "SSC_MODE_3"]
},
"pduSessionTypes": {
"defaultSessionType": "IPV4",
"allowedSessionTypes": ["IPV4"]
},
"sessionAmbr": {
"uplink": dnnConfig.uplinkAmbr,
"downlink": dnnConfig.downlinkAmbr
},
"5gQosProfile": {
"5qi": dnnConfig["5qi"],
"arp": {
"priorityLevel": 8
},
"priorityLevel": 8
},
"upSecurity": {
"upIntegr": dnnConfig.upIntegrity,
"upConfid": dnnConfig.upConfidentiality
}
}
}
return {
"sscModes": {
"defaultSscMode": "SSC_MODE_1",
"allowedSscModes": ["SSC_MODE_2", "SSC_MODE_3"]
},
"pduSessionTypes": {
"defaultSessionType": "IPV4",
"allowedSessionTypes": ["IPV4"]
},
"sessionAmbr": {
"uplink": dnnConfig.uplinkAmbr,
"downlink": dnnConfig.downlinkAmbr
},
"5gQosProfile": {
"5qi": dnnConfig["5qi"],
"arp": {
"priorityLevel": 8
},
"priorityLevel": 8
}
}
}

function smDatasFromSliceConfiguration(sliceConfiguration) {
return _.map(sliceConfiguration, slice => {
return {
Expand All @@ -17,27 +68,7 @@ function smDatasFromSliceConfiguration(sliceConfiguration) {
// key
dnnConfig.dnn,
// value
{
"sscModes": {
"defaultSscMode": "SSC_MODE_1",
"allowedSscModes": ["SSC_MODE_2", "SSC_MODE_3"]
},
"pduSessionTypes": {
"defaultSessionType": "IPV4",
"allowedSessionTypes": ["IPV4"]
},
"sessionAmbr": {
"uplink": dnnConfig.uplinkAmbr,
"downlink": dnnConfig.downlinkAmbr
},
"5gQosProfile": {
"5qi": dnnConfig["5qi"],
"arp": {
"priorityLevel": 8
},
"priorityLevel": 8
}
}
dnnConfigurationFromSliceConfiguration(dnnConfig)
]))
}
})
Expand Down Expand Up @@ -103,6 +134,18 @@ function sliceConfigurationsFromSubscriber(subscriber) {
}
})
}
if (dnnConfigs[dnn].upSecurity !== null){
return {
dnn: dnn,
uplinkAmbr: dnnConfigs[dnn].sessionAmbr.uplink,
downlinkAmbr: dnnConfigs[dnn].sessionAmbr.downlink,
"5qi": dnnConfigs[dnn]["5gQosProfile"]["5qi"],
flowRules: flowRules,
upSecurityChk: true,
upIntegrity: dnnConfigs[dnn].upSecurity.upIntegr,
upConfidentiality: dnnConfigs[dnn].upSecurity.upConfid
};
}
return {
dnn: dnn,
uplinkAmbr: dnnConfigs[dnn].sessionAmbr.uplink,
Expand Down Expand Up @@ -297,12 +340,51 @@ class SubscriberModal extends Component {
minimum: 0,
maximum: 255,
title: "Default 5QI"
},
},
flowRules: {
type: "array",
items: { $ref: "#/definitions/FlowInformation" },
maxItems: 1,
title: "Flow Rules"
},
upSecurityChk: {
"type": "boolean",
title: "UP Security",
"default": false
},
},
"dependencies": {
upSecurityChk: {
"oneOf": [
{
"properties": {
upSecurityChk: {
"enum": [false]
}
},
},
{
"properties": {
upSecurityChk: {
"enum": [true]
},
upIntegrity: {
type: "string",
title: "Integrity of UP Security",
enum: ["NOT_NEEDED", "PREFERRED", "REQUIRED"],
},
upConfidentiality: {
type: "string",
title: "Confidentiality of UP Security",
enum: ["NOT_NEEDED", "PREFERRED", "REQUIRED"],
},
},
"required": [
"upIntegrity",
"upConfidentiality"
]
}
]
}
},
},
Expand Down

0 comments on commit b2332d9

Please sign in to comment.