From e7780c2b24f06110f570294c5986beb921539a8c Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Wed, 13 Mar 2024 13:51:30 +0000 Subject: [PATCH] libbbf: moved DSL,FAST,ATM,PTM as microservice --- README.md | 4 + libbbfdm/dmtree/tr181/atm.c | 420 -------- libbbfdm/dmtree/tr181/atm.h | 24 - libbbfdm/dmtree/tr181/device.c | 8 - libbbfdm/dmtree/tr181/dsl.c | 1670 -------------------------------- libbbfdm/dmtree/tr181/dsl.h | 40 - libbbfdm/dmtree/tr181/fast.c | 1041 -------------------- libbbfdm/dmtree/tr181/fast.h | 28 - libbbfdm/dmtree/tr181/ptm.c | 282 ------ libbbfdm/dmtree/tr181/ptm.h | 22 - tools/tools_input.json | 10 + 11 files changed, 14 insertions(+), 3535 deletions(-) delete mode 100644 libbbfdm/dmtree/tr181/atm.c delete mode 100644 libbbfdm/dmtree/tr181/atm.h delete mode 100644 libbbfdm/dmtree/tr181/dsl.c delete mode 100644 libbbfdm/dmtree/tr181/dsl.h delete mode 100644 libbbfdm/dmtree/tr181/fast.c delete mode 100644 libbbfdm/dmtree/tr181/fast.h delete mode 100644 libbbfdm/dmtree/tr181/ptm.c delete mode 100644 libbbfdm/dmtree/tr181/ptm.h diff --git a/README.md b/README.md index 152eea4e..b6709d43 100644 --- a/README.md +++ b/README.md @@ -98,3 +98,7 @@ All supported tools are presented in this file[BBFDM Tools](./tools/README.md) | Device.DynamicDNS. | ddnsmngr | https://dev.iopsys.eu/bbf/ddnsmngr.git | | Device.Hosts. | hostmngr | https://dev.iopsys.eu/iopsys/hostmngr.git | | Device.Services.VoiceService. | tr104 | https://dev.iopsys.eu/voice/tr104.git | +| Device.DSL. | dslmngr | https://dev.iopsys.eu/hal/dslmngr.git | +| Device.FAST. | dslmngr | https://dev.iopsys.eu/hal/dslmngr.git | +| Device.ATM. | dslmngr | https://dev.iopsys.eu/hal/dslmngr.git | +| Device.PTM. | dslmngr | https://dev.iopsys.eu/hal/dslmngr.git | diff --git a/libbbfdm/dmtree/tr181/atm.c b/libbbfdm/dmtree/tr181/atm.c deleted file mode 100644 index 60a94b25..00000000 --- a/libbbfdm/dmtree/tr181/atm.c +++ /dev/null @@ -1,420 +0,0 @@ -/* - * Copyright (C) 2019 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: Anis Ellouze - * - */ - -#include "atm.h" - -struct atm_args -{ - struct dmmap_dup *sections; - char *device; -}; - -/************************************************************************** -* INIT -***************************************************************************/ -static inline int init_atm_link(struct atm_args *args, struct dmmap_dup *s, char *device) -{ - args->sections = s; - args->device = device; - return 0; -} - -/************************************************************* -* COMMON FUNCTIONS -**************************************************************/ -void remove_device_from_interface(struct uci_section *interface_s, char *device) -{ - char *curr_device = NULL; - char new_device[64] = {0}; - unsigned pos = 0; - - if (!interface_s || !device) - return; - - dmuci_get_value_by_section_string(interface_s, "device", &curr_device); - if (DM_STRLEN(curr_device) == 0) - return; - - new_device[0] = '\0'; - - char *pch = NULL, *spch = NULL; - for (pch = strtok_r(curr_device, " ", &spch); pch; pch = strtok_r(NULL, " ", &spch)) { - - if (strcmp(pch, device) == 0) - continue; - - pos += snprintf(&new_device[pos], sizeof(new_device) - pos, "%s ", pch); - } - - if (pos) - new_device[pos - 1] = 0; - - dmuci_set_value_by_section(interface_s, "device", new_device); -} - -/************************************************************* -* ENTRY METHOD -*************************************************************/ -/*#Device.ATM.Link.{i}.!UCI:dsl/atm-device/dmmap_dsl*/ -static int browseAtmLinkInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) -{ - char *inst = NULL, *device; - struct atm_args curr_atm_args = {0}; - struct dmmap_dup *p = NULL; - LIST_HEAD(dup_list); - - synchronize_specific_config_sections_with_dmmap("dsl", "atm-device", "dmmap_dsl", &dup_list); - list_for_each_entry(p, &dup_list, list) { - - dmuci_get_value_by_section_string(p->config_section, "device", &device); - init_atm_link(&curr_atm_args, p, device); - - inst = handle_instance(dmctx, parent_node, p->dmmap_section, "atmlinkinstance", "atmlinkalias"); - - if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&curr_atm_args, inst) == DM_STOP) - break; - } - free_dmmap_config_dup_list(&dup_list); - return 0; -} - -/************************************************************* -* ADD & DEL OBJ -**************************************************************/ -static int add_atm_link(char *refparam, struct dmctx *ctx, void *data, char **instance) -{ - struct uci_section *dmmap_atm = NULL; - char atm_device[16]; - - snprintf(atm_device, sizeof(atm_device), "atm%s", *instance); - - dmuci_set_value("dsl", atm_device, "", "atm-device"); - dmuci_set_value("dsl", atm_device, "name", "ATM"); - dmuci_set_value("dsl", atm_device, "enabled", "0"); - dmuci_set_value("dsl", atm_device, "vpi", "8"); - dmuci_set_value("dsl", atm_device, "vci", "35"); - dmuci_set_value("dsl", atm_device, "device", atm_device); - - dmuci_add_section_bbfdm("dmmap_dsl", "atm-device", &dmmap_atm); - dmuci_set_value_by_section(dmmap_atm, "section_name", atm_device); - dmuci_set_value_by_section(dmmap_atm, "atmlinkinstance", *instance); - return 0; -} - -static int delete_atm_link(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action) -{ - struct uci_section *s = NULL, *stmp = NULL; - - switch (del_action) { - case DEL_INST: - uci_foreach_option_cont("network", "interface", "device", ((struct atm_args *)data)->device, s) { - remove_device_from_interface(stmp, ((struct atm_args *)data)->device); - } - - dmuci_delete_by_section((((struct atm_args *)data)->sections)->dmmap_section, NULL, NULL); - dmuci_delete_by_section((((struct atm_args *)data)->sections)->config_section, NULL, NULL); - break; - case DEL_ALL: - uci_foreach_sections_safe("dsl", "atm-device", stmp, s) { - struct uci_section *ns = NULL; - char *device = NULL; - - dmuci_get_value_by_section_string(s, "device", &device); - if (DM_STRLEN(device) == 0) - continue; - - uci_foreach_option_cont("network", "interface", "device", device, ns) { - remove_device_from_interface(ns, device); - } - - get_dmmap_section_of_config_section("dmmap_dsl", "atm-device", section_name(s), &ns); - dmuci_delete_by_section(ns, NULL, NULL); - - dmuci_delete_by_section(s, NULL, NULL); - } - break; - } - return 0; -} - -/************************************************************* -* GET & SET PARAM -**************************************************************/ -/*#Device.ATM.Link.{i}.DestinationAddress!UCI:dsl/atm-device,@i-1/vpi&UCI:dsl/atm-device,@i-1/vci*/ -static int get_atm_destination_address(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *vpi, *vci; - - dmuci_get_value_by_section_string((((struct atm_args *)data)->sections)->config_section, "vpi", &vpi); - dmuci_get_value_by_section_string((((struct atm_args *)data)->sections)->config_section, "vci", &vci); - dmasprintf(value, "%s/%s", vpi, vci); // MEM WILL BE FREED IN DMMEMCLEAN - return 0; -} - -static int set_atm_destination_address(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - char *Destination_Address[] = {"^\\d+/\\d+$", NULL}; - char *vpi = NULL, *vci = NULL, *spch; - - switch (action) { - case VALUECHECK: - if (bbfdm_validate_string(ctx, value, -1, 256, NULL, Destination_Address)) - return FAULT_9007; - return 0; - case VALUESET: - vpi = strtok_r(value, "/", &spch); - if (vpi) - vci = strtok_r(NULL, "/", &spch); - if (vpi && vci) { - dmuci_set_value_by_section((((struct atm_args *)data)->sections)->config_section, "vpi", vpi); - dmuci_set_value_by_section((((struct atm_args *)data)->sections)->config_section, "vci", vci); - } - return 0; - } - return 0; -} - -/*#Device.ATM.Link.{i}.Name!UCI:dsl/atm-device,@i-1/name*/ -static int get_atm_link_name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = dmstrdup(((struct atm_args *)data)->device); - return 0; -} - -/*#Device.ATM.Link.{i}.Encapsulation!UCI:dsl/atm-device,@i-1/encapsulation*/ -static int get_atm_encapsulation(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *encapsulation; - - dmuci_get_value_by_section_string((((struct atm_args *)data)->sections)->config_section, "encapsulation", &encapsulation); - - *value = (DM_LSTRCMP(encapsulation, "vcmux") == 0) ? "VCMUX" : "LLC"; - return 0; -} - -static int set_atm_encapsulation(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - char *encapsulation[] = {"LLC", "VCMUX", NULL}; - - switch (action) { - case VALUECHECK: - if (bbfdm_validate_string(ctx, value, -1, -1, encapsulation, NULL)) - return FAULT_9007; - return 0; - case VALUESET: - dmuci_set_value_by_section((((struct atm_args *)data)->sections)->config_section, "encapsulation", (DM_LSTRCMP(value, "LLC") == 0) ? "llc" : "vcmux"); - return 0; - } - return 0; -} - -/*#Device.ATM.Link.{i}.LinkType!UCI:dsl/atm-device,@i-1/link_type*/ -static int get_atm_link_type(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *link_type; - - dmuci_get_value_by_section_string((((struct atm_args *)data)->sections)->config_section, "link_type", &link_type); - if (DM_LSTRCMP(link_type, "eoa") == 0) - *value = "EoA"; - else if (DM_LSTRCMP(link_type, "ipoa") == 0) - *value = "IPoA"; - else if (DM_LSTRCMP(link_type, "pppoa") == 0) - *value = "PPPoA"; - else if (DM_LSTRCMP(link_type, "cip") == 0) - *value = "CIP"; - else - *value = "Unconfigured"; - return 0; -} - -static int set_atm_link_type(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - char *Link_Type[] = {"EoA", "IPoA", "PPPoA", "CIP", "Unconfigured", NULL}; - - switch (action) { - case VALUECHECK: - if (bbfdm_validate_string(ctx, value, -1, -1, Link_Type, NULL)) - return FAULT_9007; - return 0; - case VALUESET: - if (DM_LSTRCMP(value, "EoA") == 0) - dmuci_set_value_by_section((((struct atm_args *)data)->sections)->config_section, "link_type", "eoa"); - else if (DM_LSTRCMP(value, "IPoA") == 0) - dmuci_set_value_by_section((((struct atm_args *)data)->sections)->config_section, "link_type", "ipoa"); - else if (DM_LSTRCMP(value, "PPPoA") == 0) - dmuci_set_value_by_section((((struct atm_args *)data)->sections)->config_section, "link_type", "pppoa"); - else if (DM_LSTRCMP(value, "CIP") == 0) - dmuci_set_value_by_section((((struct atm_args *)data)->sections)->config_section, "link_type", "cip"); - else - dmuci_set_value_by_section((((struct atm_args *)data)->sections)->config_section, "link_type", ""); - return 0; - } - return 0; -} - -static int get_atm_lower_layer(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - dmuci_get_value_by_section_string((((struct atm_args *)data)->sections)->dmmap_section, "LowerLayers", value); - - if ((*value)[0] == '\0') { - char atm_file[128]; - - snprintf(atm_file, sizeof(atm_file), "/sys/class/net/atm%ld", DM_STRTOL(instance) - 1); - if (folder_exists(atm_file)) - adm_entry_get_reference_param(ctx, "Device.DSL.Channel.*.Name", instance, value); - - // Store LowerLayers value - dmuci_set_value_by_section((((struct atm_args *)data)->sections)->dmmap_section, "LowerLayers", *value); - } else { - if (!adm_entry_object_exists(ctx, *value)) - *value = ""; - } - - return 0; -} - -static int set_atm_lower_layer(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - struct dm_reference reference = {0}; - - bbf_get_reference_args(value, &reference); - - switch (action) { - case VALUECHECK: - if (DM_LSTRNCMP(reference.path, "Device.DSL.Channel.1", strlen("Device.DSL.Channel.1")) != 0) - return FAULT_9007; - break; - case VALUESET: - dmuci_set_value_by_section((((struct atm_args *)data)->sections)->dmmap_section, "LowerLayers", reference.path); - break; - } - return 0; -} - -static inline int ubus_atm_stats(char **value, char *stat_mod, void *data) -{ - json_object *res = NULL; - dmubus_call("network.device", "status", UBUS_ARGS{{"name", ((struct atm_args *)data)->device, String}}, 1, &res); - DM_ASSERT(res, *value = "0"); - *value = dmjson_get_value(res, 2, "statistics", stat_mod); - if ((*value)[0] == '\0') - *value = "0"; - return 0; -} - -/*#Device.ATM.Link.{i}.Stats.BytesReceived!UBUS:network.device/status/name,@Name/statistics.rx_bytes*/ -static int get_atm_stats_bytes_received(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - ubus_atm_stats(value, "rx_bytes", data); - return 0; -} - -/*#Device.ATM.Link.{i}.Stats.BytesSent!UBUS:network.device/status/name,@Name/statistics.tx_bytes*/ -static int get_atm_stats_bytes_sent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - ubus_atm_stats(value, "tx_bytes", data); - return 0; -} - -/*#Device.ATM.Link.{i}.Stats.PacketsReceived!UBUS:network.device/status/name,@Name/statistics.rx_packets*/ -static int get_atm_stats_pack_received(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - ubus_atm_stats(value, "rx_packets", data); - return 0; -} - -/*#Device.ATM.Link.{i}.Stats.PacketsSent!UBUS:network.device/status/name,@Name/statistics.tx_packets*/ -static int get_atm_stats_pack_sent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - ubus_atm_stats(value, "tx_packets", data); - return 0; -} - -/*#Device.ATM.Link.{i}.Enable!UCI:dsl/atm-device,@i-1/enabled*/ -static int get_atm_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = dmuci_get_value_by_section_fallback_def((((struct atm_args *)data)->sections)->config_section, "enabled", "1"); - return 0; -} - -static int set_atm_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - bool b; - - switch (action) { - case VALUECHECK: - if (bbfdm_validate_boolean(ctx, value)) - return FAULT_9007; - return 0; - case VALUESET: - string_to_bool(value, &b); - dmuci_set_value_by_section((((struct atm_args *)data)->sections)->config_section, "enabled", b ? "1" : "0"); - return 0; - } - return 0; -} - -/*#Device.ATM.Link.{i}.Status!SYSFS:/sys/class/net/@Name/operstate*/ -static int get_atm_status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return get_net_device_status(((struct atm_args *)data)->device, value); -} - -/*#Device.ATM.Link.{i}.Alias!UCI:dmmap_dsl/atm-device,@i-1/atmlinkalias*/ -static int get_atm_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return bbf_get_alias(ctx, (((struct atm_args *)data)->sections)->dmmap_section, "atmlinkalias", instance, value); -} - -static int set_atm_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - return bbf_set_alias(ctx, (((struct atm_args *)data)->sections)->dmmap_section, "atmlinkalias", instance, value); -} - -/********************************************************************************************************************************** -* OBJ & LEAF DEFINITION -***********************************************************************************************************************************/ -/*** ATM. ***/ -DMOBJ tATMObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/ -{"Link", &DMWRITE, add_atm_link, delete_atm_link, NULL, browseAtmLinkInst, NULL, NULL, tATMLinkObj, tATMLinkParams, NULL, BBFDM_BOTH, NULL}, -{0} -}; - -/*** ATM.Link. ***/ -DMOBJ tATMLinkObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/ -{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tATMLinkStatsParams, NULL, BBFDM_BOTH, NULL}, -{0} -}; - -DMLEAF tATMLinkParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/ -{"Alias", &DMWRITE, DMT_STRING, get_atm_alias, set_atm_alias, BBFDM_BOTH, DM_FLAG_UNIQUE}, -{"Enable", &DMWRITE, DMT_BOOL, get_atm_enable, set_atm_enable, BBFDM_BOTH}, -{"Name", &DMREAD, DMT_STRING, get_atm_link_name, NULL, BBFDM_BOTH, DM_FLAG_UNIQUE|DM_FLAG_LINKER}, -{"Status", &DMREAD, DMT_STRING, get_atm_status, NULL, BBFDM_BOTH}, -{"LowerLayers", &DMWRITE, DMT_STRING, get_atm_lower_layer, set_atm_lower_layer, BBFDM_BOTH, DM_FLAG_REFERENCE}, -{"LinkType", &DMWRITE, DMT_STRING, get_atm_link_type, set_atm_link_type, BBFDM_BOTH}, -{"DestinationAddress", &DMWRITE, DMT_STRING, get_atm_destination_address, set_atm_destination_address, BBFDM_BOTH}, -{"Encapsulation", &DMWRITE, DMT_STRING, get_atm_encapsulation, set_atm_encapsulation, BBFDM_BOTH}, -{0} -}; - -/*** ATM.Link.Stats. ***/ -DMLEAF tATMLinkStatsParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/ -{"BytesSent", &DMREAD, DMT_UNLONG, get_atm_stats_bytes_sent, NULL, BBFDM_BOTH}, -{"BytesReceived", &DMREAD, DMT_UNLONG, get_atm_stats_bytes_received, NULL, BBFDM_BOTH}, -{"PacketsSent", &DMREAD, DMT_UNLONG, get_atm_stats_pack_sent, NULL, BBFDM_BOTH}, -{"PacketsReceived", &DMREAD, DMT_UNLONG, get_atm_stats_pack_received, NULL, BBFDM_BOTH}, -{0} -}; diff --git a/libbbfdm/dmtree/tr181/atm.h b/libbbfdm/dmtree/tr181/atm.h deleted file mode 100644 index 8d959466..00000000 --- a/libbbfdm/dmtree/tr181/atm.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2019 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: Anis Ellouze - * - */ - -#ifndef __ATM_H -#define __ATM_H - -#include "libbbfdm-api/dmcommon.h" - -extern DMOBJ tATMObj[]; -extern DMOBJ tATMLinkObj[]; -extern DMLEAF tATMLinkParams[]; -extern DMLEAF tATMLinkStatsParams[]; - -void remove_device_from_interface(struct uci_section *interface_s, char *device); - -#endif diff --git a/libbbfdm/dmtree/tr181/device.c b/libbbfdm/dmtree/tr181/device.c index c9fe9bb3..81f750c1 100644 --- a/libbbfdm/dmtree/tr181/device.c +++ b/libbbfdm/dmtree/tr181/device.c @@ -18,15 +18,11 @@ #include "ethernet.h" #include "bridging.h" #include "wifi.h" -#include "atm.h" -#include "ptm.h" #include "dhcpv4.h" #include "nat.h" #include "ppp.h" #include "routing.h" #include "firewall.h" -#include "dsl.h" -#include "fast.h" #include "dhcpv6.h" #include "interfacestack.h" #include "qos.h" @@ -96,10 +92,6 @@ DMOBJ tDeviceObj[] = { {"Bridging", &DMREAD, NULL, NULL, "file:/etc/config/network", NULL, NULL, NULL, tBridgingObj, tBridgingParams, NULL, BBFDM_BOTH, NULL}, {"IP", &DMREAD, NULL, NULL, "file:/etc/config/network", NULL, NULL, NULL, tIPObj, tIPParams, NULL, BBFDM_BOTH, NULL}, {"Ethernet", &DMREAD, NULL, NULL, "file:/etc/config/network", NULL, NULL, NULL, tEthernetObj, tEthernetParams, NULL, BBFDM_BOTH, NULL}, -{"DSL", &DMREAD, NULL, NULL, "file:/etc/config/dsl", NULL, NULL, NULL, tDSLObj, tDSLParams, NULL, BBFDM_BOTH, NULL}, -{"FAST", &DMREAD, NULL, NULL, "ubus:fast", NULL, NULL, NULL, tFASTObj, tFASTParams, NULL, BBFDM_BOTH, NULL}, -{"ATM", &DMREAD, NULL, NULL, "file:/etc/config/dsl", NULL, NULL, NULL, tATMObj, NULL, NULL, BBFDM_BOTH, NULL}, -{"PTM", &DMREAD, NULL, NULL, "file:/etc/config/dsl", NULL, NULL, NULL, tPTMObj, NULL, NULL, BBFDM_BOTH, NULL}, {"DHCPv4", &DMREAD, NULL, NULL, "file:/lib/netifd/proto/dhcp.sh,/etc/config/dhcp", NULL, NULL, NULL, tDHCPv4Obj, tDHCPv4Params, NULL, BBFDM_BOTH, NULL}, {"DHCPv6", &DMREAD, NULL, NULL, "file:/lib/netifd/proto/dhcpv6.sh,/etc/config/dhcp", NULL, NULL, NULL, tDHCPv6Obj, tDHCPv6Params, NULL, BBFDM_BOTH, NULL}, {"NAT", &DMREAD, NULL, NULL, "file:/etc/config/firewall", NULL, NULL, NULL, tNATObj, tNATParams, NULL, BBFDM_BOTH, NULL}, diff --git a/libbbfdm/dmtree/tr181/dsl.c b/libbbfdm/dmtree/tr181/dsl.c deleted file mode 100644 index a5031f37..00000000 --- a/libbbfdm/dmtree/tr181/dsl.c +++ /dev/null @@ -1,1670 +0,0 @@ -/* - * Copyright (C) 2019 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: AMIN Ben Ramdhane - */ - -#include "dsl.h" - -struct dsl_line_args -{ - struct uci_section *line_sec; - char *id; -}; - -struct dsl_channel_args -{ - struct uci_section *channel_sec; - char *id; -}; - -/************************************************************************** -* INIT -***************************************************************************/ -static inline int init_dsl_line(struct dsl_line_args *args, struct uci_section *s) -{ - args->line_sec = s; - return 0; -} - -static inline int init_dsl_channel(struct dsl_channel_args *args, struct uci_section *s) -{ - args->channel_sec = s; - return 0; -} - -/*************************************************************/ -static struct uci_section *update_create_dmmap_dsl_line(char *curr_id) -{ - struct uci_section *s = NULL; - - uci_path_foreach_option_eq(bbfdm, "dmmap", "dsl_line", "id", curr_id, s) { - return s; - } - if (!s) { - char instance[16]; - - snprintf(instance, sizeof(instance), "%ld", DM_STRTOL(curr_id)); - dmuci_add_section_bbfdm("dmmap", "dsl_line", &s); - dmuci_set_value_by_section_bbfdm(s, "id", curr_id); - dmuci_set_value_by_section_bbfdm(s, "dsl_line_instance", instance); - } - return s; -} - -static struct uci_section *update_create_dmmap_dsl_channel(char *curr_id) -{ - struct uci_section *s = NULL; - - uci_path_foreach_option_eq(bbfdm, "dmmap", "dsl_channel", "id", curr_id, s) { - return s; - } - if (!s) { - char instance[16]; - - snprintf(instance, sizeof(instance), "%ld", DM_STRTOL(curr_id)); - dmuci_add_section_bbfdm("dmmap", "dsl_channel", &s); - dmuci_set_value_by_section_bbfdm(s, "id", curr_id); - dmuci_set_value_by_section_bbfdm(s, "dsl_channel_instance", instance); - } - return s; -} -/************************************************************* -* ENTRY METHOD -*************************************************************/ -static int browseDSLLineInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) -{ - json_object *res = NULL, *line_obj = NULL; - struct dsl_line_args cur_dsl_line_args = {0}; - struct uci_section *s = NULL; - char *inst = NULL; - int entries = 0; - - dmubus_call("dsl", "status", UBUS_ARGS{0}, 0, &res); - while (res) { - line_obj = dmjson_select_obj_in_array_idx(res, entries, 1, "line"); - if(line_obj) { - cur_dsl_line_args.id = dmjson_get_value(line_obj, 1, "id"); - entries++; - s = update_create_dmmap_dsl_line(cur_dsl_line_args.id); - init_dsl_line(&cur_dsl_line_args, s); - - inst = handle_instance(dmctx, parent_node, s, "dsl_line_instance", "dsl_line_alias"); - - if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&cur_dsl_line_args, inst) == DM_STOP) - break; - } - else - break; - } - return 0; -} - -static int browseDSLChannelInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) -{ - json_object *res = NULL, *line_obj = NULL, *channel_obj = NULL; - struct dsl_channel_args cur_dsl_channel_args = {0}; - struct uci_section *s = NULL; - char *inst = NULL; - int entries_line = 0, entries_channel = 0; - - dmubus_call("dsl", "status", UBUS_ARGS{0}, 0, &res); - while (res) { - line_obj = dmjson_select_obj_in_array_idx(res, entries_line, 1, "line"); - while (line_obj) { - channel_obj = dmjson_select_obj_in_array_idx(line_obj, entries_channel, 1, "channel"); - if(channel_obj) { - cur_dsl_channel_args.id = dmjson_get_value(channel_obj, 1, "id"); - entries_channel++; - s = update_create_dmmap_dsl_channel(cur_dsl_channel_args.id); - init_dsl_channel(&cur_dsl_channel_args, s); - - inst = handle_instance(dmctx, parent_node, s, "dsl_channel_instance", "dsl_channel_alias"); - - if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&cur_dsl_channel_args, inst) == DM_STOP) - break; - } - else - break; - } - entries_line++; - if(!line_obj) - break; - } - return 0; -} - -/************************************************************************** -* COMMON FUNCTIONS -***************************************************************************/ -static char *get_dsl_value_without_argument(char *command1, char *id, char *command2, char *key) -{ - json_object *res = NULL; - char command[16], *value = "0"; - - snprintf(command, sizeof(command), "%s.%s", command1, id); - dmubus_call(command, command2, UBUS_ARGS{0}, 0, &res); - if (!res) return ""; - value = dmjson_get_value(res, 1, key); - return value; -} - -static char *get_dsl_value_without_argument_and_with_two_key(char *command1, char *id, char *command2, char *key1, char *key2) -{ - json_object *res = NULL; - char command[16], *value = "0"; - - snprintf(command, sizeof(command), "%s.%s", command1, id); - dmubus_call(command, command2, UBUS_ARGS{0}, 0, &res); - if (!res) return ""; - value = dmjson_get_value(res, 2, key1, key2); - return value; -} - -char *get_value_with_argument(char *command1, char *id, char *command2, char *argument, char *key) -{ - json_object *res = NULL; - char command[16], *value = "0"; - - snprintf(command, sizeof(command), "%s.%s", command1, id); - dmubus_call(command, command2, UBUS_ARGS{{"interval", argument, String}}, 1, &res); - if (!res) return ""; - value = dmjson_get_value(res, 1, key); - return value; -} - -static char *get_dsl_value_array_without_argument(char *command1, char *id, char *command2, char *key) -{ - json_object *res = NULL; - char command[16], *value= "0"; - - snprintf(command, sizeof(command), "%s.%s", command1, id); - dmubus_call(command, command2, UBUS_ARGS{0}, 0, &res); - if (!res) return ""; - value = dmjson_get_value_array_all(res, ",", 1, key); - return value; -} - -int get_line_linkstatus(char *method, char *id, char **value) -{ - char *link_status = get_dsl_value_without_argument(method, id, "status", "link_status"); - - if (DM_LSTRCMP(link_status, "up") == 0) - *value = "Up"; - else if (DM_LSTRCMP(link_status, "initializing") == 0) - *value = "Initializing"; - else if (DM_LSTRCMP(link_status, "no_signal") == 0) - *value = "NoSignal"; - else if (DM_LSTRCMP(link_status, "disabled") == 0) - *value = "Disabled"; - else if (DM_LSTRCMP(link_status, "establishing") == 0) - *value = "EstablishingLink"; - else if (DM_LSTRCMP(link_status, "error") == 0) - *value = "Error"; - else - *value = link_status; - return 0; -} - -/************************************************************************** -* GET & SET DSL PARAMETERS -***************************************************************************/ -static int get_DSL_LineNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - int cnt = get_number_of_entries(ctx, data, instance, browseDSLLineInst); - dmasprintf(value, "%d", cnt); - return 0; -} - -static int get_DSL_ChannelNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - int cnt = get_number_of_entries(ctx, data, instance, browseDSLChannelInst); - dmasprintf(value, "%d", cnt); - return 0; -} - -/*#Device.DSL.Line.{i}.Enable!UBUS:dsl.line.1/status//status*/ -static int get_DSLLine_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *status = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "status"); - *value = (DM_LSTRCMP(status, "up") == 0) ? "1" : "0"; - return 0; -} - -static int set_DSLLine_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - switch (action) { - case VALUECHECK: - if (bbfdm_validate_boolean(ctx, value)) - return FAULT_9007; - break; - case VALUESET: - break; - } - return 0; -} - -/*#Device.DSL.Line.{i}.Status!UBUS:dsl.line.1/status//status*/ -static int get_DSLLine_Status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *status = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "status"); - *value = (DM_LSTRCMP(status, "up") == 0) ? "Up" : "Down"; - return 0; -} - -static int get_DSLLine_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return bbf_get_alias(ctx, ((struct dsl_line_args *)data)->line_sec, "dsl_line_alias", instance, value); -} - -static int set_DSLLine_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - return bbf_set_alias(ctx, ((struct dsl_line_args *)data)->line_sec, "dsl_line_alias", instance, value); -} - -static int get_DSLLine_Name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = ((struct dsl_line_args*)data)->id; - return 0; -} - -static int get_DSLLine_LowerLayers(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = ""; - return 0; -} - -static int set_DSLLine_LowerLayers(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - switch (action) { - case VALUECHECK: - if (bbfdm_validate_string_list(ctx, value, -1, -1, 1024, -1, -1, NULL, NULL)) - return FAULT_9007; - break; - case VALUESET: - break; - } - return 0; -} - -/*#Device.DSL.Line.{i}.Upstream!UBUS:dsl.line.1/status//upstream*/ -static int get_DSLLine_Upstream(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "upstream"); - return 0; -} - -/*#Device.DSL.Line.{i}.FirmwareVersion!UBUS:dsl.line.1/status//firmware_version*/ -static int get_DSLLine_FirmwareVersion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "firmware_version"); - return 0; -} - -/*#Device.DSL.Line.{i}.LinkStatus!UBUS:dsl.line.1/status//link_status*/ -static int get_DSLLine_LinkStatus(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return get_line_linkstatus("dsl.line", ((struct dsl_line_args*)data)->id, value); -} - -static char *get_dsl_standard(char *str) -{ - char *dsl_standard; - - if(DM_LSTRCMP(str, "gdmt_annexa") == 0) - dsl_standard = "G.992.1_Annex_A"; - else if(DM_LSTRCMP(str, "gdmt_annexb") == 0) - dsl_standard = "G.992.1_Annex_B"; - else if(DM_LSTRCMP(str, "gdmt_annexc") == 0) - dsl_standard = "G.992.1_Annex_C"; - else if(DM_LSTRCMP(str, "t1413") == 0) - dsl_standard = "T1.413"; - else if(DM_LSTRCMP(str, "t1413_i2") == 0) - dsl_standard = "T1.413i2"; - else if(DM_LSTRCMP(str, "glite") == 0) - dsl_standard = "G.992.2"; - else if(DM_LSTRCMP(str, "etsi_101_388") == 0) - dsl_standard = "ETSI_101_388"; - else if(DM_LSTRCMP(str, "adsl2_annexa") == 0) - dsl_standard = "G.992.3_Annex_A"; - else if(DM_LSTRCMP(str, "adsl2_annexb") == 0) - dsl_standard = "G.992.3_Annex_B"; - else if(DM_LSTRCMP(str, "adsl2_annexc") == 0) - dsl_standard = "G.992.3_Annex_C"; - else if(DM_LSTRCMP(str, "adsl2_annexi") == 0) - dsl_standard = "G.992.3_Annex_I"; - else if(DM_LSTRCMP(str, "adsl2_annexj") == 0) - dsl_standard = "G.992.3_Annex_J"; - else if(DM_LSTRCMP(str, "adsl2_annexl") == 0) - dsl_standard = "G.992.3_Annex_L"; - else if(DM_LSTRCMP(str, "adsl2_annexm") == 0) - dsl_standard = "G.992.3_Annex_M"; - else if(DM_LSTRCMP(str, "splitterless_adsl2") == 0) - dsl_standard = "G.992.4"; - else if(DM_LSTRCMP(str, "adsl2p_annexa") == 0) - dsl_standard = "G.992.5_Annex_A"; - else if(DM_LSTRCMP(str, "adsl2p_annexb") == 0) - dsl_standard = "G.992.5_Annex_B"; - else if(DM_LSTRCMP(str, "adsl2p_annexc") == 0) - dsl_standard = "G.992.5_Annex_C"; - else if(DM_LSTRCMP(str, "adsl2p_annexi") == 0) - dsl_standard = "G.992.5_Annex_I"; - else if(DM_LSTRCMP(str, "adsl2p_annexj") == 0) - dsl_standard = "G.992.5_Annex_J"; - else if(DM_LSTRCMP(str, "adsl2p_annexm") == 0) - dsl_standard = "G.992.5_Annex_M"; - else if(DM_LSTRCMP(str, "vdsl") == 0) - dsl_standard = "G.993.1"; - else if(DM_LSTRCMP(str, "vdsl2_annexa") == 0) - dsl_standard = "G.993.2_Annex_A"; - else if(DM_LSTRCMP(str, "vdsl2_annexb") == 0) - dsl_standard = "G.993.2_Annex_B"; - else if(DM_LSTRCMP(str, "vdsl2_annexc") == 0) - dsl_standard = "G.993.2_Annex_C"; - else - dsl_standard = str; - - return dsl_standard; -} - -/*#Device.DSL.Line.{i}.StandardsSupported!UBUS:dsl.line.1/status//standards_supported*/ -static int get_DSLLine_StandardsSupported(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *standards_supported, *pch, *spch, *tmp = NULL, *tmpPtr = NULL, *str = NULL; - - *value = "G.992.1_Annex_A"; - standards_supported = get_dsl_value_array_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "standards_supported"); - if (standards_supported[0] == '\0') - return 0; - for (pch = strtok_r(standards_supported, ",", &spch); pch != NULL; pch = strtok_r(NULL, ",", &spch)) { - tmp = get_dsl_standard(pch); - if(!str) - dmasprintf(&str, "%s", tmp); - else { - tmpPtr = dmstrdup(str); - dmfree(str); - dmasprintf(&str, "%s,%s", tmpPtr, tmp); - dmfree(tmpPtr); - } - } - *value = str; - return 0; -} - -/*#Device.DSL.Line.{i}.XTSE!UBUS:dsl.line.1/status//xtse*/ -static int get_DSLLine_XTSE(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *xtse, *pch, *spch, *tmpPtr = NULL, *str = NULL; - - *value = "0000000000000000"; - xtse = get_dsl_value_array_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "xtse"); - if(xtse[0] == '\0') - return 0; - for (pch = strtok_r(xtse, ",", &spch); pch; pch = strtok_r(NULL, ",", &spch)) { - if(!str) - dmasprintf(&str, "%s", pch); - else { - tmpPtr = dmstrdup(str); - dmfree(str); - dmasprintf(&str, "%s%s", tmpPtr, pch); - dmfree(tmpPtr); - } - } - *value = str; - return 0; -} - -/*#Device.DSL.Line.{i}.StandardUsed!UBUS:dsl.line.1/status//standard_used*/ -static int get_DSLLine_StandardUsed(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *standard_used = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "standard_used"); - *value = get_dsl_standard(standard_used); - return 0; -} - -/*#Device.DSL.Line.{i}.XTSUsed!UBUS:dsl.line.1/status//xtse_used*/ -static int get_DSLLine_XTSUsed(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *xtse_used,*pch, *spch, *tmpPtr = NULL, *str = NULL; - - *value = "0000000000000000"; - xtse_used = get_dsl_value_array_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "xtse_used"); - if (xtse_used[0] == '\0') - return 0; - for (pch = strtok_r(xtse_used, ",", &spch); pch != NULL; pch = strtok_r(NULL, ",", &spch)) { - if(!str) - dmasprintf(&str, "%s", pch); - else { - tmpPtr = dmstrdup(str); - dmfree(str); - dmasprintf(&str, "%s%s", tmpPtr, pch); - dmfree(tmpPtr); - } - } - *value = str; - return 0; -} - -/*#Device.DSL.Line.{i}.LineEncoding!UBUS:dsl.line.1/status//line_encoding*/ -static int get_DSLLine_LineEncoding(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *line_encoding = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "line_encoding"); - if(DM_LSTRCMP(line_encoding, "dmt") == 0) - *value = "DMT"; - else if(DM_LSTRCMP(line_encoding, "cap") == 0) - *value = "CAP"; - else if(DM_LSTRCMP(line_encoding, "2b1q") == 0) - *value = "2B1Q"; - else if(DM_LSTRCMP(line_encoding, "43bt") == 0) - *value = "43BT"; - else if(DM_LSTRCMP(line_encoding, "pam") == 0) - *value = "PAM"; - else if(DM_LSTRCMP(line_encoding, "qam") == 0) - *value = "QAM"; - else - *value = line_encoding; - return 0; -} - -/*#Device.DSL.Line.{i}.AllowedProfiles!UBUS:dsl.line.1/status//allowed_profiles*/ -static int get_DSLLine_AllowedProfiles(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_array_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "allowed_profiles"); - return 0; -} - -/*#Device.DSL.Line.{i}.CurrentProfile!UBUS:dsl.line.1/status//current_profile*/ -static int get_DSLLine_CurrentProfile(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *current_profile = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "current_profile"); - *value = (current_profile && DM_LSTRCMP(current_profile, "unknown") == 0) ? "" : current_profile; - return 0; -} - -/*#Device.DSL.Line.{i}.PowerManagementState!UBUS:dsl.line.1/status//power_management_state*/ -static int get_DSLLine_PowerManagementState(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *power_mng_state = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "power_management_state"); - if(DM_LSTRCMP(power_mng_state, "l0") == 0) - *value = "L0"; - else if(DM_LSTRCMP(power_mng_state, "l1") == 0) - *value = "L1"; - else if(DM_LSTRCMP(power_mng_state, "l2") == 0) - *value = "L2"; - else if(DM_LSTRCMP(power_mng_state, "l3") == 0) - *value = "L3"; - else if(DM_LSTRCMP(power_mng_state, "l4") == 0) - *value = "L4"; - else - *value = power_mng_state; - return 0; -} - -/*#Device.DSL.Line.{i}.SuccessFailureCause!UBUS:dsl.line.1/status//success_failure_cause*/ -static int get_DSLLine_SuccessFailureCause(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "success_failure_cause"); - return 0; -} - -/*#Device.DSL.Line.{i}.UPBOKLERPb!UBUS:dsl.line.1/status//upbokler_pb*/ -static int get_DSLLine_UPBOKLERPb(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_array_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "upbokler_pb"); - return 0; -} - -/*#Device.DSL.Line.{i}.RXTHRSHds!UBUS:dsl.line.1/status//rxthrsh_ds*/ -static int get_DSLLine_RXTHRSHds(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_array_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "rxthrsh_ds"); - return 0; -} - -/*#Device.DSL.Line.{i}.ACTRAMODEds!UBUS:dsl.line.1/status//act_ra_mode.ds*/ -static int get_DSLLine_ACTRAMODEds(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "act_ra_mode", "ds"); - return 0; -} - -/*#Device.DSL.Line.{i}.ACTRAMODEus!UBUS:dsl.line.1/status//act_ra_mode.us*/ -static int get_DSLLine_ACTRAMODEus(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "act_ra_mode", "us"); - return 0; -} - -/*#Device.DSL.Line.{i}.SNRMROCus!UBUS:dsl.line.1/status//snr_mroc_us*/ -static int get_DSLLine_SNRMROCus(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "snr_mroc_us"); - return 0; -} - -/*#Device.DSL.Line.{i}.LastStateTransmittedDownstream!UBUS:dsl.line.1/status//last_state_transmitted.ds*/ -static int get_DSLLine_LastStateTransmittedDownstream(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "last_state_transmitted", "ds"); - return 0; -} - -/*#Device.DSL.Line.{i}.LastStateTransmittedUpstream!UBUS:dsl.line.1/status//last_state_transmitted.us*/ -static int get_DSLLine_LastStateTransmittedUpstream(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "last_state_transmitted", "us"); - return 0; -} - -/*#Device.DSL.Line.{i}.US0MASK!UBUS:dsl.line.1/status//us0_mask*/ -static int get_DSLLine_US0MASK(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "us0_mask"); - return 0; -} - -/*#Device.DSL.Line.{i}.TRELLISds!UBUS:dsl.line.1/status//trellis.ds*/ -static int get_DSLLine_TRELLISds(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "trellis", "ds"); - return 0; -} - -/*#Device.DSL.Line.{i}.TRELLISus!UBUS:dsl.line.1/status//trellis.us*/ -static int get_DSLLine_TRELLISus(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "trellis", "us"); - return 0; -} - -/*#Device.DSL.Line.{i}.ACTSNRMODEds!UBUS:dsl.line.1/status//act_snr_mode.ds*/ -static int get_DSLLine_ACTSNRMODEds(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "act_snr_mode", "ds"); - return 0; -} - -/*#Device.DSL.Line.{i}.ACTSNRMODEus!UBUS:dsl.line.1/status//act_snr_mode.us*/ -static int get_DSLLine_ACTSNRMODEus(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "act_snr_mode", "us"); - return 0; -} - -/*#Device.DSL.Line.{i}.LineNumber!UBUS:dsl.line.1/status//line_number*/ -static int get_DSLLine_LineNumber(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "line_number"); - return 0; -} - -/*#Device.DSL.Line.{i}.UpstreamMaxBitRate!UBUS:dsl.line.1/status//max_bit_rate.us*/ -static int get_DSLLine_UpstreamMaxBitRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "max_bit_rate", "us"); - return 0; -} - -/*#Device.DSL.Line.{i}.DownstreamMaxBitRate!UBUS:dsl.line.1/status//max_bit_rate.ds*/ -static int get_DSLLine_DownstreamMaxBitRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "max_bit_rate", "ds"); - return 0; -} - -/*#Device.DSL.Line.{i}.UpstreamNoiseMargin!UBUS:dsl.line.1/status//noise_margin.us*/ -static int get_DSLLine_UpstreamNoiseMargin(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "noise_margin", "us"); - return 0; -} - -/*#Device.DSL.Line.{i}.DownstreamNoiseMargin!UBUS:dsl.line.1/status//noise_margin.ds*/ -static int get_DSLLine_DownstreamNoiseMargin(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "noise_margin", "ds"); - return 0; -} - -/*#Device.DSL.Line.{i}.SNRMpbus!UBUS:dsl.line.1/status//snr_mpb_us*/ -static int get_DSLLine_SNRMpbus(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_array_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "snr_mpb_us"); - return 0; -} - -/*#Device.DSL.Line.{i}.SNRMpbds!UBUS:dsl.line.1/status//snr_mpb_ds*/ -static int get_DSLLine_SNRMpbds(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_array_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "snr_mpb_ds"); - return 0; -} - -/*#Device.DSL.Line.{i}.UpstreamAttenuation!UBUS:dsl.line.1/status//attenuation.us*/ -static int get_DSLLine_UpstreamAttenuation(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "attenuation", "us"); - return 0; -} - -/*#Device.DSL.Line.{i}.DownstreamAttenuation!UBUS:dsl.line.1/status//attenuation.ds*/ -static int get_DSLLine_DownstreamAttenuation(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "attenuation", "ds"); - return 0; -} - -/*#Device.DSL.Line.{i}.UpstreamPower!UBUS:dsl.line.1/status//power.us*/ -static int get_DSLLine_UpstreamPower(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "power", "us"); - return 0; -} - -/*#Device.DSL.Line.{i}.DownstreamPower!UBUS:dsl.line.1/status//power.ds*/ -static int get_DSLLine_DownstreamPower(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.line", ((struct dsl_line_args*)data)->id, "status", "power", "ds"); - return 0; -} - -/*#Device.DSL.Line.{i}.XTURVendor!UBUS:dsl.line.1/status//xtur_vendor*/ -static int get_DSLLine_XTURVendor(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "xtur_vendor"); - return 0; -} - -/*#Device.DSL.Line.{i}.XTURCountry!UBUS:dsl.line.1/status//xtur_country*/ -/*#Device.DSL.Line.{i}.XTURCountry!UCI:dsl/oem-parameters,oem/country_code*/ -static int get_DSLLine_XTURCountry(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "xtur_country"); - - if ((*value)[0] == '0' || (*value)[0] == '\0') - *value = dmuci_get_option_value_fallback_def("dsl", "oem", "country_code", "0000"); - - return 0; -} - -/*#Device.DSL.Line.{i}.XTURANSIStd!UBUS:dsl.line.1/status//xtur_ansi_std*/ -static int get_DSLLine_XTURANSIStd(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "xtur_ansi_std"); - return 0; -} - -/*#Device.DSL.Line.{i}.XTURANSIRev!UBUS:dsl.line.1/status//xtur_ansi_rev*/ -static int get_DSLLine_XTURANSIRev(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "xtur_ansi_rev"); - return 0; -} - -/*#Device.DSL.Line.{i}.XTUCVendor!UBUS:dsl.line.1/status//xtuc_vendor*/ -static int get_DSLLine_XTUCVendor(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "xtuc_vendor"); - return 0; -} - -/*#Device.DSL.Line.{i}.XTUCCountry!UBUS:dsl.line.1/status//xtuc_country*/ -static int get_DSLLine_XTUCCountry(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "xtuc_country"); - return 0; -} - -/*#Device.DSL.Line.{i}.XTUCANSIStd!UBUS:dsl.line.1/status//xtuc_ansi_std*/ -static int get_DSLLine_XTUCANSIStd(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "status", "xtuc_ansi_std"); - return 0; -} - -/*#Device.DSL.Line.{i}.XTUCANSIRev!UBUS:dsl.line.1/status//xtuc_ansi_rev*/ -static int get_DSLLine_XTUCANSIRev(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line",((struct dsl_line_args*)data)->id, "status", "xtuc_ansi_rev"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.BytesSent!UBUS:dsl.line.1/stats//bytes_sent*/ -static int get_DSLLineStats_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "bytes_sent"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.BytesReceived!UBUS:dsl.line.1/stats//bytes_received*/ -static int get_DSLLineStats_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "bytes_received"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.PacketsSent!UBUS:dsl.line.1/stats//packets_sent*/ -static int get_DSLLineStats_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "packets_sent"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.PacketsReceived!UBUS:dsl.line.1/stats//packets_received*/ -static int get_DSLLineStats_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "packets_received"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.ErrorsSent!UBUS:dsl.line.1/stats//errors_sent*/ -static int get_DSLLineStats_ErrorsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "errors_sent"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.ErrorsReceived!UBUS:dsl.line.1/stats//errors_received*/ -static int get_DSLLineStats_ErrorsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "errors_received"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.DiscardPacketsSent!UBUS:dsl.line.1/stats//discard_packets_sent*/ -static int get_DSLLineStats_DiscardPacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "discard_packets_sent"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.DiscardPacketsReceived!UBUS:dsl.line.1/stats//discard_packets_received*/ -static int get_DSLLineStats_DiscardPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "discard_packets_received"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.TotalStart!UBUS:dsl.line.1/stats//total_start*/ -static int get_DSLLineStats_TotalStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "total_start"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.ShowtimeStart!UBUS:dsl.line.1/stats//showtime_start*/ -static int get_DSLLineStats_ShowtimeStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "showtime_start"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.LastShowtimeStart!UBUS:dsl.line.1/stats//last_showtime_start*/ -static int get_DSLLineStats_LastShowtimeStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "last_showtime_start"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.CurrentDayStart!UBUS:dsl.line.1/stats//current_day_start*/ -static int get_DSLLineStats_CurrentDayStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "current_day_start"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.QuarterHourStart!UBUS:dsl.line.1/stats//quarter_hour_start*/ -static int get_DSLLineStats_QuarterHourStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "quarter_hour_start"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.Total.ErroredSecs!UBUS:dsl.line.1/stats//total.errored_secs*/ -static int get_DSLLineStatsTotal_ErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "total", "errored_secs"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.Total.SeverelyErroredSecs!UBUS:dsl.line.1/stats//total.severely_errored_secs*/ -static int get_DSLLineStatsTotal_SeverelyErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "total", "severely_errored_secs"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.Showtime.ErroredSecs!UBUS:dsl.line.1/stats//showtime.errored_secs*/ -static int get_DSLLineStatsShowtime_ErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "showtime", "errored_secs"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.Showtime.SeverelyErroredSecs!UBUS:dsl.line.1/stats//showtime.severely_errored_secs*/ -static int get_DSLLineStatsShowtime_SeverelyErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "showtime", "severely_errored_secs"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.LastShowtime.ErroredSecs!UBUS:dsl.line.1/stats//lastshowtime.errored_secs*/ -static int get_DSLLineStatsLastShowtime_ErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "lastshowtime", "errored_secs"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.LastShowtime.SeverelyErroredSecs!UBUS:dsl.line.1/stats//lastshowtime.severely_errored_secs*/ -static int get_DSLLineStatsLastShowtime_SeverelyErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "lastshowtime", "severely_errored_secs"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.CurrentDay.ErroredSecs!UBUS:dsl.line.1/stats//currentday.errored_secs*/ -static int get_DSLLineStatsCurrentDay_ErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "currentday", "errored_secs"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.CurrentDay.SeverelyErroredSecs!UBUS:dsl.line.1/stats//currentday.severely_errored_secs*/ -static int get_DSLLineStatsCurrentDay_SeverelyErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "currentday", "severely_errored_secs"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.QuarterHour.ErroredSecs!UBUS:dsl.line.1/stats//quarterhour.errored_secs*/ -static int get_DSLLineStatsQuarterHour_ErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "quarterhour", "errored_secs"); - return 0; -} - -/*#Device.DSL.Line.{i}.Stats.QuarterHour.SeverelyErroredSecs!UBUS:dsl.line.1/stats//quarterhour.severely_errored_secs*/ -static int get_DSLLineStatsQuarterHour_SeverelyErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.line", ((struct dsl_line_args*)data)->id, "stats", "quarterhour", "severely_errored_secs"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Enable!UBUS:dsl.channel.1/status//status*/ -static int get_DSLChannel_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *status = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "status"); - *value = (DM_LSTRCMP(status, "up") == 0) ? "1" : "0"; - return 0; -} - -static int set_DSLChannel_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - switch (action) { - case VALUECHECK: - if (bbfdm_validate_boolean(ctx, value)) - return FAULT_9007; - break; - case VALUESET: - break; - } - return 0; -} - -/*#Device.DSL.Channel.{i}.Status!UBUS:dsl.channel.1/status//status*/ -static int get_DSLChannel_Status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *status = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "status"); - if (DM_LSTRCMP(status, "up") == 0) - *value = "Up"; - else if (DM_LSTRCMP(status, "down") == 0) - *value = "Down"; - else if (DM_LSTRCMP(status, "dormant") == 0) - *value = "Dormant"; - else if (DM_LSTRCMP(status, "not_present") == 0) - *value = "NotPresent"; - else if (DM_LSTRCMP(status, "lower_layer_down") == 0) - *value = "LowerLayerDown"; - else if (DM_LSTRCMP(status, "error") == 0) - *value = "Error"; - else - *value = "Unknown"; - return 0; -} - -static int get_DSLChannel_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return bbf_get_alias(ctx, ((struct dsl_channel_args *)data)->channel_sec, "dsl_channel_alias", instance, value); -} - -static int set_DSLChannel_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - return bbf_set_alias(ctx, ((struct dsl_channel_args *)data)->channel_sec, "dsl_channel_alias", instance, value); - -} - -static int get_DSLChannel_Name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = ((struct dsl_channel_args*)data)->id; - return 0; -} - -static int get_DSLChannel_LowerLayers(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - adm_entry_get_reference_param(ctx, "Device.DSL.Line.*.Name", ((struct dsl_line_args *)data)->id, value); - return 0; -} - -static char *get_dsl_link_encapsulation_standard(char *str) -{ - char *dsl_link_encapsulation_standard = ""; - - if(DM_LSTRCMP(str, "adsl2_atm") == 0) - dsl_link_encapsulation_standard = "G.992.3_Annex_K_ATM"; - else if(DM_LSTRCMP(str, "adsl2_ptm") == 0) - dsl_link_encapsulation_standard = "G.992.3_Annex_K_PTM"; - else if(DM_LSTRCMP(str, "vdsl2_atm") == 0) - dsl_link_encapsulation_standard = "G.993.2_Annex_K_ATM"; - else if(DM_LSTRCMP(str, "vdsl2_ptm") == 0) - dsl_link_encapsulation_standard = "G.993.2_Annex_K_PTM"; - else - dsl_link_encapsulation_standard = "G.994.1"; - - return dsl_link_encapsulation_standard; -} - -/*#Device.DSL.Channel.{i}.LinkEncapsulationSupported!UBUS:dsl.channel.1/status//link_encapsulation_supported*/ -static int get_DSLChannel_LinkEncapsulationSupported(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *link_encap,*pch, *spch, *tmp = NULL, *tmpPtr = NULL, *str = NULL; - - *value = "G.994.1"; - link_encap = get_dsl_value_array_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "link_encapsulation_supported"); - if(link_encap[0] == '\0') - return 0; - for (pch = strtok_r(link_encap, ",", &spch); pch != NULL; pch = strtok_r(NULL, ",", &spch)) { - tmp = get_dsl_link_encapsulation_standard(pch); - if(!str) - dmasprintf(&str, "%s", tmp); - else { - tmpPtr = dmstrdup(str); - dmfree(str); - dmasprintf(&str, "%s,%s", tmpPtr, tmp); - dmfree(tmpPtr); - } - } - *value = str; - return 0; -} - -/*#Device.DSL.Channel.{i}.LinkEncapsulationUsed!UBUS:dsl.channel.1/status//link_encapsulation_used*/ -static int get_DSLChannel_LinkEncapsulationUsed(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *link_encapsulation_used = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "link_encapsulation_used"); - *value = (DM_LSTRCMP(link_encapsulation_used, "auto") != 0) ? get_dsl_link_encapsulation_standard(link_encapsulation_used) : "G.993.2_Annex_K_PTM"; - return 0; -} - -/*#Device.DSL.Channel.{i}.LPATH!UBUS:dsl.channel.1/status//lpath*/ -static int get_DSLChannel_LPATH(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "lpath"); - return 0; -} - -/*#Device.DSL.Channel.{i}.INTLVDEPTH!UBUS:dsl.channel.1/status//intlvdepth*/ -static int get_DSLChannel_INTLVDEPTH(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "intlvdepth"); - return 0; -} - -/*#Device.DSL.Channel.{i}.INTLVBLOCK!UBUS:dsl.channel.1/status//intlvblock*/ -static int get_DSLChannel_INTLVBLOCK(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "intlvblock"); - return 0; -} - -/*#Device.DSL.Channel.{i}.ActualInterleavingDelay!UBUS:dsl.channel.1/status//actual_interleaving_delay*/ -static int get_DSLChannel_ActualInterleavingDelay(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "actual_interleaving_delay"); - return 0; -} - -/*#Device.DSL.Channel.{i}.ACTINP!UBUS:dsl.channel.1/status//actinp*/ -static int get_DSLChannel_ACTINP(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "actinp"); - return 0; -} - -/*#Device.DSL.Channel.{i}.INPREPORT!UBUS:dsl.channel.1/status//inpreport*/ -static int get_DSLChannel_INPREPORT(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "inpreport"); - return 0; -} - -/*#Device.DSL.Channel.{i}.NFEC!UBUS:dsl.channel.1/status//nfec*/ -static int get_DSLChannel_NFEC(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "nfec"); - return 0; -} - -/*#Device.DSL.Channel.{i}.RFEC!UBUS:dsl.channel.1/status//rfec*/ -static int get_DSLChannel_RFEC(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "rfec"); - return 0; -} - -/*#Device.DSL.Channel.{i}.LSYMB!UBUS:dsl.channel.1/status//lsymb*/ -static int get_DSLChannel_LSYMB(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "lsymb"); - return 0; -} - -/*#Device.DSL.Channel.{i}.UpstreamCurrRate!UBUS:dsl.channel.1/status//curr_rate.us*/ -static int get_DSLChannel_UpstreamCurrRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "curr_rate", "us"); - return 0; -} - -/*#Device.DSL.Channel.{i}.DownstreamCurrRate!UBUS:dsl.channel.1/status//curr_rate.ds*/ -static int get_DSLChannel_DownstreamCurrRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "curr_rate", "ds"); - return 0; -} - -/*#Device.DSL.Channel.{i}.ACTNDR!UBUS:dsl.channel.1/status//actndr.ds*/ -static int get_DSLChannel_ACTNDR(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "actndr", "ds"); - return 0; -} - -/*#Device.DSL.Channel.{i}.ACTINPREIN!UBUS:dsl.channel.1/status//actinprein.ds*/ -static int get_DSLChannel_ACTINPREIN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument_and_with_two_key("dsl.channel", ((struct dsl_channel_args*)data)->id, "status", "actinprein", "ds"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.BytesSent!UBUS:dsl.channel.1/stats//bytes_sent*/ -static int get_DSLChannelStats_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "bytes_sent"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.BytesReceived!UBUS:dsl.channel.1/stats//bytes_received*/ -static int get_DSLChannelStats_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "bytes_received"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.PacketsSent!UBUS:dsl.channel.1/stats//packets_sent*/ -static int get_DSLChannelStats_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "packets_sent"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.PacketsReceived!UBUS:dsl.channel.1/stats//packets_received*/ -static int get_DSLChannelStats_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "packets_received"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.ErrorsSent!UBUS:dsl.channel.1/stats//errors_sent*/ -static int get_DSLChannelStats_ErrorsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "errors_sent"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.ErrorsReceived!UBUS:dsl.channel.1/stats//errors_received*/ -static int get_DSLChannelStats_ErrorsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "errors_received"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.DiscardPacketsSent!UBUS:dsl.channel.1/stats//discard_packets_sent*/ -static int get_DSLChannelStats_DiscardPacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "discard_packets_sent"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.DiscardPacketsReceived!UBUS:dsl.channel.1/stats//discard_packets_received*/ -static int get_DSLChannelStats_DiscardPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "discard_packets_received"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.TotalStart!UBUS:dsl.channel.1/stats//total_start*/ -static int get_DSLChannelStats_TotalStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "total_start"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.ShowtimeStart(!UBUS:dsl.channel.1/stats//showtime_start*/ -static int get_DSLChannelStats_ShowtimeStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "showtime_start"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.LastShowtimeStart!UBUS:dsl.channel.1/stats//last_showtime_start*/ -static int get_DSLChannelStats_LastShowtimeStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "last_showtime_start"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.CurrentDayStart!UBUS:dsl.channel.1/stats//current_day_start*/ -static int get_DSLChannelStats_CurrentDayStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "current_day_start"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.QuarterHourStart!UBUS:dsl.channel.1/stats//quarter_hour_start*/ -static int get_DSLChannelStats_QuarterHourStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_dsl_value_without_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "quarter_hour_start"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.Total.XTURFECErrors!UBUS:dsl.channel.1/stats//total.xtur_fec_errors*/ -static int get_DSLChannelStatsTotal_XTURFECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "total", "xtur_fec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.Total.XTUCFECErrors!UBUS:dsl.channel.1/stats//total.xtur_fec_errors*/ -static int get_DSLChannelStatsTotal_XTUCFECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "total", "xtuc_fec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.Total.XTURHECErrors!UBUS:dsl.channel.1/stats//total.xtur_fec_errors*/ -static int get_DSLChannelStatsTotal_XTURHECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "total", "xtur_hec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.Total.XTUCHECErrors!UBUS:dsl.channel.1/stats//total.xtur_fec_errors*/ -static int get_DSLChannelStatsTotal_XTUCHECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "total", "xtuc_hec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.Total.XTURCRCErrors!UBUS:dsl.channel.1/stats//total.xtur_fec_errors*/ -static int get_DSLChannelStatsTotal_XTURCRCErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "total", "xtur_crc_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.Total.XTUCCRCErrors!UBUS:dsl.channel.1/stats//total.xtur_fec_errors*/ -static int get_DSLChannelStatsTotal_XTUCCRCErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "total", "xtuc_crc_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.Showtime.XTURFECErrors!UBUS:dsl.channel.1/stats//showtime.xtur_fec_errors*/ -static int get_DSLChannelStatsShowtime_XTURFECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "showtime", "xtur_fec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.Showtime.XTUCFECErrors!UBUS:dsl.channel.1/stats//showtime.xtuc_fec_errors*/ -static int get_DSLChannelStatsShowtime_XTUCFECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "showtime", "xtuc_fec_errors"); - return 0;} - -/*#Device.DSL.Channel.{i}.Stats.Showtime.XTURHECErrors!UBUS:dsl.channel.1/stats//showtime.xtur_hec_errors*/ -static int get_DSLChannelStatsShowtime_XTURHECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "showtime", "xtur_hec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.Showtime.XTUCHECErrors!UBUS:dsl.channel.1/stats//showtime.xtuc_hec_errors*/ -static int get_DSLChannelStatsShowtime_XTUCHECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "showtime", "xtuc_hec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.Showtime.XTURCRCErrors!UBUS:dsl.channel.1/stats//showtime.xtur_crc_errors*/ -static int get_DSLChannelStatsShowtime_XTURCRCErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "showtime", "xtur_crc_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.Showtime.XTUCCRCErrors!UBUS:dsl.channel.1/stats//showtime.xtuc_crc_errors*/ -static int get_DSLChannelStatsShowtime_XTUCCRCErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "showtime", "xtuc_crc_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.LastShowtime.XTURFECErrors!UBUS:dsl.channel.1/stats//lastshowtime.xtur_fec_errors*/ -static int get_DSLChannelStatsLastShowtime_XTURFECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "lastshowtime", "xtur_fec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.LastShowtime.XTUCFECErrors!UBUS:dsl.channel.1/stats//lastshowtime.xtuc_fec_errors*/ -static int get_DSLChannelStatsLastShowtime_XTUCFECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "lastshowtime", "xtuc_fec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.LastShowtime.XTURHECErrors!UBUS:dsl.channel.1/stats//lastshowtime.xtur_hec_errors*/ -static int get_DSLChannelStatsLastShowtime_XTURHECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "lastshowtime", "xtur_hec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.LastShowtime.XTUCHECErrors!UBUS:dsl.channel.1/stats//lastshowtime.xtuc_hec_errors*/ -static int get_DSLChannelStatsLastShowtime_XTUCHECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "lastshowtime", "xtuc_hec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.LastShowtime.XTURCRCErrors!UBUS:dsl.channel.1/stats//lastshowtime.xtur_crc_errors*/ -static int get_DSLChannelStatsLastShowtime_XTURCRCErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "lastshowtime", "xtur_crc_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.LastShowtime.XTUCCRCErrors!UBUS:dsl.channel.1/stats//lastshowtime.xtuc_crc_errors*/ -static int get_DSLChannelStatsLastShowtime_XTUCCRCErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "lastshowtime", "xtuc_crc_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.CurrentDay.XTURFECErrors!UBUS:dsl.channel.1/stats//currentday.xtur_fec_errors*/ -static int get_DSLChannelStatsCurrentDay_XTURFECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "currentday", "xtur_fec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.CurrentDay.XTUCFECErrors!UBUS:dsl.channel.1/stats//currentday.xtuc_fec_errors*/ -static int get_DSLChannelStatsCurrentDay_XTUCFECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "currentday", "xtuc_fec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.CurrentDay.XTURHECErrors!UBUS:dsl.channel.1/stats//currentday.xtur_hec_errors*/ -static int get_DSLChannelStatsCurrentDay_XTURHECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "currentday", "xtur_hec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.CurrentDay.XTUCHECErrors!UBUS:dsl.channel.1/stats//currentday.xtuc_hec_errors*/ -static int get_DSLChannelStatsCurrentDay_XTUCHECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "currentday", "xtuc_hec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.CurrentDay.XTURCRCErrors!UBUS:dsl.channel.1/stats//currentday.xtur_crc_errors*/ -static int get_DSLChannelStatsCurrentDay_XTURCRCErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "currentday", "xtur_crc_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.CurrentDay.XTUCCRCErrors!UBUS:dsl.channel.1/stats//currentday.xtuc_crc_errors*/ -static int get_DSLChannelStatsCurrentDay_XTUCCRCErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "currentday", "xtuc_crc_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.QuarterHour.XTURFECErrors!UBUS:dsl.channel.1/stats//quarterhour.xtur_fec_errors*/ -static int get_DSLChannelStatsQuarterHour_XTURFECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "quarterhour", "xtur_fec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.QuarterHour.XTUCFECErrors!UBUS:dsl.channel.1/stats//quarterhour.xtuc_fec_errors*/ -static int get_DSLChannelStatsQuarterHour_XTUCFECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "quarterhour", "xtuc_fec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.QuarterHour.XTURHECErrors!UBUS:dsl.channel.1/stats//quarterhour.xtur_hec_errors*/ -static int get_DSLChannelStatsQuarterHour_XTURHECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "quarterhour", "xtur_hec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.QuarterHour.XTUCHECErrors!UBUS:dsl.channel.1/stats//quarterhour.xtuc_hec_errors*/ -static int get_DSLChannelStatsQuarterHour_XTUCHECErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "quarterhour", "xtuc_hec_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.QuarterHour.XTURCRCErrors!UBUS:dsl.channel.1/stats//quarterhour.xtur_crc_errors*/ -static int get_DSLChannelStatsQuarterHour_XTURCRCErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "quarterhour", "xtur_crc_errors"); - return 0; -} - -/*#Device.DSL.Channel.{i}.Stats.QuarterHour.XTUCCRCErrors!UBUS:dsl.channel.1/stats//quarterhour.xtuc_crc_errors*/ -static int get_DSLChannelStatsQuarterHour_XTUCCRCErrors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("dsl.channel", ((struct dsl_channel_args*)data)->id, "stats", "quarterhour", "xtuc_crc_errors"); - return 0; -} - -/********************************************************************************************************************************** -* OBJ & LEAF DEFINITION -***********************************************************************************************************************************/ -/* *** Device.DSL. *** */ -DMOBJ tDSLObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys, version*/ -{"Line", &DMREAD, NULL, NULL, NULL, browseDSLLineInst, NULL, NULL, tDSLLineObj, tDSLLineParams, NULL, BBFDM_BOTH, NULL}, -{"Channel", &DMREAD, NULL, NULL, NULL, browseDSLChannelInst, NULL, NULL, tDSLChannelObj, tDSLChannelParams, NULL, BBFDM_BOTH, NULL}, -{0} -}; - -DMLEAF tDSLParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"LineNumberOfEntries", &DMREAD, DMT_UNINT, get_DSL_LineNumberOfEntries, NULL, BBFDM_BOTH}, -{"ChannelNumberOfEntries", &DMREAD, DMT_UNINT, get_DSL_ChannelNumberOfEntries, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Line.{i}. *** */ -DMOBJ tDSLLineObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys, version*/ -{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsObj, tDSLLineStatsParams, NULL, BBFDM_BOTH, NULL}, -{0} -}; - -DMLEAF tDSLLineParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"Enable", &DMWRITE, DMT_BOOL, get_DSLLine_Enable, set_DSLLine_Enable, BBFDM_BOTH}, -{"Status", &DMREAD, DMT_STRING, get_DSLLine_Status, NULL, BBFDM_BOTH}, -{"Alias", &DMWRITE, DMT_STRING, get_DSLLine_Alias, set_DSLLine_Alias, BBFDM_BOTH, DM_FLAG_UNIQUE}, -{"Name", &DMREAD, DMT_STRING, get_DSLLine_Name, NULL, BBFDM_BOTH, DM_FLAG_UNIQUE}, -{"LowerLayers", &DMWRITE, DMT_STRING, get_DSLLine_LowerLayers, set_DSLLine_LowerLayers, BBFDM_BOTH}, -{"Upstream", &DMREAD, DMT_BOOL, get_DSLLine_Upstream, NULL, BBFDM_BOTH}, -{"FirmwareVersion", &DMREAD, DMT_STRING, get_DSLLine_FirmwareVersion, NULL, BBFDM_BOTH}, -{"LinkStatus", &DMREAD, DMT_STRING, get_DSLLine_LinkStatus, NULL, BBFDM_BOTH}, -{"StandardsSupported", &DMREAD, DMT_STRING, get_DSLLine_StandardsSupported, NULL, BBFDM_BOTH}, -{"XTSE", &DMREAD, DMT_HEXBIN, get_DSLLine_XTSE, NULL, BBFDM_BOTH}, -{"StandardUsed", &DMREAD, DMT_STRING, get_DSLLine_StandardUsed, NULL, BBFDM_BOTH}, -{"XTSUsed", &DMREAD, DMT_HEXBIN, get_DSLLine_XTSUsed, NULL, BBFDM_BOTH}, -{"LineEncoding", &DMREAD, DMT_STRING, get_DSLLine_LineEncoding, NULL, BBFDM_BOTH}, -{"AllowedProfiles", &DMREAD, DMT_STRING, get_DSLLine_AllowedProfiles, NULL, BBFDM_BOTH}, -{"CurrentProfile", &DMREAD, DMT_STRING, get_DSLLine_CurrentProfile, NULL, BBFDM_BOTH}, -{"PowerManagementState", &DMREAD, DMT_STRING, get_DSLLine_PowerManagementState, NULL, BBFDM_BOTH}, -{"SuccessFailureCause", &DMREAD, DMT_UNINT, get_DSLLine_SuccessFailureCause, NULL, BBFDM_BOTH}, -{"UPBOKLERPb", &DMREAD, DMT_STRING, get_DSLLine_UPBOKLERPb, NULL, BBFDM_BOTH}, -{"RXTHRSHds", &DMREAD, DMT_INT, get_DSLLine_RXTHRSHds, NULL, BBFDM_BOTH}, -{"ACTRAMODEds", &DMREAD, DMT_UNINT, get_DSLLine_ACTRAMODEds, NULL, BBFDM_BOTH}, -{"ACTRAMODEus", &DMREAD, DMT_UNINT, get_DSLLine_ACTRAMODEus, NULL, BBFDM_BOTH}, -{"SNRMROCus", &DMREAD, DMT_UNINT, get_DSLLine_SNRMROCus, NULL, BBFDM_BOTH}, -{"LastStateTransmittedDownstream", &DMREAD, DMT_UNINT, get_DSLLine_LastStateTransmittedDownstream, NULL, BBFDM_BOTH}, -{"LastStateTransmittedUpstream", &DMREAD, DMT_UNINT, get_DSLLine_LastStateTransmittedUpstream, NULL, BBFDM_BOTH}, -{"US0MASK", &DMREAD, DMT_UNINT, get_DSLLine_US0MASK, NULL, BBFDM_BOTH}, -{"TRELLISds", &DMREAD, DMT_INT, get_DSLLine_TRELLISds, NULL, BBFDM_BOTH}, -{"TRELLISus", &DMREAD, DMT_INT, get_DSLLine_TRELLISus, NULL, BBFDM_BOTH}, -{"ACTSNRMODEds", &DMREAD, DMT_UNINT, get_DSLLine_ACTSNRMODEds, NULL, BBFDM_BOTH}, -{"ACTSNRMODEus", &DMREAD, DMT_UNINT, get_DSLLine_ACTSNRMODEus, NULL, BBFDM_BOTH}, -{"LineNumber", &DMREAD, DMT_INT, get_DSLLine_LineNumber, NULL, BBFDM_BOTH}, -{"UpstreamMaxBitRate", &DMREAD, DMT_UNINT, get_DSLLine_UpstreamMaxBitRate, NULL, BBFDM_BOTH}, -{"DownstreamMaxBitRate", &DMREAD, DMT_UNINT, get_DSLLine_DownstreamMaxBitRate, NULL, BBFDM_BOTH}, -{"UpstreamNoiseMargin", &DMREAD, DMT_INT, get_DSLLine_UpstreamNoiseMargin, NULL, BBFDM_BOTH}, -{"DownstreamNoiseMargin", &DMREAD, DMT_INT, get_DSLLine_DownstreamNoiseMargin, NULL, BBFDM_BOTH}, -{"SNRMpbus", &DMREAD, DMT_STRING, get_DSLLine_SNRMpbus, NULL, BBFDM_BOTH}, -{"SNRMpbds", &DMREAD, DMT_STRING, get_DSLLine_SNRMpbds, NULL, BBFDM_BOTH}, -{"UpstreamAttenuation", &DMREAD, DMT_INT, get_DSLLine_UpstreamAttenuation, NULL, BBFDM_BOTH}, -{"DownstreamAttenuation", &DMREAD, DMT_INT, get_DSLLine_DownstreamAttenuation, NULL, BBFDM_BOTH}, -{"UpstreamPower", &DMREAD, DMT_INT, get_DSLLine_UpstreamPower, NULL, BBFDM_BOTH}, -{"DownstreamPower", &DMREAD, DMT_INT, get_DSLLine_DownstreamPower, NULL, BBFDM_BOTH}, -{"XTURVendor", &DMREAD, DMT_HEXBIN, get_DSLLine_XTURVendor, NULL, BBFDM_BOTH}, -{"XTURCountry", &DMREAD, DMT_HEXBIN, get_DSLLine_XTURCountry, NULL, BBFDM_BOTH}, -{"XTURANSIStd", &DMREAD, DMT_UNINT, get_DSLLine_XTURANSIStd, NULL, BBFDM_BOTH}, -{"XTURANSIRev", &DMREAD, DMT_UNINT, get_DSLLine_XTURANSIRev, NULL, BBFDM_BOTH}, -{"XTUCVendor", &DMREAD, DMT_HEXBIN, get_DSLLine_XTUCVendor, NULL, BBFDM_BOTH}, -{"XTUCCountry", &DMREAD, DMT_HEXBIN, get_DSLLine_XTUCCountry, NULL, BBFDM_BOTH}, -{"XTUCANSIStd", &DMREAD, DMT_UNINT, get_DSLLine_XTUCANSIStd, NULL, BBFDM_BOTH}, -{"XTUCANSIRev", &DMREAD, DMT_UNINT, get_DSLLine_XTUCANSIRev, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Line.{i}.Stats. *** */ -DMOBJ tDSLLineStatsObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys, version*/ -{"Total", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsTotalParams, NULL, BBFDM_BOTH, NULL}, -{"Showtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsShowtimeParams, NULL, BBFDM_BOTH, NULL}, -{"LastShowtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsLastShowtimeParams, NULL, BBFDM_BOTH, NULL}, -{"CurrentDay", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsCurrentDayParams, NULL, BBFDM_BOTH, NULL}, -{"QuarterHour", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsQuarterHourParams, NULL, BBFDM_BOTH, NULL}, -{0} -}; - -DMLEAF tDSLLineStatsParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"BytesSent", &DMREAD, DMT_UNLONG, get_DSLLineStats_BytesSent, NULL, BBFDM_BOTH}, -{"BytesReceived", &DMREAD, DMT_UNLONG, get_DSLLineStats_BytesReceived, NULL, BBFDM_BOTH}, -{"PacketsSent", &DMREAD, DMT_UNLONG, get_DSLLineStats_PacketsSent, NULL, BBFDM_BOTH}, -{"PacketsReceived", &DMREAD, DMT_UNLONG, get_DSLLineStats_PacketsReceived, NULL, BBFDM_BOTH}, -{"ErrorsSent", &DMREAD, DMT_UNINT, get_DSLLineStats_ErrorsSent, NULL, BBFDM_BOTH}, -{"ErrorsReceived", &DMREAD, DMT_UNINT, get_DSLLineStats_ErrorsReceived, NULL, BBFDM_BOTH}, -{"DiscardPacketsSent", &DMREAD, DMT_UNINT, get_DSLLineStats_DiscardPacketsSent, NULL, BBFDM_BOTH}, -{"DiscardPacketsReceived", &DMREAD, DMT_UNINT, get_DSLLineStats_DiscardPacketsReceived, NULL, BBFDM_BOTH}, -{"TotalStart", &DMREAD, DMT_UNINT, get_DSLLineStats_TotalStart, NULL, BBFDM_BOTH}, -{"ShowtimeStart", &DMREAD, DMT_UNINT, get_DSLLineStats_ShowtimeStart, NULL, BBFDM_BOTH}, -{"LastShowtimeStart", &DMREAD, DMT_UNINT, get_DSLLineStats_LastShowtimeStart, NULL, BBFDM_BOTH}, -{"CurrentDayStart", &DMREAD, DMT_UNINT, get_DSLLineStats_CurrentDayStart, NULL, BBFDM_BOTH}, -{"QuarterHourStart", &DMREAD, DMT_UNINT, get_DSLLineStats_QuarterHourStart, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Line.{i}.Stats.Total. *** */ -DMLEAF tDSLLineStatsTotalParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"ErroredSecs", &DMREAD, DMT_UNINT, get_DSLLineStatsTotal_ErroredSecs, NULL, BBFDM_BOTH}, -{"SeverelyErroredSecs", &DMREAD, DMT_UNINT, get_DSLLineStatsTotal_SeverelyErroredSecs, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Line.{i}.Stats.Showtime. *** */ -DMLEAF tDSLLineStatsShowtimeParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"ErroredSecs", &DMREAD, DMT_UNINT, get_DSLLineStatsShowtime_ErroredSecs, NULL, BBFDM_BOTH}, -{"SeverelyErroredSecs", &DMREAD, DMT_UNINT, get_DSLLineStatsShowtime_SeverelyErroredSecs, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Line.{i}.Stats.LastShowtime. *** */ -DMLEAF tDSLLineStatsLastShowtimeParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"ErroredSecs", &DMREAD, DMT_UNINT, get_DSLLineStatsLastShowtime_ErroredSecs, NULL, BBFDM_BOTH}, -{"SeverelyErroredSecs", &DMREAD, DMT_UNINT, get_DSLLineStatsLastShowtime_SeverelyErroredSecs, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Line.{i}.Stats.CurrentDay. *** */ -DMLEAF tDSLLineStatsCurrentDayParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"ErroredSecs", &DMREAD, DMT_UNINT, get_DSLLineStatsCurrentDay_ErroredSecs, NULL, BBFDM_BOTH}, -{"SeverelyErroredSecs", &DMREAD, DMT_UNINT, get_DSLLineStatsCurrentDay_SeverelyErroredSecs, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Line.{i}.Stats.QuarterHour. *** */ -DMLEAF tDSLLineStatsQuarterHourParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"ErroredSecs", &DMREAD, DMT_UNINT, get_DSLLineStatsQuarterHour_ErroredSecs, NULL, BBFDM_BOTH}, -{"SeverelyErroredSecs", &DMREAD, DMT_UNINT, get_DSLLineStatsQuarterHour_SeverelyErroredSecs, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Channel.{i}. *** */ -DMOBJ tDSLChannelObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys, version*/ -{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsObj, tDSLChannelStatsParams, NULL, BBFDM_BOTH, NULL}, -{0} -}; - - -DMLEAF tDSLChannelParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"Enable", &DMWRITE, DMT_BOOL, get_DSLChannel_Enable, set_DSLChannel_Enable, BBFDM_BOTH}, -{"Status", &DMREAD, DMT_STRING, get_DSLChannel_Status, NULL, BBFDM_BOTH}, -{"Alias", &DMWRITE, DMT_STRING, get_DSLChannel_Alias, set_DSLChannel_Alias, BBFDM_BOTH, DM_FLAG_UNIQUE}, -{"Name", &DMREAD, DMT_STRING, get_DSLChannel_Name, NULL, BBFDM_BOTH, DM_FLAG_UNIQUE}, -{"LowerLayers", &DMREAD, DMT_STRING, get_DSLChannel_LowerLayers, NULL, BBFDM_BOTH, DM_FLAG_REFERENCE}, -{"LinkEncapsulationSupported", &DMREAD, DMT_STRING, get_DSLChannel_LinkEncapsulationSupported, NULL, BBFDM_BOTH}, -{"LinkEncapsulationUsed", &DMREAD, DMT_STRING, get_DSLChannel_LinkEncapsulationUsed, NULL, BBFDM_BOTH}, -{"LPATH", &DMREAD, DMT_UNINT, get_DSLChannel_LPATH, NULL, BBFDM_BOTH}, -{"INTLVDEPTH", &DMREAD, DMT_UNINT, get_DSLChannel_INTLVDEPTH, NULL, BBFDM_BOTH}, -{"INTLVBLOCK", &DMREAD, DMT_INT, get_DSLChannel_INTLVBLOCK, NULL, BBFDM_BOTH}, -{"ActualInterleavingDelay", &DMREAD, DMT_UNINT, get_DSLChannel_ActualInterleavingDelay, NULL, BBFDM_BOTH}, -{"ACTINP", &DMREAD, DMT_INT, get_DSLChannel_ACTINP, NULL, BBFDM_BOTH}, -{"INPREPORT", &DMREAD, DMT_BOOL, get_DSLChannel_INPREPORT, NULL, BBFDM_BOTH}, -{"NFEC", &DMREAD, DMT_INT, get_DSLChannel_NFEC, NULL, BBFDM_BOTH}, -{"RFEC", &DMREAD, DMT_INT, get_DSLChannel_RFEC, NULL, BBFDM_BOTH}, -{"LSYMB", &DMREAD, DMT_INT, get_DSLChannel_LSYMB, NULL, BBFDM_BOTH}, -{"UpstreamCurrRate", &DMREAD, DMT_UNINT, get_DSLChannel_UpstreamCurrRate, NULL, BBFDM_BOTH}, -{"DownstreamCurrRate", &DMREAD, DMT_UNINT, get_DSLChannel_DownstreamCurrRate, NULL, BBFDM_BOTH}, -{"ACTNDR", &DMREAD, DMT_UNINT, get_DSLChannel_ACTNDR, NULL, BBFDM_BOTH}, -{"ACTINPREIN", &DMREAD, DMT_UNINT, get_DSLChannel_ACTINPREIN, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Channel.{i}.Stats. *** */ -DMOBJ tDSLChannelStatsObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys, version*/ -{"Total", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsTotalParams, NULL, BBFDM_BOTH, NULL}, -{"Showtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsShowtimeParams, NULL, BBFDM_BOTH, NULL}, -{"LastShowtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsLastShowtimeParams, NULL, BBFDM_BOTH, NULL}, -{"CurrentDay", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsCurrentDayParams, NULL, BBFDM_BOTH, NULL}, -{"QuarterHour", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsQuarterHourParams, NULL, BBFDM_BOTH, NULL}, -{0} -}; - -DMLEAF tDSLChannelStatsParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"BytesSent", &DMREAD, DMT_UNLONG, get_DSLChannelStats_BytesSent, NULL, BBFDM_BOTH}, -{"BytesReceived", &DMREAD, DMT_UNLONG, get_DSLChannelStats_BytesReceived, NULL, BBFDM_BOTH}, -{"PacketsSent", &DMREAD, DMT_UNLONG, get_DSLChannelStats_PacketsSent, NULL, BBFDM_BOTH}, -{"PacketsReceived", &DMREAD, DMT_UNLONG, get_DSLChannelStats_PacketsReceived, NULL, BBFDM_BOTH}, -{"ErrorsSent", &DMREAD, DMT_UNINT, get_DSLChannelStats_ErrorsSent, NULL, BBFDM_BOTH}, -{"ErrorsReceived", &DMREAD, DMT_UNINT, get_DSLChannelStats_ErrorsReceived, NULL, BBFDM_BOTH}, -{"DiscardPacketsSent", &DMREAD, DMT_UNINT, get_DSLChannelStats_DiscardPacketsSent, NULL, BBFDM_BOTH}, -{"DiscardPacketsReceived", &DMREAD, DMT_UNINT, get_DSLChannelStats_DiscardPacketsReceived, NULL, BBFDM_BOTH}, -{"TotalStart", &DMREAD, DMT_UNINT, get_DSLChannelStats_TotalStart, NULL, BBFDM_BOTH}, -{"ShowtimeStart", &DMREAD, DMT_UNINT, get_DSLChannelStats_ShowtimeStart, NULL, BBFDM_BOTH}, -{"LastShowtimeStart", &DMREAD, DMT_UNINT, get_DSLChannelStats_LastShowtimeStart, NULL, BBFDM_BOTH}, -{"CurrentDayStart", &DMREAD, DMT_UNINT, get_DSLChannelStats_CurrentDayStart, NULL, BBFDM_BOTH}, -{"QuarterHourStart", &DMREAD, DMT_UNINT, get_DSLChannelStats_QuarterHourStart, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Channel.{i}.Stats.Total. *** */ -DMLEAF tDSLChannelStatsTotalParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"XTURFECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsTotal_XTURFECErrors, NULL, BBFDM_BOTH}, -{"XTUCFECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsTotal_XTUCFECErrors, NULL, BBFDM_BOTH}, -{"XTURHECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsTotal_XTURHECErrors, NULL, BBFDM_BOTH}, -{"XTUCHECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsTotal_XTUCHECErrors, NULL, BBFDM_BOTH}, -{"XTURCRCErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsTotal_XTURCRCErrors, NULL, BBFDM_BOTH}, -{"XTUCCRCErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsTotal_XTUCCRCErrors, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Channel.{i}.Stats.Showtime. *** */ -DMLEAF tDSLChannelStatsShowtimeParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"XTURFECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsShowtime_XTURFECErrors, NULL, BBFDM_BOTH}, -{"XTUCFECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsShowtime_XTUCFECErrors, NULL, BBFDM_BOTH}, -{"XTURHECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsShowtime_XTURHECErrors, NULL, BBFDM_BOTH}, -{"XTUCHECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsShowtime_XTUCHECErrors, NULL, BBFDM_BOTH}, -{"XTURCRCErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsShowtime_XTURCRCErrors, NULL, BBFDM_BOTH}, -{"XTUCCRCErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsShowtime_XTUCCRCErrors, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Channel.{i}.Stats.LastShowtime. *** */ -DMLEAF tDSLChannelStatsLastShowtimeParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"XTURFECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsLastShowtime_XTURFECErrors, NULL, BBFDM_BOTH}, -{"XTUCFECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsLastShowtime_XTUCFECErrors, NULL, BBFDM_BOTH}, -{"XTURHECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsLastShowtime_XTURHECErrors, NULL, BBFDM_BOTH}, -{"XTUCHECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsLastShowtime_XTUCHECErrors, NULL, BBFDM_BOTH}, -{"XTURCRCErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsLastShowtime_XTURCRCErrors, NULL, BBFDM_BOTH}, -{"XTUCCRCErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsLastShowtime_XTUCCRCErrors, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Channel.{i}.Stats.CurrentDay. *** */ -DMLEAF tDSLChannelStatsCurrentDayParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"XTURFECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsCurrentDay_XTURFECErrors, NULL, BBFDM_BOTH}, -{"XTUCFECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsCurrentDay_XTUCFECErrors, NULL, BBFDM_BOTH}, -{"XTURHECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsCurrentDay_XTURHECErrors, NULL, BBFDM_BOTH}, -{"XTUCHECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsCurrentDay_XTUCHECErrors, NULL, BBFDM_BOTH}, -{"XTURCRCErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsCurrentDay_XTURCRCErrors, NULL, BBFDM_BOTH}, -{"XTUCCRCErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsCurrentDay_XTUCCRCErrors, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DSL.Channel.{i}.Stats.QuarterHour. *** */ -DMLEAF tDSLChannelStatsQuarterHourParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"XTURFECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsQuarterHour_XTURFECErrors, NULL, BBFDM_BOTH}, -{"XTUCFECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsQuarterHour_XTUCFECErrors, NULL, BBFDM_BOTH}, -{"XTURHECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsQuarterHour_XTURHECErrors, NULL, BBFDM_BOTH}, -{"XTUCHECErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsQuarterHour_XTUCHECErrors, NULL, BBFDM_BOTH}, -{"XTURCRCErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsQuarterHour_XTURCRCErrors, NULL, BBFDM_BOTH}, -{"XTUCCRCErrors", &DMREAD, DMT_UNINT, get_DSLChannelStatsQuarterHour_XTUCCRCErrors, NULL, BBFDM_BOTH}, -{0} -}; diff --git a/libbbfdm/dmtree/tr181/dsl.h b/libbbfdm/dmtree/tr181/dsl.h deleted file mode 100644 index 9c7ca331..00000000 --- a/libbbfdm/dmtree/tr181/dsl.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2019 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: AMIN Ben Ramdhane - */ - -#ifndef __DSL_H -#define __DSL_H - -#include "libbbfdm-api/dmcommon.h" - -extern DMOBJ tDSLObj[]; -extern DMLEAF tDSLParams[]; -extern DMOBJ tDSLLineObj[]; -extern DMLEAF tDSLLineParams[]; -extern DMOBJ tDSLLineStatsObj[]; -extern DMLEAF tDSLLineStatsParams[]; -extern DMLEAF tDSLLineStatsTotalParams[]; -extern DMLEAF tDSLLineStatsShowtimeParams[]; -extern DMLEAF tDSLLineStatsLastShowtimeParams[]; -extern DMLEAF tDSLLineStatsCurrentDayParams[]; -extern DMLEAF tDSLLineStatsQuarterHourParams[]; -extern DMOBJ tDSLChannelObj[]; -extern DMLEAF tDSLChannelParams[]; -extern DMOBJ tDSLChannelStatsObj[]; -extern DMLEAF tDSLChannelStatsParams[]; -extern DMLEAF tDSLChannelStatsTotalParams[]; -extern DMLEAF tDSLChannelStatsShowtimeParams[]; -extern DMLEAF tDSLChannelStatsLastShowtimeParams[]; -extern DMLEAF tDSLChannelStatsCurrentDayParams[]; -extern DMLEAF tDSLChannelStatsQuarterHourParams[]; - -char *get_value_with_argument(char *command1, char *id, char *command2, char *argument, char *key); -int get_line_linkstatus(char *method, char *id, char **value); - -#endif //__DSL_H diff --git a/libbbfdm/dmtree/tr181/fast.c b/libbbfdm/dmtree/tr181/fast.c deleted file mode 100644 index 279446c0..00000000 --- a/libbbfdm/dmtree/tr181/fast.c +++ /dev/null @@ -1,1041 +0,0 @@ -/* - * Copyright (C) 2020 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: Jani Juvan - */ - -#include "dsl.h" -#include "fast.h" - -struct fast_line_args -{ - struct uci_section *line_sec; - char *id; -}; - -/************************************************************************** -* INIT -***************************************************************************/ -static inline int init_fast_line(struct fast_line_args *args, struct uci_section *s) -{ - args->line_sec = s; - return 0; -} - -/*************************************************************/ -static struct uci_section *update_create_dmmap_fast_line(char *curr_id) -{ - struct uci_section *s = NULL; - - uci_path_foreach_option_eq(bbfdm, "dmmap", "fast_line", "id", curr_id, s) { - return s; - } - if (!s) { - char instance[16]; - - snprintf(instance, sizeof(instance), "%ld", DM_STRTOL(curr_id)); - dmuci_add_section_bbfdm("dmmap", "fast_line", &s); - dmuci_set_value_by_section_bbfdm(s, "id", curr_id); - dmuci_set_value_by_section_bbfdm(s, "fast_line_instance", instance); - } - return s; -} - -/************************************************************* -* ENTRY METHOD -*************************************************************/ -static int browseFASTLineInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) -{ - json_object *res = NULL, *line_obj = NULL; - struct fast_line_args cur_fast_line_args = {0}; - struct uci_section *s = NULL; - char *inst = NULL; - int entries = 0; - - dmubus_call("fast", "status", UBUS_ARGS{0}, 0, &res); - while (res) { - line_obj = dmjson_select_obj_in_array_idx(res, entries, 1, "line"); - if(line_obj) { - cur_fast_line_args.id = dmjson_get_value(line_obj, 1, "id"); - entries++; - s = update_create_dmmap_fast_line(cur_fast_line_args.id); - init_fast_line(&cur_fast_line_args, s); - - inst = handle_instance(dmctx, parent_node, s, "fast_line_instance", "fast_line_alias"); - - if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&cur_fast_line_args, inst) == DM_STOP) - break; - } - else - break; - } - return 0; -} - -/************************************************************************** -* COMMON FUNCTIONS -***************************************************************************/ -static char *get_fast_value_without_argument(char *command1, char *id, char *command2, char *key) -{ - json_object *res = NULL; - char command[16], *value = "0"; - - snprintf(command, sizeof(command), "%s.%s", command1, id); - dmubus_call(command, command2, UBUS_ARGS{0}, 0, &res); - if (!res) return ""; - value = dmjson_get_value(res, 1, key); - return value; -} - -static char *get_fast_value_without_argument_and_with_two_key(char *command1, char *id, char *command2, char *key1, char *key2) -{ - json_object *res = NULL; - char command[16], *value = "0"; - - snprintf(command, sizeof(command), "%s.%s", command1, id); - dmubus_call(command, command2, UBUS_ARGS{0}, 0, &res); - if (!res) return ""; - value = dmjson_get_value(res, 2, key1, key2); - return value; -} - -static char *get_fast_value_array_without_argument(char *command1, char *id, char *command2, char *key) -{ - json_object *res = NULL; - char command[16], *value= "0"; - - snprintf(command, sizeof(command), "%s.%s", command1, id); - dmubus_call(command, command2, UBUS_ARGS{0}, 0, &res); - if (!res) return ""; - value = dmjson_get_value_array_all(res, ",", 1, key); - return value; -} - -/************************************************************************** -* GET & SET FAST PARAMETERS -***************************************************************************/ -static int get_FAST_LineNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - int cnt = get_number_of_entries(ctx, data, instance, browseFASTLineInst); - dmasprintf(value, "%d", cnt); - return 0; -} - -/*#Device.FAST.Line.{i}.Enable!UBUS:fast.line.1/status//status*/ -static int get_FASTLine_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *status = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "status", "status"); - *value = (DM_LSTRCMP(status, "up") == 0) ? "1" : "0"; - return 0; -} - -static int set_FASTLine_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - switch (action) { - case VALUECHECK: - if (bbfdm_validate_boolean(ctx, value)) - return FAULT_9007; - break; - case VALUESET: - break; - } - return 0; -} - -/*#Device.FAST.Line.{i}.Status!UBUS:fast.line.1/status//status*/ -static int get_FASTLine_Status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *status = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "status", "status"); - *value = (DM_LSTRCMP(status, "up") == 0) ? "Up" : "Down"; - return 0; -} - -static int get_FASTLine_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return bbf_get_alias(ctx, ((struct fast_line_args *)data)->line_sec, "fast_line_alias", instance, value); -} - -static int set_FASTLine_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - return bbf_set_alias(ctx, ((struct fast_line_args *)data)->line_sec, "fast_line_alias", instance, value); -} - -static int get_FASTLine_Name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = ((struct fast_line_args*)data)->id; - return 0; -} - -static int get_FASTLine_LowerLayers(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = ""; - return 0; -} - -static int set_FASTLine_LowerLayers(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - switch (action) { - case VALUECHECK: - if (bbfdm_validate_string_list(ctx, value, -1, -1, 1024, -1, -1, NULL, NULL)) - return FAULT_9007; - break; - case VALUESET: - break; - } - return 0; -} - -/*#Device.FAST.Line.{i}.Upstream!UBUS:fast.line.1/status//upstream*/ -static int get_FASTLine_Upstream(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "status", "upstream"); - return 0; -} - -/*#Device.FAST.Line.{i}.FirmwareVersion!UBUS:fast.line.1/status//firmware_version*/ -static int get_FASTLine_FirmwareVersion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "status", "firmware_version"); - return 0; -} - -/*#Device.FAST.Line.{i}.LinkStatus!UBUS:fast.line.1/status//link_status*/ -static int get_FASTLine_LinkStatus(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return get_line_linkstatus("fast.line", ((struct fast_line_args*)data)->id, value); -} - -/*#Device.FAST.Line.{i}.AllowedProfiles!UBUS:fast.line.1/status//allowed_profiles*/ -static int get_FASTLine_AllowedProfiles(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - json_object *res = NULL, *allowed_profiles = NULL; - char list_profile[16], ubus_name[16], *profile = NULL; - unsigned pos = 0, idx = 0; - - snprintf(ubus_name, sizeof(ubus_name), "fast.line.%s", ((struct fast_line_args*)data)->id); - dmubus_call(ubus_name, "status", UBUS_ARGS{0}, 0, &res); - DM_ASSERT(res, *value = ""); - - list_profile[0] = 0; - dmjson_foreach_value_in_array(res, allowed_profiles, profile, idx, 1, "allowed_profiles") { - if (profile && (DM_LSTRCMP(profile, "106a") == 0 || DM_LSTRCMP(profile, "212a") == 0)) - pos += snprintf(&list_profile[pos], sizeof(list_profile) - pos, "%s,", profile); - } - - /* cut tailing ',' */ - if (pos) - list_profile[pos - 1] = 0; - - *value = dmstrdup(list_profile); - return 0; -} - -/*#Device.FAST.Line.{i}.CurrentProfile!UBUS:fast.line.1/status//current_profile*/ -static int get_FASTLine_CurrentProfile(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *current_profile = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "status", "current_profile"); - *value = (current_profile && DM_LSTRCMP(current_profile, "unknown") == 0) ? "" : current_profile; - return 0; -} - -/*#Device.FAST.Line.{i}.PowerManagementState!UBUS:fast.line.1/status//power_management_state*/ -static int get_FASTLine_PowerManagementState(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *power_mng_state = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "status", "power_management_state"); - if(DM_LSTRCMP(power_mng_state, "l0") == 0) - *value = "L0"; - else if(DM_LSTRCMP(power_mng_state, "l1") == 0) - *value = "L2.1"; - else if(DM_LSTRCMP(power_mng_state, "l2") == 0) - *value = "L2.2"; - else if(DM_LSTRCMP(power_mng_state, "l3") == 0) - *value = "L3"; - else - *value = power_mng_state; - return 0; -} - -/*#Device.FAST.Line.{i}.SuccessFailureCause!UBUS:fast.line.1/status//success_failure_cause*/ -static int get_FASTLine_SuccessFailureCause(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "status", "success_failure_cause"); - return 0; -} - -/*#Device.FAST.Line.{i}.UPBOKLER!UBUS:fast.line.1/status//upbokler*/ -static int get_FASTLine_UPBOKLER(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_array_without_argument("fast.line", ((struct fast_line_args*)data)->id, "status", "upbokler"); - return 0; -} - -/*#Device.FAST.Line.{i}.UPBOKLE!UBUS:fast.line.1/status//upbokle*/ -static int get_FASTLine_UPBOKLE(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_array_without_argument("fast.line", ((struct fast_line_args*)data)->id, "status", "upbokle"); - return 0; -} - -/*#Device.FAST.Line.{i}.LineNumber!UBUS:fast.line.1/status//line_number*/ -static int get_FASTLine_LineNumber(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "status", "line_number"); - return 0; -} - -/*#Device.FAST.Line.{i}.UpstreamMaxBitRate!UBUS:fast.line.1/status//max_bit_rate.us*/ -static int get_FASTLine_UpstreamMaxBitRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument_and_with_two_key("fast.line", ((struct fast_line_args*)data)->id, "status", "max_bit_rate", "us"); - return 0; -} - -/*#Device.FAST.Line.{i}.DownstreamMaxBitRate!UBUS:fast.line.1/status//max_bit_rate.ds*/ -static int get_FASTLine_DownstreamMaxBitRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument_and_with_two_key("fast.line", ((struct fast_line_args*)data)->id, "status", "max_bit_rate", "ds"); - return 0; -} - -/*#Device.FAST.Line.{i}.UpstreamNoiseMargin!UBUS:fast.line.1/status//noise_margin.us*/ -static int get_FASTLine_UpstreamNoiseMargin(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument_and_with_two_key("fast.line", ((struct fast_line_args*)data)->id, "status", "noise_margin", "us"); - return 0; -} - -/*#Device.FAST.Line.{i}.DownstreamNoiseMargin!UBUS:fast.line.1/status//noise_margin.ds*/ -static int get_FASTLine_DownstreamNoiseMargin(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument_and_with_two_key("fast.line", ((struct fast_line_args*)data)->id, "status", "noise_margin", "ds"); - return 0; -} - -/*#Device.FAST.Line.{i}.UpstreamAttenuation!UBUS:fast.line.1/status//attenuation.us*/ -static int get_FASTLine_UpstreamAttenuation(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument_and_with_two_key("fast.line", ((struct fast_line_args*)data)->id, "status", "attenuation", "us"); - return 0; -} - -/*#Device.FAST.Line.{i}.DownstreamAttenuation!UBUS:fast.line.1/status//attenuation.ds*/ -static int get_FASTLine_DownstreamAttenuation(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument_and_with_two_key("fast.line", ((struct fast_line_args*)data)->id, "status", "attenuation", "ds"); - return 0; -} - -/*#Device.FAST.Line.{i}.UpstreamPower!UBUS:fast.line.1/status//power.us*/ -static int get_FASTLine_UpstreamPower(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument_and_with_two_key("fast.line", ((struct fast_line_args*)data)->id, "status", "power", "us"); - return 0; -} - -/*#Device.FAST.Line.{i}.DownstreamPower!UBUS:fast.line.1/status//power.ds*/ -static int get_FASTLine_DownstreamPower(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument_and_with_two_key("fast.line", ((struct fast_line_args*)data)->id, "status", "power", "ds"); - return 0; -} - -/*#Device.FAST.Line.{i}.SNRMRMCds!UBUS:fast.line.1/status//snrm_rmc.ds*/ -static int get_FASTLine_SNRMRMCds(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument_and_with_two_key("fast.line", ((struct fast_line_args*)data)->id, "status", "snrm_rmc", "ds"); - return 0; -} - -/*#Device.FAST.Line.{i}.SNRMRMCus!UBUS:fast.line.1/status//snrm_rmc.us*/ -static int get_FASTLine_SNRMRMCus(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument_and_with_two_key("fast.line", ((struct fast_line_args*)data)->id, "status", "snrm_rmc", "us"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.BytesSent!UBUS:fast.line.1/stats//bytes_sent*/ -static int get_FASTLineStats_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "bytes_sent"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.BytesReceived!UBUS:fast.line.1/stats//bytes_received*/ -static int get_FASTLineStats_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "bytes_received"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.PacketsSent!UBUS:fast.line.1/stats//packets_sent*/ -static int get_FASTLineStats_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "packets_sent"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.PacketsReceived!UBUS:fast.line.1/stats//packets_received*/ -static int get_FASTLineStats_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "packets_received"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.ErrorsSent!UBUS:fast.line.1/stats//errors_sent*/ -static int get_FASTLineStats_ErrorsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "errors_sent"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.ErrorsReceived!UBUS:fast.line.1/stats//errors_received*/ -static int get_FASTLineStats_ErrorsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "errors_received"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.DiscardPacketsSent!UBUS:fast.line.1/stats//discard_packets_sent*/ -static int get_FASTLineStats_DiscardPacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "discard_packets_sent"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.DiscardPacketsReceived!UBUS:fast.line.1/stats//discard_packets_received*/ -static int get_FASTLineStats_DiscardPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "discard_packets_received"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.TotalStart!UBUS:fast.line.1/stats//total_start*/ -static int get_FASTLineStats_TotalStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "total_start"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.ShowtimeStart!UBUS:fast.line.1/stats//showtime_start*/ -static int get_FASTLineStats_ShowtimeStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "showtime_start"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.LastShowtimeStart!UBUS:fast.line.1/stats//last_showtime_start*/ -static int get_FASTLineStats_LastShowtimeStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "last_showtime_start"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.CurrentDayStart!UBUS:fast.line.1/stats//current_day_start*/ -static int get_FASTLineStats_CurrentDayStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "current_day_start"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.QuarterHourStart!UBUS:fast.line.1/stats//quarter_hour_start*/ -static int get_FASTLineStats_QuarterHourStart(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_fast_value_without_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "quarter_hour_start"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Total.ErroredSecs!UBUS:fast.line.1/stats//total.errored_secs*/ -static int get_FASTLineStatsTotal_ErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "total", "errored_secs"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Total.SeverelyErroredSecs!UBUS:fast.line.1/stats//total.severely_errored_secs*/ -static int get_FASTLineStatsTotal_SeverelyErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "total", "severely_errored_secs"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Total.LOSS!UBUS:fast.line.1/stats//total.loss*/ -static int get_FASTLineStatsTotal_LOSS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "total", "loss"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Total.LORS!UBUS:fast.line.1/stats//total.lors*/ -static int get_FASTLineStatsTotal_LORS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "total", "lors"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Total.UAS!UBUS:fast.line.1/stats//total.uas*/ -static int get_FASTLineStatsTotal_UAS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "total", "uas"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Total.RTXUC!UBUS:fast.line.1/stats//total.rtx_uc*/ -static int get_FASTLineStatsTotal_RTXUC(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "total", "rtx_uc"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Total.RTXTX!UBUS:fast.line.1/stats//total.rtx_tx*/ -static int get_FASTLineStatsTotal_RTXTX(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "total", "rtx_tx"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Total.SuccessBSW!UBUS:fast.line.1/stats//total.success_bsw*/ -static int get_FASTLineStatsTotal_SuccessBSW(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "total", "success_bsw"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Total.SuccessSRA!UBUS:fast.line.1/stats//total.success_sra*/ -static int get_FASTLineStatsTotal_SuccessSRA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "total", "success_sra"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Total.SuccessFRA!UBUS:fast.line.1/stats//total.success_fra*/ -static int get_FASTLineStatsTotal_SuccessFRA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "total", "success_fra"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Total.SuccessRPA!UBUS:fast.line.1/stats//total.success_rpa*/ -static int get_FASTLineStatsTotal_SuccessRPA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "total", "success_rpa"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Total.SuccessTIGA!UBUS:fast.line.1/stats//total.success_tiga*/ -static int get_FASTLineStatsTotal_SuccessTIGA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "total", "success_tiga"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Showtime.ErroredSecs!UBUS:fast.line.1/stats//showtime.errored_secs*/ -static int get_FASTLineStatsShowtime_ErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "showtime", "errored_secs"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Showtime.SeverelyErroredSecs!UBUS:fast.line.1/stats//showtime.severely_errored_secs*/ -static int get_FASTLineStatsShowtime_SeverelyErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "showtime", "severely_errored_secs"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Showtime.LOSS!UBUS:fast.line.1/stats//showtime.loss*/ -static int get_FASTLineStatsShowtime_LOSS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "showtime", "loss"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Showtime.LORS!UBUS:fast.line.1/stats//showtime.lors*/ -static int get_FASTLineStatsShowtime_LORS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "showtime", "lors"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Showtime.UAS!UBUS:fast.line.1/stats//showtime.uas*/ -static int get_FASTLineStatsShowtime_UAS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "showtime", "uas"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Showtime.RTXUC!UBUS:fast.line.1/stats//showtime.rtx_uc*/ -static int get_FASTLineStatsShowtime_RTXUC(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "showtime", "rtx_uc"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Showtime.RTXTX!UBUS:fast.line.1/stats//showtime.rtx_tx*/ -static int get_FASTLineStatsShowtime_RTXTX(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "showtime", "rtx_tx"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Showtime.SuccessBSW!UBUS:fast.line.1/stats//showtime.success_bsw*/ -static int get_FASTLineStatsShowtime_SuccessBSW(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "showtime", "success_bsw"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Showtime.SuccessSRA!UBUS:fast.line.1/stats//showtime.success_sra*/ -static int get_FASTLineStatsShowtime_SuccessSRA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "showtime", "success_sra"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Showtime.SuccessFRA!UBUS:fast.line.1/stats//showtime.success_fra*/ -static int get_FASTLineStatsShowtime_SuccessFRA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "showtime", "success_fra"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Showtime.SuccessRPA!UBUS:fast.line.1/stats//showtime.success_rpa*/ -static int get_FASTLineStatsShowtime_SuccessRPA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "showtime", "success_rpa"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.Showtime.SuccessTIGA!UBUS:fast.line.1/stats//showtime.success_tiga*/ -static int get_FASTLineStatsShowtime_SuccessTIGA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "showtime", "success_tiga"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.LastShowtime.ErroredSecs!UBUS:fast.line.1/stats//lastshowtime.errored_secs*/ -static int get_FASTLineStatsLastShowtime_ErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "lastshowtime", "errored_secs"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.LastShowtime.SeverelyErroredSecs!UBUS:fast.line.1/stats//lastshowtime.severely_errored_secs*/ -static int get_FASTLineStatsLastShowtime_SeverelyErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "lastshowtime", "severely_errored_secs"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.LastShowtime.LOSS!UBUS:fast.line.1/stats//lastshowtime.loss*/ -static int get_FASTLineStatsLastShowtime_LOSS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "lastshowtime", "loss"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.LastShowtime.LORS!UBUS:fast.line.1/stats//lastshowtime.lors*/ -static int get_FASTLineStatsLastShowtime_LORS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "lastshowtime", "lors"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.LastShowtime.UAS!UBUS:fast.line.1/stats//lastshowtime.uas*/ -static int get_FASTLineStatsLastShowtime_UAS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "lastshowtime", "uas"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.LastShowtime.RTXUC!UBUS:fast.line.1/stats//lastshowtime.rtx_uc*/ -static int get_FASTLineStatsLastShowtime_RTXUC(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "lastshowtime", "rtx_uc"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.LastShowtime.RTXTX!UBUS:fast.line.1/stats//lastshowtime.rtx_tx*/ -static int get_FASTLineStatsLastShowtime_RTXTX(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "lastshowtime", "rtx_tx"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.LastShowtime.SuccessBSW!UBUS:fast.line.1/stats//lastshowtime.success_bsw*/ -static int get_FASTLineStatsLastShowtime_SuccessBSW(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "lastshowtime", "success_bsw"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.LastShowtime.SuccessSRA!UBUS:fast.line.1/stats//lastshowtime.success_sra*/ -static int get_FASTLineStatsLastShowtime_SuccessSRA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "lastshowtime", "success_sra"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.LastShowtime.SuccessFRA!UBUS:fast.line.1/stats//lastshowtime.success_fra*/ -static int get_FASTLineStatsLastShowtime_SuccessFRA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "lastshowtime", "success_fra"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.LastShowtime.SuccessRPA!UBUS:fast.line.1/stats//lastshowtime.success_rpa*/ -static int get_FASTLineStatsLastShowtime_SuccessRPA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "lastshowtime", "success_rpa"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.LastShowtime.SuccessTIGA!UBUS:fast.line.1/stats//lastshowtime.success_tiga*/ -static int get_FASTLineStatsLastShowtime_SuccessTIGA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "lastshowtime", "success_tiga"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.CurrentDay.ErroredSecs!UBUS:fast.line.1/stats//currentday.errored_secs*/ -static int get_FASTLineStatsCurrentDay_ErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "currentday", "errored_secs"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.CurrentDay.SeverelyErroredSecs!UBUS:fast.line.1/stats//currentday.severely_errored_secs*/ -static int get_FASTLineStatsCurrentDay_SeverelyErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "currentday", "severely_errored_secs"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.CurrentDay.LOSS!UBUS:fast.line.1/stats//currentday.loss*/ -static int get_FASTLineStatsCurrentDay_LOSS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "currentday", "loss"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.CurrentDay.LORS!UBUS:fast.line.1/stats//currentday.lors*/ -static int get_FASTLineStatsCurrentDay_LORS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "currentday", "lors"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.CurrentDay.UAS!UBUS:fast.line.1/stats//currentday.uas*/ -static int get_FASTLineStatsCurrentDay_UAS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "currentday", "uas"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.CurrentDay.RTXUC!UBUS:fast.line.1/stats//currentday.rtx_uc*/ -static int get_FASTLineStatsCurrentDay_RTXUC(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "currentday", "rtx_uc"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.CurrentDay.RTXTX!UBUS:fast.line.1/stats//currentday.rtx_tx*/ -static int get_FASTLineStatsCurrentDay_RTXTX(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "currentday", "rtx_tx"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.CurrentDay.SuccessBSW!UBUS:fast.line.1/stats//currentday.success_bsw*/ -static int get_FASTLineStatsCurrentDay_SuccessBSW(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "currentday", "success_bsw"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.CurrentDay.SuccessSRA!UBUS:fast.line.1/stats//currentday.success_sra*/ -static int get_FASTLineStatsCurrentDay_SuccessSRA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "currentday", "success_sra"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.CurrentDay.SuccessFRA!UBUS:fast.line.1/stats//currentday.success_fra*/ -static int get_FASTLineStatsCurrentDay_SuccessFRA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "currentday", "success_fra"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.CurrentDay.SuccessRPA!UBUS:fast.line.1/stats//currentday.success_rpa*/ -static int get_FASTLineStatsCurrentDay_SuccessRPA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "currentday", "success_rpa"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.CurrentDay.SuccessTIGA!UBUS:fast.line.1/stats//currentday.success_tiga*/ -static int get_FASTLineStatsCurrentDay_SuccessTIGA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "currentday", "success_tiga"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.QuarterHour.ErroredSecs!UBUS:fast.line.1/stats//quarterhour.errored_secs*/ -static int get_FASTLineStatsQuarterHour_ErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "quarterhour", "errored_secs"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.QuarterHour.SeverelyErroredSecs!UBUS:fast.line.1/stats//quarterhour.severely_errored_secs*/ -static int get_FASTLineStatsQuarterHour_SeverelyErroredSecs(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "quarterhour", "severely_errored_secs"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.QuarterHour.LOSS!UBUS:fast.line.1/stats//quarterhour.loss*/ -static int get_FASTLineStatsQuarterHour_LOSS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "quarterhour", "loss"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.QuarterHour.LORS!UBUS:fast.line.1/stats//quarterhour.lors*/ -static int get_FASTLineStatsQuarterHour_LORS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "quarterhour", "lors"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.QuarterHour.UAS!UBUS:fast.line.1/stats//quarterhour.uas*/ -static int get_FASTLineStatsQuarterHour_UAS(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "quarterhour", "uas"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.QuarterHour.RTXUC!UBUS:fast.line.1/stats//quarterhour.rtx_uc*/ -static int get_FASTLineStatsQuarterHour_RTXUC(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "quarterhour", "rtx_uc"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.QuarterHour.RTXTX!UBUS:fast.line.1/stats//quarterhour.rtx_tx*/ -static int get_FASTLineStatsQuarterHour_RTXTX(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "quarterhour", "rtx_tx"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.QuarterHour.SuccessBSW!UBUS:fast.line.1/stats//quarterhour.success_bsw*/ -static int get_FASTLineStatsQuarterHour_SuccessBSW(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "quarterhour", "success_bsw"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.QuarterHour.SuccessSRA!UBUS:fast.line.1/stats//quarterhour.success_sra*/ -static int get_FASTLineStatsQuarterHour_SuccessSRA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "quarterhour", "success_sra"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.QuarterHour.SuccessFRA!UBUS:fast.line.1/stats//quarterhour.success_fra*/ -static int get_FASTLineStatsQuarterHour_SuccessFRA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "quarterhour", "success_fra"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.QuarterHour.SuccessRPA!UBUS:fast.line.1/stats//quarterhour.success_rpa*/ -static int get_FASTLineStatsQuarterHour_SuccessRPA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "quarterhour", "success_rpa"); - return 0; -} - -/*#Device.FAST.Line.{i}.Stats.QuarterHour.SuccessTIGA!UBUS:fast.line.1/stats//quarterhour.success_tiga*/ -static int get_FASTLineStatsQuarterHour_SuccessTIGA(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_value_with_argument("fast.line", ((struct fast_line_args*)data)->id, "stats", "quarterhour", "success_tiga"); - return 0; -} - -/********************************************************************************************************************************** -* OBJ & LEAF DEFINITION -***********************************************************************************************************************************/ -/* *** Device.FAST. *** */ -DMOBJ tFASTObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys, version*/ -{"Line", &DMREAD, NULL, NULL, NULL, browseFASTLineInst, NULL, NULL, tFASTLineObj, tFASTLineParams, NULL, BBFDM_BOTH, NULL}, -{0} -}; - -DMLEAF tFASTParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"LineNumberOfEntries", &DMREAD, DMT_UNINT, get_FAST_LineNumberOfEntries, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.FAST.Line.{i}. *** */ -DMOBJ tFASTLineObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys, version*/ -{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsObj, tFASTLineStatsParams, NULL, BBFDM_BOTH, NULL}, -{0} -}; - -DMLEAF tFASTLineParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"Enable", &DMWRITE, DMT_BOOL, get_FASTLine_Enable, set_FASTLine_Enable, BBFDM_BOTH}, -{"Status", &DMREAD, DMT_STRING, get_FASTLine_Status, NULL, BBFDM_BOTH}, -{"Alias", &DMWRITE, DMT_STRING, get_FASTLine_Alias, set_FASTLine_Alias, BBFDM_BOTH, DM_FLAG_UNIQUE}, -{"Name", &DMREAD, DMT_STRING, get_FASTLine_Name, NULL, BBFDM_BOTH, DM_FLAG_UNIQUE}, -{"LowerLayers", &DMWRITE, DMT_STRING, get_FASTLine_LowerLayers, set_FASTLine_LowerLayers, BBFDM_BOTH}, -{"Upstream", &DMREAD, DMT_BOOL, get_FASTLine_Upstream, NULL, BBFDM_BOTH}, -{"FirmwareVersion", &DMREAD, DMT_STRING, get_FASTLine_FirmwareVersion, NULL, BBFDM_BOTH}, -{"LinkStatus", &DMREAD, DMT_STRING, get_FASTLine_LinkStatus, NULL, BBFDM_BOTH}, -{"AllowedProfiles", &DMREAD, DMT_STRING, get_FASTLine_AllowedProfiles, NULL, BBFDM_BOTH}, -{"CurrentProfile", &DMREAD, DMT_STRING, get_FASTLine_CurrentProfile, NULL, BBFDM_BOTH}, -{"PowerManagementState", &DMREAD, DMT_STRING, get_FASTLine_PowerManagementState, NULL, BBFDM_BOTH}, -{"SuccessFailureCause", &DMREAD, DMT_UNINT, get_FASTLine_SuccessFailureCause, NULL, BBFDM_BOTH}, -{"UPBOKLER", &DMREAD, DMT_UNINT, get_FASTLine_UPBOKLER, NULL, BBFDM_BOTH}, -{"UPBOKLE", &DMREAD, DMT_UNINT, get_FASTLine_UPBOKLE, NULL, BBFDM_BOTH}, -{"LineNumber", &DMREAD, DMT_INT, get_FASTLine_LineNumber, NULL, BBFDM_BOTH}, -{"UpstreamMaxBitRate", &DMREAD, DMT_UNINT, get_FASTLine_UpstreamMaxBitRate, NULL, BBFDM_BOTH}, -{"DownstreamMaxBitRate", &DMREAD, DMT_UNINT, get_FASTLine_DownstreamMaxBitRate, NULL, BBFDM_BOTH}, -{"UpstreamNoiseMargin", &DMREAD, DMT_INT, get_FASTLine_UpstreamNoiseMargin, NULL, BBFDM_BOTH}, -{"DownstreamNoiseMargin", &DMREAD, DMT_INT, get_FASTLine_DownstreamNoiseMargin, NULL, BBFDM_BOTH}, -{"UpstreamAttenuation", &DMREAD, DMT_INT, get_FASTLine_UpstreamAttenuation, NULL, BBFDM_BOTH}, -{"DownstreamAttenuation", &DMREAD, DMT_INT, get_FASTLine_DownstreamAttenuation, NULL, BBFDM_BOTH}, -{"UpstreamPower", &DMREAD, DMT_INT, get_FASTLine_UpstreamPower, NULL, BBFDM_BOTH}, -{"DownstreamPower", &DMREAD, DMT_INT, get_FASTLine_DownstreamPower, NULL, BBFDM_BOTH}, -{"SNRMRMCds", &DMREAD, DMT_INT, get_FASTLine_SNRMRMCds, NULL, BBFDM_BOTH}, -{"SNRMRMCus", &DMREAD, DMT_INT, get_FASTLine_SNRMRMCus, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.FAST.Line.{i}.Stats. *** */ -DMOBJ tFASTLineStatsObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys, version*/ -{"Total", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsTotalParams, NULL, BBFDM_BOTH, NULL}, -{"Showtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsShowtimeParams, NULL, BBFDM_BOTH, NULL}, -{"LastShowtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsLastShowtimeParams, NULL, BBFDM_BOTH, NULL}, -{"CurrentDay", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsCurrentDayParams, NULL, BBFDM_BOTH, NULL}, -{"QuarterHour", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsQuarterHourParams, NULL, BBFDM_BOTH, NULL}, -{0} -}; - -DMLEAF tFASTLineStatsParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"BytesSent", &DMREAD, DMT_UNLONG, get_FASTLineStats_BytesSent, NULL, BBFDM_BOTH}, -{"BytesReceived", &DMREAD, DMT_UNLONG, get_FASTLineStats_BytesReceived, NULL, BBFDM_BOTH}, -{"PacketsSent", &DMREAD, DMT_UNLONG, get_FASTLineStats_PacketsSent, NULL, BBFDM_BOTH}, -{"PacketsReceived", &DMREAD, DMT_UNLONG, get_FASTLineStats_PacketsReceived, NULL, BBFDM_BOTH}, -{"ErrorsSent", &DMREAD, DMT_UNINT, get_FASTLineStats_ErrorsSent, NULL, BBFDM_BOTH}, -{"ErrorsReceived", &DMREAD, DMT_UNINT, get_FASTLineStats_ErrorsReceived, NULL, BBFDM_BOTH}, -{"DiscardPacketsSent", &DMREAD, DMT_UNINT, get_FASTLineStats_DiscardPacketsSent, NULL, BBFDM_BOTH}, -{"DiscardPacketsReceived", &DMREAD, DMT_UNINT, get_FASTLineStats_DiscardPacketsReceived, NULL, BBFDM_BOTH}, -{"TotalStart", &DMREAD, DMT_UNINT, get_FASTLineStats_TotalStart, NULL, BBFDM_BOTH}, -{"ShowtimeStart", &DMREAD, DMT_UNINT, get_FASTLineStats_ShowtimeStart, NULL, BBFDM_BOTH}, -{"LastShowtimeStart", &DMREAD, DMT_UNINT, get_FASTLineStats_LastShowtimeStart, NULL, BBFDM_BOTH}, -{"CurrentDayStart", &DMREAD, DMT_UNINT, get_FASTLineStats_CurrentDayStart, NULL, BBFDM_BOTH}, -{"QuarterHourStart", &DMREAD, DMT_UNINT, get_FASTLineStats_QuarterHourStart, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.FAST.Line.{i}.Stats.Total. *** */ -DMLEAF tFASTLineStatsTotalParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"ErroredSecs", &DMREAD, DMT_UNINT, get_FASTLineStatsTotal_ErroredSecs, NULL, BBFDM_BOTH}, -{"SeverelyErroredSecs", &DMREAD, DMT_UNINT, get_FASTLineStatsTotal_SeverelyErroredSecs, NULL, BBFDM_BOTH}, -{"LOSS", &DMREAD, DMT_UNINT, get_FASTLineStatsTotal_LOSS, NULL, BBFDM_BOTH}, -{"LORS", &DMREAD, DMT_UNINT, get_FASTLineStatsTotal_LORS, NULL, BBFDM_BOTH}, -{"UAS", &DMREAD, DMT_UNINT, get_FASTLineStatsTotal_UAS, NULL, BBFDM_BOTH}, -{"RTXUC", &DMREAD, DMT_UNINT, get_FASTLineStatsTotal_RTXUC, NULL, BBFDM_BOTH}, -{"RTXTX", &DMREAD, DMT_UNINT, get_FASTLineStatsTotal_RTXTX, NULL, BBFDM_BOTH}, -{"SuccessBSW", &DMREAD, DMT_UNINT, get_FASTLineStatsTotal_SuccessBSW, NULL, BBFDM_BOTH}, -{"SuccessSRA", &DMREAD, DMT_UNINT, get_FASTLineStatsTotal_SuccessSRA, NULL, BBFDM_BOTH}, -{"SuccessFRA", &DMREAD, DMT_UNINT, get_FASTLineStatsTotal_SuccessFRA, NULL, BBFDM_BOTH}, -{"SuccessRPA", &DMREAD, DMT_UNINT, get_FASTLineStatsTotal_SuccessRPA, NULL, BBFDM_BOTH}, -{"SuccessTIGA", &DMREAD, DMT_UNINT, get_FASTLineStatsTotal_SuccessTIGA, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.FAST.Line.{i}.Stats.Showtime. *** */ -DMLEAF tFASTLineStatsShowtimeParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"ErroredSecs", &DMREAD, DMT_UNINT, get_FASTLineStatsShowtime_ErroredSecs, NULL, BBFDM_BOTH}, -{"SeverelyErroredSecs", &DMREAD, DMT_UNINT, get_FASTLineStatsShowtime_SeverelyErroredSecs, NULL, BBFDM_BOTH}, -{"LOSS", &DMREAD, DMT_UNINT, get_FASTLineStatsShowtime_LOSS, NULL, BBFDM_BOTH}, -{"LORS", &DMREAD, DMT_UNINT, get_FASTLineStatsShowtime_LORS, NULL, BBFDM_BOTH}, -{"UAS", &DMREAD, DMT_UNINT, get_FASTLineStatsShowtime_UAS, NULL, BBFDM_BOTH}, -{"RTXUC", &DMREAD, DMT_UNINT, get_FASTLineStatsShowtime_RTXUC, NULL, BBFDM_BOTH}, -{"RTXTX", &DMREAD, DMT_UNINT, get_FASTLineStatsShowtime_RTXTX, NULL, BBFDM_BOTH}, -{"SuccessBSW", &DMREAD, DMT_UNINT, get_FASTLineStatsShowtime_SuccessBSW, NULL, BBFDM_BOTH}, -{"SuccessSRA", &DMREAD, DMT_UNINT, get_FASTLineStatsShowtime_SuccessSRA, NULL, BBFDM_BOTH}, -{"SuccessFRA", &DMREAD, DMT_UNINT, get_FASTLineStatsShowtime_SuccessFRA, NULL, BBFDM_BOTH}, -{"SuccessRPA", &DMREAD, DMT_UNINT, get_FASTLineStatsShowtime_SuccessRPA, NULL, BBFDM_BOTH}, -{"SuccessTIGA", &DMREAD, DMT_UNINT, get_FASTLineStatsShowtime_SuccessTIGA, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.FAST.Line.{i}.Stats.LastShowtime. *** */ -DMLEAF tFASTLineStatsLastShowtimeParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"ErroredSecs", &DMREAD, DMT_UNINT, get_FASTLineStatsLastShowtime_ErroredSecs, NULL, BBFDM_BOTH}, -{"SeverelyErroredSecs", &DMREAD, DMT_UNINT, get_FASTLineStatsLastShowtime_SeverelyErroredSecs, NULL, BBFDM_BOTH}, -{"LOSS", &DMREAD, DMT_UNINT, get_FASTLineStatsLastShowtime_LOSS, NULL, BBFDM_BOTH}, -{"LORS", &DMREAD, DMT_UNINT, get_FASTLineStatsLastShowtime_LORS, NULL, BBFDM_BOTH}, -{"UAS", &DMREAD, DMT_UNINT, get_FASTLineStatsLastShowtime_UAS, NULL, BBFDM_BOTH}, -{"RTXUC", &DMREAD, DMT_UNINT, get_FASTLineStatsLastShowtime_RTXUC, NULL, BBFDM_BOTH}, -{"RTXTX", &DMREAD, DMT_UNINT, get_FASTLineStatsLastShowtime_RTXTX, NULL, BBFDM_BOTH}, -{"SuccessBSW", &DMREAD, DMT_UNINT, get_FASTLineStatsLastShowtime_SuccessBSW, NULL, BBFDM_BOTH}, -{"SuccessSRA", &DMREAD, DMT_UNINT, get_FASTLineStatsLastShowtime_SuccessSRA, NULL, BBFDM_BOTH}, -{"SuccessFRA", &DMREAD, DMT_UNINT, get_FASTLineStatsLastShowtime_SuccessFRA, NULL, BBFDM_BOTH}, -{"SuccessRPA", &DMREAD, DMT_UNINT, get_FASTLineStatsLastShowtime_SuccessRPA, NULL, BBFDM_BOTH}, -{"SuccessTIGA", &DMREAD, DMT_UNINT, get_FASTLineStatsLastShowtime_SuccessTIGA, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.FAST.Line.{i}.Stats.CurrentDay. *** */ -DMLEAF tFASTLineStatsCurrentDayParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"ErroredSecs", &DMREAD, DMT_UNINT, get_FASTLineStatsCurrentDay_ErroredSecs, NULL, BBFDM_BOTH}, -{"SeverelyErroredSecs", &DMREAD, DMT_UNINT, get_FASTLineStatsCurrentDay_SeverelyErroredSecs, NULL, BBFDM_BOTH}, -{"LOSS", &DMREAD, DMT_UNINT, get_FASTLineStatsCurrentDay_LOSS, NULL, BBFDM_BOTH}, -{"LORS", &DMREAD, DMT_UNINT, get_FASTLineStatsCurrentDay_LORS, NULL, BBFDM_BOTH}, -{"UAS", &DMREAD, DMT_UNINT, get_FASTLineStatsCurrentDay_UAS, NULL, BBFDM_BOTH}, -{"RTXUC", &DMREAD, DMT_UNINT, get_FASTLineStatsCurrentDay_RTXUC, NULL, BBFDM_BOTH}, -{"RTXTX", &DMREAD, DMT_UNINT, get_FASTLineStatsCurrentDay_RTXTX, NULL, BBFDM_BOTH}, -{"SuccessBSW", &DMREAD, DMT_UNINT, get_FASTLineStatsCurrentDay_SuccessBSW, NULL, BBFDM_BOTH}, -{"SuccessSRA", &DMREAD, DMT_UNINT, get_FASTLineStatsCurrentDay_SuccessSRA, NULL, BBFDM_BOTH}, -{"SuccessFRA", &DMREAD, DMT_UNINT, get_FASTLineStatsCurrentDay_SuccessFRA, NULL, BBFDM_BOTH}, -{"SuccessRPA", &DMREAD, DMT_UNINT, get_FASTLineStatsCurrentDay_SuccessRPA, NULL, BBFDM_BOTH}, -{"SuccessTIGA", &DMREAD, DMT_UNINT, get_FASTLineStatsCurrentDay_SuccessTIGA, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.FAST.Line.{i}.Stats.QuarterHour. *** */ -DMLEAF tFASTLineStatsQuarterHourParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"ErroredSecs", &DMREAD, DMT_UNINT, get_FASTLineStatsQuarterHour_ErroredSecs, NULL, BBFDM_BOTH}, -{"SeverelyErroredSecs", &DMREAD, DMT_UNINT, get_FASTLineStatsQuarterHour_SeverelyErroredSecs, NULL, BBFDM_BOTH}, -{"LOSS", &DMREAD, DMT_UNINT, get_FASTLineStatsQuarterHour_LOSS, NULL, BBFDM_BOTH}, -{"LORS", &DMREAD, DMT_UNINT, get_FASTLineStatsQuarterHour_LORS, NULL, BBFDM_BOTH}, -{"UAS", &DMREAD, DMT_UNINT, get_FASTLineStatsQuarterHour_UAS, NULL, BBFDM_BOTH}, -{"RTXUC", &DMREAD, DMT_UNINT, get_FASTLineStatsQuarterHour_RTXUC, NULL, BBFDM_BOTH}, -{"RTXTX", &DMREAD, DMT_UNINT, get_FASTLineStatsQuarterHour_RTXTX, NULL, BBFDM_BOTH}, -{"SuccessBSW", &DMREAD, DMT_UNINT, get_FASTLineStatsQuarterHour_SuccessBSW, NULL, BBFDM_BOTH}, -{"SuccessSRA", &DMREAD, DMT_UNINT, get_FASTLineStatsQuarterHour_SuccessSRA, NULL, BBFDM_BOTH}, -{"SuccessFRA", &DMREAD, DMT_UNINT, get_FASTLineStatsQuarterHour_SuccessFRA, NULL, BBFDM_BOTH}, -{"SuccessRPA", &DMREAD, DMT_UNINT, get_FASTLineStatsQuarterHour_SuccessRPA, NULL, BBFDM_BOTH}, -{"SuccessTIGA", &DMREAD, DMT_UNINT, get_FASTLineStatsQuarterHour_SuccessTIGA, NULL, BBFDM_BOTH}, -{0} -}; diff --git a/libbbfdm/dmtree/tr181/fast.h b/libbbfdm/dmtree/tr181/fast.h deleted file mode 100644 index 1402cc9f..00000000 --- a/libbbfdm/dmtree/tr181/fast.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2020 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: Jani Juvan - */ - -#ifndef __FAST_H -#define __FAST_H - -#include "libbbfdm-api/dmcommon.h" - -extern DMOBJ tFASTObj[]; -extern DMLEAF tFASTParams[]; -extern DMOBJ tFASTLineObj[]; -extern DMLEAF tFASTLineParams[]; -extern DMOBJ tFASTLineStatsObj[]; -extern DMLEAF tFASTLineStatsParams[]; -extern DMLEAF tFASTLineStatsTotalParams[]; -extern DMLEAF tFASTLineStatsShowtimeParams[]; -extern DMLEAF tFASTLineStatsLastShowtimeParams[]; -extern DMLEAF tFASTLineStatsCurrentDayParams[]; -extern DMLEAF tFASTLineStatsQuarterHourParams[]; - -#endif //__FAST_H diff --git a/libbbfdm/dmtree/tr181/ptm.c b/libbbfdm/dmtree/tr181/ptm.c deleted file mode 100644 index f32d072d..00000000 --- a/libbbfdm/dmtree/tr181/ptm.c +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (C) 2019 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: Anis Ellouze - * - */ - -#include "atm.h" -#include "ptm.h" - -struct ptm_args -{ - struct dmmap_dup *sections; - char *device; -}; - -/************************************************************************** -* INIT -***************************************************************************/ -static inline int init_ptm_link(struct ptm_args *args, struct dmmap_dup *s, char *device) -{ - args->sections = s; - args->device = device; - return 0; -} - -/************************************************************* -* ENTRY METHOD -*************************************************************/ -/*#Device.PTM.Link.{i}.!UCI:dsl/ptm-device/dmmap_dsl*/ -static int browsePtmLinkInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) -{ - char *inst = NULL, *device; - struct ptm_args curr_ptm_args = {0}; - struct dmmap_dup *p = NULL; - LIST_HEAD(dup_list); - - synchronize_specific_config_sections_with_dmmap("dsl", "ptm-device", "dmmap_dsl", &dup_list); - list_for_each_entry(p, &dup_list, list) { - dmuci_get_value_by_section_string(p->config_section, "device", &device); - init_ptm_link(&curr_ptm_args, p, device); - - inst = handle_instance(dmctx, parent_node, p->dmmap_section, "ptmlinkinstance", "ptmlinkalias"); - - if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&curr_ptm_args, inst) == DM_STOP) - break; - } - free_dmmap_config_dup_list(&dup_list); - return 0; -} - -/************************************************************* -* ADD OBJ -*************************************************************/ -static int add_ptm_link(char *refparam, struct dmctx *ctx, void *data, char **instance) -{ - struct uci_section *dmmap_ptm = NULL; - char ptm_device[16]; - - snprintf(ptm_device, sizeof(ptm_device), "ptm%s", *instance); - - dmuci_set_value("dsl", ptm_device, "", "ptm-device"); - dmuci_set_value("dsl", ptm_device, "name", "PTM"); - dmuci_set_value("dsl", ptm_device, "device", ptm_device); - dmuci_set_value("dsl", ptm_device, "enabled", "0"); - - dmuci_add_section_bbfdm("dmmap_dsl", "ptm-device", &dmmap_ptm); - dmuci_set_value_by_section(dmmap_ptm, "section_name", ptm_device); - dmuci_set_value_by_section(dmmap_ptm, "ptmlinkinstance", *instance); - return 0; -} - -static int delete_ptm_link(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action) -{ - struct uci_section *s = NULL, *stmp = NULL; - - switch (del_action) { - case DEL_INST: - uci_foreach_option_cont("network", "interface", "device", ((struct ptm_args *)data)->device, s) { - remove_device_from_interface(stmp, ((struct ptm_args *)data)->device); - } - - dmuci_delete_by_section((((struct ptm_args *)data)->sections)->dmmap_section, NULL, NULL); - dmuci_delete_by_section((((struct ptm_args *)data)->sections)->config_section, NULL, NULL); - break; - case DEL_ALL: - uci_foreach_sections_safe("dsl", "ptm-device", stmp, s) { - struct uci_section *ns = NULL; - char *device = NULL; - - dmuci_get_value_by_section_string(s, "device", &device); - if (DM_STRLEN(device) == 0) - continue; - - uci_foreach_option_cont("network", "interface", "device", device, ns) { - remove_device_from_interface(ns, device); - } - - get_dmmap_section_of_config_section("dmmap_dsl", "ptm-device", section_name(s), &ns); - dmuci_delete_by_section(ns, NULL, NULL); - - dmuci_delete_by_section(s, NULL, NULL); - } - break; - } - return 0; -} - -/************************************************************* -* GET & SET PARAM -**************************************************************/ -/*#Device.PTM.Link.{i}.Enable!UCI:dsl/ptm-device,@i-1/enabled*/ -static int get_ptm_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = dmuci_get_value_by_section_fallback_def((((struct ptm_args *)data)->sections)->config_section, "enabled", "1"); - return 0; -} - -static int set_ptm_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - bool b; - - switch (action) { - case VALUECHECK: - if (bbfdm_validate_boolean(ctx, value)) - return FAULT_9007; - return 0; - case VALUESET: - string_to_bool(value, &b); - dmuci_set_value_by_section((((struct ptm_args *)data)->sections)->config_section, "enabled", b ? "1" : "0"); - return 0; - } - return 0; -} - -/*#Device.PTM.Link.{i}.Status!SYSFS:/sys/class/net/@Name/operstate*/ -static int get_ptm_status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return get_net_device_status(((struct ptm_args *)data)->device, value); -} - -/*#Device.PTM.Link.{i}.Alias!UCI:dmmap_dsl/ptm-device,@i-1/ptmlinkalias*/ -static int get_ptm_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return bbf_get_alias(ctx, (((struct ptm_args *)data)->sections)->dmmap_section, "ptmlinkalias", instance, value); -} - -static int set_ptm_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - return bbf_set_alias(ctx, (((struct ptm_args *)data)->sections)->dmmap_section, "ptmlinkalias", instance, value); -} - -/*#Device.PTM.Link.{i}.Name!UCI:dsl/ptm-device,@i-1/name*/ -static int get_ptm_link_name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = dmstrdup(((struct ptm_args *)data)->device); - return 0; -} - -static int get_ptm_lower_layer(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - dmuci_get_value_by_section_string((((struct ptm_args *)data)->sections)->dmmap_section, "LowerLayers", value); - - if ((*value)[0] == '\0') { - char ptm_file[128] = {0}; - - adm_entry_get_reference_param(ctx, "Device.FAST.Line.*.Status", "Up", value); - if (DM_STRLEN(*value)) - return 0; - - snprintf(ptm_file, sizeof(ptm_file), "/sys/class/net/ptm%ld", DM_STRTOL(instance) - 1); - if (folder_exists(ptm_file)) { - adm_entry_get_reference_param(ctx, "Device.DSL.Channel.*.Name", "1", value); - if (DM_STRLEN(*value)) - return 0; - } - - adm_entry_get_reference_param(ctx, "Device.FAST.Line.*.Name", "1", value); - - // Store LowerLayers value - dmuci_set_value_by_section((((struct ptm_args *)data)->sections)->dmmap_section, "LowerLayers", *value); - } else { - if (!adm_entry_object_exists(ctx, *value)) - *value = ""; - } - - return 0; -} - -static int set_ptm_lower_layer(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - struct dm_reference reference = {0}; - - bbf_get_reference_args(value, &reference); - - switch (action) { - case VALUECHECK: - if (DM_LSTRNCMP(reference.path, "Device.DSL.Channel.1", strlen("Device.DSL.Channel.1")) != 0 && DM_LSTRNCMP(reference.path, "Device.FAST.Line.1", strlen("Device.FAST.Line.1")) != 0) - return FAULT_9007; - break; - case VALUESET: - dmuci_set_value_by_section((((struct ptm_args *)data)->sections)->dmmap_section, "LowerLayers", reference.path); - break; - } - return 0; -} - -static inline int ubus_ptm_stats(char **value, const char *stat_mod, void *data) -{ - json_object *res = NULL; - dmubus_call("network.device", "status", UBUS_ARGS{{"name", ((struct ptm_args *)data)->device, String}}, 1, &res); - DM_ASSERT(res, *value = "0"); - *value = dmjson_get_value(res, 2, "statistics", stat_mod); - if ((*value)[0] == '\0') - *value = "0"; - return 0; -} - -/*#Device.PTM.Link.{i}.Stats.BytesReceived!UBUS:network.device/status/name,@Name/statistics.rx_bytes*/ -static int get_ptm_stats_bytes_received(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return ubus_ptm_stats(value, "rx_bytes", data); -} - -/*#Device.PTM.Link.{i}.Stats.BytesSent!UBUS:network.device/status/name,@Name/statistics.tx_bytes*/ -static int get_ptm_stats_bytes_sent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return ubus_ptm_stats(value, "tx_bytes", data); -} - -/*#Device.PTM.Link.{i}.Stats.PacketsReceived!UBUS:network.device/status/name,@Name/statistics.rx_packets*/ -static int get_ptm_stats_pack_received(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return ubus_ptm_stats(value, "rx_packets", data); -} - -/*#Device.PTM.Link.{i}.Stats.PacketsSent!UBUS:network.device/status/name,@Name/statistics.tx_packets*/ -static int get_ptm_stats_pack_sent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return ubus_ptm_stats(value, "tx_packets", data); -} - -/********************************************************************************************************************************** -* OBJ & LEAF DEFINITION -***********************************************************************************************************************************/ -/* *** Device.PTM. *** */ -DMOBJ tPTMObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys, version*/ -{"Link", &DMWRITE, add_ptm_link, delete_ptm_link, NULL, browsePtmLinkInst, NULL, NULL, tPTMLinkObj, tPTMLinkParams, NULL, BBFDM_BOTH, NULL}, -{0} -}; - -/* *** Device.PTM.Link.{i}. *** */ -DMOBJ tPTMLinkObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys, version*/ -{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tPTMLinkStatsParams, NULL, BBFDM_BOTH, NULL}, -{0} -}; - -DMLEAF tPTMLinkParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"Enable", &DMWRITE, DMT_BOOL, get_ptm_enable, set_ptm_enable, BBFDM_BOTH}, -{"Status", &DMREAD, DMT_STRING, get_ptm_status, NULL, BBFDM_BOTH}, -{"Alias", &DMWRITE, DMT_STRING, get_ptm_alias, set_ptm_alias, BBFDM_BOTH, DM_FLAG_UNIQUE}, -{"Name", &DMREAD, DMT_STRING, get_ptm_link_name, NULL, BBFDM_BOTH, DM_FLAG_UNIQUE|DM_FLAG_LINKER}, -{"LowerLayers", &DMWRITE, DMT_STRING, get_ptm_lower_layer, set_ptm_lower_layer, BBFDM_BOTH, DM_FLAG_REFERENCE}, -{0} -}; - -/* *** Device.PTM.Link.{i}.Stats. *** */ -DMLEAF tPTMLinkStatsParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ -{"BytesSent", &DMREAD, DMT_UNLONG, get_ptm_stats_bytes_sent, NULL, BBFDM_BOTH}, -{"BytesReceived", &DMREAD, DMT_UNLONG, get_ptm_stats_bytes_received, NULL, BBFDM_BOTH}, -{"PacketsSent", &DMREAD, DMT_UNLONG, get_ptm_stats_pack_sent, NULL, BBFDM_BOTH}, -{"PacketsReceived", &DMREAD, DMT_UNLONG, get_ptm_stats_pack_received, NULL, BBFDM_BOTH}, -{0} -}; diff --git a/libbbfdm/dmtree/tr181/ptm.h b/libbbfdm/dmtree/tr181/ptm.h deleted file mode 100644 index 6aed7da9..00000000 --- a/libbbfdm/dmtree/tr181/ptm.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2019 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: Anis Ellouze - * - */ - -#ifndef __PTM_H -#define __PTM_H - -#include "libbbfdm-api/dmcommon.h" - -extern DMOBJ tPTMObj[]; -extern DMOBJ tPTMLinkObj[]; -extern DMLEAF tPTMLinkStatsParams[]; -extern DMLEAF tPTMLinkParams[]; - -#endif diff --git a/tools/tools_input.json b/tools/tools_input.json index 96e97a31..c34bd756 100644 --- a/tools/tools_input.json +++ b/tools/tools_input.json @@ -170,6 +170,16 @@ "dm_files": [ "bbf_plugin/nat_porttrigger.c" ] + }, + { + "repo": "https://dev.iopsys.eu/hal/dslmngr.git", + "proto": "git", + "dm_files": [ + "bbf_plugin/dsl.c", + "bbf_plugin/fast.c", + "bbf_plugin/atm.c", + "bbf_plugin/ptm.c" + ] } ], "output": {