From 6c633ad4f8178185a5ed0b33bf9cc6e6deb97abb Mon Sep 17 00:00:00 2001 From: Meng Date: Mon, 26 Nov 2018 10:50:59 +0100 Subject: [PATCH] Add Tr181 Data model for "VLANTermination.{i}." - Only data model is added, handlers will be implemented in small steps. - The ".Stats" object is not added on purpose. - Verified by building and running with ACS. --- dm/dmtree/tr181/ethernet.c | 120 +++++++++++++++++++++++++++++++++++++ dm/dmtree/tr181/ethernet.h | 22 +++++++ 2 files changed, 142 insertions(+) diff --git a/dm/dmtree/tr181/ethernet.c b/dm/dmtree/tr181/ethernet.c index 80f7daf..2239526 100644 --- a/dm/dmtree/tr181/ethernet.c +++ b/dm/dmtree/tr181/ethernet.c @@ -25,9 +25,21 @@ char *wan_ifname = NULL; DMOBJ tEthernetObj[] = { /* OBJ, permission, addobj, delobj, browseinstobj, finform, nextobj, leaf, linker*/ {"Interface", &DMREAD, NULL, NULL, NULL, browseEthIfaceInst, NULL, NULL, tEthernetStatObj, tEthernetParams, get_linker_val}, +{"VLANTermination", &DMWRITE, add_vlan_term, delete_vlan_term, NULL, browseVLANTermInst, NULL, NULL, NULL, tVLANTermParams, get_linker_vlan_term}, + {0} }; +DMLEAF tVLANTermParams[] = { +/* PARAM, permission, type, getvlue, setvalue, forced_inform, notification*/ +{"Enable", &DMWRITE, DMT_BOOL, get_vlan_term_enable, set_vlan_term_enable, NULL, NULL}, +{"VLANID", &DMWRITE, DMT_UNINT, get_vlan_term_vlanid, set_vlan_term_vlanid, NULL, NULL}, +{"TPID", &DMWRITE, DMT_UNINT, get_vlan_term_tpid, set_vlan_term_tpid, NULL, NULL}, +{"Status", &DMREAD, DMT_STRING, get_vlan_term_status, NULL, NULL, NULL}, +{"Name", &DMREAD, DMT_STRING, get_vlan_term_name, NULL, NULL, NULL}, +{"LowerLayers", &DMWRITE, DMT_STRING, get_vlan_term_lowerlayers, set_vlan_term_lowerlayers, NULL, NULL}, +{0} +}; DMLEAF tEthernetParams[] = { /* PARAM, permission, type, getvlue, setvalue, forced_inform, NOTIFICATION, linker*/ @@ -405,3 +417,111 @@ int browseEthIfaceInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data return 0; } +/************************************************************************** +* LINKER +***************************************************************************/ +int get_linker_vlan_term(char *refparam, struct dmctx *dmctx, void *data, char *instance, char **linker) { + // TODO + return 0; +} + +/************************************************************************** +* SET & GET Enable +***************************************************************************/ +int get_vlan_term_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + // TODO + return 0; +} + +int set_vlan_term_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) +{ + // TODO + return 0; +} + +/************************************************************************** +* SET & GET VLANID +***************************************************************************/ +int get_vlan_term_vlanid(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + // TODO + return 0; +} + +int set_vlan_term_vlanid(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) +{ + // TODO + return 0; +} + +/************************************************************************** +* SET & GET TPID +***************************************************************************/ +int get_vlan_term_tpid(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + // TODO + return 0; +} + +int set_vlan_term_tpid(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) +{ + // TODO + return 0; +} + +/************************************************************************** +* GET Status +***************************************************************************/ +int get_vlan_term_status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + // TODO + return 0; +} + +/************************************************************************** +* GET Name +***************************************************************************/ +int get_vlan_term_name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + // TODO + return 0; +} + + +/************************************************************************** +* SET & GET Lowerlayers +***************************************************************************/ +int get_vlan_term_lowerlayers(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + // TODO + return 0; +} + +int set_vlan_term_lowerlayers(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) +{ + // TODO + return 0; +} + +int add_vlan_term(char *refparam, struct dmctx *ctx, void *data, char **instance) +{ + // TODO + return 0; +} + +int delete_vlan_term(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action) +{ + // TODO + return 0; +} + +/************************************************************* + * ENTRY METHOD +/*************************************************************/ +int browseVLANTermInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) +{ + // TODO + return 0; +} + diff --git a/dm/dmtree/tr181/ethernet.h b/dm/dmtree/tr181/ethernet.h index e5d343c..e002b63 100644 --- a/dm/dmtree/tr181/ethernet.h +++ b/dm/dmtree/tr181/ethernet.h @@ -20,6 +20,8 @@ extern DMOBJ tEthernetObj[]; extern DMOBJ tEthernetStatObj[]; extern DMLEAF tEthernetParams[]; extern DMLEAF tEthernetStatParams[]; +extern DMLEAF tVLANTermParams[]; + int browseEthIfaceInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance); int get_eth_port_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value); @@ -45,4 +47,24 @@ int set_eth_port_duplexmode(char *refparam, struct dmctx *ctx, void *data, char int get_linker_val(char *refparam, struct dmctx *dmctx, void *data, char *instance, char **linker); + +int get_linker_vlan_term(char *refparam, struct dmctx *dmctx, void *data, char *instance, char **linker); + +int get_vlan_term_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value); + +int set_vlan_term_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action); + +int get_vlan_term_vlanid(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value); + +int set_vlan_term_vlanid(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action); +int get_vlan_term_tpid(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value); +int set_vlan_term_tpid(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action); +int get_vlan_term_status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value); +int get_vlan_term_name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value); +int get_vlan_term_lowerlayers(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value); +int set_vlan_term_lowerlayers(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action); +int add_vlan_term(char *refparam, struct dmctx *ctx, void *data, char **instance); +int delete_vlan_term(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action); +int browseVLANTermInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance); + #endif