Skip to content
Snippets Groups Projects
Commit 7927fd14 authored by Rohit Topno's avatar Rohit Topno
Browse files

qosmngr: add tr-181 vendor extension for VLAN ID translation

parent bcf8f365
Branches
Tags
1 merge request!28qosmngr: add tr-181 vendor extension for VLAN ID translation
Pipeline #157805 failed
LIB_QOS_BBF := libqos_bbf.so
LIB_QOS_BBF_VENDOR := libqos_vendor_bbf.so
OBJS := qos_bbf.o
OBJS_VENDOR := qos_bbf_vendor.o
LIB_CFLAGS = $(CFLAGS) -Wall -Werror
LIB_LDFLAGS = $(LDFLAGS)
......@@ -11,11 +13,14 @@ FPIC := -fPIC
%.o: %.c
$(CC) $(LIB_CFLAGS) $(FPIC) -c -o $@ $<
all: $(LIB_QOS_BBF)
all: $(LIB_QOS_BBF) $(LIB_QOS_BBF_VENDOR)
$(LIB_QOS_BBF): $(OBJS)
$(CC) $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared -o $@ $^
$(LIB_QOS_BBF_VENDOR): $(OBJS_VENDOR)
$(CC) $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared -o $@ $^
clean:
rm -f *.o $(LIB_QOS_BBF)
rm -f *.o $(LIB_QOS_BBF) $(LIB_QOS_BBF_VENDOR)
/*
* Copyright (C) 2024 iopsys Software Solutions AB
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* Author: Rohit Topno <r.topno@gxgroup.eu>
*/
#include "qos_bbf_vendor.h"
/*************************************************************
* GET & SET PARAM
*************************************************************/
static int get_QoSClassification_VLANIDMark(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dm_data *)data)->config_section, "vid_mark", "-1");
return 0;
}
static int set_QoSClassification_VLANIDMark(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (bbfdm_validate_int(ctx, value, RANGE_ARGS{{"-1",NULL}}, 1))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dm_data *)data)->config_section, "vid_mark", value);
break;
}
return 0;
}
/* ********** DynamicObj ********** */
DM_MAP_OBJ tDynamicObj[] = {
/* parentobj, nextobject, parameter */
{"Device.QoS.Classification.{i}.", NULL, tQoSClassificationParams},
{0}
};
/* *** Device.QoS.Classification.{i}. *** */
DMLEAF tQoSClassificationParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type */
{BBF_VENDOR_PREFIX"VLANIDMark", &DMWRITE, DMT_UNINT, get_QoSClassification_VLANIDMark, set_QoSClassification_VLANIDMark, BBFDM_BOTH},
{0}
};
/*
* Copyright (C) 2024 iopsys Software Solutions AB
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* Author: Rohit Topno <r.topno@gxgroup.eu>
*
*/
#ifndef __IOPSYS_QOS_H
#define __IOPSYS_QOS_H
#include "libbbfdm-api/dmcommon.h"
extern DMLEAF tQoSClassificationParams[];
#endif //__IOPSYS_QOS_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment