From d10bc999241278f9c0ef2e677dc3a30fe192848d Mon Sep 17 00:00:00 2001 From: Amin Ben Romdhane Date: Fri, 10 Feb 2023 15:56:16 +0100 Subject: [PATCH] Network update: deprecate vendor extension 'tvid' --- dmtree/tr181/bridging.c | 51 --------------------------- dmtree/tr181/bridging.h | 2 -- dmtree/vendor/iopsys/tr181/bridging.c | 26 -------------- dmtree/vendor/iopsys/tr181/bridging.h | 1 - dmtree/vendor/iopsys/tr181/vendor.c | 1 - dmtree/vendor/iopsys/vendor.json | 29 --------------- 6 files changed, 110 deletions(-) diff --git a/dmtree/tr181/bridging.c b/dmtree/tr181/bridging.c index c7c2e154..66bbabd2 100644 --- a/dmtree/tr181/bridging.c +++ b/dmtree/tr181/bridging.c @@ -165,42 +165,6 @@ void bridging_set_priority_list(char *uci_opt_name, void *data, char *value) } } -void bridging_get_vlan_tvid(char *uci_opt_name, void *data, char **value) -{ - dmuci_get_value_by_section_string(((struct bridge_vlan_args *)data)->bridge_vlan_sec, uci_opt_name, value); -} - -void bridging_set_vlan_tvid(char *uci_opt_name, void *data, char *value) -{ - struct uci_section *dmmap_s = NULL; - char *br_inst = NULL, *vlan_vid = NULL; - - dmuci_get_value_by_section_string(((struct bridge_vlan_args *)data)->bridge_vlan_sec, "br_inst", &br_inst); - dmuci_get_value_by_section_string(((struct bridge_vlan_args *)data)->bridge_vlan_sec, "vid", &vlan_vid); - if (DM_STRLEN(vlan_vid) == 0) - goto end; - - uci_path_foreach_option_eq(bbfdm, "dmmap_bridge_vlanport", "bridge_vlanport", "br_inst", br_inst, dmmap_s) { - char *curr_name = NULL; - - dmuci_get_value_by_section_string(dmmap_s, "name", &curr_name); - if (DM_STRLEN(curr_name) == 0) - continue; - - if (DM_STRSTR(curr_name, vlan_vid) != NULL) { - struct uci_section *s = NULL; - char *dev_name = NULL; - - dmuci_get_value_by_section_string(dmmap_s, "device_name", &dev_name); - get_config_section_of_dmmap_section("network", "device", dev_name, &s); - if (s) dmuci_set_value_by_section(s, "tvid", value); - } - } - -end: - dmuci_set_value_by_section(((struct bridge_vlan_args *)data)->bridge_vlan_sec, uci_opt_name, !DM_LSTRCMP(value, "0") ? "" : value); -} - static void bridge_remove_related_device_section(struct uci_list *br_ports_list) { struct uci_element *e = NULL; @@ -2953,21 +2917,6 @@ static int set_BridgingBridgeVLANPort_VLAN(char *refparam, struct dmctx *ctx, vo dmuci_set_value_by_section(((struct bridge_vlanport_args *)data)->bridge_vlanport_sec, "vid", new_vid); } dmfree(new_vid); - - /* Update tvid, read from dmmap_bridge_vlan, set in vlanport_sec */ - struct uci_section *vlan_s = NULL; - - uci_path_foreach_option_eq(bbfdm, "dmmap_bridge_vlan", "bridge_vlan", "br_inst", ((struct bridge_vlanport_args *)data)->br_inst, vlan_s) { - char *vlan_inst = NULL; - - dmuci_get_value_by_section_string(vlan_s, "bridge_vlan_instance", &vlan_inst); - if (vlan_inst && DM_STRCMP(vlan_inst, instance) == 0) { - char *tvid; - dmuci_get_value_by_section_string(vlan_s, "tvid", &tvid); - dmuci_set_value_by_section(((struct bridge_vlanport_args *)data)->bridge_vlanport_sec, "tvid", tvid); - break; - } - } } handle_inner_vid(); diff --git a/dmtree/tr181/bridging.h b/dmtree/tr181/bridging.h index d8075cd4..57c0a066 100644 --- a/dmtree/tr181/bridging.h +++ b/dmtree/tr181/bridging.h @@ -38,6 +38,4 @@ extern DMLEAF tBridgingProviderBridgeParams[]; void bridging_get_priority_list(char *uci_opt_name, void *data, char **value); void bridging_set_priority_list(char *uci_opt_name, void *data, char *value); -void bridging_get_vlan_tvid(char *uci_opt_name, void *data, char **value); -void bridging_set_vlan_tvid(char *uci_opt_name, void *data, char *value); #endif diff --git a/dmtree/vendor/iopsys/tr181/bridging.c b/dmtree/vendor/iopsys/tr181/bridging.c index 95dcbab1..44b43052 100644 --- a/dmtree/vendor/iopsys/tr181/bridging.c +++ b/dmtree/vendor/iopsys/tr181/bridging.c @@ -39,26 +39,6 @@ static int set_BridgingBridgePort_Egress_PriorityRegeneration(char *refparam, st return 0; } -static int get_BridgingBridgeVLAN_TVID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - bridging_get_vlan_tvid("tvid", data, value); - return 0; -} - -static int set_BridgingBridgeVLAN_TVID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - switch (action) { - case VALUECHECK: - if (dm_validate_int(value, RANGE_ARGS{{"0","4094"}}, 1)) - return FAULT_9007; - return 0; - case VALUESET: - bridging_set_vlan_tvid("tvid", data, value); - return 0; - } - return 0; -} - /********************************************************************************************************************************** * OBJ & PARAM DEFINITION ***********************************************************************************************************************************/ @@ -67,9 +47,3 @@ DMLEAF tIOPSYS_BridgingBridgePortParams[] = { {BBF_VENDOR_PREFIX"EgressPriorityRegeneration", &DMWRITE, DMT_STRING, get_BridgingBridgePort_Egress_PriorityRegeneration, set_BridgingBridgePort_Egress_PriorityRegeneration, BBFDM_BOTH}, {0} }; - -DMLEAF tIOPSYS_BridgingBridgeVLANParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/ -{BBF_VENDOR_PREFIX"TVID", &DMWRITE, DMT_INT, get_BridgingBridgeVLAN_TVID, set_BridgingBridgeVLAN_TVID, BBFDM_BOTH}, -{0} -}; diff --git a/dmtree/vendor/iopsys/tr181/bridging.h b/dmtree/vendor/iopsys/tr181/bridging.h index cba27bf9..11b8c10a 100644 --- a/dmtree/vendor/iopsys/tr181/bridging.h +++ b/dmtree/vendor/iopsys/tr181/bridging.h @@ -15,6 +15,5 @@ #include "libbbf_api/dmcommon.h" extern DMLEAF tIOPSYS_BridgingBridgePortParams[]; -extern DMLEAF tIOPSYS_BridgingBridgeVLANParams[]; #endif //__IOPSYS_BRIDGING_H diff --git a/dmtree/vendor/iopsys/tr181/vendor.c b/dmtree/vendor/iopsys/tr181/vendor.c index 1fb3797d..c1de2518 100644 --- a/dmtree/vendor/iopsys/tr181/vendor.c +++ b/dmtree/vendor/iopsys/tr181/vendor.c @@ -27,7 +27,6 @@ DM_MAP_OBJ tVendorExtensionIOPSYS[] = { {"Device.Ethernet.VLANTermination.{i}.", NULL, tIOPSYS_EthernetVLANTerminationParams}, {"Device.Time.", NULL, tIOPSYS_TimeParams}, {"Device.Bridging.Bridge.{i}.Port.{i}.", NULL, tIOPSYS_BridgingBridgePortParams}, -{"Device.Bridging.Bridge.{i}.VLAN.{i}.", NULL, tIOPSYS_BridgingBridgeVLANParams}, {"Device.Services.VoiceService.{i}.CallLog.{i}.", NULL, tIOPSYS_VoiceServiceCallLogParams}, {"Device.Services.VoiceService.{i}.CallLog.{i}.Session.{i}.Source.RTP.", NULL, tIOPSYS_VoiceServiceCallLogSessionSourceRTPParams}, {"Device.Services.VoiceService.{i}.CallLog.{i}.Session.{i}.Destination.RTP.", NULL, tIOPSYS_VoiceServiceCallLogSessionDestinationRTPParams}, diff --git a/dmtree/vendor/iopsys/vendor.json b/dmtree/vendor/iopsys/vendor.json index 99632a8f..8ef7f31d 100644 --- a/dmtree/vendor/iopsys/vendor.json +++ b/dmtree/vendor/iopsys/vendor.json @@ -498,35 +498,6 @@ ] } } - }, - "Device.Bridging.Bridge.{i}.VLAN.{i}.": { - "type": "object", - "version": "2.5", - "protocols": [ - "cwmp", - "usp" - ], - "description": "Bridge VLAN table. If this table is supported, if MUST contain an entry for each VLAN known to the Bridge. This table only applies to an 802.1Q <> Bridge.", - "access": true, - "array": true, - "{BBF_VENDOR_PREFIX}TVID": { - "type": "int", - "read": true, - "write": true, - "version": "2.5", - "protocols": [ - "cwmp", - "usp" - ], - "description": "Translate vlan from lan network with new VLAN ID", - "datatype": "int", - "range" : [ - { - "min": 0, - "max": 4094 - } - ] - } } } },