bbf: Added Device.QoS.Classification parameters for DHCP options 60,61,77

This commit is contained in:
Shubham Sharma 2020-10-15 22:17:38 +05:30
parent 9d151ba377
commit 17cd590dbf
4 changed files with 116 additions and 44 deletions

View file

@ -308,6 +308,18 @@ int os_get_QoSClassification_VLANIDCheck(char *refparam, struct dmctx *ctx, void
int os_set_QoSClassification_VLANIDCheck(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
int os_get_QoSClassification_TrafficClass(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
int os_set_QoSClassification_TrafficClass(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
int os_get_QoSClassification_SourceVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
int os_set_QoSClassification_SourceVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
int os_get_QoSClassification_DestVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
int os_set_QoSClassification_DestVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
int os_get_QoSClassification_SourceClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
int os_set_QoSClassification_SourceClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
int os_get_QoSClassification_DestClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
int os_set_QoSClassification_DestClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
int os_get_QoSClassification_SourceUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
int os_set_QoSClassification_SourceUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
int os_get_QoSClassification_DestUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
int os_set_QoSClassification_DestUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
int os_get_QoSQueueStats_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
int os_set_QoSQueueStats_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
int os_get_QoSQueueStats_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);

View file

@ -835,7 +835,6 @@ int os_get_QoSClassification_AllInterfaces(char *refparam, struct dmctx *ctx, vo
//TODO
return 0;
}
int os_set_QoSClassification_AllInterfaces(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
@ -847,6 +846,7 @@ int os_set_QoSClassification_AllInterfaces(char *refparam, struct dmctx *ctx, vo
}
return 0;
}
#endif
int os_get_QoSClassification_DestMask(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
@ -1563,25 +1563,35 @@ int os_set_QoSClassification_SNAPOUIExclude(char *refparam, struct dmctx *ctx, v
}
return 0;
}
#endif
int os_get_QoSClassification_SourceVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
dmuci_get_value_by_section_string((struct uci_section *)data, "src_vendor_class_id", value);
return 0;
}
int os_set_QoSClassification_SourceVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
char *src_vendor_class_id = NULL;
struct uci_section *dmmap_section = NULL;
switch (action) {
case VALUECHECK:
break;
case VALUESET:
//TODO
case VALUECHECK:
if (value[0] == '\0')
break;
if (dm_validate_string(value, -1, 255, NULL, 0, NULL, 0))
return FAULT_9007;
break;
case VALUESET:
// Set received value of source Vendor ClassID in /etc/config/qos.
dmuci_set_value_by_section((struct uci_section *)data, "src_vendor_class_id", value);
break;
}
return 0;
}
#if 0
int os_get_QoSClassification_SourceVendorClassIDv6(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
@ -1635,25 +1645,35 @@ int os_set_QoSClassification_SourceVendorClassIDMode(char *refparam, struct dmct
}
return 0;
}
#endif
int os_get_QoSClassification_DestVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
dmuci_get_value_by_section_string((struct uci_section *)data, "dst_vendor_class_id", value);
return 0;
}
int os_set_QoSClassification_DestVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
char *dst_vendor_class_id = NULL;
struct uci_section *dmmap_section = NULL;
switch (action) {
case VALUECHECK:
break;
case VALUESET:
//TODO
case VALUECHECK:
if (value[0] == '\0')
break;
if (dm_validate_string(value, -1, 255, NULL, 0, NULL, 0))
return FAULT_9007;
break;
case VALUESET:
// Set received value of Destination Vendor ClassID in /etc/config/qos.
dmuci_set_value_by_section((struct uci_section *)data, "dst_vendor_class_id", value);
break;
}
return 0;
}
#if 0
int os_get_QoSClassification_DestVendorClassIDv6(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
@ -1707,25 +1727,35 @@ int os_set_QoSClassification_DestVendorClassIDMode(char *refparam, struct dmctx
}
return 0;
}
#endif
int os_get_QoSClassification_SourceClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
dmuci_get_value_by_section_string((struct uci_section *)data, "src_client_id", value);
return 0;
}
int os_set_QoSClassification_SourceClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
char *src_client_id = NULL;
struct uci_section *dmmap_section = NULL;
switch (action) {
case VALUECHECK:
if (value[0] == '\0')
break;
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
return FAULT_9007;
break;
case VALUESET:
//TODO
// Set received value of source Client ID in /etc/config/qos.
dmuci_set_value_by_section((struct uci_section *)data, "src_client_id", value);
break;
}
return 0;
}
#if 0
int os_get_QoSClassification_SourceClientIDExclude(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
@ -1743,25 +1773,35 @@ int os_set_QoSClassification_SourceClientIDExclude(char *refparam, struct dmctx
}
return 0;
}
#endif
int os_get_QoSClassification_DestClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
dmuci_get_value_by_section_string((struct uci_section *)data, "dst_client_id", value);
return 0;
}
int os_set_QoSClassification_DestClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
char *dst_client_id = NULL;
struct uci_section *dmmap_section = NULL;
switch (action) {
case VALUECHECK:
if (value[0] == '\0')
break;
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
return FAULT_9007;
break;
case VALUESET:
//TODO
// Set received value of Destination Client ID in /etc/config/qos.
dmuci_set_value_by_section((struct uci_section *)data, "dst_client_id", value);
break;
}
return 0;
}
#if 0
int os_get_QoSClassification_DestClientIDExclude(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
@ -1779,25 +1819,35 @@ int os_set_QoSClassification_DestClientIDExclude(char *refparam, struct dmctx *c
}
return 0;
}
#endif
int os_get_QoSClassification_SourceUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
dmuci_get_value_by_section_string((struct uci_section *)data, "src_user_class_id", value);
return 0;
}
int os_set_QoSClassification_SourceUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
char *src_user_class_id = NULL;
struct uci_section *dmmap_section = NULL;
switch (action) {
case VALUECHECK:
break;
case VALUESET:
//TODO
case VALUECHECK:
if (value[0] == '\0')
break;
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
return FAULT_9007;
break;
case VALUESET:
// Set received value of source user ClassID in /etc/config/qos.
dmuci_set_value_by_section((struct uci_section *)data, "src_user_class_id", value);
break;
}
return 0;
}
#if 0
int os_get_QoSClassification_SourceUserClassIDExclude(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
@ -1815,26 +1865,36 @@ int os_set_QoSClassification_SourceUserClassIDExclude(char *refparam, struct dmc
}
return 0;
}
#endif
int os_get_QoSClassification_DestUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
dmuci_get_value_by_section_string((struct uci_section *)data, "dst_user_class_id", value);
return 0;
}
int os_set_QoSClassification_DestUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
char *dst_user_class_id = NULL;
struct uci_section *dmmap_section = NULL;
switch (action) {
case VALUECHECK:
break;
case VALUESET:
//TODO
case VALUECHECK:
if (value[0] == '\0')
break;
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
return FAULT_9007;
break;
case VALUESET:
// Set received value of destination user ClassID in /etc/config/qos.
dmuci_set_value_by_section((struct uci_section *)data, "dst_user_class_id", value);
break;
}
return 0;
}
int os_get_QoSClassification_DestUserClassIDExclude(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
#if 0
int os_get_QoSClassification_DestUserClassIDExclude(char *refparam, struct dmctdstctx, void *data, char *instance, char **value)
{
//TODO
return 0;

View file

@ -1486,13 +1486,13 @@ int set_QoSClassification_SNAPOUIExclude(char *refparam, struct dmctx *ctx, void
return 0;
}
int get_QoSClassification_SourceVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
int os_get_QoSClassification_SourceVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
return 0;
}
int set_QoSClassification_SourceVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
int os_set_QoSClassification_SourceVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
@ -1566,13 +1566,13 @@ int set_QoSClassification_SourceVendorClassIDMode(char *refparam, struct dmctx *
return 0;
}
int get_QoSClassification_DestVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
int os_get_QoSClassification_DestVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
return 0;
}
int set_QoSClassification_DestVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
int os_set_QoSClassification_DestVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
@ -1646,13 +1646,13 @@ int set_QoSClassification_DestVendorClassIDMode(char *refparam, struct dmctx *ct
return 0;
}
int get_QoSClassification_SourceClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
int os_get_QoSClassification_SourceClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
return 0;
}
int set_QoSClassification_SourceClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
int os_set_QoSClassification_SourceClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
@ -1686,13 +1686,13 @@ int set_QoSClassification_SourceClientIDExclude(char *refparam, struct dmctx *ct
return 0;
}
int get_QoSClassification_DestClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
int os_get_QoSClassification_DestClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
return 0;
}
int set_QoSClassification_DestClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
int os_set_QoSClassification_DestClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
@ -1726,13 +1726,13 @@ int set_QoSClassification_DestClientIDExclude(char *refparam, struct dmctx *ctx,
return 0;
}
int get_QoSClassification_SourceUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
int os_get_QoSClassification_SourceUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
return 0;
}
int set_QoSClassification_SourceUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
int os_set_QoSClassification_SourceUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
@ -1766,13 +1766,13 @@ int set_QoSClassification_SourceUserClassIDExclude(char *refparam, struct dmctx
return 0;
}
int get_QoSClassification_DestUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
int os_get_QoSClassification_DestUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
//TODO
return 0;
}
int set_QoSClassification_DestUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
int os_set_QoSClassification_DestUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:

