feat: mml补充UDM特殊命令处理

This commit is contained in:
TsMask
2025-04-09 19:04:27 +08:00
parent 34f4351040
commit c8187e55ab
5 changed files with 44 additions and 4 deletions

View File

@@ -43,7 +43,7 @@ INSERT INTO `mml_subscriber` VALUES (592, 'UDM', 'authdataManagement', 'Authenti
INSERT INTO `mml_subscriber` VALUES (593, 'UDM', 'authdataManagement', 'Authentication Data Management', 'baa', 'authdat', 'Batch Add Auth Data', '[{\"comment\":\"\",\"display\":\"Starting IMSI\",\"filter\":\"\",\"name\":\"start_imsi\",\"optional\":\"false\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"Auth Data Number\",\"filter\":\"\",\"name\":\"sub_num\",\"optional\":\"false\",\"type\":\"int\"},{\"comment\":\"\",\"display\":\"KI\",\"filter\":\"\",\"name\":\"ki\",\"optional\":\"false\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"AMF\",\"filter\":\"\",\"name\":\"amf\",\"optional\":\"false\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"Algo Index\",\"filter\":\"0~15\",\"name\":\"algo\",\"optional\":\"false\",\"type\":\"int\"},{\"comment\":\"\",\"display\":\"OPC\",\"filter\":\"\",\"name\":\"opc\",\"optional\":\"true\",\"type\":\"string\"}]', 'Active');
INSERT INTO `mml_subscriber` VALUES (594, 'UDM', 'authdataManagement', 'Authentication Data Management', 'bde', 'authdat', 'Batch Delete Auth Data', '[{\"comment\":\"\",\"display\":\"Starting IMSI\",\"filter\":\"\",\"name\":\"start_imsi\",\"optional\":\"false\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"Auth Data Number\",\"filter\":\"\",\"name\":\"sub_num\",\"optional\":\"false\",\"type\":\"int\"}]', 'Active');
INSERT INTO `mml_subscriber` VALUES (595, 'UDM', 'authdataManagement', 'Authentication Data Management', 'import', 'authdat', 'Import Auth Data From File', '[{\"comment\":\"\",\"display\":\"Path File\",\"filter\":\".txt\",\"name\":\"path\",\"optional\":\"false\",\"type\":\"file\"}]', 'Active');
INSERT INTO `mml_subscriber` VALUES (596, 'UDM', 'authdataManagement', 'Authentication Data Management', 'export', 'authdat', 'Export Auth Data to File', '[{\"comment\":\"\",\"display\":\"Path File\",\"filter\":\"\",\"name\":\"path\",\"optional\":\"false\",\"type\":\"string\"}]', 'Active');
INSERT INTO `mml_subscriber` VALUES (596, 'UDM', 'authdataManagement', 'Authentication Data Management', 'export', 'authdat', 'Export Auth Data to File', '[{\"comment\":\"\",\"display\":\"Path File\",\"filter\":\"\",\"name\":\"path\",\"optional\":\"false\",\"type\":\"string\"}]', 'Inactive');
INSERT INTO `mml_subscriber` VALUES (597, 'UDM', 'subscriberManagement', 'Subcriber Management', 'dsp', 'udmuser', 'Display UDM Subscriber', '[{\"comment\":\"\",\"display\":\"IMSI\",\"filter\":\"\",\"name\":\"imsi\",\"optional\":\"false\",\"type\":\"string\"}]', 'Active');
INSERT INTO `mml_subscriber` VALUES (598, 'UDM', 'subscriberManagement', 'Subcriber Management', 'add', 'udmuser', 'Add UDM Subscriber', '[{\"comment\":\"\",\"display\":\"IMSI\",\"filter\":\"\",\"name\":\"imsi\",\"optional\":\"false\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"MSISDN\",\"filter\":\"\",\"name\":\"msisdn\",\"optional\":\"false\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"5G UE AMBR\",\"filter\":\"\",\"name\":\"ambr\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"5G SNSSAIs\",\"filter\":\"\",\"name\":\"nssai\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"5G Forbidden Areas\",\"filter\":\"\",\"name\":\"arfb\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"5G Service Area Restriction\",\"filter\":\"\",\"name\":\"sar\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"RAT Type\",\"filter\":\"\",\"name\":\"rat\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"Core Network\",\"filter\":\"\",\"name\":\"cn\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"5G SMF Selection Data\",\"filter\":\"\",\"name\":\"smf_sel\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"5G SM Data\",\"filter\":\"\",\"name\":\"sm_data\",\"optional\":\"false\",\"type\":\"string\"},{\"comment\":\"Specify mobile phone static IP address, and \'-\' indicates the use of dynamic IP address\",\"display\":\"4G Static IP\",\"filter\":\"\",\"name\":\"static_ip\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"4G Context ID\",\"filter\":\"\",\"name\":\"context_id\",\"optional\":\"true\",\"type\":\"int\"},{\"comment\":\"\",\"display\":\"4G APN Context\",\"filter\":\"\",\"name\":\"apn_context\",\"optional\":\"true\",\"type\":\"int\"},{\"comment\":\"\",\"display\":\"4G EPS User Template Name\",\"filter\":\"\",\"name\":\"epstpl\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"4G EPS Flag\",\"filter\":\"{\\\"0\\\":\\\"Disable\\\", \\\"1\\\":\\\"Enable\\\"}\",\"name\":\"eps_flag\",\"optional\":\"true\",\"type\":\"enum\"},{\"comment\":\"\",\"display\":\"4G EPS ODB\",\"filter\":\"\",\"name\":\"eps_odb\",\"optional\":\"true\",\"type\":\"int\"},{\"comment\":\"\",\"display\":\"4G HPLMN ODB\",\"filter\":\"\",\"name\":\"hplmn_odb\",\"optional\":\"true\",\"type\":\"int\"},{\"comment\":\"\",\"display\":\"4G Access Restriction Data\",\"filter\":\"\",\"name\":\"ard\",\"optional\":\"true\",\"type\":\"int\"}]', 'Active');
INSERT INTO `mml_subscriber` VALUES (599, 'UDM', 'subscriberManagement', 'Subcriber Management', 'del', 'udmuser', 'Delete Subscriber Data', '[{\"comment\":\"\",\"display\":\"IMSI\",\"filter\":\"\",\"name\":\"imsi\",\"optional\":\"false\",\"type\":\"string\"}]', 'Active');
@@ -53,8 +53,11 @@ INSERT INTO `mml_subscriber` VALUES (602, 'UDM', 'subscriberManagement', 'Subcri
INSERT INTO `mml_subscriber` VALUES (603, 'UDM', 'subscriberManagement', 'Subcriber Management', 'bmd', 'udmuser', 'Batch Modify Subscriber Data', '[{\"comment\":\"\",\"display\":\"Starting IMSI\",\"filter\":\"\",\"name\":\"start_imsi\",\"optional\":\"false\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"Subcribers Number\",\"filter\":\"\",\"name\":\"sub_num\",\"optional\":\"false\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"5G UE AMBR\",\"filter\":\"\",\"name\":\"ambr\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"5G SNSSAIs\",\"filter\":\"\",\"name\":\"nssai\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"5G Forbidden Areas\",\"filter\":\"\",\"name\":\"arfb\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"5G Service Area Restriction\",\"filter\":\"\",\"name\":\"sar\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"RAT Type\",\"filter\":\"\",\"name\":\"rat\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"Core Network\",\"filter\":\"\",\"name\":\"cn\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"5G SMF Selection Data\",\"filter\":\"\",\"name\":\"smf_sel\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"5G SM Data\",\"filter\":\"\",\"name\":\"sm_data\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"Specify mobile phone static IP address, and \'-\' indicates the use of dynamic IP address\",\"display\":\"4G Static IP\",\"filter\":\"\",\"name\":\"static_ip\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"4G Context ID\",\"filter\":\"\",\"name\":\"context_id\",\"optional\":\"true\",\"type\":\"int\"},{\"comment\":\"\",\"display\":\"4G APN Context\",\"filter\":\"\",\"name\":\"apn_context\",\"optional\":\"true\",\"type\":\"int\"},{\"comment\":\"\",\"display\":\"4G EPS User Template Name\",\"filter\":\"\",\"name\":\"epstpl\",\"optional\":\"true\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"4G EPS Flag\",\"filter\":\"{\\\"0\\\":\\\"Disable\\\", \\\"1\\\":\\\"Enable\\\"}\",\"name\":\"eps_flag\",\"optional\":\"true\",\"type\":\"enum\"},{\"comment\":\"\",\"display\":\"4G EPS ODB\",\"filter\":\"\",\"name\":\"eps_odb\",\"optional\":\"true\",\"type\":\"int\"},{\"comment\":\"\",\"display\":\"4G HPLMN ODB\",\"filter\":\"\",\"name\":\"hplmn_odb\",\"optional\":\"true\",\"type\":\"int\"},{\"comment\":\"\",\"display\":\"4G Access Restriction Data\",\"filter\":\"\",\"name\":\"ard\",\"optional\":\"true\",\"type\":\"int\"}]', 'Active');
INSERT INTO `mml_subscriber` VALUES (604, 'UDM', 'subscriberManagement', 'Subcriber Management', 'import', 'udmuser', 'Import Subscriber Data From File', '[{\"comment\":\"\",\"display\":\"Path File\",\"filter\":\".txt\",\"name\":\"path\",\"optional\":\"false\",\"type\":\"file\"}]', 'Active');
INSERT INTO `mml_subscriber` VALUES (605, 'UDM', 'subscriberManagement', 'Subcriber Management', 'upload', 'udmuser', 'Upload Subscriber Data', '[{\"comment\":\"\",\"display\":\"Path File\",\"filter\":\".txt\",\"name\":\"path\",\"optional\":\"false\",\"type\":\"file\"}]', 'Inactive');
INSERT INTO `mml_subscriber` VALUES (606, 'UDM', 'subscriberManagement', 'Subcriber Management', 'export', 'udmuser', 'Export Subscriber Data to File', '[{\"comment\":\"\",\"display\":\"Path File\",\"filter\":\"\",\"name\":\"path\",\"optional\":\"false\",\"type\":\"string\"}]', 'Active');
INSERT INTO `mml_subscriber` VALUES (607, 'UDM', 'subscriberManagement', 'Subcriber Management', 'sync', 'start', 'Sync UDM Data From Public UDM', 'null', 'Active');
INSERT INTO `mml_subscriber` VALUES (608, 'UDM', 'subscriberManagement', 'Subcriber Management', 'sync', 'state', 'Query State of Sync Task', 'null', 'Active');
INSERT INTO `mml_subscriber` VALUES (606, 'UDM', 'subscriberManagement', 'Subcriber Management', 'export', 'udmuser', 'Export Subscriber Data to File', '[{\"comment\":\"\",\"display\":\"Path File\",\"filter\":\"\",\"name\":\"path\",\"optional\":\"false\",\"type\":\"string\"}]', 'Inactive');
INSERT INTO `mml_subscriber` VALUES (607, 'UDM', 'subscriberManagement', 'Subcriber Management', 'sync', 'start', 'Sync UDM Data From Public UDM', 'null', 'Inactive');
INSERT INTO `mml_subscriber` VALUES (608, 'UDM', 'subscriberManagement', 'Subcriber Management', 'sync', 'state', 'Query State of Sync Task', 'null', 'Inactive');
INSERT INTO `mml_subscriber` VALUES (609, 'UDM', 'other', 'Other', 'set suci', '', 'Set SUCI', '[{\"comment\":\"\",\"display\":\"ID\",\"filter\":\"\",\"name\":\"id\",\"optional\":\"false\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"Scheme\",\"filter\":\"\",\"name\":\"scheme\",\"optional\":\"false\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"Private Key\",\"filter\":\"\",\"name\":\"privatekey\",\"optional\":\"false\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"Public Key\",\"filter\":\"\",\"name\":\"publickey\",\"optional\":\"false\",\"type\":\"string\"}]', 'Active');
INSERT INTO `mml_subscriber` VALUES (610, 'UDM', 'other', 'Other', 'set op', '', 'Set OP', '[{\"comment\":\"\",\"display\":\"ID\",\"filter\":\"\",\"name\":\"id\",\"optional\":\"false\",\"type\":\"string\"},{\"comment\":\"\",\"display\":\"Value\",\"filter\":\"\",\"name\":\"value\",\"optional\":\"false\",\"type\":\"string\"}]', 'Active');
INSERT INTO `mml_subscriber` VALUES (611, 'UDM', 'other', 'Other', 'dec key', '', 'Check Key Profile', 'null', 'Active');
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -67,6 +67,8 @@ INSERT INTO `sys_role_menu` VALUES (2, 2096);
INSERT INTO `sys_role_menu` VALUES (2, 2097);
INSERT INTO `sys_role_menu` VALUES (2, 2099);
INSERT INTO `sys_role_menu` VALUES (2, 2102);
INSERT INTO `sys_role_menu` VALUES (2, 2107);
INSERT INTO `sys_role_menu` VALUES (2, 2109);
INSERT INTO `sys_role_menu` VALUES (2, 2113);
INSERT INTO `sys_role_menu` VALUES (2, 2114);
INSERT INTO `sys_role_menu` VALUES (2, 2118);

Binary file not shown.

View File

@@ -0,0 +1,25 @@
PRAGMA foreign_keys = false;
DELETE FROM "mml_subscriber" WHERE "id" = 609;
INSERT INTO "mml_subscriber" ("id", "ne_type", "category", "cat_display", "operation", "object", "mml_display", "param_json", "status") VALUES (609, 'UDM', 'other', 'Other', 'set suci', '', 'Set SUCI', '[{"comment":"","display":"ID","filter":"","name":"id","optional":"false","type":"string"},{"comment":"","display":"Scheme","filter":"","name":"scheme","optional":"false","type":"string"},{"comment":"","display":"Private Key","filter":"","name":"privatekey","optional":"false","type":"string"},{"comment":"","display":"Public Key","filter":"","name":"publickey","optional":"false","type":"string"}]', 'Active');
DELETE FROM "mml_subscriber" WHERE "id" = 610;
INSERT INTO "mml_subscriber" ("id", "ne_type", "category", "cat_display", "operation", "object", "mml_display", "param_json", "status") VALUES (610, 'UDM', 'other', 'Other', 'set op', '', 'Set OP', '[{"comment":"","display":"ID","filter":"","name":"id","optional":"false","type":"string"},{"comment":"","display":"Value","filter":"","name":"value","optional":"false","type":"string"}]', 'Active');
DELETE FROM "mml_subscriber" WHERE "id" = 611;
INSERT INTO "mml_subscriber" ("id", "ne_type", "category", "cat_display", "operation", "object", "mml_display", "param_json", "status") VALUES (611, 'UDM', 'other', 'Other', 'dec key', '', 'Check Key Profile', 'null', 'Active');
UPDATE "mml_subscriber" SET "ne_type" = 'UDM', "category" = 'authdataManagement', "cat_display" = 'Authentication Data Management', "operation" = 'export', "object" = 'authdat', "mml_display" = 'Export Auth Data to File', "param_json" = '[{"comment":"","display":"Path File","filter":"","name":"path","optional":"false","type":"string"}]', "status" = 'Inactive' WHERE "id" = 596;
UPDATE "mml_subscriber" SET "ne_type" = 'UDM', "category" = 'subscriberManagement', "cat_display" = 'Subcriber Management', "operation" = 'export', "object" = 'udmuser', "mml_display" = 'Export Subscriber Data to File', "param_json" = '[{"comment":"","display":"Path File","filter":"","name":"path","optional":"false","type":"string"}]', "status" = 'Inactive' WHERE "id" = 606;
UPDATE "mml_subscriber" SET "ne_type" = 'UDM', "category" = 'subscriberManagement', "cat_display" = 'Subcriber Management', "operation" = 'sync', "object" = 'start', "mml_display" = 'Sync UDM Data From Public UDM', "param_json" = 'null', "status" = 'Inactive' WHERE "id" = 607;
UPDATE "mml_subscriber" SET "ne_type" = 'UDM', "category" = 'subscriberManagement', "cat_display" = 'Subcriber Management', "operation" = 'sync', "object" = 'state', "mml_display" = 'Query State of Sync Task', "param_json" = 'null', "status" = 'Inactive' WHERE "id" = 608;
DELETE FROM "sys_role_menu" WHERE "role_id" = 2 AND "menu_id" = 2107;
INSERT INTO `sys_role_menu` VALUES (2, 2107);
DELETE FROM "sys_role_menu" WHERE "role_id" = 2 AND "menu_id" = 2109;
INSERT INTO `sys_role_menu` VALUES (2, 2109);
PRAGMA foreign_keys = true;

View File

@@ -616,6 +616,16 @@ func PostMMLToNF(w http.ResponseWriter, r *http.Request) {
result := re1.ReplaceAllString(string(buf[0:n-len(neType)-2]), "")
result = re2.ReplaceAllString(result, "")
mmlResult = append(mmlResult, result)
// UDM 特殊命令处理
if neType == "UDM" && strings.Contains(mml, "dec key") {
output, err := neService.NewNeInfo.NeRunSSHCmd(neInfo.NeType, neInfo.NeId, "cat /usr/local/etc/udm/ueKeyProfile.tmp")
if err != nil {
mmlResult = append(mmlResult, err.Error())
} else {
mmlResult = append(mmlResult, output)
}
}
}
}