Moved Device.Time. vendor extensions to timemngr

This commit is contained in:
Suvendhu Hansa 2024-04-15 04:33:49 +00:00 committed by Vivek Kumar Dutta
parent 6332fe98e1
commit b4aebc9c6d
3 changed files with 0 additions and 78 deletions

View file

@ -20,7 +20,6 @@
DM_MAP_OBJ tDynamicObj[] = {
/* parentobj, nextobject, parameter */
{"Device.DeviceInfo.", NULL, tIOPSYS_DeviceInfoParams},
{"Device.Time.", NULL, tIOPSYS_TimeParams},
{"Device.Bridging.Bridge.{i}.Port.{i}.", NULL, tIOPSYS_BridgingBridgePortParams},
{"Device.WiFi.AccessPoint.{i}.", NULL, tIOPSYS_WiFiAccessPointParams},
{0}

View file

@ -1,58 +0,0 @@
/*
* Copyright (C) 2021 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 <amin.benramdhane@pivasoftware.com>
*
*/
#include "times.h"
static int get_local_time_zone_name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
dmuci_get_option_value_string("system", "@system[0]", "zonename", value);
replace_char(*value, ' ', '_');
return 0;
}
static int get_time_source_interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
char *iface = NULL;
dmuci_get_option_value_string("system", "ntp", "interface", &iface);
adm_entry_get_reference_param(ctx, "Device.IP.Interface.*.Name", iface, value);
return 0;
}
static int set_time_source_interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
char *allowed_objects[] = {"Device.IP.Interface.", NULL};
struct dm_reference reference = {0};
bbf_get_reference_args(value, &reference);
switch (action) {
case VALUECHECK:
if (dm_validate_allowed_objects(ctx, &reference, allowed_objects))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value("system", "ntp", "interface", reference.value);
return 0;
}
return 0;
}
/**********************************************************************************************************************************
* OBJ & PARAM DEFINITION
***********************************************************************************************************************************/
DMLEAF tIOPSYS_TimeParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{BBF_VENDOR_PREFIX"LocalTimeZoneName", &DMREAD, DMT_STRING, get_local_time_zone_name, NULL, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"SourceInterface", &DMWRITE, DMT_STRING, get_time_source_interface, set_time_source_interface, BBFDM_BOTH, DM_FLAG_REFERENCE},
{0}
};

View file

@ -1,19 +0,0 @@
/*
* Copyright (C) 2021 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 <amin.benramdhane@pivasoftware.com>
*
*/
#ifndef __IOPSYS_TIMES_H
#define __IOPSYS_TIMES_H
#include "libbbfdm-api/dmcommon.h"
extern DMLEAF tIOPSYS_TimeParams[];
#endif //__IOPSYS_TIMES_H