mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-03-02 15:43:49 +01:00
Moved Device.Time. vendor extensions to timemngr
This commit is contained in:
parent
6332fe98e1
commit
b4aebc9c6d
3 changed files with 0 additions and 78 deletions
1
libbbfdm/dmtree/vendor/iopsys/extension.c
vendored
1
libbbfdm/dmtree/vendor/iopsys/extension.c
vendored
|
|
@ -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}
|
||||
|
|
|
|||
58
libbbfdm/dmtree/vendor/iopsys/times.c
vendored
58
libbbfdm/dmtree/vendor/iopsys/times.c
vendored
|
|
@ -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}
|
||||
};
|
||||
19
libbbfdm/dmtree/vendor/iopsys/times.h
vendored
19
libbbfdm/dmtree/vendor/iopsys/times.h
vendored
|
|
@ -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
|
||||
Loading…
Add table
Reference in a new issue