forked from acouzens/open5gs
add OPc field to Subscriber and Profile Document
This commit is contained in:
parent
d4dd8bb72d
commit
588a6ba012
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "nextepc",
|
"name": "nextepc",
|
||||||
"version": "0.1.0",
|
"version": "0.2.0",
|
||||||
"description": "NextEPC",
|
"description": "NextEPC",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": "https://github.com/acetcom/nextepc",
|
"repository": "https://github.com/acetcom/nextepc",
|
||||||
|
|
|
@ -8,6 +8,7 @@ const Profile = new Schema({
|
||||||
security: {
|
security: {
|
||||||
k: String,
|
k: String,
|
||||||
op: String,
|
op: String,
|
||||||
|
opc: String,
|
||||||
amf: String,
|
amf: String,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ const Subscriber = new Schema({
|
||||||
security: {
|
security: {
|
||||||
k: String,
|
k: String,
|
||||||
op: String,
|
op: String,
|
||||||
|
opc: String,
|
||||||
amf: String,
|
amf: String,
|
||||||
rand: String,
|
rand: String,
|
||||||
sqn: Schema.Types.Long
|
sqn: Schema.Types.Long
|
||||||
|
|
|
@ -27,15 +27,6 @@ const schema = {
|
||||||
"pattern": "Only hexadecimal digits are allowed"
|
"pattern": "Only hexadecimal digits are allowed"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"op": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "Operator Key (OP)*",
|
|
||||||
"required": true,
|
|
||||||
"pattern": "^[0-9a-fA-F\\s]+$",
|
|
||||||
"messages": {
|
|
||||||
"pattern": "Only hexadecimal digits are allowed"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"amf": {
|
"amf": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "Authentication Management Field (AMF)*",
|
"title": "Authentication Management Field (AMF)*",
|
||||||
|
@ -44,7 +35,23 @@ const schema = {
|
||||||
"messages": {
|
"messages": {
|
||||||
"pattern": "Only hexadecimal digits are allowed"
|
"pattern": "Only hexadecimal digits are allowed"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"op_type": {
|
||||||
|
"type": "number",
|
||||||
|
"title": "USIM Type",
|
||||||
|
"enum": [0, 1],
|
||||||
|
"enumNames": ["OPc", "OP"],
|
||||||
|
"default": 0,
|
||||||
|
},
|
||||||
|
"op_value": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Operator Key (OPc/OP)*",
|
||||||
|
"required": true,
|
||||||
|
"pattern": "^[0-9a-fA-F\\s]+$",
|
||||||
|
"messages": {
|
||||||
|
"pattern": "Only hexadecimal digits are allowed"
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ambr": {
|
"ambr": {
|
||||||
|
@ -273,14 +280,17 @@ const uiSchema = {
|
||||||
},
|
},
|
||||||
"security" : {
|
"security" : {
|
||||||
"k" : {
|
"k" : {
|
||||||
classNames: "col-xs-12",
|
|
||||||
},
|
|
||||||
"op" : {
|
|
||||||
classNames: "col-xs-7",
|
classNames: "col-xs-7",
|
||||||
},
|
},
|
||||||
"amf" : {
|
"amf" : {
|
||||||
classNames: "col-xs-5",
|
classNames: "col-xs-5",
|
||||||
},
|
},
|
||||||
|
"op_type" : {
|
||||||
|
classNames: "col-xs-3",
|
||||||
|
},
|
||||||
|
"op_value" : {
|
||||||
|
classNames: "col-xs-8",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"ambr" : {
|
"ambr" : {
|
||||||
"downlink" : {
|
"downlink" : {
|
||||||
|
|
|
@ -200,10 +200,18 @@ const View = ({ visible, disableOnClickOutside, profile, onEdit, onDelete, onHid
|
||||||
{security.k}
|
{security.k}
|
||||||
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>K</span>
|
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>K</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="data">
|
{security.opc &&
|
||||||
{security.op}
|
<div className="data">
|
||||||
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>OP</span>
|
{security.opc}
|
||||||
</div>
|
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>OPc</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
{security.op &&
|
||||||
|
<div className="data">
|
||||||
|
{security.op}
|
||||||
|
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>OP</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<div className="data">
|
<div className="data">
|
||||||
{security.amf}
|
{security.amf}
|
||||||
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>AMF</span>
|
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>AMF</span>
|
||||||
|
|
|
@ -31,15 +31,6 @@ const schema = {
|
||||||
"pattern": "Only hexadecimal digits are allowed"
|
"pattern": "Only hexadecimal digits are allowed"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"op": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "Operator Key (OP)*",
|
|
||||||
"required": true,
|
|
||||||
"pattern": "^[0-9a-fA-F\\s]+$",
|
|
||||||
"messages": {
|
|
||||||
"pattern": "Only hexadecimal digits are allowed"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"amf": {
|
"amf": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "Authentication Management Field (AMF)*",
|
"title": "Authentication Management Field (AMF)*",
|
||||||
|
@ -48,7 +39,23 @@ const schema = {
|
||||||
"messages": {
|
"messages": {
|
||||||
"pattern": "Only hexadecimal digits are allowed"
|
"pattern": "Only hexadecimal digits are allowed"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"op_type": {
|
||||||
|
"type": "number",
|
||||||
|
"title": "USIM Type",
|
||||||
|
"enum": [0, 1],
|
||||||
|
"enumNames": ["OPc", "OP"],
|
||||||
|
"default": 0,
|
||||||
|
},
|
||||||
|
"op_value": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Operator Key (OPc/OP)*",
|
||||||
|
"required": true,
|
||||||
|
"pattern": "^[0-9a-fA-F\\s]+$",
|
||||||
|
"messages": {
|
||||||
|
"pattern": "Only hexadecimal digits are allowed"
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ambr": {
|
"ambr": {
|
||||||
|
@ -277,14 +284,17 @@ const uiSchema = {
|
||||||
},
|
},
|
||||||
"security" : {
|
"security" : {
|
||||||
"k" : {
|
"k" : {
|
||||||
classNames: "col-xs-12",
|
|
||||||
},
|
|
||||||
"op" : {
|
|
||||||
classNames: "col-xs-7",
|
classNames: "col-xs-7",
|
||||||
},
|
},
|
||||||
"amf" : {
|
"amf" : {
|
||||||
classNames: "col-xs-5",
|
classNames: "col-xs-5",
|
||||||
},
|
},
|
||||||
|
"op_type" : {
|
||||||
|
classNames: "col-xs-3",
|
||||||
|
},
|
||||||
|
"op_value" : {
|
||||||
|
classNames: "col-xs-8",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"ambr" : {
|
"ambr" : {
|
||||||
"downlink" : {
|
"downlink" : {
|
||||||
|
|
|
@ -199,10 +199,18 @@ const View = ({ visible, disableOnClickOutside, subscriber, onEdit, onDelete, on
|
||||||
{security.k}
|
{security.k}
|
||||||
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>K</span>
|
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>K</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="data">
|
{security.opc &&
|
||||||
{security.op}
|
<div className="data">
|
||||||
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>OP</span>
|
{security.opc}
|
||||||
</div>
|
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>OPc</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
{security.op &&
|
||||||
|
<div className="data">
|
||||||
|
{security.op}
|
||||||
|
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>OP</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<div className="data">
|
<div className="data">
|
||||||
{security.amf}
|
{security.amf}
|
||||||
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>AMF</span>
|
<span style={{color:oc.gray[5]}}><KeyboardControlIcon/>AMF</span>
|
||||||
|
|
|
@ -16,8 +16,8 @@ import traverse from 'traverse';
|
||||||
const formData = {
|
const formData = {
|
||||||
"security": {
|
"security": {
|
||||||
k: "465B5CE8 B199B49F AA5F0A2E E238A6BC",
|
k: "465B5CE8 B199B49F AA5F0A2E E238A6BC",
|
||||||
op: "5F1D289C 5D354D0A 140C2548 F5F3E3BA",
|
amf: "8000",
|
||||||
amf: "8000"
|
op_value: "E8ED289D EBA952E4 283B54E8 8E6183CA",
|
||||||
},
|
},
|
||||||
"ambr": {
|
"ambr": {
|
||||||
"downlink": 1024000,
|
"downlink": 1024000,
|
||||||
|
@ -81,6 +81,16 @@ class Document extends Component {
|
||||||
if (this.key == 'downlink') this.update(Number(x));
|
if (this.key == 'downlink') this.update(Number(x));
|
||||||
if (this.key == 'uplink') this.update(Number(x));
|
if (this.key == 'uplink') this.update(Number(x));
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (profile.data.security) {
|
||||||
|
if (profile.data.security.opc) {
|
||||||
|
profile.data.security.op_type = 0;
|
||||||
|
profile.data.security.op_value = profile.data.security.opc;
|
||||||
|
} else {
|
||||||
|
profile.data.security.op_type = 1;
|
||||||
|
profile.data.security.op_value = profile.data.security.op;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.setState({ formData: profile.data })
|
this.setState({ formData: profile.data })
|
||||||
} else {
|
} else {
|
||||||
this.setState({ formData });
|
this.setState({ formData });
|
||||||
|
@ -163,6 +173,16 @@ class Document extends Component {
|
||||||
handleSubmit = (formData) => {
|
handleSubmit = (formData) => {
|
||||||
const { dispatch, action } = this.props;
|
const { dispatch, action } = this.props;
|
||||||
|
|
||||||
|
if (formData.security) {
|
||||||
|
if (formData.security.op_type === 1) {
|
||||||
|
formData.security.op = formData.security.op_value;
|
||||||
|
formData.security.opc = null;
|
||||||
|
} else {
|
||||||
|
formData.security.op = null;
|
||||||
|
formData.security.opc = formData.security.op_value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NProgress.configure({
|
NProgress.configure({
|
||||||
parent: '#nprogress-base-form',
|
parent: '#nprogress-base-form',
|
||||||
trickleSpeed: 5
|
trickleSpeed: 5
|
||||||
|
|
|
@ -17,8 +17,8 @@ import traverse from 'traverse';
|
||||||
const formData = {
|
const formData = {
|
||||||
"security": {
|
"security": {
|
||||||
k: "465B5CE8 B199B49F AA5F0A2E E238A6BC",
|
k: "465B5CE8 B199B49F AA5F0A2E E238A6BC",
|
||||||
op: "5F1D289C 5D354D0A 140C2548 F5F3E3BA",
|
amf: "8000",
|
||||||
amf: "8000"
|
op_value: "E8ED289D EBA952E4 283B54E8 8E6183CA",
|
||||||
},
|
},
|
||||||
"ambr": {
|
"ambr": {
|
||||||
"downlink": 1024000,
|
"downlink": 1024000,
|
||||||
|
@ -88,17 +88,37 @@ class Document extends Component {
|
||||||
if (this.key == 'downlink') this.update(Number(x));
|
if (this.key == 'downlink') this.update(Number(x));
|
||||||
if (this.key == 'uplink') this.update(Number(x));
|
if (this.key == 'uplink') this.update(Number(x));
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (subscriber.data.security) {
|
||||||
|
if (subscriber.data.security.opc) {
|
||||||
|
subscriber.data.security.op_type = 0;
|
||||||
|
subscriber.data.security.op_value = subscriber.data.security.opc;
|
||||||
|
} else {
|
||||||
|
subscriber.data.security.op_type = 1;
|
||||||
|
subscriber.data.security.op_value = subscriber.data.security.op;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({ formData: subscriber.data })
|
this.setState({ formData: subscriber.data })
|
||||||
} else {
|
} else {
|
||||||
this.setState({ formData });
|
this.setState({ formData });
|
||||||
}
|
}
|
||||||
|
|
||||||
profiles.data.map(profile =>
|
profiles.data.map(profile => {
|
||||||
traverse(profile).forEach(function(x) {
|
traverse(profile).forEach(function(x) {
|
||||||
if (this.key == 'downlink') this.update(Number(x));
|
if (this.key == 'downlink') this.update(Number(x));
|
||||||
if (this.key == 'uplink') this.update(Number(x));
|
if (this.key == 'uplink') this.update(Number(x));
|
||||||
})
|
})
|
||||||
);
|
if (profile.security) {
|
||||||
|
if (profile.security.opc) {
|
||||||
|
profile.security.op_type = 0;
|
||||||
|
profile.security.op_value = profile.security.opc;
|
||||||
|
} else {
|
||||||
|
profile.security.op_type = 1;
|
||||||
|
profile.security.op_value = profile.security.op;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (status.response) {
|
if (status.response) {
|
||||||
NProgress.configure({
|
NProgress.configure({
|
||||||
|
@ -181,6 +201,15 @@ class Document extends Component {
|
||||||
|
|
||||||
handleSubmit = (formData) => {
|
handleSubmit = (formData) => {
|
||||||
const { dispatch, action } = this.props;
|
const { dispatch, action } = this.props;
|
||||||
|
if (formData.security) {
|
||||||
|
if (formData.security.op_type === 1) {
|
||||||
|
formData.security.op = formData.security.op_value;
|
||||||
|
formData.security.opc = null;
|
||||||
|
} else {
|
||||||
|
formData.security.op = null;
|
||||||
|
formData.security.opc = formData.security.op_value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NProgress.configure({
|
NProgress.configure({
|
||||||
parent: '#nprogress-base-form',
|
parent: '#nprogress-base-form',
|
||||||
|
|
Loading…
Reference in New Issue