View file

@ -90,21 +90,21 @@ DMLEAF tQoSClassificationParams[] = {
//{"LLCControlExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_LLCControlExclude, set_QoSClassification_LLCControlExclude, NULL, NULL, BBFDM_BOTH},
//{"SNAPOUI", &DMWRITE, DMT_INT, get_QoSClassification_SNAPOUI, set_QoSClassification_SNAPOUI, NULL, NULL, BBFDM_BOTH},
//{"SNAPOUIExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_SNAPOUIExclude, set_QoSClassification_SNAPOUIExclude, NULL, NULL, BBFDM_BOTH},
//{"SourceVendorClassID", &DMWRITE, DMT_STRING, get_QoSClassification_SourceVendorClassID, set_QoSClassification_SourceVendorClassID, NULL, NULL, BBFDM_BOTH},
{"SourceVendorClassID", &DMWRITE, DMT_STRING, os_get_QoSClassification_SourceVendorClassID, os_set_QoSClassification_SourceVendorClassID, NULL, NULL, BBFDM_BOTH},
//{"SourceVendorClassIDv6", &DMWRITE, DMT_HEXBIN, get_QoSClassification_SourceVendorClassIDv6, set_QoSClassification_SourceVendorClassIDv6, NULL, NULL, BBFDM_BOTH},
//{"SourceVendorClassIDExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_SourceVendorClassIDExclude, set_QoSClassification_SourceVendorClassIDExclude, NULL, NULL, BBFDM_BOTH},
//{"SourceVendorClassIDMode", &DMWRITE, DMT_STRING, get_QoSClassification_SourceVendorClassIDMode, set_QoSClassification_SourceVendorClassIDMode, NULL, NULL, BBFDM_BOTH},
//{"DestVendorClassID", &DMWRITE, DMT_STRING, get_QoSClassification_DestVendorClassID, set_QoSClassification_DestVendorClassID, NULL, NULL, BBFDM_BOTH},
{"DestVendorClassID", &DMWRITE, DMT_STRING, os_get_QoSClassification_DestVendorClassID, os_set_QoSClassification_DestVendorClassID, NULL, NULL, BBFDM_BOTH},
//{"DestVendorClassIDv6", &DMWRITE, DMT_HEXBIN, get_QoSClassification_DestVendorClassIDv6, set_QoSClassification_DestVendorClassIDv6, NULL, NULL, BBFDM_BOTH},
//{"DestVendorClassIDExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_DestVendorClassIDExclude, set_QoSClassification_DestVendorClassIDExclude, NULL, NULL, BBFDM_BOTH},
//{"DestVendorClassIDMode", &DMWRITE, DMT_STRING, get_QoSClassification_DestVendorClassIDMode, set_QoSClassification_DestVendorClassIDMode, NULL, NULL, BBFDM_BOTH},
//{"SourceClientID", &DMWRITE, DMT_HEXBIN, get_QoSClassification_SourceClientID, set_QoSClassification_SourceClientID, NULL, NULL, BBFDM_BOTH},
{"SourceClientID", &DMWRITE, DMT_HEXBIN, os_get_QoSClassification_SourceClientID, os_set_QoSClassification_SourceClientID, NULL, NULL, BBFDM_BOTH},
//{"SourceClientIDExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_SourceClientIDExclude, set_QoSClassification_SourceClientIDExclude, NULL, NULL, BBFDM_BOTH},
//{"DestClientID", &DMWRITE, DMT_HEXBIN, get_QoSClassification_DestClientID, set_QoSClassification_DestClientID, NULL, NULL, BBFDM_BOTH},
{"DestClientID", &DMWRITE, DMT_HEXBIN, os_get_QoSClassification_DestClientID, os_set_QoSClassification_DestClientID, NULL, NULL, BBFDM_BOTH},
//{"DestClientIDExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_DestClientIDExclude, set_QoSClassification_DestClientIDExclude, NULL, NULL, BBFDM_BOTH},
//{"SourceUserClassID", &DMWRITE, DMT_HEXBIN, get_QoSClassification_SourceUserClassID, set_QoSClassification_SourceUserClassID, NULL, NULL, BBFDM_BOTH},
{"SourceUserClassID", &DMWRITE, DMT_HEXBIN, os_get_QoSClassification_SourceUserClassID, os_set_QoSClassification_SourceUserClassID, NULL, NULL, BBFDM_BOTH},
//{"SourceUserClassIDExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_SourceUserClassIDExclude, set_QoSClassification_SourceUserClassIDExclude, NULL, NULL, BBFDM_BOTH},
//{"DestUserClassID", &DMWRITE, DMT_HEXBIN, get_QoSClassification_DestUserClassID, set_QoSClassification_DestUserClassID, NULL, NULL, BBFDM_BOTH},
{"DestUserClassID", &DMWRITE, DMT_HEXBIN, os_get_QoSClassification_DestUserClassID, os_set_QoSClassification_DestUserClassID, NULL, NULL, BBFDM_BOTH},
//{"DestUserClassIDExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_DestUserClassIDExclude, set_QoSClassification_DestUserClassIDExclude, NULL, NULL, BBFDM_BOTH},
//{"SourceVendorSpecificInfo", &DMWRITE, DMT_HEXBIN, get_QoSClassification_SourceVendorSpecificInfo, set_QoSClassification_SourceVendorSpecificInfo, NULL, NULL, BBFDM_BOTH},
//{"SourceVendorSpecificInfoExclude", &DMWRITE, DMT_BOOL, get_QoSClassification_SourceVendorSpecificInfoExclude, set_QoSClassification_SourceVendorSpecificInfoExclude, NULL, NULL, BBFDM_BOTH},