diff --git a/bin/Makefile.am b/bin/Makefile.am index bbb0620d..54544aa8 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -51,7 +51,6 @@ libbbfdm_la_SOURCES += \ ../dmtree/tr181/managementserver.c \ ../dmtree/tr181/times.c \ ../dmtree/tr181/upnp.c \ - ../dmtree/tr181/x_iopsys_eu_power_mgmt.c \ ../dmtree/tr181/x_iopsys_eu_syslog.c \ ../dmtree/tr181/x_iopsys_eu_dropbear.c \ ../dmtree/tr181/x_iopsys_eu_owsd.c \ diff --git a/dmtree/tr064/upnp_device.c b/dmtree/tr064/upnp_device.c index f5455039..ecd1cbfb 100644 --- a/dmtree/tr064/upnp_device.c +++ b/dmtree/tr064/upnp_device.c @@ -14,7 +14,6 @@ #include "managementserver.h" #include "times.h" #include "upnp.h" -#include "x_iopsys_eu_power_mgmt.h" #include "x_iopsys_eu_syslog.h" #include "softwaremodules.h" #include "xmpp.h" @@ -91,8 +90,6 @@ DMOBJ tRoot181ObjUPNPBBF[] = { #if BBF_TR104 {"VoiceService", &DMREAD, NULL, NULL, NULL, browseVoiceServiceInst, NULL, NULL, tServicesVoiceServiceObj, tServicesVoiceServiceParams, NULL, BBFDM_BOTH}, #endif -{CUSTOM_PREFIX"MCPD", &DMREAD, NULL, NULL, NULL, NULL, NULL, &DMNONE,NULL, X_IOPSYS_EU_MCPDParams, NULL, BBFDM_BOTH}, -{CUSTOM_PREFIX"PowerManagement", &DMREAD, NULL, NULL, NULL, NULL, NULL, &DMNONE,NULL, tSe_PowerManagementParam, NULL, BBFDM_BOTH}, {CUSTOM_PREFIX"Syslog", &DMREAD, NULL, NULL, NULL, NULL, NULL, &DMNONE,NULL, tSe_SyslogParam, NULL, BBFDM_BOTH}, {"SoftwareModules", &DMREAD, NULL, NULL, NULL, NULL, NULL, &DMNONE,tSoftwareModulesObj, NULL, NULL, BBFDM_BOTH}, {CUSTOM_PREFIX"OWSD", &DMREAD, NULL, NULL, NULL, NULL, NULL, &DMNONE,X_IOPSYS_EU_OWSDObj, X_IOPSYS_EU_OWSDParams, NULL, BBFDM_BOTH}, @@ -123,7 +120,6 @@ UPNP_SUPPORTED_DM tUPNPSupportedDM_181[] = { {"/BBF/Time/", DMROOT_URI_181, DMROOT_URL_181, "Time from "DMROOT_DESC_181, ""}, {"/BBF/UPnP/", DMROOT_URI_181, DMROOT_URL_181, "UPnP from "DMROOT_DESC_181, ""}, {"/BBF/VoiceService/", "urn:broadband-forum-org:wt-104-2-0-0", "https://www.broadband-forum.org/cwmp/tr-104-2-0-0.html", "TR-104 Voice:2 Service Object definition", ""}, -{"/BBF/"CUSTOM_PREFIX"PowerManagement/", "urn:iopsys-eu:na", "https://www.iopsys.eu/", "iopsys extension for PowerManagement", ""}, {"/BBF/"CUSTOM_PREFIX"Syslog/", "urn:iopsys-eu:na", "https://www.iopsys.eu/", "iopsys extension for Syslog", ""}, {"/BBF/SoftwareModules/", DMROOT_URI_181, DMROOT_URL_181, "SoftwareModules from "DMROOT_DESC_181, ""}, {"/BBF/"CUSTOM_PREFIX"OWSD/", "urn:iopsys-eu:na", "https://www.iopsys.eu/", "iopsys extension for OWSD", ""}, diff --git a/dmtree/tr181/device.c b/dmtree/tr181/device.c index c77902fd..167205a0 100644 --- a/dmtree/tr181/device.c +++ b/dmtree/tr181/device.c @@ -15,7 +15,6 @@ #include "managementserver.h" #include "times.h" #include "upnp.h" -#include "x_iopsys_eu_power_mgmt.h" #include "x_iopsys_eu_syslog.h" #include "xmpp.h" #include "x_iopsys_eu_owsd.h" @@ -77,7 +76,6 @@ DMOBJ tRoot_181_Obj[] = { #ifdef BBF_TR104 {"Services", &DMREAD, NULL, NULL, NULL, NULL, NULL, &DMNONE, NULL, tServicesObj, NULL, NULL, BBFDM_BOTH}, #endif -{CUSTOM_PREFIX"PowerManagement", &DMREAD, NULL, NULL, NULL, NULL, NULL, &DMNONE, NULL, NULL, tSe_PowerManagementParam, NULL, BBFDM_BOTH}, {CUSTOM_PREFIX"Syslog", &DMREAD, NULL, NULL, NULL, NULL, NULL, &DMNONE, NULL, NULL, tSe_SyslogParam, NULL, BBFDM_BOTH}, {CUSTOM_PREFIX"OWSD", &DMREAD, NULL, NULL, NULL, NULL, NULL, &DMNONE, NULL, X_IOPSYS_EU_OWSDObj, X_IOPSYS_EU_OWSDParams, NULL, BBFDM_BOTH}, {CUSTOM_PREFIX"Dropbear", &DMWRITE, add_dropbear_instance, delete_dropbear_instance, NULL, browseXIopsysEuDropbear, NULL, &DMNONE, NULL, NULL, X_IOPSYS_EU_DropbearParams, NULL, BBFDM_BOTH}, diff --git a/dmtree/tr181/x_iopsys_eu_power_mgmt.c b/dmtree/tr181/x_iopsys_eu_power_mgmt.c deleted file mode 100644 index 4d88d049..00000000 --- a/dmtree/tr181/x_iopsys_eu_power_mgmt.c +++ /dev/null @@ -1,101 +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: Imen Bhiri - * Author: Feten Besbes - * Author: Mohamed Kallel - * Author: Anis Ellouze - */ - -#include "x_iopsys_eu_power_mgmt.h" - - -static int get_pwr_mgmt_value_ethapd(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - dmuci_get_option_value_string("power_mgmt", "power_mgmt", "ethapd", value); - return 0; -} - -static int get_pwr_mgmt_value_eee(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - dmuci_get_option_value_string("power_mgmt", "power_mgmt", "eee", value); - return 0; -} - -static int get_pwr_nbr_interfaces_up(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char buf[256]; - int pp; - - *value = ""; - pp = dmcmd("pwrctl", 1, "show"); - if (pp) { - dmcmd_read(pp, buf, 256); - close(pp); - return 0; - } - return 0; -} - -static int get_pwr_nbr_interfaces_down(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char buf[256]; - int pp; - - *value = ""; - pp = dmcmd("pwrctl", 1, "show"); - if (pp) { - dmcmd_read(pp, buf, 256); - close(pp); - return 0; - } - return 0; -} - -static int set_power_mgmt_param_ethapd(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - bool b; - - switch (action) { - case VALUECHECK: - if (dm_validate_boolean(value)) - return FAULT_9007; - return 0; - case VALUESET: - string_to_bool(value, &b); - dmuci_set_value("power_mgmt", "power_mgmt", "ethapd", b ? "1" : "0"); - return 0; - } - return 0; -} - -static int set_power_mgmt_param_eee(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - bool b; - - switch (action) { - case VALUECHECK: - if (dm_validate_boolean(value)) - return FAULT_9007; - return 0; - case VALUESET: - string_to_bool(value, &b); - dmuci_set_value("power_mgmt", "power_mgmt", "eee", b ? "1" : "0"); - return 0; - } - return 0; -} - -/*** DMROOT.X_IOPSYS_EU_PowerManagement. ***/ -DMLEAF tSe_PowerManagementParam[] = { -/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/ -{"EthernetAutoPowerDownEnable", &DMWRITE, DMT_BOOL, get_pwr_mgmt_value_ethapd, set_power_mgmt_param_ethapd, NULL, NULL, BBFDM_BOTH}, -{"EnergyEfficientEthernetEnable", &DMWRITE, DMT_BOOL, get_pwr_mgmt_value_eee, set_power_mgmt_param_eee, NULL, NULL, BBFDM_BOTH}, -{"NumberOfEthernetInterfacesPoweredUp", &DMREAD, DMT_UNINT, get_pwr_nbr_interfaces_up, NULL, NULL, NULL, BBFDM_BOTH}, -{"NumberOfEthernetInterfacesPoweredDown", &DMREAD, DMT_UNINT, get_pwr_nbr_interfaces_down, NULL, NULL, NULL, BBFDM_BOTH}, -{0} -}; diff --git a/dmtree/tr181/x_iopsys_eu_power_mgmt.h b/dmtree/tr181/x_iopsys_eu_power_mgmt.h deleted file mode 100644 index b74f4307..00000000 --- a/dmtree/tr181/x_iopsys_eu_power_mgmt.h +++ /dev/null @@ -1,19 +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: Imen Bhiri - * Author: Feten Besbes - */ - -#ifndef __POWER_MGMT_H -#define __POWER_MGMT_H - -#include - -extern DMLEAF tSe_PowerManagementParam[]; - -#endif