From 52fd3d1b73f850aeb587396ab3139fcffd575895 Mon Sep 17 00:00:00 2001
From: Amin Ben Romdhane <amin.benromdhane@iopsys.eu>
Date: Tue, 29 Apr 2025 12:32:20 +0200
Subject: [PATCH] Add Data Model description File

---
 src/datamodel_description.json | 49 ++++++++++++++++++++++++++++++++++
 src/qos_bbf.c                  |  2 +-
 2 files changed, 50 insertions(+), 1 deletion(-)
 create mode 100644 src/datamodel_description.json

diff --git a/src/datamodel_description.json b/src/datamodel_description.json
new file mode 100644
index 0000000..c087438
--- /dev/null
+++ b/src/datamodel_description.json
@@ -0,0 +1,49 @@
+{
+	"Device.": {
+		"type": "object",
+		"protocols": [
+			"cwmp",
+			"usp"
+		],
+		"description": "The top-level object for a Device.",
+		"access": false,
+		"array": false,
+		"Device.QoS.": {
+			"type": "object",
+			"protocols": [
+				"cwmp",
+				"usp"
+			],
+			"description": "Queue management configuration object.",
+			"access": false,
+			"array": false,
+			"Device.QoS.Classification.{i}.": {
+				"type": "object",
+				"protocols": [
+					"cwmp",
+					"usp"
+				],
+				"description": "Classification table. For enabled table entries, if <<param|Interface>> is not a valid reference and <<param|AllInterfaces>> is <<false>>, then the table entry is inoperable and the CPE MUST set <<param|Status>> to <<enum|Error_Misconfigured|Status>>. Several of this objects parameters specify DHCP option values. Some cases are version neutral (the parameter can apply to both DHCPv4 and DHCPv6), but in other cases the representation of the option is different for DHCPv4 and DHCPv6, so it is necessary to define separate DHCPv4-specific and DHCPv6-specific parameters. Therefore, an instance of this object that uses DHCP option values as classification criteria will be associated with either DHCPv4 or DHCPv6, as indicated by the <<param|DHCPType>> parameter.",
+				"access": true,
+				"array": true,
+				"{BBF_VENDOR_PREFIX}VLANIDMark": {
+					"type": "int",
+					"read": true,
+					"write": true,
+					"protocols": [
+						"cwmp",
+						"usp"
+					],
+					"description": "Specifies the VLAN ID to mark on egress packets that match this classification rule. A value of -1 indicates no VLAN ID marking will be applied.",
+					"default": "-1",
+					"datatype": "int",
+					"range": [
+						{
+							"min": -1
+						}
+					]
+				}
+			}
+		}
+	}
+}
\ No newline at end of file
diff --git a/src/qos_bbf.c b/src/qos_bbf.c
index 6e40051..80231f4 100644
--- a/src/qos_bbf.c
+++ b/src/qos_bbf.c
@@ -2158,7 +2158,7 @@ DMLEAF tQoSClassificationParams[] = {
 {"TrafficClass", &DMWRITE, DMT_INT, get_QoSClassification_TrafficClass, set_QoSClassification_TrafficClass, BBFDM_BOTH},
 {"Policer", &DMWRITE, DMT_STRING, get_QoSClassification_Policer, set_QoSClassification_Policer, BBFDM_BOTH},
 //{"App", &DMWRITE, DMT_STRING, get_QoSClassification_App, set_QoSClassification_App, BBFDM_BOTH},
-{BBF_VENDOR_PREFIX"VLANIDMark", &DMWRITE, DMT_UNINT, get_QoSClassification_VLANIDMark, set_QoSClassification_VLANIDMark, BBFDM_BOTH},
+{BBF_VENDOR_PREFIX"VLANIDMark", &DMWRITE, DMT_INT, get_QoSClassification_VLANIDMark, set_QoSClassification_VLANIDMark, BBFDM_BOTH},
 {0}
 };
 
-- 
GitLab