diff --git a/bin/Makefile.am b/bin/Makefile.am index d3387901..f126f572 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -92,13 +92,14 @@ libbbfdm_la_SOURCES += \ ../dmtree/tr181/deviceinfo-openwrt.c \ ../dmtree/tr181/wifi-openwrt.c \ ../dmtree/tr181/hosts-openwrt.c\ - ../dmtree/tr181/qos.c + ../dmtree/tr181/qos.c else libbbfdm_la_SOURCES += \ ../dmtree/tr181/deviceinfo-iopsyswrt.c \ ../dmtree/tr181/wifi-iopsyswrt.c \ - ../dmtree/tr181/hosts-iopsyswrt.c\ - ../dmtree/tr181/qos-iopsyswrt.c + ../dmtree/tr181/hosts-iopsyswrt.c\ + ../dmtree/tr181/qos-iopsyswrt.c + endif if BBF_TR104 diff --git a/dmtree/tr181/qos-iopsyswrt.c b/dmtree/tr181/qos-iopsyswrt.c index c6f33fad..c6110aa8 100644 --- a/dmtree/tr181/qos-iopsyswrt.c +++ b/dmtree/tr181/qos-iopsyswrt.c @@ -78,6 +78,7 @@ static int browseQoSQueueStatsInst(struct dmctx *dmctx, DMNODE *parent_node, voi return 0; } #endif + static int browseQoSShaperInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) { char *inst = NULL, *inst_last = NULL; @@ -212,7 +213,7 @@ static int addObjQoSQueue(char *refparam, struct dmctx *ctx, void *data, char ** check_create_dmmap_package("dmmap_qos"); inst = get_last_instance_bbfdm("dmmap_qos", "queue", "queueinstance"); - dmuci_add_section_and_rename("qos", "queue", &s, &value); + dmuci_add_section("qos", "queue", &s, &value); dmuci_set_value_by_section(s, "enable", "false"); dmuci_set_value_by_section(s, "status", "disabled"); dmuci_set_value_by_section(s, "all_interface", "false"); @@ -238,10 +239,17 @@ static int delObjQoSQueue(char *refparam, struct dmctx *ctx, void *data, char *i switch (del_action) { case DEL_INST: - get_dmmap_section_of_config_section("dmmap_qos", "queue", section_name((struct uci_section *)data), &dmmap_section); - if(dmmap_section != NULL) - dmuci_delete_by_section(dmmap_section, NULL, NULL); - dmuci_delete_by_section((struct uci_section *)data, NULL, NULL); + if(is_section_unnamed(section_name((struct uci_section *)data))){ + LIST_HEAD(dup_list); + delete_sections_save_next_sections("dmmap_qos", "queue", "queueinstance", section_name((struct uci_section *)data), atoi(instance), &dup_list); + update_dmmap_sections(&dup_list, "queueinstance", "dmmap_qos", "queue"); + dmuci_delete_by_section_unnamed((struct uci_section *)data, NULL, NULL); + } else { + get_dmmap_section_of_config_section("dmmap_qos", "queue", section_name((struct uci_section *)data), &dmmap_section); + if(dmmap_section != NULL) + dmuci_delete_by_section_unnamed_bbfdm(dmmap_section, NULL, NULL); + dmuci_delete_by_section((struct uci_section *)data, NULL, NULL); + } break; case DEL_ALL: uci_foreach_sections("qos", "queue", s) { @@ -291,7 +299,7 @@ static int addObjQoSShaper(char *refparam, struct dmctx *ctx, void *data, char * check_create_dmmap_package("dmmap_qos"); inst = get_last_instance_bbfdm("dmmap_qos", "shaper", "shaperinstance"); - dmuci_add_section_and_rename("qos", "shaper", &s, &value); + dmuci_add_section("qos", "shaper", &s, &value); dmuci_set_value_by_section(s, "enable", "false"); dmuci_set_value_by_section(s, "status", "disabled"); @@ -310,10 +318,17 @@ static int delObjQoSShaper(char *refparam, struct dmctx *ctx, void *data, char * switch (del_action) { case DEL_INST: - get_dmmap_section_of_config_section("dmmap_qos", "shaper", section_name((struct uci_section *)data), &dmmap_section); - if(dmmap_section != NULL) - dmuci_delete_by_section(dmmap_section, NULL, NULL); - dmuci_delete_by_section((struct uci_section *)data, NULL, NULL); + if(is_section_unnamed(section_name((struct uci_section *)data))){ + LIST_HEAD(dup_list); + delete_sections_save_next_sections("dmmap_qos", "shaper", "shaperinstance", section_name((struct uci_section *)data), atoi(instance), &dup_list); + update_dmmap_sections(&dup_list, "shaperinstance", "dmmap_qos", "shaper"); + dmuci_delete_by_section_unnamed((struct uci_section *)data, NULL, NULL); + } else { + get_dmmap_section_of_config_section("dmmap_qos", "shaper", section_name((struct uci_section *)data), &dmmap_section); + if(dmmap_section != NULL) + dmuci_delete_by_section_unnamed_bbfdm(dmmap_section, NULL, NULL); + dmuci_delete_by_section((struct uci_section *)data, NULL, NULL); + } break; case DEL_ALL: uci_foreach_sections("qos", "shaper", s) { @@ -395,18 +410,13 @@ static int get_QoS_PolicerNumberOfEntries(char *refparam, struct dmctx *ctx, voi //TODO return 0; } -#endif + static int get_QoS_MaxQueueEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - struct uci_section *s = NULL; - int cnt = 0; - - uci_foreach_sections("qos", "queue", s) { - cnt++; - } - dmasprintf(value, "%d", cnt); + //TODO return 0; } +#endif /*#Device.QoS.QueueNumberOfEntries!UCI:qos/queue,false/false*/ static int get_QoS_QueueNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) @@ -426,18 +436,13 @@ static int get_QoS_QueueStatsNumberOfEntries(char *refparam, struct dmctx *ctx, //TODO return 0; } -#endif + static int get_QoS_MaxShaperEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - struct uci_section *s = NULL; - int cnt = 0; - - uci_foreach_sections("qos", "shaper", s) { - cnt++; - } - dmasprintf(value, "%d", cnt); + //TODO return 0; } +#endif static int get_QoS_ShaperNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { @@ -2756,21 +2761,31 @@ static int get_QoSPolicer_NonConformingCountedBytes(char *refparam, struct dmctx return 0; } #endif + static int get_QoSQueue_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - /* Simply setting default value as mentioned in tr-181 | since no paraneter in UCI (qos) file */ - char *default_val = "true"; - dmasprintf(value, "%s", default_val); + dmuci_get_value_by_section_string((struct uci_section *)data, "enable", value); + if(*value[0] == '\0' || *value[0] == '0') + *value = "0"; + else + *value = "1"; return 0; } static int set_QoSQueue_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) { + bool b; switch (action) { case VALUECHECK: + if (dm_validate_boolean(value)) + return FAULT_9007; break; case VALUESET: - //TODO + string_to_bool(value, &b); + if(b) + dmuci_set_value_by_section((struct uci_section *)data, "enable", "1"); + else + dmuci_set_value_by_section((struct uci_section *)data, "enable", "0"); break; } return 0; @@ -2778,27 +2793,34 @@ static int set_QoSQueue_Enable(char *refparam, struct dmctx *ctx, void *data, ch static int get_QoSQueue_Status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - /* Simply setting default value as mentioned in tr-181 | since no paraneter in UCI (qos) file */ - char *default_val = "Enabled"; - dmasprintf(value, "%s", default_val); + dmuci_get_value_by_section_string((struct uci_section *)data, "enable", value); + dmuci_get_value_by_section_string((struct uci_section *)data, "enable", value); + if(*value[0] == '\0' || *value[0] == '0') + *value = "Disabled"; + else + *value = "Enabled"; return 0; } static int get_QoSQueue_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - /* Simply setting default value as mentioned in tr-181 | since no paraneter in UCI (qos) file */ - char *default_val = " "; - dmasprintf(value, "%s", default_val); + struct uci_section *dmmap_section = NULL; + get_dmmap_section_of_config_section("dmmap_qos", "queue", section_name((struct uci_section *)data), &dmmap_section); + dmuci_get_value_by_section_string(dmmap_section, "queuealias", value); return 0; } static int set_QoSQueue_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) { + struct uci_section *dmmap_section = NULL; switch (action) { case VALUECHECK: + if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0)) + return FAULT_9007; break; case VALUESET: - //TODO + get_dmmap_section_of_config_section("dmmap_qos", "queue", section_name((struct uci_section *)data), &dmmap_section); + DMUCI_SET_VALUE_BY_SECTION(bbfdm, dmmap_section, "queuealias", value); break; } return 0; @@ -2826,28 +2848,40 @@ static int get_QoSQueue_Interface(char *refparam, struct dmctx *ctx, void *data, { char *ifname; dmuci_get_value_by_section_string((struct uci_section *)data, "ifname", &ifname); - adm_entry_get_linker_param(ctx, dm_print_path("%s%cEthernet%cInterface%c", dmroot, dm_delim, dm_delim, dm_delim), ifname, value); + + adm_entry_get_linker_param(ctx, dm_print_path("%s%cIP%cInterface%c", dmroot, dm_delim, dm_delim, dm_delim), ifname, value); + if (*value == NULL) + adm_entry_get_linker_param(ctx, dm_print_path("%s%cPPP%cInterface%c", dmroot, dm_delim, dm_delim, dm_delim), ifname, value); + if (*value == NULL) + adm_entry_get_linker_param(ctx, dm_print_path("%s%cEthernet%cInterface%c", dmroot, dm_delim, dm_delim, dm_delim), ifname, value); + if (*value == NULL) + adm_entry_get_linker_param(ctx, dm_print_path("%s%cWiFi%cRadio%c", dmroot, dm_delim, dm_delim, dm_delim), ifname, value); + if (*value == NULL) + *value = ""; + return 0; } static int set_QoSQueue_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) { + char *interface_linker = NULL; switch (action) { case VALUECHECK: + if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0)) + return FAULT_9007; break; case VALUESET: - //TODO - dmuci_set_value_by_section((struct uci_section *)data, "ifname", value); + adm_entry_get_linker_value(ctx, value, &interface_linker); + dmuci_set_value_by_section((struct uci_section *)data, "ifname", interface_linker); break; } return 0; } +#if 0 static int get_QoSQueue_AllInterfaces(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - /* Simply setting default value as mentioned in tr-181 | since no paraneter in UCI (qos) file */ - char *default_val = "false"; - dmasprintf(value, "%s", default_val); + //TODO return 0; } @@ -2855,6 +2889,8 @@ static int set_QoSQueue_AllInterfaces(char *refparam, struct dmctx *ctx, void *d { switch (action) { case VALUECHECK: + if (dm_validate_boolean(value)) + return FAULT_9007; break; case VALUESET: //TODO @@ -2865,20 +2901,17 @@ static int set_QoSQueue_AllInterfaces(char *refparam, struct dmctx *ctx, void *d static int get_QoSQueue_HardwareAssisted(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - /* Simply setting default value as mentioned in tr-181 | since no paraneter in UCI (qos) file */ - char *default_val = "true"; - dmasprintf(value, "%s", default_val); + //TODO return 0; } /*#Device.QoS.Queue.{i}.BufferLength!UCI:qos/class,@i-1/maxsize*/ static int get_QoSQueue_BufferLength(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - /* Simply setting default value as mentioned in tr-181 | since no paraneter in UCI (qos) file */ - char *default_val = "0"; - dmasprintf(value, "%s", default_val); + //TODO return 0; } +#endif static int get_QoSQueue_Weight(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { @@ -2890,9 +2923,11 @@ static int set_QoSQueue_Weight(char *refparam, struct dmctx *ctx, void *data, ch { switch (action) { case VALUECHECK: + if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1)) + return FAULT_9007; break; - case VALUESET: - dmuci_set_value_by_section((struct uci_section *)data, "weight", value); + case VALUESET: + dmuci_set_value_by_section((struct uci_section *)data, "weight", value); break; } return 0; @@ -2909,6 +2944,8 @@ static int set_QoSQueue_Precedence(char *refparam, struct dmctx *ctx, void *data { switch (action) { case VALUECHECK: + if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1)) + return FAULT_9007; break; case VALUESET: dmuci_set_value_by_section((struct uci_section *)data, "precedence", value); @@ -2917,6 +2954,7 @@ static int set_QoSQueue_Precedence(char *refparam, struct dmctx *ctx, void *data return 0; } +#if 0 static int get_QoSQueue_REDThreshold(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { /* Simply setting default value as mentioned in tr-181 | since no paraneter in UCI (qos) file */ @@ -2929,6 +2967,8 @@ static int set_QoSQueue_REDThreshold(char *refparam, struct dmctx *ctx, void *da { switch (action) { case VALUECHECK: + if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,"100"}}, 1)) + return FAULT_9007; break; case VALUESET: //TODO @@ -2949,6 +2989,8 @@ static int set_QoSQueue_REDPercentage(char *refparam, struct dmctx *ctx, void *d { switch (action) { case VALUECHECK: + if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,"100"}}, 1)) + return FAULT_9007; break; case VALUESET: //TODO @@ -2971,11 +3013,13 @@ static int set_QoSQueue_DropAlgorithm(char *refparam, struct dmctx *ctx, void *d case VALUECHECK: break; case VALUESET: - //TODO + if (dm_validate_string(value, -1, -1, DropAlgorithm, 4, NULL, 0)) + return FAULT_9007; break; } return 0; } +#endif static int get_QoSQueue_SchedulerAlgorithm(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { @@ -2987,6 +3031,8 @@ static int set_QoSQueue_SchedulerAlgorithm(char *refparam, struct dmctx *ctx, vo { switch (action) { case VALUECHECK: + if (dm_validate_string(value, -1, -1, SchedulerAlgorithm, 3, NULL, 0)) + return FAULT_9007; break; case VALUESET: dmuci_set_value_by_section((struct uci_section *)data, "scheduling", value); @@ -2995,6 +3041,7 @@ static int set_QoSQueue_SchedulerAlgorithm(char *refparam, struct dmctx *ctx, vo return 0; } + /*#Device.QoS.Queue.{i}.ShapingRate!UCI:qos/class,@i-1/limitrate*/ static int get_QoSQueue_ShapingRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { @@ -3002,10 +3049,13 @@ static int get_QoSQueue_ShapingRate(char *refparam, struct dmctx *ctx, void *dat return 0; } + static int set_QoSQueue_ShapingRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) { switch (action) { case VALUECHECK: + if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1)) + return FAULT_9007; break; case VALUESET: dmuci_set_value_by_section((struct uci_section *)data, "rate", value); @@ -3026,6 +3076,8 @@ static int set_QoSQueue_ShapingBurstSize(char *refparam, struct dmctx *ctx, void case VALUECHECK: break; case VALUESET: + if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1)) + return FAULT_9007; dmuci_set_value_by_section((struct uci_section *)data, "burst_size", value); break; } @@ -3148,19 +3200,28 @@ static int get_QoSQueueStats_QueueOccupancyPercentage(char *refparam, struct dmc #endif static int get_QoSShaper_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - /* Simply setting default value as mentioned in tr-181 | since no paraneter in UCI (qos) file */ - char *default_val = "true"; - dmasprintf(value, "%s", default_val); + dmuci_get_value_by_section_string((struct uci_section *)data, "enable", value); + if(*value[0] == '\0' || *value[0] == '0') + *value = "0"; + else + *value = "1"; return 0; } static int set_QoSShaper_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) { + bool b; switch (action) { case VALUECHECK: + if (dm_validate_boolean(value)) + return FAULT_9007; break; case VALUESET: - //TODO + string_to_bool(value, &b); + if(b) + dmuci_set_value_by_section((struct uci_section *)data, "enable", "1"); + else + dmuci_set_value_by_section((struct uci_section *)data, "enable", "0"); break; } return 0; @@ -3168,27 +3229,34 @@ static int set_QoSShaper_Enable(char *refparam, struct dmctx *ctx, void *data, c static int get_QoSShaper_Status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - /* Simply setting default value as mentioned in tr-181 | since no paraneter in UCI (qos) file */ - char *default_val = "Enabled"; - dmasprintf(value, "%s", default_val); + dmuci_get_value_by_section_string((struct uci_section *)data, "enable", value); + if(*value[0] == '\0' || *value[0] == '0') + *value = "Disabled"; + else + *value = "Enabled"; return 0; } static int get_QoSShaper_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - /* Simply setting default value as mentioned in tr-181 | since no paraneter in UCI (qos) file */ - char *default_val = " "; - dmasprintf(value, "%s", default_val); + struct uci_section *dmmap_section = NULL; + get_dmmap_section_of_config_section("dmmap_qos", "shaper", section_name((struct uci_section *)data), &dmmap_section); + dmuci_get_value_by_section_string(dmmap_section, "shaperalias", value); return 0; } static int set_QoSShaper_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) { + struct uci_section *dmmap_section = NULL; + switch (action) { case VALUECHECK: + if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0)) + return FAULT_9007; break; case VALUESET: - //TODO + get_dmmap_section_of_config_section("dmmap_qos", "shaper", section_name((struct uci_section *)data), &dmmap_section); + DMUCI_SET_VALUE_BY_SECTION(bbfdm, dmmap_section, "shaperalias", value); break; } return 0; @@ -3196,19 +3264,32 @@ static int set_QoSShaper_Alias(char *refparam, struct dmctx *ctx, void *data, ch static int get_QoSShaper_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - char *ifname; + char *ifname = NULL; + dmuci_get_value_by_section_string((struct uci_section *)data, "ifname", &ifname); - adm_entry_get_linker_param(ctx, dm_print_path("%s%cEthernet%cInterface%c", dmroot, dm_delim, dm_delim, dm_delim), ifname, value); + adm_entry_get_linker_param(ctx, dm_print_path("%s%cIP%cInterface%c", dmroot, dm_delim, dm_delim, dm_delim), ifname, value); + if (*value == NULL) + adm_entry_get_linker_param(ctx, dm_print_path("%s%cPPP%cInterface%c", dmroot, dm_delim, dm_delim, dm_delim), ifname, value); + if (*value == NULL) + adm_entry_get_linker_param(ctx, dm_print_path("%s%cEthernet%cInterface%c", dmroot, dm_delim, dm_delim, dm_delim), ifname, value); + if (*value == NULL) + adm_entry_get_linker_param(ctx, dm_print_path("%s%cWiFi%cRadio%c", dmroot, dm_delim, dm_delim, dm_delim), ifname, value); + if (*value == NULL) + *value = ""; return 0; } static int set_QoSShaper_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) { + char *interface_linker = NULL; switch (action) { case VALUECHECK: + if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0)) + return FAULT_9007; break; case VALUESET: - dmuci_set_value_by_section((struct uci_section *)data, "ifname", value); + adm_entry_get_linker_value(ctx, value, &interface_linker); + dmuci_set_value_by_section((struct uci_section *)data, "ifname", interface_linker); break; } return 0; @@ -3224,6 +3305,8 @@ static int set_QoSShaper_ShapingRate(char *refparam, struct dmctx *ctx, void *da { switch (action) { case VALUECHECK: + if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1)) + return FAULT_9007; break; case VALUESET: dmuci_set_value_by_section((struct uci_section *)data, "rate", value); @@ -3242,6 +3325,8 @@ static int set_QoSShaper_ShapingBurstSize(char *refparam, struct dmctx *ctx, voi { switch (action) { case VALUECHECK: + if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1)) + return FAULT_9007; break; case VALUESET: dmuci_set_value_by_section((struct uci_section *)data, "burst_size", value); @@ -3272,10 +3357,10 @@ DMLEAF tQoSParams[] = { //{"FlowNumberOfEntries", &DMREAD, DMT_UNINT, get_QoS_FlowNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH}, //{"MaxPolicerEntries", &DMREAD, DMT_UNINT, get_QoS_MaxPolicerEntries, NULL, NULL, NULL, BBFDM_BOTH}, //{"PolicerNumberOfEntries", &DMREAD, DMT_UNINT, get_QoS_PolicerNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH}, -{"MaxQueueEntries", &DMREAD, DMT_UNINT, get_QoS_MaxQueueEntries, NULL, NULL, NULL, BBFDM_BOTH}, +//{"MaxQueueEntries", &DMREAD, DMT_UNINT, get_QoS_MaxQueueEntries, NULL, NULL, NULL, BBFDM_BOTH}, {"QueueNumberOfEntries", &DMREAD, DMT_UNINT, get_QoS_QueueNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH}, //{"QueueStatsNumberOfEntries", &DMREAD, DMT_UNINT, get_QoS_QueueStatsNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH}, -{"MaxShaperEntries", &DMREAD, DMT_UNINT, get_QoS_MaxShaperEntries, NULL, NULL, NULL, BBFDM_BOTH}, +//{"MaxShaperEntries", &DMREAD, DMT_UNINT, get_QoS_MaxShaperEntries, NULL, NULL, NULL, BBFDM_BOTH}, {"ShaperNumberOfEntries", &DMREAD, DMT_UNINT, get_QoS_ShaperNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH}, //{"DefaultForwardingPolicy", &DMWRITE, DMT_UNINT, get_QoS_DefaultForwardingPolicy, set_QoS_DefaultForwardingPolicy, NULL, NULL, BBFDM_BOTH}, //{"DefaultTrafficClass", &DMWRITE, DMT_UNINT, get_QoS_DefaultTrafficClass, set_QoS_DefaultTrafficClass, NULL, NULL, BBFDM_BOTH}, @@ -3449,14 +3534,14 @@ DMLEAF tQoSQueueParams[] = { {"Alias", &DMWRITE, DMT_STRING, get_QoSQueue_Alias, set_QoSQueue_Alias, NULL, NULL, BBFDM_BOTH}, {"TrafficClasses", &DMWRITE, DMT_STRING, get_QoSQueue_TrafficClasses, set_QoSQueue_TrafficClasses, NULL, NULL, BBFDM_BOTH}, {"Interface", &DMWRITE, DMT_STRING, get_QoSQueue_Interface, set_QoSQueue_Interface, NULL, NULL, BBFDM_BOTH}, -{"AllInterfaces", &DMWRITE, DMT_BOOL, get_QoSQueue_AllInterfaces, set_QoSQueue_AllInterfaces, NULL, NULL, BBFDM_BOTH}, -{"HardwareAssisted", &DMREAD, DMT_BOOL, get_QoSQueue_HardwareAssisted, NULL, NULL, NULL, BBFDM_BOTH}, -{"BufferLength", &DMREAD, DMT_UNINT, get_QoSQueue_BufferLength, NULL, NULL, NULL, BBFDM_BOTH}, +//{"AllInterfaces", &DMWRITE, DMT_BOOL, get_QoSQueue_AllInterfaces, set_QoSQueue_AllInterfaces, NULL, NULL, BBFDM_BOTH}, +//{"HardwareAssisted", &DMREAD, DMT_BOOL, get_QoSQueue_HardwareAssisted, NULL, NULL, NULL, BBFDM_BOTH}, +//{"BufferLength", &DMREAD, DMT_UNINT, get_QoSQueue_BufferLength, NULL, NULL, NULL, BBFDM_BOTH}, {"Weight", &DMWRITE, DMT_UNINT, get_QoSQueue_Weight, set_QoSQueue_Weight, NULL, NULL, BBFDM_BOTH}, {"Precedence", &DMWRITE, DMT_UNINT, get_QoSQueue_Precedence, set_QoSQueue_Precedence, NULL, NULL, BBFDM_BOTH}, -{"REDThreshold", &DMWRITE, DMT_UNINT, get_QoSQueue_REDThreshold, set_QoSQueue_REDThreshold, NULL, NULL, BBFDM_BOTH}, -{"REDPercentage", &DMWRITE, DMT_UNINT, get_QoSQueue_REDPercentage, set_QoSQueue_REDPercentage, NULL, NULL, BBFDM_BOTH}, -{"DropAlgorithm", &DMWRITE, DMT_STRING, get_QoSQueue_DropAlgorithm, set_QoSQueue_DropAlgorithm, NULL, NULL, BBFDM_BOTH}, +//{"REDThreshold", &DMWRITE, DMT_UNINT, get_QoSQueue_REDThreshold, set_QoSQueue_REDThreshold, NULL, NULL, BBFDM_BOTH}, +//{"REDPercentage", &DMWRITE, DMT_UNINT, get_QoSQueue_REDPercentage, set_QoSQueue_REDPercentage, NULL, NULL, BBFDM_BOTH}, +//{"DropAlgorithm", &DMWRITE, DMT_STRING, get_QoSQueue_DropAlgorithm, set_QoSQueue_DropAlgorithm, NULL, NULL, BBFDM_BOTH}, {"SchedulerAlgorithm", &DMWRITE, DMT_STRING, get_QoSQueue_SchedulerAlgorithm, set_QoSQueue_SchedulerAlgorithm, NULL, NULL, BBFDM_BOTH}, {"ShapingRate", &DMWRITE, DMT_INT, get_QoSQueue_ShapingRate, set_QoSQueue_ShapingRate, NULL, NULL, BBFDM_BOTH}, {"ShapingBurstSize", &DMWRITE, DMT_UNINT, get_QoSQueue_ShapingBurstSize, set_QoSQueue_ShapingBurstSize, NULL, NULL, BBFDM_BOTH}, diff --git a/dmtree/tr181/qos.c b/dmtree/tr181/qos.c index 3d2dff34..e9fdc351 100644 --- a/dmtree/tr181/qos.c +++ b/dmtree/tr181/qos.c @@ -8,13 +8,8 @@ * Author: Omar Kallel */ -#include "dmentry.h" #include "qos.h" -#if 0 -#define queuessts1 "^qdisc noqueue [0-9]*: dev [[:alnum:]]* [[:alnum:]]* refcnt [0-9]*" -#define queuessts2 "^qdisc pfifo_fast [0-9]*: dev [[:alnum:]]* [[:alnum:]]* refcnt [0-9]*" - struct queuestats { struct uci_section *dmsect; @@ -38,6 +33,7 @@ struct queuestats /************************************************************************** * LINKER ***************************************************************************/ +#if 0 static int get_linker_qos_queue(char *refparam, struct dmctx *dmctx, void *data, char *instance, char **linker) { if (data && ((struct dmmap_dup *)data)->config_section) { @@ -48,7 +44,7 @@ static int get_linker_qos_queue(char *refparam, struct dmctx *dmctx, void *data, return 0; } } - +#endif /************************************************************************** * Browse functions ***************************************************************************/ @@ -68,7 +64,7 @@ static int browseQoSClassificationInst(struct dmctx *dmctx, DMNODE *parent_node, free_dmmap_config_dup_list(&dup_list); return 0; } - +#if 0 static int browseQoSAppInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) { //TODO @@ -86,7 +82,9 @@ static int browseQoSPolicerInst(struct dmctx *dmctx, DMNODE *parent_node, void * //TODO return 0; } +#endif +#if 0 /*#Device.QoS.Queue.{i}.!UCI:qos/class/dmmap_qos*/ static int browseQoSQueueInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) { @@ -103,6 +101,7 @@ static int browseQoSQueueInst(struct dmctx *dmctx, DMNODE *parent_node, void *pr free_dmmap_config_dup_list(&dup_list); return 0; } +#endif struct uci_section *get_dup_qos_stats_section_in_dmmap(char *dmmap_package, char *section_type, char *dev) { @@ -121,10 +120,10 @@ static int browseQoSQueueStatsInst(struct dmctx *dmctx, DMNODE *parent_node, voi char *questatsout[256], *instance = NULL, *inst_last = NULL, *v, *lastinstancestore = NULL, dev[50] = "", user[50] = ""; int length, i, ret; struct queuestats queuests = {0}, emptyquestats = {0}; - regex_t regex1, regex2; + regex_t regex1 = {}, regex2 = {}; - regcomp(®ex1, queuessts1, 0); - regcomp(®ex2, queuessts2, 0); + regcomp(®ex1, "^qdisc noqueue [0-9]*: dev [[:alnum:]]* [[:alnum:]]* refcnt [0-9]*", 0); + regcomp(®ex2, "^qdisc pfifo_fast [0-9]*: dev [[:alnum:]]* [[:alnum:]]* refcnt [0-9]*", 0); check_create_dmmap_package("dmmap_qos"); command_exec_output_to_array("tc -s qdisc", questatsout, &length); for (i = 0; i < length; i++){ @@ -158,10 +157,13 @@ static int browseQoSQueueStatsInst(struct dmctx *dmctx, DMNODE *parent_node, voi break; } } + regfree(®ex1); + regfree(®ex2); end: return 0; } +#if 0 static int browseQoSShaperInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) { char *wnum = NULL, *wnum_last = NULL; @@ -181,6 +183,7 @@ static int browseQoSShaperInst(struct dmctx *dmctx, DMNODE *parent_node, void *p free_dmmap_config_dup_list(&dup_list); return 0; } +#endif static int addObjQoSClassification(char *refparam, struct dmctx *ctx, void *data, char **instance) @@ -219,7 +222,8 @@ static int delObjQoSClassification(char *refparam, struct dmctx *ctx, void *data dmuci_delete_by_section_unnamed(p->config_section, NULL, NULL); } else { get_dmmap_section_of_config_section("dmmap_qos", "classify", section_name(p->config_section), &dmmap_section); - dmuci_delete_by_section_unnamed_bbfdm(dmmap_section, NULL, NULL); + if(dmmap_section != NULL) + dmuci_delete_by_section_unnamed_bbfdm(dmmap_section, NULL, NULL); dmuci_delete_by_section(p->config_section, NULL, NULL); } break; @@ -245,6 +249,7 @@ static int delObjQoSClassification(char *refparam, struct dmctx *ctx, void *data return 0; } +#if 0 static int addObjQoSApp(char *refparam, struct dmctx *ctx, void *data, char **instance) { //TODO @@ -302,6 +307,7 @@ static int delObjQoSPolicer(char *refparam, struct dmctx *ctx, void *data, char return 0; } + static int addObjQoSQueue(char *refparam, struct dmctx *ctx, void *data, char **instance) { struct uci_section *s, *dmmap_qos_class; @@ -363,6 +369,7 @@ static int delObjQoSQueue(char *refparam, struct dmctx *ctx, void *data, char *i } return 0; } +#endif static int addObjQoSQueueStats(char *refparam, struct dmctx *ctx, void *data, char **instance) { @@ -383,6 +390,7 @@ static int delObjQoSQueueStats(char *refparam, struct dmctx *ctx, void *data, ch return 0; } +#if 0 static int addObjQoSShaper(char *refparam, struct dmctx *ctx, void *data, char **instance) { struct uci_section *s, *dmmap_qos_class; @@ -424,12 +432,12 @@ static int delObjQoSShaper(char *refparam, struct dmctx *ctx, void *data, char * return 0; } - static int get_QoS_MaxClassificationEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { //TODO return 0; } +#endif /*#Device.QoS.ClassificationNumberOfEntries!UCI:qos/classify/*/ static int get_QoS_ClassificationNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) @@ -443,6 +451,7 @@ static int get_QoS_ClassificationNumberOfEntries(char *refparam, struct dmctx *c return 0; } +#if 0 static int get_QoS_MaxAppEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { //TODO @@ -497,6 +506,7 @@ static int get_QoS_QueueNumberOfEntries(char *refparam, struct dmctx *ctx, void dmasprintf(value, "%d", nbre); return 0; } +#endif static int get_QoS_QueueStatsNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { @@ -508,6 +518,7 @@ static int get_QoS_QueueStatsNumberOfEntries(char *refparam, struct dmctx *ctx, return 0; } +#if 0 static int get_QoS_MaxShaperEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { //TODO @@ -603,6 +614,7 @@ static int get_QoS_DefaultQueue(char *refparam, struct dmctx *ctx, void *data, c return 0; } + static int set_QoS_DefaultQueue(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) { char *linker; @@ -650,7 +662,6 @@ static int set_QoS_DefaultDSCPMark(char *refparam, struct dmctx *ctx, void *data } return 0; } - static int get_QoS_DefaultEthernetPriorityMark(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { //TODO @@ -742,6 +753,7 @@ static int set_QoSClassification_Order(char *refparam, struct dmctx *ctx, void * } return 0; } +#endif static int get_QoSClassification_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { @@ -766,6 +778,7 @@ static int set_QoSClassification_Alias(char *refparam, struct dmctx *ctx, void * return 0; } +#if 0 static int get_QoSClassification_DHCPType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { //TODO @@ -785,6 +798,7 @@ static int set_QoSClassification_DHCPType(char *refparam, struct dmctx *ctx, voi } return 0; } +#endif static int get_QoSClassification_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { @@ -833,6 +847,7 @@ static int set_QoSClassification_Interface(char *refparam, struct dmctx *ctx, vo return 0; } +#if 0 static int get_QoSClassification_AllInterfaces(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { //TODO @@ -853,30 +868,6 @@ static int set_QoSClassification_AllInterfaces(char *refparam, struct dmctx *ctx return 0; } -/*#Device.QoS.Classification.{i}.DestIP!UCI:qos/classify,@i-1/dsthost*/ -static int get_QoSClassification_DestIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - dmuci_get_value_by_section_string(p->config_section, "dsthost", value); - return 0; -} - -static int set_QoSClassification_DestIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - - switch (action) { - case VALUECHECK: - if (dm_validate_string(value, -1, 45, NULL, 0, IPAddress, 2)) - return FAULT_9007; - break; - case VALUESET: - dmuci_set_value_by_section(p->config_section, "dsthost", value); - break; - } - return 0; -} - static int get_QoSClassification_DestMask(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { //TODO @@ -917,30 +908,6 @@ static int set_QoSClassification_DestIPExclude(char *refparam, struct dmctx *ctx return 0; } -/*#Device.QoS.Classification.{i}.SourceIP!UCI:qos/classify,@i-1/srchost*/ -static int get_QoSClassification_SourceIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - dmuci_get_value_by_section_string(p->config_section, "srchost", value); - return 0; -} - -static int set_QoSClassification_SourceIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - - switch (action) { - case VALUECHECK: - if (dm_validate_string(value, -1, 45, NULL, 0, IPAddress, 2)) - return FAULT_9007; - break; - case VALUESET: - dmuci_set_value_by_section(p->config_section, "srchost", value); - break; - } - return 0; -} - static int get_QoSClassification_SourceMask(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { //TODO @@ -981,6 +948,97 @@ static int set_QoSClassification_SourceIPExclude(char *refparam, struct dmctx *c return 0; } +static int get_QoSClassification_ProtocolExclude(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + //TODO + return 0; +} + +static int set_QoSClassification_ProtocolExclude(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) +{ + switch (action) { + case VALUECHECK: + if (dm_validate_boolean(value)) + return FAULT_9007; + break; + case VALUESET: + //TODO + break; + } + return 0; +} + +static int get_QoSClassification_DestPortExclude(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + //TODO + return 0; +} + +static int set_QoSClassification_DestPortExclude(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) +{ + switch (action) { + case VALUECHECK: + if (dm_validate_boolean(value)) + return FAULT_9007; + break; + case VALUESET: + //TODO + break; + } + return 0; +} +#endif + +/*#Device.QoS.Classification.{i}.DestIP!UCI:qos/classify,@i-1/dsthost*/ +static int get_QoSClassification_DestIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + struct dmmap_dup *p= (struct dmmap_dup*)data; + dmuci_get_value_by_section_string(p->config_section, "dsthost", value); + return 0; +} + +static int set_QoSClassification_DestIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) +{ + struct dmmap_dup *p= (struct dmmap_dup*)data; + + switch (action) { + case VALUECHECK: + if (dm_validate_string(value, -1, 45, NULL, 0, IPAddress, 2)) + return FAULT_9007; + break; + case VALUESET: + dmuci_set_value_by_section(p->config_section, "dsthost", value); + break; + } + return 0; +} + + + +/*#Device.QoS.Classification.{i}.SourceIP!UCI:qos/classify,@i-1/srchost*/ +static int get_QoSClassification_SourceIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + struct dmmap_dup *p= (struct dmmap_dup*)data; + dmuci_get_value_by_section_string(p->config_section, "srchost", value); + return 0; +} + +static int set_QoSClassification_SourceIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) +{ + struct dmmap_dup *p= (struct dmmap_dup*)data; + + switch (action) { + case VALUECHECK: + if (dm_validate_string(value, -1, 45, NULL, 0, IPAddress, 2)) + return FAULT_9007; + break; + case VALUESET: + dmuci_set_value_by_section(p->config_section, "srchost", value); + break; + } + return 0; +} + /*#Device.QoS.Classification.{i}.Protocol!UCI:qos/classify,@i-1/proto*/ static int get_QoSClassification_Protocol(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { @@ -1004,26 +1062,6 @@ static int set_QoSClassification_Protocol(char *refparam, struct dmctx *ctx, voi return 0; } -static int get_QoSClassification_ProtocolExclude(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - //TODO - return 0; -} - -static int set_QoSClassification_ProtocolExclude(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - switch (action) { - case VALUECHECK: - if (dm_validate_boolean(value)) - return FAULT_9007; - break; - case VALUESET: - //TODO - break; - } - return 0; -} - /*#Device.QoS.Classification.{i}.DestPort!UCI:qos/classify,@i-1/dstports*/ static int get_QoSClassification_DestPort(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { @@ -1072,26 +1110,6 @@ static int set_QoSClassification_DestPortRangeMax(char *refparam, struct dmctx * return 0; } -static int get_QoSClassification_DestPortExclude(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - //TODO - return 0; -} - -static int set_QoSClassification_DestPortExclude(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - switch (action) { - case VALUECHECK: - if (dm_validate_boolean(value)) - return FAULT_9007; - break; - case VALUESET: - //TODO - break; - } - return 0; -} - /*#Device.QoS.Classification.{i}.SourcePort!UCI:qos/classify,@i-1/srcports*/ static int get_QoSClassification_SourcePort(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { @@ -1116,6 +1134,7 @@ static int set_QoSClassification_SourcePort(char *refparam, struct dmctx *ctx, v return 0; } +#if 0 static int get_QoSClassification_SourcePortRangeMax(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { //TODO @@ -3501,6 +3520,26 @@ static int get_QoSQueueStats_Status(char *refparam, struct dmctx *ctx, void *dat return 0; } +static int get_QoSQueueStats_Queue(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + //TODO + return 0; +} + +static int set_QoSQueueStats_Queue(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) +{ + switch (action) { + case VALUECHECK: + if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0)) + return FAULT_9007; + break; + case VALUESET: + //TODO + break; + } + return 0; +} +#endif static int get_QoSQueueStats_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { struct queuestats *qts= (struct queuestats*)data; @@ -3524,26 +3563,6 @@ static int set_QoSQueueStats_Alias(char *refparam, struct dmctx *ctx, void *data return 0; } -static int get_QoSQueueStats_Queue(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - //TODO - return 0; -} - -static int set_QoSQueueStats_Queue(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - switch (action) { - case VALUECHECK: - if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0)) - return FAULT_9007; - break; - case VALUESET: - //TODO - break; - } - return 0; -} - static int get_QoSQueueStats_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { struct queuestats *qts= (struct queuestats*)data; @@ -3607,6 +3626,7 @@ static int get_QoSQueueStats_QueueOccupancyPackets(char *refparam, struct dmctx return 0; } +#if 0 static int get_QoSQueueStats_QueueOccupancyPercentage(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { //TODO @@ -3765,12 +3785,12 @@ static int set_QoSShaper_ShapingBurstSize(char *refparam, struct dmctx *ctx, voi /* *** Device.QoS. *** */ DMOBJ tQoSObj[] = { /* OBJ, permission, addobj, delobj, checkobj, browseinstobj, forced_inform, notification, nextdynamicobj, nextobj, leaf, linker, bbfdm_type*/ -//{"Classification", &DMWRITE, addObjQoSClassification, delObjQoSClassification, NULL, browseQoSClassificationInst, NULL, NULL, NULL, NULL, tQoSClassificationParams, NULL, BBFDM_BOTH}, +{"Classification", &DMWRITE, addObjQoSClassification, delObjQoSClassification, NULL, browseQoSClassificationInst, NULL, NULL, NULL, NULL, tQoSClassificationParams, NULL, BBFDM_BOTH}, +{"QueueStats", &DMWRITE, addObjQoSQueueStats, delObjQoSQueueStats, NULL, browseQoSQueueStatsInst, NULL, NULL, NULL, NULL, tQoSQueueStatsParams, NULL, BBFDM_BOTH}, //{"App", &DMWRITE, addObjQoSApp, delObjQoSApp, NULL, browseQoSAppInst, NULL, NULL, NULL, NULL, tQoSAppParams, NULL, BBFDM_BOTH}, //{"Flow", &DMWRITE, addObjQoSFlow, delObjQoSFlow, NULL, browseQoSFlowInst, NULL, NULL, NULL, NULL, tQoSFlowParams, NULL, BBFDM_BOTH}, //{"Policer", &DMWRITE, addObjQoSPolicer, delObjQoSPolicer, NULL, browseQoSPolicerInst, NULL, NULL, NULL, NULL, tQoSPolicerParams, NULL, BBFDM_BOTH}, //{"Queue", &DMWRITE, addObjQoSQueue, delObjQoSQueue, NULL, browseQoSQueueInst, NULL, NULL, NULL, NULL, tQoSQueueParams, get_linker_qos_queue, BBFDM_BOTH}, -//{"QueueStats", &DMWRITE, addObjQoSQueueStats, delObjQoSQueueStats, NULL, browseQoSQueueStatsInst, NULL, NULL, NULL, NULL, tQoSQueueStatsParams, NULL, BBFDM_BOTH}, //{"Shaper", &DMWRITE, addObjQoSShaper, delObjQoSShaper, NULL, browseQoSShaperInst, NULL, NULL, NULL, NULL, tQoSShaperParams, NULL, BBFDM_BOTH}, {0} }; @@ -3778,7 +3798,7 @@ DMOBJ tQoSObj[] = { DMLEAF tQoSParams[] = { /* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/ //{"MaxClassificationEntries", &DMREAD, DMT_UNINT, get_QoS_MaxClassificationEntries, NULL, NULL, NULL, BBFDM_BOTH}, -//{"ClassificationNumberOfEntries", &DMREAD, DMT_UNINT, get_QoS_ClassificationNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH}, +{"ClassificationNumberOfEntries", &DMREAD, DMT_UNINT, get_QoS_ClassificationNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH}, //{"MaxAppEntries", &DMREAD, DMT_UNINT, get_QoS_MaxAppEntries, NULL, NULL, NULL, BBFDM_BOTH}, //{"AppNumberOfEntries", &DMREAD, DMT_UNINT, get_QoS_AppNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH}, //{"MaxFlowEntries", &DMREAD, DMT_UNINT, get_QoS_MaxFlowEntries, NULL, NULL, NULL, BBFDM_BOTH}, @@ -3787,7 +3807,7 @@ DMLEAF tQoSParams[] = { //{"PolicerNumberOfEntries", &DMREAD, DMT_UNINT, get_QoS_PolicerNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH}, //{"MaxQueueEntries", &DMREAD, DMT_UNINT, get_QoS_MaxQueueEntries, NULL, NULL, NULL, BBFDM_BOTH}, //{"QueueNumberOfEntries", &DMREAD, DMT_UNINT, get_QoS_QueueNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH}, -//{"QueueStatsNumberOfEntries", &DMREAD, DMT_UNINT, get_QoS_QueueStatsNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH}, +{"QueueStatsNumberOfEntries", &DMREAD, DMT_UNINT, get_QoS_QueueStatsNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH}, //{"MaxShaperEntries", &DMREAD, DMT_UNINT, get_QoS_MaxShaperEntries, NULL, NULL, NULL, BBFDM_BOTH}, //{"ShaperNumberOfEntries", &DMREAD, DMT_UNINT, get_QoS_ShaperNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH}, //{"DefaultForwardingPolicy", &DMWRITE, DMT_UNINT, get_QoS_DefaultForwardingPolicy, set_QoS_DefaultForwardingPolicy, NULL, NULL, BBFDM_BOTH}, @@ -3807,22 +3827,22 @@ DMLEAF tQoSClassificationParams[] = { //{"Enable", &DMWRITE, DMT_BOOL, get_QoSClassification_Enable, set_QoSClassification_Enable, NULL, NULL, BBFDM_BOTH}, //{"Status", &DMREAD, DMT_STRING, get_QoSClassification_Status, NULL, NULL, NULL, BBFDM_BOTH}, //{"Order", &DMWRITE, DMT_UNINT, get_QoSClassification_Order, set_QoSClassification_Order, NULL, NULL, BBFDM_BOTH}, -//{"Alias", &DMWRITE, DMT_STRING, get_QoSClassification_Alias, set_QoSClassification_Alias, NULL, NULL, BBFDM_BOTH}, +{"Alias", &DMWRITE, DMT_STRING, get_QoSClassification_Alias, set_QoSClassification_Alias, NULL, NULL, BBFDM_BOTH}, //{"DHCPType", &DMWRITE, DMT_STRING, get_QoSClassification_DHCPType, set_QoSClassification_DHCPType, NULL, NULL, BBFDM_BOTH}, -//{"Interface", &DMWRITE, DMT_STRING, get_QoSClassification_Interface, set_QoSClassification_Interface, NULL, NULL, BBFDM_BOTH}, +{"Interface", &DMWRITE, DMT_STRING, get_QoSClassification_Interface, set_QoSClassification_Interface, NULL, NULL, BBFDM_BOTH}, //{"AllInterfaces", &DMWRITE, DMT_BOOL, get_QoSClassification_AllInterfaces, set_QoSClassification_AllInterfaces, NULL, NULL, BBFDM_BOTH}, -//{"DestIP", &DMWRITE, DMT_STRING, get_QoSClassification_DestIP, set_QoSClassification_DestIP, NULL, NULL, BBFDM_BOTH}, +{"DestIP", &DMWRITE, DMT_STRING, get_QoSClassification_DestIP, set_QoSClassification_DestIP, NULL, NULL, BBFDM_BOTH}, //{"DestMask", &DMWRITE, DMT_STRING, get_QoSClassification_DestMask, set_QoSClassification_DestMask, NULL, NULL, BBFDM_BOTH}, //{"DestIPExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_DestIPExclude, set_QoSClassification_DestIPExclude, NULL, NULL, BBFDM_BOTH}, -//{"SourceIP", &DMWRITE, DMT_STRING, get_QoSClassification_SourceIP, set_QoSClassification_SourceIP, NULL, NULL, BBFDM_BOTH}, +{"SourceIP", &DMWRITE, DMT_STRING, get_QoSClassification_SourceIP, set_QoSClassification_SourceIP, NULL, NULL, BBFDM_BOTH}, //{"SourceMask", &DMWRITE, DMT_STRING, get_QoSClassification_SourceMask, set_QoSClassification_SourceMask, NULL, NULL, BBFDM_BOTH}, //{"SourceIPExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_SourceIPExclude, set_QoSClassification_SourceIPExclude, NULL, NULL, BBFDM_BOTH}, -//{"Protocol", &DMWRITE, DMT_INT, get_QoSClassification_Protocol, set_QoSClassification_Protocol, NULL, NULL, BBFDM_BOTH}, +{"Protocol", &DMWRITE, DMT_INT, get_QoSClassification_Protocol, set_QoSClassification_Protocol, NULL, NULL, BBFDM_BOTH}, //{"ProtocolExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_ProtocolExclude, set_QoSClassification_ProtocolExclude, NULL, NULL, BBFDM_BOTH}, -//{"DestPort", &DMWRITE, DMT_INT, get_QoSClassification_DestPort, set_QoSClassification_DestPort, NULL, NULL, BBFDM_BOTH}, -//{"DestPortRangeMax", &DMWRITE, DMT_INT, get_QoSClassification_DestPortRangeMax, set_QoSClassification_DestPortRangeMax, NULL, NULL, BBFDM_BOTH}, +{"DestPort", &DMWRITE, DMT_INT, get_QoSClassification_DestPort, set_QoSClassification_DestPort, NULL, NULL, BBFDM_BOTH}, +{"DestPortRangeMax", &DMWRITE, DMT_INT, get_QoSClassification_DestPortRangeMax, set_QoSClassification_DestPortRangeMax, NULL, NULL, BBFDM_BOTH}, //{"DestPortExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_DestPortExclude, set_QoSClassification_DestPortExclude, NULL, NULL, BBFDM_BOTH}, -//{"SourcePort", &DMWRITE, DMT_INT, get_QoSClassification_SourcePort, set_QoSClassification_SourcePort, NULL, NULL, BBFDM_BOTH}, +{"SourcePort", &DMWRITE, DMT_INT, get_QoSClassification_SourcePort, set_QoSClassification_SourcePort, NULL, NULL, BBFDM_BOTH}, //{"SourcePortRangeMax", &DMWRITE, DMT_INT, get_QoSClassification_SourcePortRangeMax, set_QoSClassification_SourcePortRangeMax, NULL, NULL, BBFDM_BOTH}, //{"SourcePortExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_SourcePortExclude, set_QoSClassification_SourcePortExclude, NULL, NULL, BBFDM_BOTH}, //{"SourceMACAddress", &DMWRITE, DMT_STRING, get_QoSClassification_SourceMACAddress, set_QoSClassification_SourceMACAddress, NULL, NULL, BBFDM_BOTH}, @@ -3981,14 +4001,14 @@ DMLEAF tQoSQueueStatsParams[] = { /* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/ //{"Enable", &DMWRITE, DMT_BOOL, get_QoSQueueStats_Enable, set_QoSQueueStats_Enable, NULL, NULL, BBFDM_BOTH}, //{"Status", &DMREAD, DMT_STRING, get_QoSQueueStats_Status, NULL, NULL, NULL, BBFDM_BOTH}, -//{"Alias", &DMWRITE, DMT_STRING, get_QoSQueueStats_Alias, set_QoSQueueStats_Alias, NULL, NULL, BBFDM_BOTH}, +{"Alias", &DMWRITE, DMT_STRING, get_QoSQueueStats_Alias, set_QoSQueueStats_Alias, NULL, NULL, BBFDM_BOTH}, //{"Queue", &DMWRITE, DMT_STRING, get_QoSQueueStats_Queue, set_QoSQueueStats_Queue, NULL, NULL, BBFDM_BOTH}, -//{"Interface", &DMWRITE, DMT_STRING, get_QoSQueueStats_Interface, set_QoSQueueStats_Interface, NULL, NULL, BBFDM_BOTH}, -//{"OutputPackets", &DMREAD, DMT_UNINT, get_QoSQueueStats_OutputPackets, NULL, NULL, NULL, BBFDM_BOTH}, -//{"OutputBytes", &DMREAD, DMT_UNINT, get_QoSQueueStats_OutputBytes, NULL, NULL, NULL, BBFDM_BOTH}, -//{"DroppedPackets", &DMREAD, DMT_UNINT, get_QoSQueueStats_DroppedPackets, NULL, NULL, NULL, BBFDM_BOTH}, -//{"DroppedBytes", &DMREAD, DMT_UNINT, get_QoSQueueStats_DroppedBytes, NULL, NULL, NULL, BBFDM_BOTH}, -//{"QueueOccupancyPackets", &DMREAD, DMT_UNINT, get_QoSQueueStats_QueueOccupancyPackets, NULL, NULL, NULL, BBFDM_BOTH}, +{"Interface", &DMWRITE, DMT_STRING, get_QoSQueueStats_Interface, set_QoSQueueStats_Interface, NULL, NULL, BBFDM_BOTH}, +{"OutputPackets", &DMREAD, DMT_UNINT, get_QoSQueueStats_OutputPackets, NULL, NULL, NULL, BBFDM_BOTH}, +{"OutputBytes", &DMREAD, DMT_UNINT, get_QoSQueueStats_OutputBytes, NULL, NULL, NULL, BBFDM_BOTH}, +{"DroppedPackets", &DMREAD, DMT_UNINT, get_QoSQueueStats_DroppedPackets, NULL, NULL, NULL, BBFDM_BOTH}, +{"DroppedBytes", &DMREAD, DMT_UNINT, get_QoSQueueStats_DroppedBytes, NULL, NULL, NULL, BBFDM_BOTH}, +{"QueueOccupancyPackets", &DMREAD, DMT_UNINT, get_QoSQueueStats_QueueOccupancyPackets, NULL, NULL, NULL, BBFDM_BOTH}, //{"QueueOccupancyPercentage", &DMREAD, DMT_UNINT, get_QoSQueueStats_QueueOccupancyPercentage, NULL, NULL, NULL, BBFDM_BOTH}, {0} }; diff --git a/dmtree/tr181/qos.h b/dmtree/tr181/qos.h index a3e213e8..df1e65a8 100644 --- a/dmtree/tr181/qos.h +++ b/dmtree/tr181/qos.h @@ -12,6 +12,7 @@ #define __QOS_H #include +#include "dmentry.h" extern DMOBJ tQoSObj[]; extern DMLEAF tQoSParams[];