mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-03-09 02:47:08 +01:00
bbf: add support for vendor extension
This commit is contained in:
parent
3b44e4430a
commit
5e97bdb5e4
133 changed files with 8216 additions and 12800 deletions
16
README
16
README
|
|
@ -2,11 +2,11 @@ BBF Compilation
|
|||
===================
|
||||
|
||||
autoreconf -i
|
||||
./configure CC="gcc-9" --enable-tr181 --enable-tr104 --enable-tr143 --enable-libopenssl CPPFLAGS=-DCUSTOM_PREFIX=\\\"X_IOPSYS_EU_\\\"
|
||||
make
|
||||
cp bin/.libs/libbbfdm.so* /usr/lib/
|
||||
cp bin/.libs/libbbf_api.so* /usr/lib/
|
||||
mkdir /usr/include/libbbfdm
|
||||
mkdir /usr/include/libbbf_api
|
||||
cp *.h /usr/include/libbbfdm/
|
||||
cp libbbf_api/*.h /usr/include/libbbf_api/
|
||||
./configure CC="gcc-9" --enable-tr181 --enable-tr104 --enable-tr143 --enable-libopenssl --enable-vendor-extension BBF_VENDOR_LIST="iopsys"
|
||||
make CPPFLAGS=-DBBF_VENDOR_LIST=\\\"iopsys\\\" CPPFLAGS+=-DBBF_VENDOR_PREFIX=\\\"X_IOPSYS_EU_\\\"
|
||||
make install
|
||||
ldconfig
|
||||
|
||||
mkdir -p /etc/bbfdm/
|
||||
mkdir -p /etc/bbfdm/json
|
||||
mkdir -p /usr/lib/bbfdm
|
||||
|
|
|
|||
10
README.md
10
README.md
|
|
@ -491,22 +491,22 @@ The application should bring its plugin(library) file under **'/usr/lib/bbfdm/'*
|
|||
|
||||
To build a new library, you can use **example source code** under **dynamic_parameters/library** folder to help you build it.
|
||||
|
||||
Each library should contains two Root table named **“tRootDynamicObj”** and **“tRootDynamicOperate”** to define the parant path for each new object and operate.
|
||||
Each library should contains two Root table named **“tDynamicObj”** and **“tDynamicOperate”** to define the parant path for each new object and operate.
|
||||
|
||||
#### RootDynamicObject definition ####
|
||||
#### DynamicObject definition ####
|
||||

|
||||
|
||||
Each object in the **LIB_MAP_OBJ** table contains two arguments:
|
||||
Each object in the **DM_MAP_OBJ** table contains two arguments:
|
||||
|
||||
| Argument | Description |
|
||||
| ------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `parentobj` | A string of the parent object name. Example “Device.IP.Diagnostics.”, “Device.DeviceInfo”, “Device.WiFi.Radio.” |
|
||||
| `nextobject` | Pointer to a **DMOBJ** array which contains a list of the child objects. |
|
||||
|
||||
#### RootDynamicOperate definition ####
|
||||
#### DynamicOperate definition ####
|
||||

|
||||
|
||||
Each operate in the **LIB_MAP_OPERATE** table contains two arguments:
|
||||
Each operate in the **DM_MAP_OPERATE** table contains two arguments:
|
||||
|
||||
| Argument | Description |
|
||||
| ------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ lib_LTLIBRARIES += libbbfdm.la
|
|||
|
||||
libbbfdm_la_SOURCES = \
|
||||
../dmentry.c \
|
||||
../dmentrylibrary.c \
|
||||
../dmentryjson.c \
|
||||
../dmdynamiclibrary.c \
|
||||
../dmdynamicjson.c \
|
||||
../dmmemjson.c \
|
||||
../dmoperate.c \
|
||||
../dmdiagnostics.c \
|
||||
|
|
@ -47,12 +47,6 @@ libbbfdm_la_SOURCES += \
|
|||
../dmtree/tr181/managementserver.c \
|
||||
../dmtree/tr181/times.c \
|
||||
../dmtree/tr181/upnp.c \
|
||||
../dmtree/tr181/x_iopsys_eu_igmp.c \
|
||||
../dmtree/tr181/x_iopsys_eu_mld.c \
|
||||
../dmtree/tr181/x_iopsys_eu_syslog.c \
|
||||
../dmtree/tr181/x_iopsys_eu_dropbear.c \
|
||||
../dmtree/tr181/x_iopsys_eu_owsd.c \
|
||||
../dmtree/tr181/x_iopsys_eu_buttons.c \
|
||||
../dmtree/tr181/wifi.c \
|
||||
../dmtree/tr181/ethernet.c \
|
||||
../dmtree/tr181/atm.c \
|
||||
|
|
@ -83,20 +77,6 @@ libbbfdm_la_SOURCES += \
|
|||
|
||||
endif
|
||||
|
||||
if GENERIC_OPENWRT
|
||||
libbbfdm_la_SOURCES += \
|
||||
../dmtree/tr181/deviceinfo-openwrt.c \
|
||||
../dmtree/tr181/wifi-openwrt.c \
|
||||
../dmtree/tr181/hosts-openwrt.c \
|
||||
../dmtree/tr181/qos-openwrt.c
|
||||
else
|
||||
libbbfdm_la_SOURCES += \
|
||||
../dmtree/tr181/deviceinfo-iopsyswrt.c \
|
||||
../dmtree/tr181/wifi-iopsyswrt.c \
|
||||
../dmtree/tr181/hosts-iopsyswrt.c \
|
||||
../dmtree/tr181/qos-iopsyswrt.c
|
||||
endif
|
||||
|
||||
if BBF_TR104
|
||||
libbbfdm_la_SOURCES += \
|
||||
../dmtree/tr104/common.c \
|
||||
|
|
@ -116,6 +96,43 @@ libbbfdm_la_SOURCES += \
|
|||
../dmtree/tr143/diagnostics.c
|
||||
endif
|
||||
|
||||
if BBF_VENDOR_EXTENSION
|
||||
|
||||
libbbfdm_la_SOURCES += \
|
||||
../dmdynamicvendor.c \
|
||||
../dmtree/vendor/vendor.c
|
||||
|
||||
if BBF_VENDOR_IOPSYS
|
||||
libbbfdm_la_SOURCES += \
|
||||
../dmtree/vendor/iopsys/tr181/vendor.c \
|
||||
../dmtree/vendor/iopsys/tr181/device.c \
|
||||
../dmtree/vendor/iopsys/tr181/deviceinfo.c \
|
||||
../dmtree/vendor/iopsys/tr181/bridging.c \
|
||||
../dmtree/vendor/iopsys/tr181/ethernet.c \
|
||||
../dmtree/vendor/iopsys/tr181/ieee1905.c \
|
||||
../dmtree/vendor/iopsys/tr181/times.c \
|
||||
../dmtree/vendor/iopsys/tr181/x_iopsys_eu_igmp.c \
|
||||
../dmtree/vendor/iopsys/tr181/x_iopsys_eu_mld.c
|
||||
endif
|
||||
|
||||
if BBF_VENDOR_OPENWRT
|
||||
libbbfdm_la_SOURCES += \
|
||||
../dmtree/vendor/openwrt/tr181/vendor.c \
|
||||
../dmtree/vendor/openwrt/tr181/deviceinfo.c \
|
||||
../dmtree/vendor/openwrt/tr181/qos.c
|
||||
endif
|
||||
|
||||
if BBF_VENDOR_TEST
|
||||
libbbfdm_la_SOURCES += \
|
||||
../dmtree/vendor/test/tr181/vendor.c \
|
||||
../dmtree/vendor/test/tr181/deviceinfo.c \
|
||||
../dmtree/vendor/test/tr181/firewall.c \
|
||||
../dmtree/vendor/test/tr181/device.c \
|
||||
../dmtree/vendor/test/tr181/x_test_com_dropbear.c
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
libbbfdm_la_CFLAGS = \
|
||||
$(AM_CFLAGS) \
|
||||
$(LIBUCI_CFLAGS) \
|
||||
|
|
@ -144,6 +161,7 @@ libbbfdm_la_LIBADD = \
|
|||
-lbbf_api
|
||||
|
||||
libbbfdm_la_CFLAGS+=-I../
|
||||
libbbfdm_la_CFLAGS+=-I../dmtree
|
||||
libbbfdm_la_CFLAGS+=-I../dmtree/tr181
|
||||
libbbfdm_la_CFLAGS+=-I../dmtree/tr104
|
||||
libbbfdm_la_CFLAGS+=-I../dmtree/tr143
|
||||
|
|
|
|||
20
configure.ac
20
configure.ac
|
|
@ -18,8 +18,24 @@ AM_CONDITIONAL([LOPENSSL],[test "x$enable_libopenssl" = "xyes"])
|
|||
AC_ARG_ENABLE(libmbedtls, [AS_HELP_STRING([--enable-libmbedtls], [enable libmbedtls upnp feature])], AC_DEFINE(LMBEDTLS),)
|
||||
AM_CONDITIONAL([LMBEDTLS],[test "x$enable_libmbedtls" = "xyes"])
|
||||
|
||||
AC_ARG_ENABLE(generic_openwrt, [AS_HELP_STRING([--enable-generic-openwrt], [enable generic openwrt support])], AC_DEFINE(GENERIC_OPENWRT),)
|
||||
AM_CONDITIONAL([GENERIC_OPENWRT],[test "x$enable_generic_openwrt" = "xyes"])
|
||||
AC_ARG_ENABLE(vendor_extension, [AS_HELP_STRING([--enable-vendor-extension], [enable vendor extension])], AC_DEFINE(BBF_VENDOR_EXTENSION),)
|
||||
AM_CONDITIONAL([BBF_VENDOR_EXTENSION],[test "x$enable_vendor_extension" = "xyes"])
|
||||
|
||||
case $BBF_VENDOR_LIST in
|
||||
*openwrt*) vendor_openwrt=yes ;;&
|
||||
*iopsys*) vendor_iopsys=yes ;;&
|
||||
*test*) vendor_test=yes ;;&
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL([BBF_VENDOR_IOPSYS],[test "x$vendor_iopsys" = "xyes"])
|
||||
AM_COND_IF([BBF_VENDOR_IOPSYS], [AC_DEFINE(BBF_VENDOR_IOPSYS)],)
|
||||
|
||||
AM_CONDITIONAL([BBF_VENDOR_OPENWRT],[test "x$vendor_openwrt" = "xyes"])
|
||||
AM_COND_IF([BBF_VENDOR_OPENWRT], [AC_DEFINE(BBF_VENDOR_OPENWRT)],)
|
||||
|
||||
AM_CONDITIONAL([BBF_VENDOR_TEST],[test "x$vendor_test" = "xyes"])
|
||||
AM_COND_IF([BBF_VENDOR_TEST], [AC_DEFINE(BBF_VENDOR_TEST)],)
|
||||
|
||||
# checks for programs
|
||||
AC_PROG_CC
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "dmentryjson.h"
|
||||
#include "dmdynamicjson.h"
|
||||
#include "dmmemjson.h"
|
||||
#include "dmentry.h"
|
||||
|
||||
|
|
@ -18,10 +18,10 @@ LIST_HEAD(json_list);
|
|||
static void add_json_data_to_list(struct list_head *dup_list, char *name, char *arg1, const char *arg2, const char *arg3, const char *arg4,
|
||||
const char *arg5, const char *arg6, const char *arg7, const char *arg8)
|
||||
{
|
||||
struct dm_json_parameter *dm_json_parameter;
|
||||
dm_json_parameter = dmcallocjson(1, sizeof(struct dm_json_parameter));
|
||||
struct dm_json_parameter *dm_json_parameter = dmcallocjson(1, sizeof(struct dm_json_parameter));
|
||||
|
||||
list_add_tail(&dm_json_parameter->list, dup_list);
|
||||
if(name) dm_json_parameter->name = dmstrdupjson(name);
|
||||
if (name) dm_json_parameter->name = dmstrdupjson(name);
|
||||
if (arg1) dm_json_parameter->arg1 = dmstrdupjson(arg1);
|
||||
if (arg2) dm_json_parameter->arg2 = dmstrdupjson(arg2);
|
||||
if (arg3) dm_json_parameter->arg3 = dmstrdupjson(arg3);
|
||||
|
|
@ -57,15 +57,13 @@ static void free_json_data_from_list(struct list_head *dup_list)
|
|||
}
|
||||
}
|
||||
|
||||
static int dm_browse_node_json_object_tree(DMNODE *parent_node, DMOBJ *entryobj)
|
||||
static void dm_browse_node_json_object_tree(DMNODE *parent_node, DMOBJ *entryobj)
|
||||
{
|
||||
if (!entryobj)
|
||||
return 0;
|
||||
for (; (entryobj && entryobj->obj); entryobj++) {
|
||||
|
||||
for (; entryobj->obj; entryobj++) {
|
||||
if (entryobj->nextdynamicobj) {
|
||||
struct dm_dynamic_obj *next_dyn_array = entryobj->nextdynamicobj + INDX_JSON_OBJ_MOUNT;
|
||||
if (next_dyn_array->nextobj) FREE(next_dyn_array->nextobj);
|
||||
struct dm_dynamic_obj *next_dyn_array = entryobj->nextdynamicobj + INDX_JSON_MOUNT;
|
||||
FREE(next_dyn_array->nextobj);
|
||||
}
|
||||
|
||||
DMNODE node = {0};
|
||||
|
|
@ -77,15 +75,14 @@ static int dm_browse_node_json_object_tree(DMNODE *parent_node, DMOBJ *entryobj)
|
|||
if (entryobj->nextobj)
|
||||
dm_browse_node_json_object_tree(&node, entryobj->nextobj);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int free_node_object_tree_dynamic_array(DMOBJ *dm_entryobj)
|
||||
static void free_node_object_tree_dynamic_array(DMOBJ *dm_entryobj)
|
||||
{
|
||||
DMOBJ *root = dm_entryobj;
|
||||
DMNODE node = {.current_object = ""};
|
||||
|
||||
dm_browse_node_json_object_tree(&node, root);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int free_json_dynamic_arrays(DMOBJ *dm_entryobj)
|
||||
|
|
@ -146,7 +143,7 @@ static char *generate_obj_without_instance(char *full_obj, bool is_obj)
|
|||
return obj;
|
||||
}
|
||||
|
||||
int get_index_of_available_entry(DMOBJ *jentryobj)
|
||||
static int get_index_of_available_entry(DMOBJ *jentryobj)
|
||||
{
|
||||
int idx = 0;
|
||||
for (; (jentryobj && jentryobj->obj); jentryobj++) {
|
||||
|
|
@ -155,34 +152,7 @@ int get_index_of_available_entry(DMOBJ *jentryobj)
|
|||
return idx;
|
||||
}
|
||||
|
||||
static int check_json_root_obj(struct dmctx *ctx, char *in_param_json, DMOBJ **root_entry)
|
||||
{
|
||||
char *prefix_obj = NULL, *obj = NULL, *full_obj;
|
||||
int prefix_obj_found = 0, obj_found = 0;
|
||||
DMOBJ *root = ctx->dm_entryobj;
|
||||
DMNODE node = {.current_object = ""};
|
||||
|
||||
full_obj = replace_str(in_param_json, ".{i}.", ".");
|
||||
|
||||
if (strcmp(full_obj, "Device.") == 0)
|
||||
prefix_obj = full_obj;
|
||||
else
|
||||
generate_prefixobj_and_obj_full_obj(full_obj, &prefix_obj, &obj);
|
||||
|
||||
dm_check_dynamic_obj(ctx, &node, root, full_obj, prefix_obj, root_entry, &prefix_obj_found);
|
||||
if(prefix_obj_found && *root_entry) {
|
||||
dm_check_dynamic_obj(ctx, &node, root, full_obj, full_obj, root_entry, &obj_found);
|
||||
dmfreejson(full_obj);
|
||||
if(obj_found)
|
||||
return 1;
|
||||
else
|
||||
return 2;
|
||||
}
|
||||
dmfreejson(full_obj);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int browse_obj(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
static int browse_obj(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
struct dm_json_parameter *pleaf = NULL;
|
||||
char *arg1 = NULL, *arg2 = NULL, *arg3 = NULL, *arg4 = NULL, *arg5 = NULL, *arg6 = NULL;
|
||||
|
|
@ -581,7 +551,7 @@ static void parse_param(char *object, char *param, json_object *jobj, DMLEAF *pl
|
|||
{
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type(6)*/
|
||||
struct json_object *type, *protocols, *proto, *write, *mapping_arr, *mapping;
|
||||
char full_param[256] = "";
|
||||
char full_param[256] = {0};
|
||||
size_t n_proto;
|
||||
|
||||
if (!pleaf) return;
|
||||
|
|
@ -637,7 +607,6 @@ static void parse_param(char *object, char *param, json_object *jobj, DMLEAF *pl
|
|||
pleaf[i].bbfdm_type = BBFDM_BOTH;
|
||||
|
||||
snprintf(full_param, sizeof(full_param), "%s%s", object, param);
|
||||
json_object_object_get_ex(jobj, "mapping", &mapping);
|
||||
json_object_object_get_ex(jobj, "mapping", &mapping_arr);
|
||||
// for now, we have only one case
|
||||
mapping = json_object_array_get_idx(mapping_arr, 0);
|
||||
|
|
@ -652,8 +621,7 @@ static void count_obj_param_under_jsonobj(json_object *jsonobj, int *obj_number,
|
|||
if ((strcmp(key1, "type") == 0) && (strcmp(json_object_get_string(jobj1), "object") == 0)) {
|
||||
(*obj_number)++;
|
||||
break;
|
||||
}
|
||||
else if (((strcmp(key1, "type") == 0) && (strcmp(json_object_get_string(jobj1), "object") != 0)) && (strcmp(key, "mapping") != 0)) {
|
||||
} else if (((strcmp(key1, "type") == 0) && (strcmp(json_object_get_string(jobj1), "object") != 0)) && (strcmp(key, "mapping") != 0)) {
|
||||
(*param_number)++;
|
||||
break;
|
||||
}
|
||||
|
|
@ -664,7 +632,7 @@ static void count_obj_param_under_jsonobj(json_object *jsonobj, int *obj_number,
|
|||
|
||||
static void parse_obj(char *object, json_object *jobj, DMOBJ *pobj, int index, struct list_head *list)
|
||||
{
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys(12)*/
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys(13)*/
|
||||
|
||||
char *prfix_obj = NULL, *obj_str = NULL;
|
||||
int obj_number = 0, param_number = 0, i = 0, j = 0;
|
||||
|
|
@ -675,7 +643,9 @@ static void parse_obj(char *object, json_object *jobj, DMOBJ *pobj, int index, s
|
|||
char *full_obj = replace_str(object, ".{i}.", ".");
|
||||
generate_prefixobj_and_obj_full_obj(full_obj, &prfix_obj, &obj_str);
|
||||
|
||||
if (!pobj) return;
|
||||
if (!pobj)
|
||||
return;
|
||||
|
||||
//OBJ
|
||||
pobj[index].obj = obj_str;
|
||||
|
||||
|
|
@ -754,50 +724,58 @@ static void parse_obj(char *object, json_object *jobj, DMOBJ *pobj, int index, s
|
|||
|
||||
int load_json_dynamic_arrays(struct dmctx *ctx)
|
||||
{
|
||||
struct dirent *ent = NULL;
|
||||
DIR *dir = NULL;
|
||||
|
||||
if (folder_exists(JSON_FOLDER_PATH)) {
|
||||
struct dirent *ent = NULL;
|
||||
DIR *dir = NULL;
|
||||
|
||||
sysfs_foreach_file(JSON_FOLDER_PATH, dir, ent) {
|
||||
if (strstr(ent->d_name, ".json")) {
|
||||
|
||||
if (!strstr(ent->d_name, ".json"))
|
||||
continue;
|
||||
|
||||
char buf[512] = {0};
|
||||
snprintf(buf, sizeof(buf), "%s/%s", JSON_FOLDER_PATH, ent->d_name);
|
||||
|
||||
json_object *json = json_object_from_file(buf);
|
||||
if (!json) continue;
|
||||
|
||||
json_object_object_foreach(json, key, jobj) {
|
||||
if (!key)
|
||||
break;
|
||||
|
||||
char *obj_prefix = NULL;
|
||||
char *obj = NULL;
|
||||
|
||||
generate_prefixobj_and_obj_full_obj(key, &obj_prefix, &obj);
|
||||
|
||||
DMOBJ *dm_entryobj = NULL;
|
||||
json_object *json;
|
||||
char buf[280] = "";
|
||||
snprintf(buf, sizeof(buf), "%s/%s", JSON_FOLDER_PATH, ent->d_name);
|
||||
json = json_object_from_file(buf);
|
||||
if (!json) continue;
|
||||
bool obj_exists = find_root_entry(ctx, obj_prefix, &dm_entryobj);
|
||||
if (obj_exists == 0 || !dm_entryobj)
|
||||
continue;
|
||||
|
||||
json_object_object_foreach(json, key, jobj) {
|
||||
if (!key) break;
|
||||
int check_obj = check_json_root_obj(ctx, key, &dm_entryobj);
|
||||
if (check_obj == 0)
|
||||
continue;
|
||||
|
||||
if (!dm_entryobj)
|
||||
continue;
|
||||
|
||||
if (dm_entryobj->nextdynamicobj == NULL) {
|
||||
dm_entryobj->nextdynamicobj = calloc(__INDX_DYNAMIC_MAX, sizeof(struct dm_dynamic_obj));
|
||||
dm_entryobj->nextdynamicobj[INDX_JSON_OBJ_MOUNT].isstatic = 0;
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_OBJ_MOUNT].isstatic = 1;
|
||||
}
|
||||
|
||||
if (dm_entryobj->nextdynamicobj[INDX_JSON_OBJ_MOUNT].nextobj == NULL) {
|
||||
dm_entryobj->nextdynamicobj[INDX_JSON_OBJ_MOUNT].nextobj = calloc(2, sizeof(struct dm_obj_s *));
|
||||
}
|
||||
|
||||
if (dm_entryobj->nextdynamicobj[INDX_JSON_OBJ_MOUNT].nextobj[0] == NULL) {
|
||||
dm_entryobj->nextdynamicobj[INDX_JSON_OBJ_MOUNT].nextobj[0] = dmcallocjson(2, sizeof(struct dm_obj_s));
|
||||
parse_obj(key, jobj, dm_entryobj->nextdynamicobj[INDX_JSON_OBJ_MOUNT].nextobj[0], 0, &json_list);
|
||||
} else {
|
||||
int idx = get_index_of_available_entry(dm_entryobj->nextdynamicobj[INDX_JSON_OBJ_MOUNT].nextobj[0]);
|
||||
dm_entryobj->nextdynamicobj[INDX_JSON_OBJ_MOUNT].nextobj[0] = dmreallocjson(dm_entryobj->nextdynamicobj[INDX_JSON_OBJ_MOUNT].nextobj[0], (idx + 2) * sizeof(struct dm_obj_s));
|
||||
memset(dm_entryobj->nextdynamicobj[INDX_JSON_OBJ_MOUNT].nextobj[0] + (idx + 1), 0, sizeof(struct dm_obj_s));
|
||||
parse_obj(key, jobj, dm_entryobj->nextdynamicobj[INDX_JSON_OBJ_MOUNT].nextobj[0], idx, &json_list);
|
||||
}
|
||||
if (dm_entryobj->nextdynamicobj == NULL) {
|
||||
dm_entryobj->nextdynamicobj = calloc(__INDX_DYNAMIC_MAX, sizeof(struct dm_dynamic_obj));
|
||||
dm_entryobj->nextdynamicobj[INDX_JSON_MOUNT].idx_type = INDX_JSON_MOUNT;
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_MOUNT].idx_type = INDX_LIBRARY_MOUNT;
|
||||
dm_entryobj->nextdynamicobj[INDX_VENDOR_MOUNT].idx_type = INDX_VENDOR_MOUNT;
|
||||
}
|
||||
|
||||
if (dm_entryobj->nextdynamicobj[INDX_JSON_MOUNT].nextobj == NULL) {
|
||||
dm_entryobj->nextdynamicobj[INDX_JSON_MOUNT].nextobj = calloc(2, sizeof(struct dm_obj_s *));
|
||||
}
|
||||
|
||||
if (dm_entryobj->nextdynamicobj[INDX_JSON_MOUNT].nextobj[0] == NULL) {
|
||||
dm_entryobj->nextdynamicobj[INDX_JSON_MOUNT].nextobj[0] = dmcallocjson(2, sizeof(struct dm_obj_s));
|
||||
parse_obj(key, jobj, dm_entryobj->nextdynamicobj[INDX_JSON_MOUNT].nextobj[0], 0, &json_list);
|
||||
} else {
|
||||
int idx = get_index_of_available_entry(dm_entryobj->nextdynamicobj[INDX_JSON_MOUNT].nextobj[0]);
|
||||
dm_entryobj->nextdynamicobj[INDX_JSON_MOUNT].nextobj[0] = dmreallocjson(dm_entryobj->nextdynamicobj[INDX_JSON_MOUNT].nextobj[0], (idx + 2) * sizeof(struct dm_obj_s));
|
||||
memset(dm_entryobj->nextdynamicobj[INDX_JSON_MOUNT].nextobj[0] + (idx + 1), 0, sizeof(struct dm_obj_s));
|
||||
parse_obj(key, jobj, dm_entryobj->nextdynamicobj[INDX_JSON_MOUNT].nextobj[0], idx, &json_list);
|
||||
}
|
||||
if (json) json_object_put(json);
|
||||
}
|
||||
if (json) json_object_put(json);
|
||||
|
||||
}
|
||||
if (dir) closedir(dir);
|
||||
}
|
||||
170
dmdynamiclibrary.c
Normal file
170
dmdynamiclibrary.c
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
/*
|
||||
* 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 "dmdynamiclibrary.h"
|
||||
#include "dmoperate.h"
|
||||
|
||||
LIST_HEAD(loaded_library_list);
|
||||
|
||||
struct loaded_library
|
||||
{
|
||||
struct list_head list;
|
||||
void *library;
|
||||
};
|
||||
|
||||
static void add_list_loaded_libraries(struct list_head *library_list, void *library)
|
||||
{
|
||||
struct loaded_library *lib = calloc(1, sizeof(struct loaded_library));
|
||||
list_add_tail(&lib->list, library_list);
|
||||
lib->library = library;
|
||||
}
|
||||
|
||||
static void free_all_list_open_library(struct list_head *library_list)
|
||||
{
|
||||
struct loaded_library *lib;
|
||||
while (library_list->next != library_list) {
|
||||
lib = list_entry(library_list->next, struct loaded_library, list);
|
||||
list_del(&lib->list);
|
||||
if (lib->library) {
|
||||
dlclose(lib->library);
|
||||
}
|
||||
FREE(lib);
|
||||
}
|
||||
}
|
||||
|
||||
static void dm_browse_node_dynamic_object_tree(DMNODE *parent_node, DMOBJ *entryobj)
|
||||
{
|
||||
for (; (entryobj && entryobj->obj); entryobj++) {
|
||||
|
||||
if (entryobj->nextdynamicobj) {
|
||||
struct dm_dynamic_obj *next_dyn_array = entryobj->nextdynamicobj + INDX_LIBRARY_MOUNT;
|
||||
FREE(next_dyn_array->nextobj);
|
||||
}
|
||||
|
||||
if (entryobj->dynamicleaf) {
|
||||
struct dm_dynamic_leaf *next_dyn_array = entryobj->dynamicleaf + INDX_LIBRARY_MOUNT;
|
||||
FREE(next_dyn_array->nextleaf);
|
||||
}
|
||||
|
||||
DMNODE node = {0};
|
||||
node.obj = entryobj;
|
||||
node.parent = parent_node;
|
||||
node.instance_level = parent_node->instance_level;
|
||||
node.matched = parent_node->matched;
|
||||
|
||||
if (entryobj->nextobj)
|
||||
dm_browse_node_dynamic_object_tree(&node, entryobj->nextobj);
|
||||
}
|
||||
}
|
||||
|
||||
void free_library_dynamic_arrays(DMOBJ *dm_entryobj)
|
||||
{
|
||||
DMOBJ *root = dm_entryobj;
|
||||
DMNODE node = {.current_object = ""};
|
||||
|
||||
free_all_list_open_library(&loaded_library_list);
|
||||
dm_browse_node_dynamic_object_tree(&node, root);
|
||||
FREE(dynamic_operate);
|
||||
}
|
||||
|
||||
int load_library_dynamic_arrays(struct dmctx *ctx)
|
||||
{
|
||||
struct dirent *ent = NULL;
|
||||
DIR *dir = NULL;
|
||||
|
||||
if (folder_exists(LIBRARY_FOLDER_PATH)) {
|
||||
sysfs_foreach_file(LIBRARY_FOLDER_PATH, dir, ent) {
|
||||
|
||||
if (!strstr(ent->d_name, ".so"))
|
||||
continue;
|
||||
|
||||
char buf[512] = {0};
|
||||
snprintf(buf, sizeof(buf), "%s/%s", LIBRARY_FOLDER_PATH, ent->d_name);
|
||||
|
||||
void *handle = dlopen(buf, RTLD_LAZY);
|
||||
if (!handle) continue;
|
||||
|
||||
//Dynamic Object
|
||||
DM_MAP_OBJ *dynamic_obj = NULL;
|
||||
*(void **) (&dynamic_obj) = dlsym(handle, "tDynamicObj");
|
||||
if (dynamic_obj) {
|
||||
|
||||
for (int i = 0; dynamic_obj[i].path; i++) {
|
||||
|
||||
DMOBJ *dm_entryobj = NULL;
|
||||
bool obj_exists = find_root_entry(ctx, dynamic_obj[i].path, &dm_entryobj);
|
||||
if (obj_exists == false || !dm_entryobj)
|
||||
continue;
|
||||
|
||||
if (dynamic_obj[i].root_obj) {
|
||||
|
||||
if (dm_entryobj->nextdynamicobj == NULL) {
|
||||
dm_entryobj->nextdynamicobj = calloc(__INDX_DYNAMIC_MAX, sizeof(struct dm_dynamic_obj));
|
||||
dm_entryobj->nextdynamicobj[INDX_JSON_MOUNT].idx_type = INDX_JSON_MOUNT;
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_MOUNT].idx_type = INDX_LIBRARY_MOUNT;
|
||||
dm_entryobj->nextdynamicobj[INDX_VENDOR_MOUNT].idx_type = INDX_VENDOR_MOUNT;
|
||||
}
|
||||
|
||||
if (dm_entryobj->nextdynamicobj[INDX_LIBRARY_MOUNT].nextobj == NULL) {
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_MOUNT].nextobj = calloc(2, sizeof(DMOBJ *));
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_MOUNT].nextobj[0] = dynamic_obj[i].root_obj;
|
||||
} else {
|
||||
int idx = get_obj_idx_dynamic_array(dm_entryobj->nextdynamicobj[INDX_LIBRARY_MOUNT].nextobj);
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_MOUNT].nextobj = realloc(dm_entryobj->nextdynamicobj[INDX_LIBRARY_MOUNT].nextobj, (idx + 2) * sizeof(DMOBJ *));
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_MOUNT].nextobj[idx] = dynamic_obj[i].root_obj;
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_MOUNT].nextobj[idx+1] = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (dynamic_obj[i].root_leaf) {
|
||||
|
||||
if (dm_entryobj->dynamicleaf == NULL) {
|
||||
dm_entryobj->dynamicleaf = calloc(__INDX_DYNAMIC_MAX, sizeof(struct dm_dynamic_leaf));
|
||||
dm_entryobj->dynamicleaf[INDX_JSON_MOUNT].idx_type = INDX_JSON_MOUNT;
|
||||
dm_entryobj->dynamicleaf[INDX_LIBRARY_MOUNT].idx_type = INDX_LIBRARY_MOUNT;
|
||||
dm_entryobj->dynamicleaf[INDX_VENDOR_MOUNT].idx_type = INDX_VENDOR_MOUNT;
|
||||
}
|
||||
|
||||
if (dm_entryobj->dynamicleaf[INDX_LIBRARY_MOUNT].nextleaf == NULL) {
|
||||
dm_entryobj->dynamicleaf[INDX_LIBRARY_MOUNT].nextleaf = calloc(2, sizeof(DMLEAF *));
|
||||
dm_entryobj->dynamicleaf[INDX_LIBRARY_MOUNT].nextleaf[0] = dynamic_obj[i].root_leaf;
|
||||
} else {
|
||||
int idx = get_leaf_idx_dynamic_array(dm_entryobj->dynamicleaf[INDX_LIBRARY_MOUNT].nextleaf);
|
||||
dm_entryobj->dynamicleaf[INDX_LIBRARY_MOUNT].nextleaf = realloc(dm_entryobj->dynamicleaf[INDX_LIBRARY_MOUNT].nextleaf, (idx + 2) * sizeof(DMLEAF *));
|
||||
dm_entryobj->dynamicleaf[INDX_LIBRARY_MOUNT].nextleaf[idx] = dynamic_obj[i].root_leaf;
|
||||
dm_entryobj->dynamicleaf[INDX_LIBRARY_MOUNT].nextleaf[idx+1] = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Dynamic Operate
|
||||
DM_MAP_OPERATE *dynamic_operate = NULL;
|
||||
*(void **) (&dynamic_operate) = dlsym(handle, "tDynamicOperate");
|
||||
if (dynamic_operate) {
|
||||
|
||||
for (int i = 0; dynamic_operate[i].path; i++) {
|
||||
if (dynamic_operate[i].operate && dynamic_operate[i].type)
|
||||
add_dynamic_operate(dynamic_operate[i].path,
|
||||
dynamic_operate[i].operate,
|
||||
dynamic_operate[i].type);
|
||||
}
|
||||
}
|
||||
|
||||
add_list_loaded_libraries(&loaded_library_list, handle);
|
||||
|
||||
}
|
||||
if (dir) closedir(dir);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* 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
|
||||
|
|
@ -17,6 +17,6 @@
|
|||
#define LIBRARY_FOLDER_PATH "/usr/lib/bbfdm"
|
||||
|
||||
int load_library_dynamic_arrays(struct dmctx *ctx);
|
||||
int free_library_dynamic_arrays(DMOBJ *dm_entryobj);
|
||||
void free_library_dynamic_arrays(DMOBJ *dm_entryobj);
|
||||
|
||||
#endif //__DMENTRYLIBRARY_H__
|
||||
300
dmdynamicvendor.c
Normal file
300
dmdynamicvendor.c
Normal file
|
|
@ -0,0 +1,300 @@
|
|||
/*
|
||||
* 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 "dmdynamicvendor.h"
|
||||
#include "dmtree/vendor/vendor.h"
|
||||
|
||||
static void dm_browse_node_vendor_object_tree(DMNODE *parent_node, DMOBJ *entryobj)
|
||||
{
|
||||
for (; (entryobj && entryobj->obj); entryobj++) {
|
||||
|
||||
if (entryobj->nextdynamicobj) {
|
||||
struct dm_dynamic_obj *next_dyn_array = entryobj->nextdynamicobj + INDX_VENDOR_MOUNT;
|
||||
FREE(next_dyn_array->nextobj);
|
||||
}
|
||||
|
||||
if (entryobj->dynamicleaf) {
|
||||
struct dm_dynamic_leaf *next_dyn_array = entryobj->dynamicleaf + INDX_VENDOR_MOUNT;
|
||||
FREE(next_dyn_array->nextleaf);
|
||||
}
|
||||
|
||||
DMNODE node = {0};
|
||||
node.obj = entryobj;
|
||||
node.parent = parent_node;
|
||||
node.instance_level = parent_node->instance_level;
|
||||
node.matched = parent_node->matched;
|
||||
|
||||
if (entryobj->nextobj)
|
||||
dm_browse_node_vendor_object_tree(&node, entryobj->nextobj);
|
||||
}
|
||||
}
|
||||
|
||||
void free_vendor_dynamic_arrays(DMOBJ *dm_entryobj)
|
||||
{
|
||||
DMOBJ *root = dm_entryobj;
|
||||
DMNODE node = {.current_object = ""};
|
||||
|
||||
dm_browse_node_vendor_object_tree(&node, root);
|
||||
}
|
||||
|
||||
static void overwrite_param(DMOBJ *entryobj, DMLEAF *leaf)
|
||||
{
|
||||
if (entryobj->leaf) {
|
||||
|
||||
DMLEAF *entryleaf = entryobj->leaf;
|
||||
for (; (entryleaf && entryleaf->parameter); entryleaf++) {
|
||||
|
||||
if (strcmp(entryleaf->parameter, leaf->parameter) == 0) {
|
||||
entryleaf->getvalue = leaf->getvalue;
|
||||
entryleaf->setvalue = leaf->setvalue;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void overwrite_obj(DMOBJ *entryobj, DMOBJ *dmobj)
|
||||
{
|
||||
if (entryobj->nextobj) {
|
||||
|
||||
DMOBJ *entrynextobj = entryobj->nextobj;
|
||||
for (; (entrynextobj && entrynextobj->obj); entrynextobj++) {
|
||||
|
||||
if (strcmp(entrynextobj->obj, dmobj->obj) == 0) {
|
||||
|
||||
entrynextobj->addobj = dmobj->addobj;
|
||||
entrynextobj->delobj = dmobj->delobj;
|
||||
entrynextobj->checkdep = dmobj->checkdep;
|
||||
entrynextobj->browseinstobj = dmobj->browseinstobj;
|
||||
entrynextobj->get_linker = dmobj->get_linker;
|
||||
|
||||
|
||||
if (dmobj->leaf) {
|
||||
DMLEAF *leaf = dmobj->leaf;
|
||||
for (; (leaf && leaf->parameter); leaf++) {
|
||||
overwrite_param(entrynextobj, leaf);
|
||||
}
|
||||
}
|
||||
|
||||
if (dmobj->nextobj) {
|
||||
DMOBJ *dmnextobj = dmobj->nextobj;
|
||||
for (; (dmnextobj && dmnextobj->obj); dmnextobj++) {
|
||||
overwrite_obj(entrynextobj, dmnextobj);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void load_vendor_extension_arrays(struct dmctx *ctx)
|
||||
{
|
||||
char vendor_list[512] = {0};
|
||||
size_t length = 0;
|
||||
|
||||
DM_STRNCPY(vendor_list, BBF_VENDOR_LIST, sizeof(vendor_list));
|
||||
char **tokens = strsplit(vendor_list, ",", &length);
|
||||
|
||||
for (int idx = length - 1; idx >= 0; idx--) {
|
||||
|
||||
DM_MAP_VENDOR *vendor_map_obj = tVendorExtension;
|
||||
|
||||
for (int j = 0; vendor_map_obj[j].vendor; j++) {
|
||||
|
||||
if (strcmp(vendor_map_obj[j].vendor, tokens[idx]) != 0)
|
||||
continue;
|
||||
|
||||
DM_MAP_OBJ *vendor_obj = vendor_map_obj[j].vendor_obj;
|
||||
|
||||
for (int i = 0; vendor_obj[i].path; i++) {
|
||||
|
||||
DMOBJ *dm_entryobj = NULL;
|
||||
bool obj_exists = find_root_entry(ctx, vendor_obj[i].path, &dm_entryobj);
|
||||
if (obj_exists == false || !dm_entryobj)
|
||||
continue;
|
||||
|
||||
if (vendor_obj[i].root_obj) {
|
||||
if (dm_entryobj->nextdynamicobj == NULL) {
|
||||
dm_entryobj->nextdynamicobj = calloc(__INDX_DYNAMIC_MAX, sizeof(struct dm_dynamic_obj));
|
||||
dm_entryobj->nextdynamicobj[INDX_JSON_MOUNT].idx_type = INDX_JSON_MOUNT;
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_MOUNT].idx_type = INDX_LIBRARY_MOUNT;
|
||||
dm_entryobj->nextdynamicobj[INDX_VENDOR_MOUNT].idx_type = INDX_VENDOR_MOUNT;
|
||||
}
|
||||
|
||||
if (dm_entryobj->nextdynamicobj[INDX_VENDOR_MOUNT].nextobj == NULL) {
|
||||
dm_entryobj->nextdynamicobj[INDX_VENDOR_MOUNT].nextobj = calloc(2, sizeof(DMOBJ *));
|
||||
dm_entryobj->nextdynamicobj[INDX_VENDOR_MOUNT].nextobj[0] = vendor_obj[i].root_obj;
|
||||
} else {
|
||||
int idx = get_obj_idx_dynamic_array(dm_entryobj->nextdynamicobj[INDX_VENDOR_MOUNT].nextobj);
|
||||
dm_entryobj->nextdynamicobj[INDX_VENDOR_MOUNT].nextobj = realloc(dm_entryobj->nextdynamicobj[INDX_VENDOR_MOUNT].nextobj, (idx + 2) * sizeof(DMOBJ *));
|
||||
dm_entryobj->nextdynamicobj[INDX_VENDOR_MOUNT].nextobj[idx] = vendor_obj[i].root_obj;
|
||||
dm_entryobj->nextdynamicobj[INDX_VENDOR_MOUNT].nextobj[idx+1] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (vendor_obj[i].root_leaf) {
|
||||
if (dm_entryobj->dynamicleaf == NULL) {
|
||||
dm_entryobj->dynamicleaf = calloc(__INDX_DYNAMIC_MAX, sizeof(struct dm_dynamic_leaf));
|
||||
dm_entryobj->dynamicleaf[INDX_JSON_MOUNT].idx_type = INDX_JSON_MOUNT;
|
||||
dm_entryobj->dynamicleaf[INDX_LIBRARY_MOUNT].idx_type = INDX_LIBRARY_MOUNT;
|
||||
dm_entryobj->dynamicleaf[INDX_VENDOR_MOUNT].idx_type = INDX_VENDOR_MOUNT;
|
||||
}
|
||||
|
||||
if (dm_entryobj->dynamicleaf[INDX_VENDOR_MOUNT].nextleaf == NULL) {
|
||||
dm_entryobj->dynamicleaf[INDX_VENDOR_MOUNT].nextleaf = calloc(2, sizeof(DMLEAF *));
|
||||
dm_entryobj->dynamicleaf[INDX_VENDOR_MOUNT].nextleaf[0] = vendor_obj[i].root_leaf;
|
||||
} else {
|
||||
int idx = get_leaf_idx_dynamic_array(dm_entryobj->dynamicleaf[INDX_VENDOR_MOUNT].nextleaf);
|
||||
dm_entryobj->dynamicleaf[INDX_VENDOR_MOUNT].nextleaf = realloc(dm_entryobj->dynamicleaf[INDX_VENDOR_MOUNT].nextleaf, (idx + 2) * sizeof(DMLEAF *));
|
||||
dm_entryobj->dynamicleaf[INDX_VENDOR_MOUNT].nextleaf[idx] = vendor_obj[i].root_leaf;
|
||||
dm_entryobj->dynamicleaf[INDX_VENDOR_MOUNT].nextleaf[idx+1] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void load_vendor_extension_overwrite_arrays(struct dmctx *ctx)
|
||||
{
|
||||
char vendor_list[512] = {0};
|
||||
size_t length = 0;
|
||||
|
||||
DM_STRNCPY(vendor_list, BBF_VENDOR_LIST, sizeof(vendor_list));
|
||||
char **tokens = strsplit(vendor_list, ",", &length);
|
||||
|
||||
for (int idx = length - 1; idx >= 0; idx--) {
|
||||
|
||||
DM_MAP_VENDOR *vendor_map_obj = tVendorExtensionOverwrite;
|
||||
|
||||
for (int j = 0; vendor_map_obj[j].vendor; j++) {
|
||||
|
||||
if (strcmp(vendor_map_obj[j].vendor, tokens[idx]) != 0)
|
||||
continue;
|
||||
|
||||
DM_MAP_OBJ *dynamic_overwrite_obj = vendor_map_obj[j].vendor_obj;
|
||||
DMOBJ *dm_entryobj = NULL;
|
||||
|
||||
for (int i = 0; dynamic_overwrite_obj[i].path; i++) {
|
||||
|
||||
bool obj_exists = find_root_entry(ctx, dynamic_overwrite_obj[i].path, &dm_entryobj);
|
||||
if (obj_exists == false || !dm_entryobj)
|
||||
continue;
|
||||
|
||||
if (dynamic_overwrite_obj[i].root_obj) {
|
||||
DMOBJ *dmobj = dynamic_overwrite_obj[i].root_obj;
|
||||
for (; (dmobj && dmobj->obj); dmobj++) {
|
||||
overwrite_obj(dm_entryobj, dmobj);
|
||||
}
|
||||
}
|
||||
|
||||
if (dynamic_overwrite_obj[i].root_leaf) {
|
||||
DMLEAF *leaf = dynamic_overwrite_obj[i].root_leaf;
|
||||
for (; (leaf && leaf->parameter); leaf++) {
|
||||
overwrite_param(dm_entryobj, leaf);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void exclude_obj(struct dmctx *ctx, char *in_obj)
|
||||
{
|
||||
DMOBJ *root = ctx->dm_entryobj;
|
||||
DMNODE node = {.current_object = ""};
|
||||
|
||||
char *obj_path = replace_str(in_obj, ".{i}.", ".");
|
||||
dm_exclude_obj(ctx, &node, root, obj_path);
|
||||
dmfree(obj_path);
|
||||
}
|
||||
|
||||
static void exclude_param(struct dmctx *ctx, char *in_param)
|
||||
{
|
||||
DMOBJ *entryobj = NULL;
|
||||
char obj_prefix[256] = {'\0'};
|
||||
|
||||
char *ret = strrchr(in_param, '.');
|
||||
strncpy(obj_prefix, in_param, ret - in_param +1);
|
||||
|
||||
bool obj_exists = find_root_entry(ctx, obj_prefix, &entryobj);
|
||||
|
||||
if (entryobj && obj_exists == true) {
|
||||
DMLEAF *leaf = entryobj->leaf;
|
||||
|
||||
for (; (leaf && leaf->parameter); leaf++) {
|
||||
|
||||
char *full_param;
|
||||
|
||||
dmastrcat(&full_param, obj_prefix, leaf->parameter);
|
||||
if (strcmp(full_param, in_param) == 0) {
|
||||
leaf->bbfdm_type = BBFDM_NONE;
|
||||
dmfree(full_param);
|
||||
return;
|
||||
}
|
||||
|
||||
dmfree(full_param);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void load_vendor_extension_exclude_arrays(struct dmctx *ctx)
|
||||
{
|
||||
char vendor_list[512] = {0};
|
||||
size_t length = 0;
|
||||
|
||||
DM_STRNCPY(vendor_list, BBF_VENDOR_LIST, sizeof(vendor_list));
|
||||
char **tokens = strsplit(vendor_list, ",", &length);
|
||||
|
||||
for (int idx = length - 1; idx >= 0; idx--) {
|
||||
|
||||
DM_MAP_VENDOR_EXCLUDE *vendor_map_exclude_obj = tVendorExtensionExclude;
|
||||
|
||||
for (int j = 0; vendor_map_exclude_obj[j].vendor; j++) {
|
||||
|
||||
if (strcmp(vendor_map_exclude_obj[j].vendor, tokens[idx]) != 0)
|
||||
continue;
|
||||
|
||||
char **dynamic_exclude_obj = vendor_map_exclude_obj[j].vendor_obj;
|
||||
|
||||
for (; *dynamic_exclude_obj; dynamic_exclude_obj++) {
|
||||
|
||||
if ((*dynamic_exclude_obj)[strlen(*dynamic_exclude_obj) - 1] == '.')
|
||||
exclude_obj(ctx, *dynamic_exclude_obj);
|
||||
else
|
||||
exclude_param(ctx, *dynamic_exclude_obj);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void load_vendor_dynamic_arrays(struct dmctx *ctx)
|
||||
{
|
||||
load_vendor_extension_arrays(ctx);
|
||||
load_vendor_extension_overwrite_arrays(ctx);
|
||||
load_vendor_extension_exclude_arrays(ctx);
|
||||
}
|
||||
20
dmdynamicvendor.h
Normal file
20
dmdynamicvendor.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* 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 __DMENTRYVENDOR_H__
|
||||
#define __DMENTRYVENDOR_H__
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
void load_vendor_dynamic_arrays(struct dmctx *ctx);
|
||||
void free_vendor_dynamic_arrays(DMOBJ *dm_entryobj);
|
||||
|
||||
#endif //__DMENTRYVENDOR_H__
|
||||
42
dmentry.c
42
dmentry.c
|
|
@ -13,8 +13,9 @@
|
|||
*/
|
||||
|
||||
#include "dmentry.h"
|
||||
#include "dmentryjson.h"
|
||||
#include "dmentrylibrary.h"
|
||||
#include "dmdynamicjson.h"
|
||||
#include "dmdynamiclibrary.h"
|
||||
#include "dmdynamicvendor.h"
|
||||
#include "dmoperate.h"
|
||||
#include "device.h"
|
||||
#include "dmbbfcommon.h"
|
||||
|
|
@ -24,6 +25,10 @@ LIST_HEAD(head_package_change);
|
|||
static char json_hash[64] = {0};
|
||||
static char library_hash[64] = {0};
|
||||
|
||||
#ifdef BBF_VENDOR_EXTENSION
|
||||
static bool first_boot = false;
|
||||
#endif
|
||||
|
||||
int usp_fault_map(int fault)
|
||||
{
|
||||
int out_fault;
|
||||
|
|
@ -119,18 +124,7 @@ static int dm_ctx_init_custom(struct dmctx *ctx, unsigned int instance_mode, int
|
|||
ctx->end_session_flag = 0;
|
||||
return 0;
|
||||
}
|
||||
void dm_ctx_init_list_parameter(struct dmctx *ctx)
|
||||
{
|
||||
INIT_LIST_HEAD(&ctx->list_parameter);
|
||||
INIT_LIST_HEAD(&ctx->set_list_tmp);
|
||||
INIT_LIST_HEAD(&ctx->list_fault_param);
|
||||
}
|
||||
void dm_ctx_clean_list_parameter(struct dmctx *ctx)
|
||||
{
|
||||
free_all_list_parameter(ctx);
|
||||
free_all_set_list_tmp(ctx);
|
||||
free_all_list_fault_param(ctx);
|
||||
}
|
||||
|
||||
static int dm_ctx_clean_custom(struct dmctx *ctx, int custom)
|
||||
{
|
||||
free_all_list_parameter(ctx);
|
||||
|
|
@ -427,7 +421,7 @@ static int check_stats_folder(bool json_path)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int load_dynamic_arrays(struct dmctx *ctx)
|
||||
void load_dynamic_arrays(struct dmctx *ctx)
|
||||
{
|
||||
// Load dynamic objects and parameters exposed via a JSON file
|
||||
if (check_stats_folder(true)) {
|
||||
|
|
@ -441,17 +435,25 @@ int load_dynamic_arrays(struct dmctx *ctx)
|
|||
load_library_dynamic_arrays(ctx);
|
||||
}
|
||||
|
||||
return 0;
|
||||
#ifdef BBF_VENDOR_EXTENSION
|
||||
// Load objects and parameters exposed via vendor extension
|
||||
if (first_boot == false) {
|
||||
free_vendor_dynamic_arrays(tEntry181Obj);
|
||||
load_vendor_dynamic_arrays(ctx);
|
||||
first_boot = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int free_dynamic_arrays(void)
|
||||
void free_dynamic_arrays(void)
|
||||
{
|
||||
DMOBJ *root = tEntry181Obj;
|
||||
DMNODE node = {.current_object = ""};
|
||||
|
||||
free_dm_browse_node_dynamic_object_tree(&node, root);
|
||||
free_json_dynamic_arrays(tEntry181Obj);
|
||||
free_library_dynamic_arrays(tEntry181Obj);
|
||||
|
||||
return 0;
|
||||
#ifdef BBF_VENDOR_EXTENSION
|
||||
free_vendor_dynamic_arrays(tEntry181Obj);
|
||||
#endif
|
||||
free_dm_browse_node_dynamic_object_tree(&node, root);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,16 +28,12 @@ int dm_ctx_init(struct dmctx *ctx, unsigned int instance_mode);
|
|||
int dm_ctx_init_sub(struct dmctx *ctx, unsigned int instance_mode);
|
||||
int dm_entry_param_method(struct dmctx *ctx, int cmd, char *inparam, char *arg1, char *arg2);
|
||||
int dm_entry_apply(struct dmctx *ctx, int cmd, char *arg1, char *arg2);
|
||||
int adm_entry_get_linker_param(struct dmctx *ctx, char *param, char *linker, char **value);
|
||||
int adm_entry_get_linker_value(struct dmctx *ctx, char *param, char **value);
|
||||
int dm_entry_restart_services(void);
|
||||
int dm_entry_revert_changes(void);
|
||||
int usp_fault_map(int fault);
|
||||
int dm_ctx_clean(struct dmctx *ctx);
|
||||
int dm_ctx_clean_sub(struct dmctx *ctx);
|
||||
int load_dynamic_arrays(struct dmctx *ctx);
|
||||
int free_dynamic_arrays(void);
|
||||
void dm_ctx_init_list_parameter(struct dmctx *ctx);
|
||||
void dm_ctx_clean_list_parameter(struct dmctx *ctx);
|
||||
void load_dynamic_arrays(struct dmctx *ctx);
|
||||
void free_dynamic_arrays(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
128
dmentrylibrary.c
128
dmentrylibrary.c
|
|
@ -1,128 +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 Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "dmentrylibrary.h"
|
||||
#include "dmoperate.h"
|
||||
|
||||
static int dm_browse_node_dynamic_object_tree(DMNODE *parent_node, DMOBJ *entryobj)
|
||||
{
|
||||
if (!entryobj)
|
||||
return 0;
|
||||
|
||||
for (; entryobj->obj; entryobj++) {
|
||||
if (entryobj->nextdynamicobj) {
|
||||
struct dm_dynamic_obj *next_dyn_array = entryobj->nextdynamicobj + INDX_LIBRARY_OBJ_MOUNT;
|
||||
if (next_dyn_array->nextobj) FREE(next_dyn_array->nextobj);
|
||||
}
|
||||
|
||||
DMNODE node = {0};
|
||||
node.obj = entryobj;
|
||||
node.parent = parent_node;
|
||||
node.instance_level = parent_node->instance_level;
|
||||
node.matched = parent_node->matched;
|
||||
|
||||
if (entryobj->nextobj)
|
||||
dm_browse_node_dynamic_object_tree(&node, entryobj->nextobj);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int free_library_dynamic_arrays(DMOBJ *dm_entryobj)
|
||||
{
|
||||
DMOBJ *root = dm_entryobj;
|
||||
DMNODE node = {.current_object = ""};
|
||||
dm_browse_node_dynamic_object_tree(&node, root);
|
||||
FREE(dynamic_operate);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int check_library_root_obj(struct dmctx *ctx, char *in_param, DMOBJ **root_entry)
|
||||
{
|
||||
int obj_found = 0;
|
||||
DMOBJ *root = ctx->dm_entryobj;
|
||||
DMNODE node = {.current_object = ""};
|
||||
dm_check_dynamic_obj(ctx, &node, root, in_param, in_param, root_entry, &obj_found);
|
||||
if(obj_found && *root_entry) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_index_of_available_dynamic_array(struct dm_obj_s **jentryobj)
|
||||
{
|
||||
int i, idx = 0;
|
||||
for (i = 0; jentryobj[i]; i++) {
|
||||
idx++;
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
|
||||
int load_library_dynamic_arrays(struct dmctx *ctx)
|
||||
{
|
||||
struct dirent *ent = NULL;
|
||||
DIR *dir = NULL;
|
||||
|
||||
if (folder_exists(LIBRARY_FOLDER_PATH)) {
|
||||
sysfs_foreach_file(LIBRARY_FOLDER_PATH, dir, ent) {
|
||||
if (strstr(ent->d_name, ".so")) {
|
||||
void *handle;
|
||||
LIB_MAP_OBJ *root_dynamic_obj = NULL;
|
||||
LIB_MAP_OPERATE *root_dynamic_operate = NULL;
|
||||
DMOBJ *dm_entryobj = NULL;
|
||||
char buf[280] = "";
|
||||
int i;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/%s", LIBRARY_FOLDER_PATH, ent->d_name);
|
||||
handle = dlopen(buf, RTLD_LAZY);
|
||||
if (!handle) continue;
|
||||
|
||||
//Dynamic Object
|
||||
*(void **) (&root_dynamic_obj) = dlsym(handle, "tRootDynamicObj");
|
||||
if(root_dynamic_obj) {
|
||||
for (i = 0; root_dynamic_obj[i].path; i++) {
|
||||
if (!root_dynamic_obj[i].root_obj) continue;
|
||||
int check_obj = check_library_root_obj(ctx, root_dynamic_obj[i].path, &dm_entryobj);
|
||||
if ((check_obj == 0) || (!dm_entryobj)) continue;
|
||||
|
||||
if (dm_entryobj->nextdynamicobj == NULL) {
|
||||
dm_entryobj->nextdynamicobj = calloc(__INDX_DYNAMIC_MAX, sizeof(struct dm_dynamic_obj));
|
||||
dm_entryobj->nextdynamicobj[INDX_JSON_OBJ_MOUNT].isstatic = 0;
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_OBJ_MOUNT].isstatic = 1;
|
||||
}
|
||||
|
||||
if (dm_entryobj->nextdynamicobj[INDX_LIBRARY_OBJ_MOUNT].nextobj == NULL) {
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_OBJ_MOUNT].nextobj = calloc(2, sizeof(struct dm_obj_s *));
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_OBJ_MOUNT].nextobj[0] = root_dynamic_obj[i].root_obj;
|
||||
} else {
|
||||
int idx = get_index_of_available_dynamic_array(dm_entryobj->nextdynamicobj[INDX_LIBRARY_OBJ_MOUNT].nextobj);
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_OBJ_MOUNT].nextobj = realloc(dm_entryobj->nextdynamicobj[INDX_LIBRARY_OBJ_MOUNT].nextobj, (idx + 2) * sizeof(struct dm_obj_s *));
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_OBJ_MOUNT].nextobj[idx] = root_dynamic_obj[i].root_obj;
|
||||
dm_entryobj->nextdynamicobj[INDX_LIBRARY_OBJ_MOUNT].nextobj[idx+1] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Dynamic Operate
|
||||
*(void **) (&root_dynamic_operate) = dlsym(handle, "tRootDynamicOperate");
|
||||
if(root_dynamic_operate) {
|
||||
for (i = 0; root_dynamic_operate[i].path; i++) {
|
||||
if (root_dynamic_operate[i].operate && root_dynamic_operate[i].type)
|
||||
add_dynamic_operate(root_dynamic_operate[i].path,
|
||||
root_dynamic_operate[i].operate,
|
||||
root_dynamic_operate[i].type);
|
||||
}
|
||||
}
|
||||
|
||||
if (handle) dlclose(handle);
|
||||
}
|
||||
}
|
||||
if (dir) closedir(dir);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1177,7 +1177,8 @@ void operate_list_cmds(struct dmctx *dmctx)
|
|||
size_t i;
|
||||
struct op_cmd *save_pointer = NULL;
|
||||
|
||||
if (dynamic_operate) save_pointer = dynamic_operate;
|
||||
if (dynamic_operate)
|
||||
save_pointer = dynamic_operate;
|
||||
|
||||
for(i = 0; i < n; i++) {
|
||||
param = dmstrdup(operate_helper[i].name);
|
||||
|
|
@ -1193,7 +1194,8 @@ void operate_list_cmds(struct dmctx *dmctx)
|
|||
add_list_parameter(dmctx, param, (char *)args, type, NULL);
|
||||
}
|
||||
|
||||
if (save_pointer)dynamic_operate = save_pointer;
|
||||
if (save_pointer)
|
||||
dynamic_operate = save_pointer;
|
||||
}
|
||||
|
||||
static opr_ret_t do_operate(struct dmctx *dmctx, char *path, operation func, const char *input)
|
||||
|
|
|
|||
|
|
@ -268,22 +268,22 @@ static int set_service_alias(char *refparam, struct dmctx *ctx, void *data, char
|
|||
***********************************************************************************************************************************/
|
||||
/* *** Device.Services. *** */
|
||||
DMOBJ tServicesObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"VoiceService", &DMREAD, NULL, NULL, "file:/etc/config/asterisk", browseVoiceServiceInst, NULL, tServicesVoiceServiceObj, tServicesVoiceServiceParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"VoiceService", &DMREAD, NULL, NULL, "file:/etc/config/asterisk", browseVoiceServiceInst, NULL, NULL, tServicesVoiceServiceObj, tServicesVoiceServiceParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.Services.VoiceService.{i}. *** */
|
||||
DMOBJ tServicesVoiceServiceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Capabilities", &DMREAD, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceCapabilitiesObj, tServicesVoiceServiceCapabilitiesParams, NULL, BBFDM_BOTH},
|
||||
{"ReservedPorts", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceReservedPortsParams, NULL, BBFDM_BOTH},
|
||||
{"POTS", &DMREAD, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServicePOTSObj, tServicesVoiceServicePOTSParams, NULL, BBFDM_BOTH},
|
||||
{"SIP", &DMREAD, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceSIPObj, NULL, NULL, BBFDM_BOTH},
|
||||
{"CallControl", &DMREAD, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceCallControlObj, NULL, NULL, BBFDM_BOTH},
|
||||
{"CallLog", &DMREAD, NULL, NULL, NULL, browseServicesVoiceServiceCallLogInst, NULL, NULL, tServicesVoiceServiceCallLogParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"VoIPProfile", &DMWRITE, addObjServicesVoiceServiceVoIPProfile, delObjServicesVoiceServiceVoIPProfile, NULL, browseServicesVoiceServiceVoIPProfileInst, NULL, tServicesVoiceServiceVoIPProfileObj, tServicesVoiceServiceVoIPProfileParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"CodecProfile", &DMWRITE, addObjServicesVoiceServiceCodecProfile, delObjServicesVoiceServiceCodecProfile, NULL, browseServicesVoiceServiceCodecProfileInst, NULL, NULL, tServicesVoiceServiceCodecProfileParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Capabilities", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceCapabilitiesObj, tServicesVoiceServiceCapabilitiesParams, NULL, BBFDM_BOTH},
|
||||
{"ReservedPorts", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceReservedPortsParams, NULL, BBFDM_BOTH},
|
||||
{"POTS", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServicePOTSObj, tServicesVoiceServicePOTSParams, NULL, BBFDM_BOTH},
|
||||
{"SIP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceSIPObj, NULL, NULL, BBFDM_BOTH},
|
||||
{"CallControl", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceCallControlObj, NULL, NULL, BBFDM_BOTH},
|
||||
{"CallLog", &DMREAD, NULL, NULL, NULL, browseServicesVoiceServiceCallLogInst, NULL, NULL, NULL, tServicesVoiceServiceCallLogParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"VoIPProfile", &DMWRITE, addObjServicesVoiceServiceVoIPProfile, delObjServicesVoiceServiceVoIPProfile, NULL, browseServicesVoiceServiceVoIPProfileInst, NULL, NULL, tServicesVoiceServiceVoIPProfileObj, tServicesVoiceServiceVoIPProfileParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"CodecProfile", &DMWRITE, addObjServicesVoiceServiceCodecProfile, delObjServicesVoiceServiceCodecProfile, NULL, browseServicesVoiceServiceCodecProfileInst, NULL, NULL, NULL, tServicesVoiceServiceCodecProfileParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -524,12 +524,12 @@ static int set_ServicesVoiceServiceCallControlCallingFeaturesSetSCREJ_CallingNum
|
|||
***********************************************************************************************************************************/
|
||||
/* *** Device.Services.VoiceService.{i}.CallControl. *** */
|
||||
DMOBJ tServicesVoiceServiceCallControlObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Line", &DMWRITE, addObjServicesVoiceServiceCallControlLine, delObjServicesVoiceServiceCallControlLine, NULL, browseServicesVoiceServiceCallControlLineInst, NULL, NULL, tServicesVoiceServiceCallControlLineParams, get_voice_service_line_linker, BBFDM_BOTH, LIST_KEY{"DirectoryNumber", "Alias", NULL}},
|
||||
{"IncomingMap", &DMWRITE, addObjServicesVoiceServiceCallControlIncomingMap, delObjServicesVoiceServiceCallControlIncomingMap, NULL, browseServicesVoiceServiceCallControlIncomingMapInst, NULL, NULL, tServicesVoiceServiceCallControlIncomingMapParams, NULL, BBFDM_BOTH, LIST_KEY{"Line", "Extension", "Alias", NULL}},
|
||||
{"OutgoingMap", &DMWRITE, addObjServicesVoiceServiceCallControlOutgoingMap, delObjServicesVoiceServiceCallControlOutgoingMap, NULL, browseServicesVoiceServiceCallControlOutgoingMapInst, NULL, NULL, tServicesVoiceServiceCallControlOutgoingMapParams, NULL, BBFDM_BOTH, LIST_KEY{"Extension", "Line", "Alias", NULL}},
|
||||
{"NumberingPlan", &DMWRITE, addObjServicesVoiceServiceCallControlNumberingPlan, delObjServicesVoiceServiceCallControlNumberingPlan, NULL, browseServicesVoiceServiceCallControlNumberingPlanInst, NULL, NULL, tServicesVoiceServiceCallControlNumberingPlanParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"CallingFeatures", &DMREAD, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceCallControlCallingFeaturesObj, NULL, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Line", &DMWRITE, addObjServicesVoiceServiceCallControlLine, delObjServicesVoiceServiceCallControlLine, NULL, browseServicesVoiceServiceCallControlLineInst, NULL, NULL, NULL, tServicesVoiceServiceCallControlLineParams, get_voice_service_line_linker, BBFDM_BOTH, LIST_KEY{"DirectoryNumber", "Alias", NULL}},
|
||||
{"IncomingMap", &DMWRITE, addObjServicesVoiceServiceCallControlIncomingMap, delObjServicesVoiceServiceCallControlIncomingMap, NULL, browseServicesVoiceServiceCallControlIncomingMapInst, NULL, NULL, NULL, tServicesVoiceServiceCallControlIncomingMapParams, NULL, BBFDM_BOTH, LIST_KEY{"Line", "Extension", "Alias", NULL}},
|
||||
{"OutgoingMap", &DMWRITE, addObjServicesVoiceServiceCallControlOutgoingMap, delObjServicesVoiceServiceCallControlOutgoingMap, NULL, browseServicesVoiceServiceCallControlOutgoingMapInst, NULL, NULL, NULL, tServicesVoiceServiceCallControlOutgoingMapParams, NULL, BBFDM_BOTH, LIST_KEY{"Extension", "Line", "Alias", NULL}},
|
||||
{"NumberingPlan", &DMWRITE, addObjServicesVoiceServiceCallControlNumberingPlan, delObjServicesVoiceServiceCallControlNumberingPlan, NULL, browseServicesVoiceServiceCallControlNumberingPlanInst, NULL, NULL, NULL, tServicesVoiceServiceCallControlNumberingPlanParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"CallingFeatures", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceCallControlCallingFeaturesObj, NULL, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -567,15 +567,15 @@ DMLEAF tServicesVoiceServiceCallControlNumberingPlanParams[] = {
|
|||
|
||||
/* *** Device.Services.VoiceService.{i}.CallControl.CallingFeatures. *** */
|
||||
DMOBJ tServicesVoiceServiceCallControlCallingFeaturesObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Set", &DMWRITE, addObjServicesVoiceServiceCallControlCallingFeaturesSet, delObjServicesVoiceServiceCallControlCallingFeaturesSet, NULL, browseServicesVoiceServiceCallControlCallingFeaturesSetInst, NULL, tServicesVoiceServiceCallControlCallingFeaturesSetObj, tServicesVoiceServiceCallControlCallingFeaturesSetParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Set", &DMWRITE, addObjServicesVoiceServiceCallControlCallingFeaturesSet, delObjServicesVoiceServiceCallControlCallingFeaturesSet, NULL, browseServicesVoiceServiceCallControlCallingFeaturesSetInst, NULL, NULL, tServicesVoiceServiceCallControlCallingFeaturesSetObj, tServicesVoiceServiceCallControlCallingFeaturesSetParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}. *** */
|
||||
DMOBJ tServicesVoiceServiceCallControlCallingFeaturesSetObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"SCREJ", &DMWRITE, addObjServicesVoiceServiceCallControlCallingFeaturesSetSCREJ, delObjServicesVoiceServiceCallControlCallingFeaturesSetSCREJ, NULL, browseServicesVoiceServiceCallControlCallingFeaturesSetSCREJInst, NULL, NULL, tServicesVoiceServiceCallControlCallingFeaturesSetSCREJParams, NULL, BBFDM_BOTH, LIST_KEY{"CallingNumber", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"SCREJ", &DMWRITE, addObjServicesVoiceServiceCallControlCallingFeaturesSetSCREJ, delObjServicesVoiceServiceCallControlCallingFeaturesSetSCREJ, NULL, browseServicesVoiceServiceCallControlCallingFeaturesSetSCREJInst, NULL, NULL, NULL, tServicesVoiceServiceCallControlCallingFeaturesSetSCREJParams, NULL, BBFDM_BOTH, LIST_KEY{"CallingNumber", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -178,9 +178,9 @@ static int get_ServicesVoiceServiceCapabilitiesCodec_PacketizationPeriod(char *r
|
|||
/* *** Device.Services.VoiceService.{i}.Capabilities. *** */
|
||||
DMOBJ tServicesVoiceServiceCapabilitiesObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"SIP", &DMREAD, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceCapabilitiesSIPObj, NULL, NULL, BBFDM_BOTH},
|
||||
{"POTS", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceCapabilitiesPOTSParams, NULL, BBFDM_BOTH},
|
||||
{"Codec", &DMREAD, NULL, NULL, NULL, browseServicesVoiceServiceCapabilitiesCodecInst, NULL, NULL, tServicesVoiceServiceCapabilitiesCodecParams, get_voice_service_capabilities_codec_linker, BBFDM_BOTH, LIST_KEY{"Alias", "Codec", "BitRate", NULL}},
|
||||
{"SIP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceCapabilitiesSIPObj, NULL, NULL, BBFDM_BOTH},
|
||||
{"POTS", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceCapabilitiesPOTSParams, NULL, BBFDM_BOTH},
|
||||
{"Codec", &DMREAD, NULL, NULL, NULL, browseServicesVoiceServiceCapabilitiesCodecInst, NULL, NULL, NULL, tServicesVoiceServiceCapabilitiesCodecParams, get_voice_service_capabilities_codec_linker, BBFDM_BOTH, LIST_KEY{"Alias", "Codec", "BitRate", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -196,8 +196,8 @@ DMLEAF tServicesVoiceServiceCapabilitiesParams[] = {
|
|||
|
||||
/* *** Device.Services.VoiceService.{i}.Capabilities.SIP. *** */
|
||||
DMOBJ tServicesVoiceServiceCapabilitiesSIPObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceCapabilitiesSIPClientParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceCapabilitiesSIPClientParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -193,8 +193,8 @@ static int set_ServicesVoiceServicePOTSFXSVoiceProcessing_EchoCancellationEnable
|
|||
***********************************************************************************************************************************/
|
||||
/* *** Device.Services.VoiceService.{i}.POTS. *** */
|
||||
DMOBJ tServicesVoiceServicePOTSObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"FXS", &DMREAD, NULL, NULL, NULL, browseServicesVoiceServicePOTSFXSInst, NULL, tServicesVoiceServicePOTSFXSObj, tServicesVoiceServicePOTSFXSParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"FXS", &DMREAD, NULL, NULL, NULL, browseServicesVoiceServicePOTSFXSInst, NULL, NULL, tServicesVoiceServicePOTSFXSObj, tServicesVoiceServicePOTSFXSParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -206,8 +206,8 @@ DMLEAF tServicesVoiceServicePOTSParams[] = {
|
|||
|
||||
/* *** Device.Services.VoiceService.{i}.POTS.FXS.{i}. *** */
|
||||
DMOBJ tServicesVoiceServicePOTSFXSObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"VoiceProcessing", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServicePOTSFXSVoiceProcessingParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"VoiceProcessing", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServicePOTSFXSVoiceProcessingParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -983,16 +983,16 @@ static int set_ServicesVoiceServiceSIPNetworkFQDNServer_Port(char *refparam, str
|
|||
***********************************************************************************************************************************/
|
||||
/* *** Device.Services.VoiceService.{i}.SIP. *** */
|
||||
DMOBJ tServicesVoiceServiceSIPObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMWRITE, addObjServicesVoiceServiceSIPClient, delObjServicesVoiceServiceSIPClient, NULL, browseServicesVoiceServiceSIPClientInst, NULL, tServicesVoiceServiceSIPClientObj, tServicesVoiceServiceSIPClientParams, get_voice_service_sip_client_linker, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"Network", &DMWRITE, addObjServicesVoiceServiceSIPNetwork, delObjServicesVoiceServiceSIPNetwork, NULL, browseServicesVoiceServiceSIPNetworkInst, NULL, tServicesVoiceServiceSIPNetworkObj, tServicesVoiceServiceSIPNetworkParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMWRITE, addObjServicesVoiceServiceSIPClient, delObjServicesVoiceServiceSIPClient, NULL, browseServicesVoiceServiceSIPClientInst, NULL, NULL, tServicesVoiceServiceSIPClientObj, tServicesVoiceServiceSIPClientParams, get_voice_service_sip_client_linker, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"Network", &DMWRITE, addObjServicesVoiceServiceSIPNetwork, delObjServicesVoiceServiceSIPNetwork, NULL, browseServicesVoiceServiceSIPNetworkInst, NULL, NULL, tServicesVoiceServiceSIPNetworkObj, tServicesVoiceServiceSIPNetworkParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.Services.VoiceService.{i}.SIP.Client.{i}. *** */
|
||||
DMOBJ tServicesVoiceServiceSIPClientObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Contact", &DMWRITE, addObjServicesVoiceServiceSIPClientContact, delObjServicesVoiceServiceSIPClientContact, NULL, browseServicesVoiceServiceSIPClientContactInst, NULL, NULL, tServicesVoiceServiceSIPClientContactParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Contact", &DMWRITE, addObjServicesVoiceServiceSIPClientContact, delObjServicesVoiceServiceSIPClientContact, NULL, browseServicesVoiceServiceSIPClientContactInst, NULL, NULL, NULL, tServicesVoiceServiceSIPClientContactParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1019,8 +1019,8 @@ DMLEAF tServicesVoiceServiceSIPClientContactParams[] = {
|
|||
|
||||
/* *** Device.Services.VoiceService.{i}.SIP.Network.{i}. *** */
|
||||
DMOBJ tServicesVoiceServiceSIPNetworkObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"FQDNServer", &DMWRITE, addObjServicesVoiceServiceSIPNetworkFQDNServer, delObjServicesVoiceServiceSIPNetworkFQDNServer, NULL, browseServicesVoiceServiceSIPNetworkFQDNServerInst, NULL, NULL, tServicesVoiceServiceSIPNetworkFQDNServerParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "Domain", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"FQDNServer", &DMWRITE, addObjServicesVoiceServiceSIPNetworkFQDNServer, delObjServicesVoiceServiceSIPNetworkFQDNServer, NULL, browseServicesVoiceServiceSIPNetworkFQDNServerInst, NULL, NULL, NULL, tServicesVoiceServiceSIPNetworkFQDNServerParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "Domain", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -282,8 +282,8 @@ static int set_ServicesVoiceServiceVoIPProfileRTPSRTP_EncryptionKeySizes(char *r
|
|||
***********************************************************************************************************************************/
|
||||
/* *** Device.Services.VoiceService.{i}.VoIPProfile.{i}. *** */
|
||||
DMOBJ tServicesVoiceServiceVoIPProfileObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"RTP", &DMREAD, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceVoIPProfileRTPObj, tServicesVoiceServiceVoIPProfileRTPParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"RTP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceVoIPProfileRTPObj, tServicesVoiceServiceVoIPProfileRTPParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -295,9 +295,9 @@ DMLEAF tServicesVoiceServiceVoIPProfileParams[] = {
|
|||
|
||||
/* *** Device.Services.VoiceService.{i}.VoIPProfile.{i}.RTP. *** */
|
||||
DMOBJ tServicesVoiceServiceVoIPProfileRTPObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"RTCP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceVoIPProfileRTPRTCPParams, NULL, BBFDM_BOTH},
|
||||
{"SRTP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceVoIPProfileRTPSRTPParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"RTCP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceVoIPProfileRTPRTCPParams, NULL, BBFDM_BOTH},
|
||||
{"SRTP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tServicesVoiceServiceVoIPProfileRTPSRTPParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1479,27 +1479,6 @@ static int set_IPDiagnosticsServerSelectionDiagnostics_Protocol(char *refparam,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int get_IPDiagnosticsServerSelectionDiagnostics_Port(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_diagnostics_option_fallback_def("serverselection", "port", "1");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_IPDiagnosticsServerSelectionDiagnostics_Port(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
SERVERSELECTION_STOP;
|
||||
set_diagnostics_option("serverselection", "port", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_IPDiagnosticsServerSelectionDiagnostics_HostList(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_diagnostics_option("serverselection", "HostList");
|
||||
|
|
@ -1636,13 +1615,13 @@ static int browseIPDiagnosticsUploadDiagnosticsPerConnectionResultInst(struct dm
|
|||
|
||||
/* *** Device.IP.Diagnostics. *** */
|
||||
DMOBJ tIPDiagnosticsObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPPing", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsIPPingParams, NULL, BBFDM_CWMP},
|
||||
{"TraceRoute", &DMREAD, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsTraceRouteObj, tIPDiagnosticsTraceRouteParams, NULL, BBFDM_CWMP},
|
||||
{"DownloadDiagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsDownloadDiagnosticsObj, tIPDiagnosticsDownloadDiagnosticsParams, NULL, BBFDM_CWMP},
|
||||
{"UploadDiagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsUploadDiagnosticsObj, tIPDiagnosticsUploadDiagnosticsParams, NULL, BBFDM_CWMP},
|
||||
{"UDPEchoDiagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsUDPEchoDiagnosticsParams, NULL, BBFDM_CWMP},
|
||||
{"ServerSelectionDiagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsServerSelectionDiagnosticsParams, NULL, BBFDM_CWMP},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPPing", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsIPPingParams, NULL, BBFDM_CWMP},
|
||||
{"TraceRoute", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsTraceRouteObj, tIPDiagnosticsTraceRouteParams, NULL, BBFDM_CWMP},
|
||||
{"DownloadDiagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsDownloadDiagnosticsObj, tIPDiagnosticsDownloadDiagnosticsParams, NULL, BBFDM_CWMP},
|
||||
{"UploadDiagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsUploadDiagnosticsObj, tIPDiagnosticsUploadDiagnosticsParams, NULL, BBFDM_CWMP},
|
||||
{"UDPEchoDiagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsUDPEchoDiagnosticsParams, NULL, BBFDM_CWMP},
|
||||
{"ServerSelectionDiagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsServerSelectionDiagnosticsParams, NULL, BBFDM_CWMP},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1687,8 +1666,8 @@ DMLEAF tIPDiagnosticsIPPingParams[] = {
|
|||
|
||||
/* *** Device.IP.Diagnostics.TraceRoute. *** */
|
||||
DMOBJ tIPDiagnosticsTraceRouteObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"RouteHops", &DMREAD, NULL, NULL, NULL, browseIPDiagnosticsTraceRouteRouteHopsInst, NULL, NULL, tIPDiagnosticsTraceRouteRouteHopsParams, NULL, BBFDM_CWMP},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"RouteHops", &DMREAD, NULL, NULL, NULL, browseIPDiagnosticsTraceRouteRouteHopsInst, NULL, NULL, NULL, tIPDiagnosticsTraceRouteRouteHopsParams, NULL, BBFDM_CWMP},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1720,8 +1699,8 @@ DMLEAF tIPDiagnosticsTraceRouteRouteHopsParams[] = {
|
|||
|
||||
/* *** Device.IP.Diagnostics.DownloadDiagnostics. *** */
|
||||
DMOBJ tIPDiagnosticsDownloadDiagnosticsObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"PerConnectionResult", &DMREAD, NULL, NULL, NULL, browseIPDiagnosticsDownloadDiagnosticsPerConnectionResultInst, NULL, NULL, tIPDiagnosticsDownloadDiagnosticsPerConnectionResultParams, NULL, BBFDM_CWMP},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"PerConnectionResult", &DMREAD, NULL, NULL, NULL, browseIPDiagnosticsDownloadDiagnosticsPerConnectionResultInst, NULL, NULL, NULL, tIPDiagnosticsDownloadDiagnosticsPerConnectionResultParams, NULL, BBFDM_CWMP},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1769,8 +1748,8 @@ DMLEAF tIPDiagnosticsDownloadDiagnosticsPerConnectionResultParams[] = {
|
|||
|
||||
/* *** Device.IP.Diagnostics.UploadDiagnostics. *** */
|
||||
DMOBJ tIPDiagnosticsUploadDiagnosticsObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"PerConnectionResult", &DMREAD, NULL, NULL, NULL, browseIPDiagnosticsUploadDiagnosticsPerConnectionResultInst, NULL, NULL, tIPDiagnosticsUploadDiagnosticsPerConnectionResultParams, NULL, BBFDM_CWMP},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"PerConnectionResult", &DMREAD, NULL, NULL, NULL, browseIPDiagnosticsUploadDiagnosticsPerConnectionResultInst, NULL, NULL, NULL, tIPDiagnosticsUploadDiagnosticsPerConnectionResultParams, NULL, BBFDM_CWMP},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1844,7 +1823,6 @@ DMLEAF tIPDiagnosticsServerSelectionDiagnosticsParams[] = {
|
|||
{"Interface", &DMWRITE, DMT_STRING, get_IPDiagnosticsServerSelectionDiagnostics_Interface, set_IPDiagnosticsServerSelectionDiagnostics_Interface, BBFDM_CWMP},
|
||||
{"ProtocolVersion", &DMWRITE, DMT_STRING, get_IPDiagnosticsServerSelectionDiagnostics_ProtocolVersion, set_IPDiagnosticsServerSelectionDiagnostics_ProtocolVersion, BBFDM_CWMP},
|
||||
{"Protocol", &DMWRITE, DMT_STRING, get_IPDiagnosticsServerSelectionDiagnostics_Protocol, set_IPDiagnosticsServerSelectionDiagnostics_Protocol, BBFDM_CWMP},
|
||||
{CUSTOM_PREFIX"Port", &DMWRITE, DMT_UNINT, get_IPDiagnosticsServerSelectionDiagnostics_Port, set_IPDiagnosticsServerSelectionDiagnostics_Port, BBFDM_CWMP},
|
||||
{"HostList", &DMWRITE, DMT_STRING, get_IPDiagnosticsServerSelectionDiagnostics_HostList, set_IPDiagnosticsServerSelectionDiagnostics_HostList, BBFDM_CWMP},
|
||||
{"NumberOfRepetitions", &DMWRITE, DMT_UNINT, get_IPDiagnosticsServerSelectionDiagnostics_NumberOfRepetitions, set_IPDiagnosticsServerSelectionDiagnostics_NumberOfRepetitions, BBFDM_CWMP},
|
||||
{"Timeout", &DMWRITE, DMT_UNINT, get_IPDiagnosticsServerSelectionDiagnostics_Timeout, set_IPDiagnosticsServerSelectionDiagnostics_Timeout, BBFDM_CWMP},
|
||||
|
|
|
|||
|
|
@ -379,15 +379,15 @@ static int browseAtmLinkInst(struct dmctx *dmctx, DMNODE *parent_node, void *pre
|
|||
|
||||
/*** ATM. ***/
|
||||
DMOBJ tATMObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Link", &DMWRITE, add_atm_link, delete_atm_link, NULL, browseAtmLinkInst, NULL, tATMLinkObj, tATMLinkParams, get_atm_linker, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
/* 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, get_atm_linker, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
/*** ATM.Link. ***/
|
||||
DMOBJ tATMLinkObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tATMLinkStatsParams, NULL, BBFDM_BOTH},
|
||||
/* 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},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2299,7 +2299,7 @@ static int set_BridgingBridgePort_DefaultUserPriority(char *refparam, struct dmc
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void get_priority_list(char *uci_opt_name, void *data, char **value)
|
||||
void bridging_get_priority_list(char *uci_opt_name, void *data, char **value)
|
||||
{
|
||||
struct uci_list *v= NULL;
|
||||
struct uci_element *e = NULL;
|
||||
|
|
@ -2326,7 +2326,7 @@ static void get_priority_list(char *uci_opt_name, void *data, char **value)
|
|||
dmasprintf(value, "%s", uci_value);
|
||||
}
|
||||
|
||||
static void set_priority_list(char *uci_opt_name, void *data, char *value)
|
||||
void bridging_set_priority_list(char *uci_opt_name, void *data, char *value)
|
||||
{
|
||||
char buf[16];
|
||||
char *pch, *pchr;
|
||||
|
|
@ -2349,7 +2349,7 @@ static void set_priority_list(char *uci_opt_name, void *data, char *value)
|
|||
|
||||
static int get_BridgingBridgePort_PriorityRegeneration(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
get_priority_list("ingress_qos_mapping", data, value);
|
||||
bridging_get_priority_list("ingress_qos_mapping", data, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -2362,54 +2362,12 @@ static int set_BridgingBridgePort_PriorityRegeneration(char *refparam, struct dm
|
|||
break;
|
||||
|
||||
case VALUESET:
|
||||
set_priority_list("ingress_qos_mapping", data, value);
|
||||
bridging_set_priority_list("ingress_qos_mapping", data, value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_BridgingBridgePort_Egress_PriorityRegeneration(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
get_priority_list("egress_qos_mapping", data, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_BridgingBridgePort_Egress_PriorityRegeneration(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt_list(value, 8, 8, -1, RANGE_ARGS{{"0","7"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
|
||||
case VALUESET:
|
||||
set_priority_list("egress_qos_mapping", data, value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_BridgingBridgePort_DSCP_Eth_Priority_Map(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
get_priority_list("dscp2pbit", data, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_BridgingBridgePort_DSCP_Eth_Priority_Map(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt_list(value, 1, 64, -1, RANGE_ARGS{{"0","7"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
|
||||
case VALUESET:
|
||||
set_priority_list("dscp2pbit", data, value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_BridgingBridgePort_PVID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def(((struct bridge_port_args *)data)->bridge_port_sec, "vid", "1");
|
||||
|
|
@ -3385,9 +3343,9 @@ static int browseBridgingBridgeVLANPortInst(struct dmctx *dmctx, DMNODE *parent_
|
|||
***********************************************************************************************************************************/
|
||||
/* *** Device.Bridging. *** */
|
||||
DMOBJ tBridgingObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Bridge", &DMWRITE, addObjBridgingBridge, delObjBridgingBridge, NULL, browseBridgingBridgeInst, NULL, tBridgingBridgeObj, tBridgingBridgeParams, get_linker_bridge, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"ProviderBridge", &DMWRITE, addObjBridgingProviderBridge , delObjBridgingProviderBridge, NULL, browseBridgingProviderBridgeInst, NULL, NULL, tBridgingProviderBridgeParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Bridge", &DMWRITE, addObjBridgingBridge, delObjBridgingBridge, NULL, browseBridgingBridgeInst, NULL, NULL, tBridgingBridgeObj, tBridgingBridgeParams, get_linker_bridge, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"ProviderBridge", &DMWRITE, addObjBridgingProviderBridge, delObjBridgingProviderBridge, NULL, browseBridgingProviderBridgeInst, NULL, NULL, NULL, tBridgingProviderBridgeParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -3406,10 +3364,10 @@ DMLEAF tBridgingParams[] = {
|
|||
|
||||
/*** Bridging.Bridge.{i}. ***/
|
||||
DMOBJ tBridgingBridgeObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Port", &DMWRITE, addObjBridgingBridgePort, delObjBridgingBridgePort, NULL, browseBridgingBridgePortInst, NULL, tBridgingBridgePortObj, tBridgingBridgePortParams, get_linker_br_port, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"VLAN", &DMWRITE, addObjBridgingBridgeVLAN, delObjBridgingBridgeVLAN, NULL, browseBridgingBridgeVLANInst, NULL, NULL, tBridgingBridgeVLANParams, get_linker_br_vlan, BBFDM_BOTH, LIST_KEY{"VLANID", "Alias", NULL}},
|
||||
{"VLANPort", &DMWRITE, addObjBridgingBridgeVLANPort, delObjBridgingBridgeVLANPort, NULL, browseBridgingBridgeVLANPortInst, NULL, NULL, tBridgingBridgeVLANPortParams, NULL, BBFDM_BOTH, LIST_KEY{"VLAN", "Port", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Port", &DMWRITE, addObjBridgingBridgePort, delObjBridgingBridgePort, NULL, browseBridgingBridgePortInst, NULL, NULL, tBridgingBridgePortObj, tBridgingBridgePortParams, get_linker_br_port, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"VLAN", &DMWRITE, addObjBridgingBridgeVLAN, delObjBridgingBridgeVLAN, NULL, browseBridgingBridgeVLANInst, NULL, NULL, NULL, tBridgingBridgeVLANParams, get_linker_br_vlan, BBFDM_BOTH, LIST_KEY{"VLANID", "Alias", NULL}},
|
||||
{"VLANPort", &DMWRITE, addObjBridgingBridgeVLANPort, delObjBridgingBridgeVLANPort, NULL, browseBridgingBridgeVLANPortInst, NULL, NULL, NULL, tBridgingBridgeVLANPortParams, NULL, BBFDM_BOTH, LIST_KEY{"VLAN", "Port", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -3427,8 +3385,8 @@ DMLEAF tBridgingBridgeParams[] = {
|
|||
|
||||
/*** Bridging.Bridge.{i}.Port.{i}. ***/
|
||||
DMOBJ tBridgingBridgePortObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tBridgingBridgePortStatsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tBridgingBridgePortStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -3444,8 +3402,6 @@ DMLEAF tBridgingBridgePortParams[] = {
|
|||
//{"Type", &DMWRITE, DMT_STRING, get_BridgingBridgePort_Type, set_BridgingBridgePort_Type, BBFDM_BOTH},
|
||||
{"DefaultUserPriority", &DMWRITE, DMT_UNINT, get_BridgingBridgePort_DefaultUserPriority, set_BridgingBridgePort_DefaultUserPriority, BBFDM_BOTH},
|
||||
{"PriorityRegeneration", &DMWRITE, DMT_STRING, get_BridgingBridgePort_PriorityRegeneration, set_BridgingBridgePort_PriorityRegeneration, BBFDM_BOTH},
|
||||
{"X_IOPSYS_EU_EgressPriorityRegeneration", &DMWRITE, DMT_STRING, get_BridgingBridgePort_Egress_PriorityRegeneration, set_BridgingBridgePort_Egress_PriorityRegeneration, BBFDM_BOTH},
|
||||
{"X_IOPSYS_EU_DSCPEthernetPriorityMapping", &DMWRITE, DMT_STRING, get_BridgingBridgePort_DSCP_Eth_Priority_Map, set_BridgingBridgePort_DSCP_Eth_Priority_Map, BBFDM_BOTH},
|
||||
//{"PortState", &DMREAD, DMT_STRING, get_BridgingBridgePort_PortState, NULL, BBFDM_BOTH},
|
||||
{"PVID", &DMWRITE, DMT_INT, get_BridgingBridgePort_PVID, set_BridgingBridgePort_PVID, BBFDM_BOTH},
|
||||
{"TPID", &DMWRITE, DMT_UNINT, get_BridgingBridgePort_TPID, set_BridgingBridgePort_TPID, BBFDM_BOTH},
|
||||
|
|
|
|||
|
|
@ -26,4 +26,7 @@ extern DMOBJ tBridgingBridgePortObj[];
|
|||
extern DMLEAF tBridgingBridgePortStatsParams[];
|
||||
extern DMLEAF tBridgingProviderBridgeParams[];
|
||||
|
||||
void bridging_get_priority_list(char *uci_opt_name, void *data, char **value);
|
||||
void bridging_set_priority_list(char *uci_opt_name, void *data, char *value);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -15,12 +15,6 @@
|
|||
#include "managementserver.h"
|
||||
#include "times.h"
|
||||
#include "upnp.h"
|
||||
#include "x_iopsys_eu_igmp.h"
|
||||
#include "x_iopsys_eu_mld.h"
|
||||
#include "x_iopsys_eu_syslog.h"
|
||||
#include "x_iopsys_eu_owsd.h"
|
||||
#include "x_iopsys_eu_dropbear.h"
|
||||
#include "x_iopsys_eu_buttons.h"
|
||||
#include "ip.h"
|
||||
#include "ethernet.h"
|
||||
#include "bridging.h"
|
||||
|
|
@ -54,8 +48,8 @@
|
|||
|
||||
/* *** BBFDM *** */
|
||||
DMOBJ tEntry181Obj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Device", &DMREAD, NULL, NULL, NULL, NULL, NULL, tDeviceObj, tDeviceParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Device", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDeviceObj, tDeviceParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -67,49 +61,39 @@ DMLEAF tDeviceParams[] = {
|
|||
};
|
||||
|
||||
DMOBJ tDeviceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"DeviceInfo", &DMREAD, NULL, NULL, NULL, NULL, NULL, tDeviceInfoObj, tDeviceInfoParams, NULL, BBFDM_BOTH},
|
||||
{"ManagementServer", &DMREAD, NULL, NULL, "file:/etc/config/cwmp", NULL, NULL, NULL, tManagementServerParams, NULL, BBFDM_BOTH},
|
||||
{"Time", &DMREAD, NULL, NULL, "file:/etc/config/system", NULL, NULL, NULL, tTimeParams, NULL, BBFDM_BOTH},
|
||||
{"UPnP", &DMREAD, NULL, NULL, "file:/etc/config/upnpd", NULL, NULL, tUPnPObj, NULL, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"DeviceInfo", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDeviceInfoObj, tDeviceInfoParams, NULL, BBFDM_BOTH},
|
||||
{"ManagementServer", &DMREAD, NULL, NULL, "file:/etc/config/cwmp", NULL, NULL, NULL, NULL, tManagementServerParams, NULL, BBFDM_BOTH},
|
||||
{"Time", &DMREAD, NULL, NULL, "file:/etc/config/system", NULL, NULL, NULL, NULL, tTimeParams, NULL, BBFDM_BOTH},
|
||||
{"UPnP", &DMREAD, NULL, NULL, "file:/etc/config/upnpd", NULL, NULL, NULL, tUPnPObj, NULL, NULL, BBFDM_BOTH},
|
||||
#ifdef BBF_TR104
|
||||
{"Services", &DMREAD, NULL, NULL, NULL, NULL, NULL, tServicesObj, NULL, NULL, BBFDM_BOTH},
|
||||
{"Services", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tServicesObj, NULL, NULL, BBFDM_BOTH},
|
||||
#endif
|
||||
{CUSTOM_PREFIX"Syslog", &DMREAD, NULL, NULL, "file:/etc/config/system", NULL, NULL, NULL, tSe_SyslogParam, NULL, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"OWSD", &DMREAD, NULL, NULL, "file:/etc/config/owsd", NULL, NULL, X_IOPSYS_EU_OWSDObj, X_IOPSYS_EU_OWSDParams, NULL, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"IGMP", &DMREAD, NULL, NULL, "file:/etc/config/mcast", NULL, NULL, X_IOPSYS_EU_IGMPObj, X_IOPSYS_EU_IGMPParams, NULL, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"MLD", &DMREAD, NULL, NULL, "file:/etc/config/mcast", NULL, NULL, X_IOPSYS_EU_MLDObj, X_IOPSYS_EU_MLDParams, NULL, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"Dropbear", &DMWRITE, add_dropbear_instance, delete_dropbear_instance, "file:/etc/config/dropbear", browseXIopsysEuDropbear, NULL, NULL, X_IOPSYS_EU_DropbearParams, NULL, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"Buttons", &DMREAD, NULL, NULL, "file:/etc/config/buttons", browseXIopsysEuButton, NULL, NULL, X_IOPSYS_EU_ButtonParams, NULL, BBFDM_BOTH},
|
||||
{"Bridging", &DMREAD, NULL, NULL, "file:/etc/config/network", NULL, NULL, tBridgingObj, tBridgingParams, NULL, BBFDM_BOTH},
|
||||
{"WiFi", &DMREAD, NULL, NULL, "file:/etc/config/wireless", NULL, NULL, tWiFiObj, tWiFiParams, NULL, BBFDM_BOTH},
|
||||
{"IP", &DMREAD, NULL, NULL, "file:/etc/config/network", NULL, NULL, tIPObj, tIPParams, NULL, BBFDM_BOTH},
|
||||
{"Ethernet", &DMREAD, NULL, NULL, "file:/etc/config/network", NULL, NULL, tEthernetObj, tEthernetParams, NULL, BBFDM_BOTH},
|
||||
{"DSL", &DMREAD, NULL, NULL, "file:/etc/config/dsl", NULL, NULL, tDSLObj, tDSLParams, NULL, BBFDM_BOTH},
|
||||
{"FAST", &DMREAD, NULL, NULL, "ubus:fast", NULL, NULL, tFASTObj, NULL, NULL, BBFDM_BOTH},
|
||||
{"ATM", &DMREAD, NULL, NULL, "file:/etc/config/dsl", NULL, NULL, tATMObj, NULL, NULL, BBFDM_BOTH},
|
||||
{"PTM", &DMREAD, NULL, NULL, "file:/etc/config/dsl", NULL, NULL, tPTMObj, NULL, NULL, BBFDM_BOTH},
|
||||
{"DHCPv4", &DMREAD, NULL, NULL, "file:/lib/netifd/proto/dhcp.sh", NULL, NULL, tDHCPv4Obj, tDHCPv4Params, NULL, BBFDM_BOTH},
|
||||
{"DHCPv6", &DMREAD, NULL, NULL, "file:/lib/netifd/proto/dhcpv6.sh", NULL, NULL, tDHCPv6Obj, tDHCPv6Params, NULL, BBFDM_BOTH},
|
||||
#ifdef GENERIC_OPENWRT
|
||||
{"Hosts", &DMREAD, NULL, NULL, NULL, NULL, NULL, tHostsObj, tHostsParams, NULL, BBFDM_BOTH},
|
||||
#else
|
||||
{"Hosts", &DMREAD, NULL, NULL, "ubus:router.network->hosts", NULL, NULL, tHostsObj, tHostsParams, NULL, BBFDM_BOTH},
|
||||
#endif
|
||||
{"NAT", &DMREAD, NULL, NULL, "file:/etc/config/firewall", NULL, NULL, tNATObj, tNATParams, NULL, BBFDM_BOTH},
|
||||
{"PPP", &DMREAD, NULL, NULL, "file:/lib/netifd/proto/ppp.sh", NULL, NULL, tPPPObj, tPPPParams, NULL, BBFDM_BOTH},
|
||||
{"Routing", &DMREAD, NULL, NULL, "file:/etc/config/network", NULL, NULL, tRoutingObj, tRoutingParams, NULL, BBFDM_BOTH},
|
||||
{"Firewall", &DMREAD, NULL, NULL, "file:/etc/config/firewall", NULL, NULL, tFirewallObj, tFirewallParams, NULL, BBFDM_BOTH},
|
||||
{"DNS", &DMREAD, NULL, NULL, "file:/etc/config/dhcp", NULL, NULL, tDNSObj, tDNSParams, NULL, BBFDM_BOTH},
|
||||
{"Users", &DMREAD, NULL, NULL, "file:/etc/config/users", NULL, NULL, tUsersObj, tUsersParams, NULL, BBFDM_BOTH},
|
||||
{"IEEE1905", &DMREAD, NULL, NULL, "file:/etc/config/ieee1905,/etc/config/topology;ubus:ieee1905->info,topology->dump", NULL, NULL, tIEEE1905Obj, tIEEE1905Params, NULL, BBFDM_BOTH},
|
||||
{"InterfaceStack", &DMREAD, NULL, NULL, "file:/etc/config/network", browseInterfaceStackInst, NULL, NULL, tInterfaceStackParams, NULL, BBFDM_BOTH},
|
||||
{"USB", &DMREAD, NULL, NULL, NULL, NULL, NULL, tUSBObj, tUSBParams, NULL, BBFDM_BOTH},
|
||||
{"GRE", &DMREAD, NULL, NULL, "file:/lib/netifd/proto/gre.sh", NULL, NULL, tGREObj, tGREParams, NULL, BBFDM_BOTH},
|
||||
{"DynamicDNS", &DMREAD, NULL, NULL, "file:/etc/config/ddns", NULL, NULL, tDynamicDNSObj, tDynamicDNSParams, NULL, BBFDM_BOTH},
|
||||
{"QoS", &DMREAD, NULL, NULL, "file:/etc/config/qos", NULL, NULL, tQoSObj, tQoSParams, NULL, BBFDM_BOTH},
|
||||
{"LANConfigSecurity", &DMREAD, NULL, NULL, "file:/etc/config/users", NULL, NULL, NULL, tLANConfigSecurityParams, NULL, BBFDM_BOTH},
|
||||
{"SoftwareModules", &DMREAD, NULL, NULL, "ubus:swmodules", NULL, NULL, tSoftwareModulesObj, tSoftwareModulesParams, NULL, BBFDM_BOTH},
|
||||
{"Security", &DMREAD, NULL, NULL, NULL, NULL, NULL, tSecurityObj, tSecurityParams, NULL, BBFDM_BOTH},
|
||||
{"Bridging", &DMREAD, NULL, NULL, "file:/etc/config/network", NULL, NULL, NULL, tBridgingObj, tBridgingParams, NULL, BBFDM_BOTH},
|
||||
{"WiFi", &DMREAD, NULL, NULL, "file:/etc/config/wireless", NULL, NULL, NULL, tWiFiObj, tWiFiParams, NULL, BBFDM_BOTH},
|
||||
{"IP", &DMREAD, NULL, NULL, "file:/etc/config/network", NULL, NULL, NULL, tIPObj, tIPParams, NULL, BBFDM_BOTH},
|
||||
{"Ethernet", &DMREAD, NULL, NULL, "file:/etc/config/network", NULL, NULL, NULL, tEthernetObj, tEthernetParams, NULL, BBFDM_BOTH},
|
||||
{"DSL", &DMREAD, NULL, NULL, "file:/etc/config/dsl", NULL, NULL, NULL, tDSLObj, tDSLParams, NULL, BBFDM_BOTH},
|
||||
{"FAST", &DMREAD, NULL, NULL, "ubus:fast", NULL, NULL, NULL, tFASTObj, NULL, NULL, BBFDM_BOTH},
|
||||
{"ATM", &DMREAD, NULL, NULL, "file:/etc/config/dsl", NULL, NULL, NULL, tATMObj, NULL, NULL, BBFDM_BOTH},
|
||||
{"PTM", &DMREAD, NULL, NULL, "file:/etc/config/dsl", NULL, NULL, NULL, tPTMObj, NULL, NULL, BBFDM_BOTH},
|
||||
{"DHCPv4", &DMREAD, NULL, NULL, "file:/lib/netifd/proto/dhcp.sh", NULL, NULL, NULL, tDHCPv4Obj, tDHCPv4Params, NULL, BBFDM_BOTH},
|
||||
{"DHCPv6", &DMREAD, NULL, NULL, "file:/lib/netifd/proto/dhcpv6.sh", NULL, NULL, NULL, tDHCPv6Obj, tDHCPv6Params, NULL, BBFDM_BOTH},
|
||||
{"Hosts", &DMREAD, NULL, NULL, "ubus:router.network->hosts", NULL, NULL, NULL, tHostsObj, tHostsParams, NULL, BBFDM_BOTH},
|
||||
{"NAT", &DMREAD, NULL, NULL, "file:/etc/config/firewall", NULL, NULL, NULL, tNATObj, tNATParams, NULL, BBFDM_BOTH},
|
||||
{"PPP", &DMREAD, NULL, NULL, "file:/lib/netifd/proto/ppp.sh", NULL, NULL, NULL, tPPPObj, tPPPParams, NULL, BBFDM_BOTH},
|
||||
{"Routing", &DMREAD, NULL, NULL, "file:/etc/config/network", NULL, NULL, NULL, tRoutingObj, tRoutingParams, NULL, BBFDM_BOTH},
|
||||
{"Firewall", &DMREAD, NULL, NULL, "file:/etc/config/firewall", NULL, NULL, NULL, tFirewallObj, tFirewallParams, NULL, BBFDM_BOTH},
|
||||
{"DNS", &DMREAD, NULL, NULL, "file:/etc/config/dhcp", NULL, NULL, NULL, tDNSObj, tDNSParams, NULL, BBFDM_BOTH},
|
||||
{"Users", &DMREAD, NULL, NULL, "file:/etc/config/users", NULL, NULL, NULL, tUsersObj, tUsersParams, NULL, BBFDM_BOTH},
|
||||
{"IEEE1905", &DMREAD, NULL, NULL, "file:/etc/config/ieee1905,/etc/config/topology;ubus:ieee1905->info,topology->dump", NULL, NULL, NULL, tIEEE1905Obj, tIEEE1905Params, NULL, BBFDM_BOTH},
|
||||
{"InterfaceStack", &DMREAD, NULL, NULL, "file:/etc/config/network", browseInterfaceStackInst, NULL, NULL, NULL, tInterfaceStackParams, NULL, BBFDM_BOTH},
|
||||
{"USB", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tUSBObj, tUSBParams, NULL, BBFDM_BOTH},
|
||||
{"GRE", &DMREAD, NULL, NULL, "file:/lib/netifd/proto/gre.sh", NULL, NULL, NULL, tGREObj, tGREParams, NULL, BBFDM_BOTH},
|
||||
{"DynamicDNS", &DMREAD, NULL, NULL, "file:/etc/config/ddns", NULL, NULL, NULL, tDynamicDNSObj, tDynamicDNSParams, NULL, BBFDM_BOTH},
|
||||
{"QoS", &DMREAD, NULL, NULL, "file:/etc/config/qos", NULL, NULL, NULL, tQoSObj, tQoSParams, NULL, BBFDM_BOTH},
|
||||
{"LANConfigSecurity", &DMREAD, NULL, NULL, "file:/etc/config/users", NULL, NULL, NULL, NULL, tLANConfigSecurityParams, NULL, BBFDM_BOTH},
|
||||
{"SoftwareModules", &DMREAD, NULL, NULL, "ubus:swmodules", NULL, NULL, NULL, tSoftwareModulesObj, tSoftwareModulesParams, NULL, BBFDM_BOTH},
|
||||
{"Security", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tSecurityObj, tSecurityParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,216 +0,0 @@
|
|||
#include "os.h"
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
/*#Device.DeviceInfo.Manufacturer!UCI:cwmp/cpe,cpe/manufacturer*/
|
||||
char * os__get_deviceid_manufacturer()
|
||||
{
|
||||
char *v;
|
||||
dmuci_get_option_value_string("cwmp","cpe","manufacturer", &v);
|
||||
if (v[0] == '\0') {
|
||||
db_get_value_string("device", "deviceinfo", "Manufacturer", &v);
|
||||
return v;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProductClass!UCI:cwmp/cpe,cpe/product_class*/
|
||||
char * os__get_deviceid_productclass()
|
||||
{
|
||||
char *v;
|
||||
dmuci_get_option_value_string("cwmp", "cpe", "product_class", &v);
|
||||
if (v[0] == '\0') {
|
||||
db_get_value_string("device", "deviceinfo", "ProductClass", &v);
|
||||
return v;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
char * os__get_deviceid_serialnumber()
|
||||
{
|
||||
char *v;
|
||||
db_get_value_string("device", "deviceinfo", "SerialNumber", &v);
|
||||
return v;
|
||||
}
|
||||
|
||||
char * os__get_softwareversion()
|
||||
{
|
||||
char *v;
|
||||
db_get_value_string("device", "deviceinfo", "SoftwareVersion", &v);
|
||||
return v;
|
||||
}
|
||||
|
||||
int os__get_device_hardwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
db_get_value_string("device", "deviceinfo", "HardwareVersion", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_device_devicecategory(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
db_get_value_string("device", "deviceinfo", "DeviceCategory", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_device_additionalhardwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
db_get_value_string("device", "deviceinfo", "AdditionalHardwareVersion", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_device_additionalsoftwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
db_get_value_string("device", "deviceinfo", "AdditionalSoftwareVersion", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ModelName!UCI:cwmp/cpe,cpe/model_name*/
|
||||
int os__get_device_modelname(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_option_value_string("cwmp", "cpe", "model_name", value);
|
||||
if (*value[0] == '\0')
|
||||
db_get_value_string("device", "deviceinfo", "ModelName", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.Description!UCI:cwmp/cpe,cpe/description*/
|
||||
int os__get_device_description(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_option_value_string("cwmp", "cpe", "description", value);
|
||||
if (*value[0] == '\0')
|
||||
db_get_value_string("device", "deviceinfo", "Description", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ManufacturerOUI!UCI:cwmp/cpe,cpe/manufacturer_oui*/
|
||||
char * os__get_deviceid_manufactureroui()
|
||||
{
|
||||
char *v;
|
||||
dmuci_get_option_value_string("cwmp", "cpe", "manufacturer_oui", &v);
|
||||
if (v[0] == '\0') {
|
||||
db_get_value_string("device", "deviceinfo", "ManufacturerOUI", &v);
|
||||
return v;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
int os__get_base_mac_addr(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
db_get_value_string("device", "deviceinfo", "BaseMACAddress", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.MemoryStatus.Total!UBUS:router.system/memory//total*/
|
||||
int os__get_memory_status_total(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res;
|
||||
dmubus_call("router.system", "memory", UBUS_ARGS{{}}, 0, &res);
|
||||
DM_ASSERT(res, *value = "0");
|
||||
*value = dmjson_get_value(res, 1, "total");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.MemoryStatus.Free!UBUS:router.system/memory//free*/
|
||||
int os__get_memory_status_free(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res;
|
||||
dmubus_call("router.system", "memory", UBUS_ARGS{{}}, 0, &res);
|
||||
DM_ASSERT(res, *value = "0");
|
||||
*value = dmjson_get_value(res, 1, "free");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.CPUUsage!UBUS:router.system/process//cpu_usage*/
|
||||
int os__get_process_cpu_usage(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res;
|
||||
dmubus_call("router.system", "process", UBUS_ARGS{{}}, 0, &res);
|
||||
DM_ASSERT(res, *value = "0");
|
||||
*value = dmjson_get_value(res, 1, "cpu_usage");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.ProcessNumberOfEntries!UBUS:router.system/processes//processes*/
|
||||
int os__get_process_number_of_entries(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res = NULL, *processes = NULL;
|
||||
int nbre_process = 0;
|
||||
|
||||
dmubus_call("router.system", "processes", UBUS_ARGS{}, 0, &res);
|
||||
if (res) {
|
||||
json_object_object_get_ex(res, "processes", &processes);
|
||||
if (processes)
|
||||
nbre_process = json_object_array_length(processes);
|
||||
}
|
||||
dmasprintf(value, "%d", nbre_process);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.PID!UBUS:router.system/processes//processes[@i-1].pid*/
|
||||
int os__get_process_pid(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "pid");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.Command!UBUS:router.system/processes//processes[@i-1].command*/
|
||||
int os__get_process_command(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "command");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.Size!UBUS:router.system/processes//processes[@i-1].vsz*/
|
||||
int os__get_process_size(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "vsz");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.Priority!UBUS:router.system/processes//processes[@i-1].priority*/
|
||||
int os__get_process_priority(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
int priority = 0;
|
||||
|
||||
*value = dmjson_get_value((json_object *)data, 1, "priority");
|
||||
|
||||
priority = (*value && **value) ? atoi(*value) : 0;
|
||||
|
||||
/* Convert Linux priority to a value between 0 and 99 */
|
||||
priority = round((priority + 100) * 99 / 139);
|
||||
|
||||
dmasprintf(value, "%d", priority);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.CPUTime!UBUS:router.system/processes//processes[@i-1].cputime*/
|
||||
int os__get_process_cpu_time(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "cputime");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.State!UBUS:router.system/processes//processes[@i-1].state*/
|
||||
int os__get_process_state(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *state = dmjson_get_value((json_object *)data, 1, "state");
|
||||
*value = (state && strcmp(state, "Unknown") == 0) ? "Idle" : state;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.!UBUS:router.system/processes//processes*/
|
||||
int os__browseProcessEntriesInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
json_object *res = NULL, *processes = NULL, *arrobj = NULL;
|
||||
char *inst = NULL, *max_inst = NULL;
|
||||
int id = 0, i = 0;
|
||||
|
||||
dmubus_call("router.system", "processes", UBUS_ARGS{}, 0, &res);
|
||||
dmjson_foreach_obj_in_array(res, arrobj, processes, i, 1, "processes") {
|
||||
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_without_section, 1, ++id);
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)processes, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
#include "os.h"
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
#define BASE_IFACE "br-lan"
|
||||
|
||||
static char * get_uci_deviceinfo(char *opt)
|
||||
{
|
||||
char *v;
|
||||
|
||||
dmuci_get_option_value_string("cwmp", "@deviceinfo[0]", opt, &v);
|
||||
return v;
|
||||
}
|
||||
|
||||
char * os__get_deviceid_manufacturer()
|
||||
{
|
||||
return get_uci_deviceinfo("Manufacturer");
|
||||
}
|
||||
|
||||
char * os__get_deviceid_productclass()
|
||||
{
|
||||
return get_uci_deviceinfo("ProductClass");
|
||||
}
|
||||
|
||||
char * os__get_deviceid_serialnumber()
|
||||
{
|
||||
return get_uci_deviceinfo("SerialNumber");
|
||||
}
|
||||
|
||||
char * os__get_softwareversion()
|
||||
{
|
||||
return get_uci_deviceinfo("SoftwareVersion");
|
||||
}
|
||||
|
||||
int os__get_device_hardwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("HardwareVersion");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_device_devicecategory(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("DeviceCategory");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_device_additionalhardwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("AdditionalHardwareVersion");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_device_additionalsoftwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("AdditionalSoftwareVersion");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_device_modelname(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("ModelName");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_device_description(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("Description");
|
||||
return 0;
|
||||
}
|
||||
|
||||
char * os__get_deviceid_manufactureroui()
|
||||
{
|
||||
return get_uci_deviceinfo("ManufacturerOUI");
|
||||
}
|
||||
|
||||
int os__get_base_mac_addr(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return get_net_device_sysfs(BASE_IFACE, "address", value);
|
||||
}
|
||||
|
||||
static int not_implemented(char **value)
|
||||
{
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_memory_status_total(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_memory_status_free(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_process_cpu_usage(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_process_number_of_entries(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_process_pid(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_process_command(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_process_size(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_process_priority(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_process_cpu_time(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_process_state(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__browseProcessEntriesInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -10,7 +10,6 @@
|
|||
*/
|
||||
|
||||
#include "deviceinfo.h"
|
||||
#include "os.h"
|
||||
|
||||
struct Supported_Data_Models
|
||||
{
|
||||
|
|
@ -58,33 +57,45 @@ struct Supported_Data_Models Data_Models[] = {
|
|||
{"http://www.broadband-forum.org/cwmp/tr-157-1-3-0.xml","urn:broadband-forum-org:tr-157-1-3-0", "Bulkdata,SoftwareModules"},
|
||||
};
|
||||
|
||||
/*#Device.DeviceInfo.Manufacturer!UCI:cwmp/cpe,cpe/manufacturer*/
|
||||
static int get_device_manufacturer(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = os__get_deviceid_manufacturer();
|
||||
dmuci_get_option_value_string("cwmp","cpe","manufacturer", value);
|
||||
if (*value[0] == '\0')
|
||||
db_get_value_string("device", "deviceinfo", "Manufacturer", value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ManufacturerOUI!UCI:cwmp/cpe,cpe/manufacturer_oui*/
|
||||
static int get_device_manufactureroui(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = os__get_deviceid_manufactureroui();
|
||||
dmuci_get_option_value_string("cwmp", "cpe", "manufacturer_oui", value);
|
||||
if (*value[0] == '\0')
|
||||
db_get_value_string("device", "deviceinfo", "ManufacturerOUI", value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProductClass!UCI:cwmp/cpe,cpe/product_class*/
|
||||
static int get_device_productclass(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = os__get_deviceid_productclass();
|
||||
dmuci_get_option_value_string("cwmp", "cpe", "product_class", value);
|
||||
if (*value[0] == '\0')
|
||||
db_get_value_string("device", "deviceinfo", "ProductClass", value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_device_serialnumber(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = os__get_deviceid_serialnumber();
|
||||
db_get_value_string("device", "deviceinfo", "SerialNumber", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_device_softwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = os__get_softwareversion();
|
||||
db_get_value_string("device", "deviceinfo", "SoftwareVersion", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -94,6 +105,48 @@ static int get_device_active_fwimage(char *refparam, struct dmctx *ctx, void *da
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int get_device_hardwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
db_get_value_string("device", "deviceinfo", "HardwareVersion", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_device_devicecategory(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
db_get_value_string("device", "deviceinfo", "DeviceCategory", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_device_additionalhardwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
db_get_value_string("device", "deviceinfo", "AdditionalHardwareVersion", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_device_additionalsoftwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
db_get_value_string("device", "deviceinfo", "AdditionalSoftwareVersion", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ModelName!UCI:cwmp/cpe,cpe/model_name*/
|
||||
static int get_device_modelname(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_option_value_string("cwmp", "cpe", "model_name", value);
|
||||
if (*value[0] == '\0')
|
||||
db_get_value_string("device", "deviceinfo", "ModelName", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.Description!UCI:cwmp/cpe,cpe/description*/
|
||||
static int get_device_description(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_option_value_string("cwmp", "cpe", "description", value);
|
||||
if (*value[0] == '\0')
|
||||
db_get_value_string("device", "deviceinfo", "Description", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.UpTime!PROCFS:/proc/uptime*/
|
||||
static int get_device_info_uptime(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
|
|
@ -542,40 +595,151 @@ static int get_FirmwareImage_bootfailurelog(char *refparam, struct dmctx *ctx, v
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.MemoryStatus.Total!UBUS:router.system/memory//total*/
|
||||
static int get_memory_status_total(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res;
|
||||
dmubus_call("router.system", "memory", UBUS_ARGS{{}}, 0, &res);
|
||||
DM_ASSERT(res, *value = "0");
|
||||
*value = dmjson_get_value(res, 1, "total");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.MemoryStatus.Free!UBUS:router.system/memory//free*/
|
||||
static int get_memory_status_free(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res;
|
||||
dmubus_call("router.system", "memory", UBUS_ARGS{{}}, 0, &res);
|
||||
DM_ASSERT(res, *value = "0");
|
||||
*value = dmjson_get_value(res, 1, "free");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.CPUUsage!UBUS:router.system/process//cpu_usage*/
|
||||
static int get_process_cpu_usage(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res;
|
||||
dmubus_call("router.system", "process", UBUS_ARGS{{}}, 0, &res);
|
||||
DM_ASSERT(res, *value = "0");
|
||||
*value = dmjson_get_value(res, 1, "cpu_usage");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.ProcessNumberOfEntries!UBUS:router.system/processes//processes*/
|
||||
static int get_process_number_of_entries(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res = NULL, *processes = NULL;
|
||||
int nbre_process = 0;
|
||||
|
||||
dmubus_call("router.system", "processes", UBUS_ARGS{}, 0, &res);
|
||||
DM_ASSERT(res, *value = "0");
|
||||
json_object_object_get_ex(res, "processes", &processes);
|
||||
nbre_process = (processes) ? json_object_array_length(processes) : 0;
|
||||
dmasprintf(value, "%d", nbre_process);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.!UBUS:router.system/processes//processes*/
|
||||
static int browseProcessEntriesInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
json_object *res = NULL, *processes = NULL, *arrobj = NULL;
|
||||
char *inst = NULL, *max_inst = NULL;
|
||||
int id = 0, i = 0;
|
||||
|
||||
dmubus_call("router.system", "processes", UBUS_ARGS{}, 0, &res);
|
||||
dmjson_foreach_obj_in_array(res, arrobj, processes, i, 1, "processes") {
|
||||
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_without_section, 1, ++id);
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)processes, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.PID!UBUS:router.system/processes//processes[@i-1].pid*/
|
||||
static int get_process_pid(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "pid");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.Command!UBUS:router.system/processes//processes[@i-1].command*/
|
||||
static int get_process_command(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "command");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.Size!UBUS:router.system/processes//processes[@i-1].vsz*/
|
||||
static int get_process_size(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "vsz");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.Priority!UBUS:router.system/processes//processes[@i-1].priority*/
|
||||
static int get_process_priority(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
int priority = 0;
|
||||
|
||||
*value = dmjson_get_value((json_object *)data, 1, "priority");
|
||||
|
||||
priority = (*value && **value) ? atoi(*value) : 0;
|
||||
|
||||
/* Convert Linux priority to a value between 0 and 99 */
|
||||
priority = round((priority + 100) * 99 / 139);
|
||||
|
||||
dmasprintf(value, "%d", priority);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.CPUTime!UBUS:router.system/processes//processes[@i-1].cputime*/
|
||||
static int get_process_cpu_time(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "cputime");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.State!UBUS:router.system/processes//processes[@i-1].state*/
|
||||
static int get_process_state(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *state = dmjson_get_value((json_object *)data, 1, "state");
|
||||
*value = (state && strcmp(state, "Unknown") == 0) ? "Idle" : state;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* *** Device.DeviceInfo. *** */
|
||||
DMOBJ tDeviceInfoObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"VendorConfigFile", &DMREAD, NULL, NULL, NULL, browseVcfInst, NULL, NULL, tDeviceInfoVendorConfigFileParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"MemoryStatus", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDeviceInfoMemoryStatusParams, NULL, BBFDM_BOTH},
|
||||
{"ProcessStatus", &DMREAD, NULL, NULL, NULL, NULL, NULL, tDeviceInfoProcessStatusObj, tDeviceInfoProcessStatusParams, NULL, BBFDM_BOTH},
|
||||
{"Processor", &DMREAD, NULL, NULL, NULL, browseDeviceInfoProcessorInst, NULL, NULL, tDeviceInfoProcessorParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"VendorLogFile", &DMREAD, NULL, NULL, NULL, browseVlfInst, NULL, NULL, tDeviceInfoVendorLogFileParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"SupportedDataModel", &DMREAD, NULL, NULL, NULL, browseDeviceInfoSupportedDataModelInst, NULL, NULL, tDeviceInfoSupportedDataModelParams, NULL, BBFDM_CWMP, LIST_KEY{"URL", "Alias", "UUID", NULL}},
|
||||
{"FirmwareImage", &DMREAD, NULL, NULL, NULL, browseDeviceInfoFirmwareImageInst, NULL, NULL, tDeviceInfoFirmwareImageParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"VendorConfigFile", &DMREAD, NULL, NULL, NULL, browseVcfInst, NULL, NULL, NULL, tDeviceInfoVendorConfigFileParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"MemoryStatus", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDeviceInfoMemoryStatusParams, NULL, BBFDM_BOTH},
|
||||
{"ProcessStatus", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDeviceInfoProcessStatusObj, tDeviceInfoProcessStatusParams, NULL, BBFDM_BOTH},
|
||||
{"Processor", &DMREAD, NULL, NULL, NULL, browseDeviceInfoProcessorInst, NULL, NULL, NULL, tDeviceInfoProcessorParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"VendorLogFile", &DMREAD, NULL, NULL, NULL, browseVlfInst, NULL, NULL, NULL, tDeviceInfoVendorLogFileParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"SupportedDataModel", &DMREAD, NULL, NULL, NULL, browseDeviceInfoSupportedDataModelInst, NULL, NULL, NULL, tDeviceInfoSupportedDataModelParams, NULL, BBFDM_CWMP, LIST_KEY{"URL", "Alias", "UUID", NULL}},
|
||||
{"FirmwareImage", &DMREAD, NULL, NULL, NULL, browseDeviceInfoFirmwareImageInst, NULL, NULL, NULL, tDeviceInfoFirmwareImageParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tDeviceInfoParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"DeviceCategory", &DMREAD, DMT_STRING, os__get_device_devicecategory, NULL, BBFDM_BOTH},
|
||||
{"DeviceCategory", &DMREAD, DMT_STRING, get_device_devicecategory, NULL, BBFDM_BOTH},
|
||||
{"Manufacturer", &DMREAD, DMT_STRING, get_device_manufacturer, NULL, BBFDM_BOTH},
|
||||
{"ManufacturerOUI", &DMREAD, DMT_STRING, get_device_manufactureroui, NULL, BBFDM_BOTH},
|
||||
{"ModelName", &DMREAD, DMT_STRING, os__get_device_modelname, NULL, BBFDM_BOTH},
|
||||
{"Description", &DMREAD, DMT_STRING, os__get_device_description, NULL, BBFDM_BOTH},
|
||||
{"ModelName", &DMREAD, DMT_STRING, get_device_modelname, NULL, BBFDM_BOTH},
|
||||
{"Description", &DMREAD, DMT_STRING, get_device_description, NULL, BBFDM_BOTH},
|
||||
{"ProductClass", &DMREAD, DMT_STRING, get_device_productclass, NULL, BBFDM_BOTH},
|
||||
{"SerialNumber", &DMREAD, DMT_STRING, get_device_serialnumber, NULL, BBFDM_BOTH},
|
||||
{"HardwareVersion", &DMREAD, DMT_STRING, os__get_device_hardwareversion, NULL, BBFDM_BOTH},
|
||||
{"HardwareVersion", &DMREAD, DMT_STRING, get_device_hardwareversion, NULL, BBFDM_BOTH},
|
||||
{"SoftwareVersion", &DMREAD, DMT_STRING, get_device_softwareversion, NULL, BBFDM_BOTH},
|
||||
{"ActiveFirmwareImage", &DMREAD, DMT_STRING, get_device_active_fwimage, NULL, BBFDM_BOTH},
|
||||
{"AdditionalHardwareVersion", &DMREAD, DMT_STRING, os__get_device_additionalhardwareversion, NULL, BBFDM_BOTH},
|
||||
{"AdditionalSoftwareVersion", &DMREAD, DMT_STRING, os__get_device_additionalsoftwareversion, NULL, BBFDM_BOTH},
|
||||
{"AdditionalHardwareVersion", &DMREAD, DMT_STRING, get_device_additionalhardwareversion, NULL, BBFDM_BOTH},
|
||||
{"AdditionalSoftwareVersion", &DMREAD, DMT_STRING, get_device_additionalsoftwareversion, NULL, BBFDM_BOTH},
|
||||
{"ProvisioningCode", &DMWRITE, DMT_STRING, get_device_provisioningcode, set_device_provisioningcode, BBFDM_BOTH},
|
||||
{"UpTime", &DMREAD, DMT_UNINT, get_device_info_uptime, NULL, BBFDM_BOTH},
|
||||
{"ProcessorNumberOfEntries", &DMREAD, DMT_UNINT, get_DeviceInfo_ProcessorNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{"SupportedDataModelNumberOfEntries", &DMREAD, DMT_UNINT, get_DeviceInfo_SupportedDataModelNumberOfEntries, NULL, BBFDM_CWMP},
|
||||
{"FirmwareImageNumberOfEntries", &DMREAD, DMT_UNINT, get_DeviceInfo_FirmwareImageNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"BaseMACAddress", &DMREAD, DMT_STRING, os__get_base_mac_addr, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -594,33 +758,33 @@ DMLEAF tDeviceInfoVendorConfigFileParams[] = {
|
|||
/* *** Device.DeviceInfo.MemoryStatus. *** */
|
||||
DMLEAF tDeviceInfoMemoryStatusParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"Total", &DMREAD, DMT_UNINT, os__get_memory_status_total, NULL, BBFDM_BOTH},
|
||||
{"Free", &DMREAD, DMT_UNINT, os__get_memory_status_free, NULL, BBFDM_BOTH},
|
||||
{"Total", &DMREAD, DMT_UNINT, get_memory_status_total, NULL, BBFDM_BOTH},
|
||||
{"Free", &DMREAD, DMT_UNINT, get_memory_status_free, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
/* *** Device.DeviceInfo.ProcessStatus. *** */
|
||||
DMOBJ tDeviceInfoProcessStatusObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Process", &DMREAD, NULL, NULL, NULL, os__browseProcessEntriesInst, NULL, NULL, tDeviceInfoProcessStatusProcessParams, NULL, BBFDM_BOTH, LIST_KEY{"PID", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Process", &DMREAD, NULL, NULL, NULL, browseProcessEntriesInst, NULL, NULL, NULL, tDeviceInfoProcessStatusProcessParams, NULL, BBFDM_BOTH, LIST_KEY{"PID", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tDeviceInfoProcessStatusParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"CPUUsage", &DMREAD, DMT_UNINT, os__get_process_cpu_usage, NULL, BBFDM_BOTH},
|
||||
{"ProcessNumberOfEntries", &DMREAD, DMT_UNINT, os__get_process_number_of_entries, NULL, BBFDM_BOTH},
|
||||
{"CPUUsage", &DMREAD, DMT_UNINT, get_process_cpu_usage, NULL, BBFDM_BOTH},
|
||||
{"ProcessNumberOfEntries", &DMREAD, DMT_UNINT, get_process_number_of_entries, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.DeviceInfo.ProcessStatus.Process.{i}. *** */
|
||||
DMLEAF tDeviceInfoProcessStatusProcessParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"PID", &DMREAD, DMT_UNINT, os__get_process_pid, NULL, BBFDM_BOTH},
|
||||
{"Command", &DMREAD, DMT_STRING, os__get_process_command, NULL, BBFDM_BOTH},
|
||||
{"Size", &DMREAD, DMT_UNINT, os__get_process_size, NULL, BBFDM_BOTH},
|
||||
{"Priority", &DMREAD, DMT_UNINT, os__get_process_priority, NULL, BBFDM_BOTH},
|
||||
{"CPUTime", &DMREAD, DMT_UNINT, os__get_process_cpu_time, NULL, BBFDM_BOTH},
|
||||
{"State", &DMREAD, DMT_STRING, os__get_process_state, NULL, BBFDM_BOTH},
|
||||
{"PID", &DMREAD, DMT_UNINT, get_process_pid, NULL, BBFDM_BOTH},
|
||||
{"Command", &DMREAD, DMT_STRING, get_process_command, NULL, BBFDM_BOTH},
|
||||
{"Size", &DMREAD, DMT_UNINT, get_process_size, NULL, BBFDM_BOTH},
|
||||
{"Priority", &DMREAD, DMT_UNINT, get_process_priority, NULL, BBFDM_BOTH},
|
||||
{"CPUTime", &DMREAD, DMT_UNINT, get_process_cpu_time, NULL, BBFDM_BOTH},
|
||||
{"State", &DMREAD, DMT_STRING, get_process_state, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2934,7 +2934,7 @@ static int browseDHCPv4ClientSentOptionInst(struct dmctx *dmctx, DMNODE *parent_
|
|||
sentopts = strsplit(options, " ", &length);
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
if (sentopts[i])
|
||||
if (sentopts && sentopts[i])
|
||||
buf = strsplit(sentopts[i], ":", &length2);
|
||||
|
||||
if ((dhcp_client_dmmap_s = get_dup_section_in_dmmap_eq("dmmap_dhcp_client", "send_option", section_name(dhcp_client_s), "option_tag", buf[0])) == NULL) {
|
||||
|
|
@ -2983,6 +2983,9 @@ static int browseDHCPv4ClientReqOptionInst(struct dmctx *dmctx, DMNODE *parent_n
|
|||
reqtopts = strsplit(options, " ", &length);
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
if (reqtopts == NULL)
|
||||
continue;
|
||||
|
||||
if ((dhcp_client_dmmap_s = get_dup_section_in_dmmap_eq("dmmap_dhcp_client", "req_option", section_name(dhcp_client_s), "option_tag", reqtopts[i])) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_dhcp_client", "req_option", &dhcp_client_dmmap_s);
|
||||
dmuci_set_value_by_section_bbfdm(dhcp_client_dmmap_s, "option_tag", reqtopts[i]);
|
||||
|
|
@ -3114,10 +3117,10 @@ static int browseDHCPv4RelayForwardingInst(struct dmctx *dmctx, DMNODE *parent_n
|
|||
***********************************************************************************************************************************/
|
||||
/* *** Device.DHCPv4. *** */
|
||||
DMOBJ tDHCPv4Obj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMWRITE, addObjDHCPv4Client, delObjDHCPv4Client, NULL, browseDHCPv4ClientInst, NULL, tDHCPv4ClientObj, tDHCPv4ClientParams, NULL, BBFDM_BOTH, LIST_KEY{"Interface", "Alias", NULL}},
|
||||
{"Server", &DMREAD, NULL, NULL, NULL, NULL, NULL, tDHCPv4ServerObj, tDHCPv4ServerParams, NULL, BBFDM_BOTH},
|
||||
{"Relay", &DMREAD, NULL, NULL, NULL, NULL, NULL, tDHCPv4RelayObj, tDHCPv4RelayParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMWRITE, addObjDHCPv4Client, delObjDHCPv4Client, NULL, browseDHCPv4ClientInst, NULL, NULL, tDHCPv4ClientObj, tDHCPv4ClientParams, NULL, BBFDM_BOTH, LIST_KEY{"Interface", "Alias", NULL}},
|
||||
{"Server", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDHCPv4ServerObj, tDHCPv4ServerParams, NULL, BBFDM_BOTH},
|
||||
{"Relay", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDHCPv4RelayObj, tDHCPv4RelayParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -3129,9 +3132,9 @@ DMLEAF tDHCPv4Params[] = {
|
|||
|
||||
/* *** Device.DHCPv4.Client.{i}. *** */
|
||||
DMOBJ tDHCPv4ClientObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"SentOption", &DMWRITE, addObjDHCPv4ClientSentOption, delObjDHCPv4ClientSentOption, NULL, browseDHCPv4ClientSentOptionInst, NULL, NULL, tDHCPv4ClientSentOptionParams, NULL, BBFDM_BOTH, LIST_KEY{"Tag", "Alias", NULL}},
|
||||
{"ReqOption", &DMWRITE, addObjDHCPv4ClientReqOption, delObjDHCPv4ClientReqOption, NULL, browseDHCPv4ClientReqOptionInst, NULL, NULL, tDHCPv4ClientReqOptionParams, NULL, BBFDM_BOTH, LIST_KEY{"Tag", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"SentOption", &DMWRITE, addObjDHCPv4ClientSentOption, delObjDHCPv4ClientSentOption, NULL, browseDHCPv4ClientSentOptionInst, NULL, NULL, NULL, tDHCPv4ClientSentOptionParams, NULL, BBFDM_BOTH, LIST_KEY{"Tag", "Alias", NULL}},
|
||||
{"ReqOption", &DMWRITE, addObjDHCPv4ClientReqOption, delObjDHCPv4ClientReqOption, NULL, browseDHCPv4ClientReqOptionInst, NULL, NULL, NULL, tDHCPv4ClientReqOptionParams, NULL, BBFDM_BOTH, LIST_KEY{"Tag", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -3179,8 +3182,8 @@ DMLEAF tDHCPv4ClientReqOptionParams[] = {
|
|||
|
||||
/* *** Device.DHCPv4.Server. *** */
|
||||
DMOBJ tDHCPv4ServerObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Pool", &DMWRITE, addObjDHCPv4ServerPool, delObjDHCPv4ServerPool, NULL, browseDHCPv4ServerPoolInst, NULL, tDHCPv4ServerPoolObj, tDHCPv4ServerPoolParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Pool", &DMWRITE, addObjDHCPv4ServerPool, delObjDHCPv4ServerPool, NULL, browseDHCPv4ServerPoolInst, NULL, NULL, tDHCPv4ServerPoolObj, tDHCPv4ServerPoolParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -3193,10 +3196,10 @@ DMLEAF tDHCPv4ServerParams[] = {
|
|||
|
||||
/* *** Device.DHCPv4.Server.Pool.{i}. *** */
|
||||
DMOBJ tDHCPv4ServerPoolObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"StaticAddress", &DMWRITE, addObjDHCPv4ServerPoolStaticAddress, delObjDHCPv4ServerPoolStaticAddress, NULL, browseDHCPv4ServerPoolStaticAddressInst, NULL, NULL, tDHCPv4ServerPoolStaticAddressParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "Chaddr", NULL}},
|
||||
{"Option", &DMWRITE, addObjDHCPv4ServerPoolOption, delObjDHCPv4ServerPoolOption, NULL, browseDHCPv4ServerPoolOptionInst, NULL, NULL, tDHCPv4ServerPoolOptionParams, NULL, BBFDM_BOTH, LIST_KEY{"Tag", "Alias", NULL}},
|
||||
{"Client", &DMREAD, NULL, NULL, NULL, browseDhcpClientInst, NULL, tDHCPv4ServerPoolClientObj, tDHCPv4ServerPoolClientParams, get_dhcp_client_linker, BBFDM_BOTH, LIST_KEY{"Chaddr", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"StaticAddress", &DMWRITE, addObjDHCPv4ServerPoolStaticAddress, delObjDHCPv4ServerPoolStaticAddress, NULL, browseDHCPv4ServerPoolStaticAddressInst, NULL, NULL, NULL, tDHCPv4ServerPoolStaticAddressParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "Chaddr", NULL}},
|
||||
{"Option", &DMWRITE, addObjDHCPv4ServerPoolOption, delObjDHCPv4ServerPoolOption, NULL, browseDHCPv4ServerPoolOptionInst, NULL, NULL, NULL, tDHCPv4ServerPoolOptionParams, NULL, BBFDM_BOTH, LIST_KEY{"Tag", "Alias", NULL}},
|
||||
{"Client", &DMREAD, NULL, NULL, NULL, browseDhcpClientInst, NULL, NULL, tDHCPv4ServerPoolClientObj, tDHCPv4ServerPoolClientParams, get_dhcp_client_linker, BBFDM_BOTH, LIST_KEY{"Chaddr", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -3254,9 +3257,9 @@ DMLEAF tDHCPv4ServerPoolOptionParams[] = {
|
|||
|
||||
/* *** Device.DHCPv4.Server.Pool.{i}.Client.{i}. *** */
|
||||
DMOBJ tDHCPv4ServerPoolClientObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPv4Address", &DMREAD, NULL, NULL, NULL, browseDhcpClientIPv4Inst, NULL, NULL, tDHCPv4ServerPoolClientIPv4AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"IPAddress", NULL}},
|
||||
{"Option", &DMREAD, NULL, NULL, NULL, browseDHCPv4ServerPoolClientOptionInst, NULL, NULL, tDHCPv4ServerPoolClientOptionParams, NULL, BBFDM_BOTH, LIST_KEY{"Tag", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPv4Address", &DMREAD, NULL, NULL, NULL, browseDhcpClientIPv4Inst, NULL, NULL, NULL, tDHCPv4ServerPoolClientIPv4AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"IPAddress", NULL}},
|
||||
{"Option", &DMREAD, NULL, NULL, NULL, browseDHCPv4ServerPoolClientOptionInst, NULL, NULL, NULL, tDHCPv4ServerPoolClientOptionParams, NULL, BBFDM_BOTH, LIST_KEY{"Tag", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -3288,8 +3291,8 @@ DMLEAF tDHCPv4ServerPoolClientOptionParams[] = {
|
|||
|
||||
/* *** Device.DHCPv4.Relay. *** */
|
||||
DMOBJ tDHCPv4RelayObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Forwarding", &DMWRITE, addObjDHCPv4RelayForwarding, delObjDHCPv4RelayForwarding, NULL, browseDHCPv4RelayForwardingInst, NULL, NULL, tDHCPv4RelayForwardingParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Forwarding", &DMWRITE, addObjDHCPv4RelayForwarding, delObjDHCPv4RelayForwarding, NULL, browseDHCPv4RelayForwardingInst, NULL, NULL, NULL, tDHCPv4RelayForwardingParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1302,9 +1302,9 @@ static int set_DHCPv6ServerPoolOption_Value(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
/* *** Device.DHCPv6. *** */
|
||||
DMOBJ tDHCPv6Obj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMWRITE, addObjDHCPv6Client, delObjDHCPv6Client, NULL, browseDHCPv6ClientInst, NULL, tDHCPv6ClientObj, tDHCPv6ClientParams, NULL, BBFDM_BOTH, LIST_KEY{"Interface", "Alias", NULL}},
|
||||
{"Server", &DMREAD, NULL, NULL, NULL, NULL, NULL, tDHCPv6ServerObj, tDHCPv6ServerParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMWRITE, addObjDHCPv6Client, delObjDHCPv6Client, NULL, browseDHCPv6ClientInst, NULL, NULL, tDHCPv6ClientObj, tDHCPv6ClientParams, NULL, BBFDM_BOTH, LIST_KEY{"Interface", "Alias", NULL}},
|
||||
{"Server", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDHCPv6ServerObj, tDHCPv6ServerParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1316,10 +1316,10 @@ DMLEAF tDHCPv6Params[] = {
|
|||
|
||||
/* *** Device.DHCPv6.Client.{i}. *** */
|
||||
DMOBJ tDHCPv6ClientObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
//{"Server", &DMREAD, NULL, NULL, NULL, browseDHCPv6ClientServerInst, NULL, NULL, tDHCPv6ClientServerParams, NULL, BBFDM_BOTH, LIST_KEY{"SourceAddress", NULL}},
|
||||
//{"SentOption", &DMWRITE, addObjDHCPv6ClientSentOption, delObjDHCPv6ClientSentOption, NULL, browseDHCPv6ClientSentOptionInst, NULL, NULL, tDHCPv6ClientSentOptionParams, NULL, BBFDM_BOTH, LIST_KEY{"Tag", "Alias", NULL}},
|
||||
//{"ReceivedOption", &DMREAD, NULL, NULL, NULL, browseDHCPv6ClientReceivedOptionInst, NULL, NULL, tDHCPv6ClientReceivedOptionParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
//{"Server", &DMREAD, NULL, NULL, NULL, browseDHCPv6ClientServerInst, NULL, NULL, NULL, tDHCPv6ClientServerParams, NULL, BBFDM_BOTH, LIST_KEY{"SourceAddress", NULL}},
|
||||
//{"SentOption", &DMWRITE, addObjDHCPv6ClientSentOption, delObjDHCPv6ClientSentOption, NULL, browseDHCPv6ClientSentOptionInst, NULL, NULL, NULL, tDHCPv6ClientSentOptionParams, NULL, BBFDM_BOTH, LIST_KEY{"Tag", "Alias", NULL}},
|
||||
//{"ReceivedOption", &DMREAD, NULL, NULL, NULL, browseDHCPv6ClientReceivedOptionInst, NULL, NULL, NULL, tDHCPv6ClientReceivedOptionParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1374,8 +1374,8 @@ DMLEAF tDHCPv6ClientReceivedOptionParams[] = {
|
|||
|
||||
/* *** Device.DHCPv6.Server. *** */
|
||||
DMOBJ tDHCPv6ServerObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Pool", &DMWRITE, addObjDHCPv6ServerPool, delObjDHCPv6ServerPool, NULL, browseDHCPv6ServerPoolInst, NULL, tDHCPv6ServerPoolObj, tDHCPv6ServerPoolParams, NULL, BBFDM_BOTH, LIST_KEY{"Order", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Pool", &DMWRITE, addObjDHCPv6ServerPool, delObjDHCPv6ServerPool, NULL, browseDHCPv6ServerPoolInst, NULL, NULL, tDHCPv6ServerPoolObj, tDHCPv6ServerPoolParams, NULL, BBFDM_BOTH, LIST_KEY{"Order", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1388,9 +1388,9 @@ DMLEAF tDHCPv6ServerParams[] = {
|
|||
|
||||
/* *** Device.DHCPv6.Server.Pool.{i}. *** */
|
||||
DMOBJ tDHCPv6ServerPoolObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMREAD, NULL, NULL, NULL, browseDHCPv6ServerPoolClientInst, NULL, tDHCPv6ServerPoolClientObj, tDHCPv6ServerPoolClientParams, NULL, BBFDM_BOTH, LIST_KEY{"SourceAddress", "Alias", NULL}},
|
||||
{"Option", &DMWRITE, addObjDHCPv6ServerPoolOption, delObjDHCPv6ServerPoolOption, NULL, browseDHCPv6ServerPoolOptionInst, NULL, NULL, tDHCPv6ServerPoolOptionParams, NULL, BBFDM_BOTH, LIST_KEY{"Tag", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMREAD, NULL, NULL, NULL, browseDHCPv6ServerPoolClientInst, NULL, NULL, tDHCPv6ServerPoolClientObj, tDHCPv6ServerPoolClientParams, NULL, BBFDM_BOTH, LIST_KEY{"SourceAddress", "Alias", NULL}},
|
||||
{"Option", &DMWRITE, addObjDHCPv6ServerPoolOption, delObjDHCPv6ServerPoolOption, NULL, browseDHCPv6ServerPoolOptionInst, NULL, NULL, NULL, tDHCPv6ServerPoolOptionParams, NULL, BBFDM_BOTH, LIST_KEY{"Tag", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1424,10 +1424,10 @@ DMLEAF tDHCPv6ServerPoolParams[] = {
|
|||
|
||||
/* *** Device.DHCPv6.Server.Pool.{i}.Client.{i}. *** */
|
||||
DMOBJ tDHCPv6ServerPoolClientObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPv6Address", &DMREAD, NULL, NULL, NULL, browseDHCPv6ServerPoolClientIPv6AddressInst, NULL, NULL, tDHCPv6ServerPoolClientIPv6AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"IPAddress", NULL}},
|
||||
{"IPv6Prefix", &DMREAD, NULL, NULL, NULL, browseDHCPv6ServerPoolClientIPv6PrefixInst, NULL, NULL, tDHCPv6ServerPoolClientIPv6PrefixParams, NULL, BBFDM_BOTH, LIST_KEY{"Prefix", NULL}},
|
||||
//{"Option", &DMREAD, NULL, NULL, NULL, browseDHCPv6ServerPoolClientOptionInst, NULL, NULL, tDHCPv6ServerPoolClientOptionParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPv6Address", &DMREAD, NULL, NULL, NULL, browseDHCPv6ServerPoolClientIPv6AddressInst, NULL, NULL, NULL, tDHCPv6ServerPoolClientIPv6AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"IPAddress", NULL}},
|
||||
{"IPv6Prefix", &DMREAD, NULL, NULL, NULL, browseDHCPv6ServerPoolClientIPv6PrefixInst, NULL, NULL, NULL, tDHCPv6ServerPoolClientIPv6PrefixParams, NULL, BBFDM_BOTH, LIST_KEY{"Prefix", NULL}},
|
||||
//{"Option", &DMREAD, NULL, NULL, NULL, browseDHCPv6ServerPoolClientOptionInst, NULL, NULL, NULL, tDHCPv6ServerPoolClientOptionParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -688,10 +688,10 @@ static int set_nslookupdiagnostics_number_of_repetitions(char *refparam, struct
|
|||
|
||||
/* *** Device.DNS. *** */
|
||||
DMOBJ tDNSObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMREAD, NULL, NULL, NULL, NULL, NULL, tDNSClientObj, tDNSClientParams, NULL, BBFDM_BOTH},
|
||||
{"Relay", &DMREAD, NULL, NULL, NULL, NULL, NULL, tDNSRelayObj, tDNSRelayParams, NULL, BBFDM_BOTH},
|
||||
{"Diagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, tDNSDiagnosticsObj, NULL, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDNSClientObj, tDNSClientParams, NULL, BBFDM_BOTH},
|
||||
{"Relay", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDNSRelayObj, tDNSRelayParams, NULL, BBFDM_BOTH},
|
||||
{"Diagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDNSDiagnosticsObj, NULL, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -703,8 +703,8 @@ DMLEAF tDNSParams[] = {
|
|||
|
||||
/* *** Device.DNS.Client. *** */
|
||||
DMOBJ tDNSClientObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Server", &DMWRITE, add_dns_server, delete_dns_server, NULL, browseDNSServerInst, NULL, NULL, tDNSClientServerParams, NULL, BBFDM_BOTH, LIST_KEY{"DNSServer", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Server", &DMWRITE, add_dns_server, delete_dns_server, NULL, browseDNSServerInst, NULL, NULL, NULL, tDNSClientServerParams, NULL, BBFDM_BOTH, LIST_KEY{"DNSServer", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -730,8 +730,8 @@ DMLEAF tDNSClientServerParams[] = {
|
|||
|
||||
/* *** Device.DNS.Relay. *** */
|
||||
DMOBJ tDNSRelayObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Forwarding", &DMWRITE, add_dns_server, delete_dns_server, NULL, browseDNSServerInst, NULL, NULL, tDNSRelayForwardingParams, NULL, BBFDM_BOTH, LIST_KEY{"DNSServer", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Forwarding", &DMWRITE, add_dns_server, delete_dns_server, NULL, browseDNSServerInst, NULL, NULL, NULL, tDNSRelayForwardingParams, NULL, BBFDM_BOTH, LIST_KEY{"DNSServer", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -757,15 +757,15 @@ DMLEAF tDNSRelayForwardingParams[] = {
|
|||
|
||||
/* *** Device.DNS.Diagnostics. *** */
|
||||
DMOBJ tDNSDiagnosticsObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"NSLookupDiagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, tDNSDiagnosticsNSLookupDiagnosticsObj, tDNSDiagnosticsNSLookupDiagnosticsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"NSLookupDiagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDNSDiagnosticsNSLookupDiagnosticsObj, tDNSDiagnosticsNSLookupDiagnosticsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.DNS.Diagnostics.NSLookupDiagnostics. *** */
|
||||
DMOBJ tDNSDiagnosticsNSLookupDiagnosticsObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Result", &DMREAD, NULL, NULL, NULL, browseResultInst, NULL, NULL, tDNSDiagnosticsNSLookupDiagnosticsResultParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Result", &DMREAD, NULL, NULL, NULL, browseResultInst, NULL, NULL, NULL, tDNSDiagnosticsNSLookupDiagnosticsResultParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1460,9 +1460,9 @@ static int get_DSLChannelStatsQuarterHour_XTUCCRCErrors(char *refparam, struct d
|
|||
|
||||
/* *** Device.DSL. *** */
|
||||
DMOBJ tDSLObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Line", &DMREAD, NULL, NULL, NULL, browseDSLLineInst, NULL, tDSLLineObj, tDSLLineParams, get_dsl_line_linker, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"Channel", &DMREAD, NULL, NULL, NULL, browseDSLChannelInst, NULL, tDSLChannelObj, tDSLChannelParams, get_dsl_channel_linker, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Line", &DMREAD, NULL, NULL, NULL, browseDSLLineInst, NULL, NULL, tDSLLineObj, tDSLLineParams, get_dsl_line_linker, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"Channel", &DMREAD, NULL, NULL, NULL, browseDSLChannelInst, NULL, NULL, tDSLChannelObj, tDSLChannelParams, get_dsl_channel_linker, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1475,8 +1475,8 @@ DMLEAF tDSLParams[] = {
|
|||
|
||||
/* *** Device.DSL.Line.{i}. *** */
|
||||
DMOBJ tDSLLineObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsObj, tDSLLineStatsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsObj, tDSLLineStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1535,12 +1535,12 @@ DMLEAF tDSLLineParams[] = {
|
|||
|
||||
/* *** Device.DSL.Line.{i}.Stats. *** */
|
||||
DMOBJ tDSLLineStatsObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Total", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsTotalParams, NULL, BBFDM_BOTH},
|
||||
{"Showtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsShowtimeParams, NULL, BBFDM_BOTH},
|
||||
{"LastShowtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsLastShowtimeParams, NULL, BBFDM_BOTH},
|
||||
{"CurrentDay", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsCurrentDayParams, NULL, BBFDM_BOTH},
|
||||
{"QuarterHour", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsQuarterHourParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Total", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsTotalParams, NULL, BBFDM_BOTH},
|
||||
{"Showtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsShowtimeParams, NULL, BBFDM_BOTH},
|
||||
{"LastShowtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsLastShowtimeParams, NULL, BBFDM_BOTH},
|
||||
{"CurrentDay", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsCurrentDayParams, NULL, BBFDM_BOTH},
|
||||
{"QuarterHour", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLLineStatsQuarterHourParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1604,8 +1604,8 @@ DMLEAF tDSLLineStatsQuarterHourParams[] = {
|
|||
|
||||
/* *** Device.DSL.Channel.{i}. *** */
|
||||
DMOBJ tDSLChannelObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsObj, tDSLChannelStatsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsObj, tDSLChannelStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1637,12 +1637,12 @@ DMLEAF tDSLChannelParams[] = {
|
|||
|
||||
/* *** Device.DSL.Channel.{i}.Stats. *** */
|
||||
DMOBJ tDSLChannelStatsObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Total", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsTotalParams, NULL, BBFDM_BOTH},
|
||||
{"Showtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsShowtimeParams, NULL, BBFDM_BOTH},
|
||||
{"LastShowtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsLastShowtimeParams, NULL, BBFDM_BOTH},
|
||||
{"CurrentDay", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsCurrentDayParams, NULL, BBFDM_BOTH},
|
||||
{"QuarterHour", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsQuarterHourParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Total", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsTotalParams, NULL, BBFDM_BOTH},
|
||||
{"Showtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsShowtimeParams, NULL, BBFDM_BOTH},
|
||||
{"LastShowtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsLastShowtimeParams, NULL, BBFDM_BOTH},
|
||||
{"CurrentDay", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsCurrentDayParams, NULL, BBFDM_BOTH},
|
||||
{"QuarterHour", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDSLChannelStatsQuarterHourParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1059,9 +1059,9 @@ static int set_DynamicDNSServer_MaxRetries(char *refparam, struct dmctx *ctx, vo
|
|||
|
||||
/* *** Device.DynamicDNS. *** */
|
||||
DMOBJ tDynamicDNSObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMWRITE, addObjDynamicDNSClient, delObjDynamicDNSClient, NULL, browseDynamicDNSClientInst, NULL, tDynamicDNSClientObj, tDynamicDNSClientParams, NULL, BBFDM_BOTH, LIST_KEY{"Server", "Username", "Alias", NULL}},
|
||||
{"Server", &DMWRITE, addObjDynamicDNSServer, delObjDynamicDNSServer, NULL, browseDynamicDNSServerInst, NULL, NULL, tDynamicDNSServerParams, get_linker_dynamicdns_server, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Client", &DMWRITE, addObjDynamicDNSClient, delObjDynamicDNSClient, NULL, browseDynamicDNSClientInst, NULL, NULL, tDynamicDNSClientObj, tDynamicDNSClientParams, NULL, BBFDM_BOTH, LIST_KEY{"Server", "Username", "Alias", NULL}},
|
||||
{"Server", &DMWRITE, addObjDynamicDNSServer, delObjDynamicDNSServer, NULL, browseDynamicDNSServerInst, NULL, NULL, NULL, tDynamicDNSServerParams, get_linker_dynamicdns_server, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1075,8 +1075,8 @@ DMLEAF tDynamicDNSParams[] = {
|
|||
|
||||
/* *** Device.DynamicDNS.Client.{i}. *** */
|
||||
DMOBJ tDynamicDNSClientObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Hostname", &DMREAD, NULL, NULL, NULL, browseDynamicDNSClientHostnameInst, NULL, NULL, tDynamicDNSClientHostnameParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Hostname", &DMREAD, NULL, NULL, NULL, browseDynamicDNSClientHostnameInst, NULL, NULL, NULL, tDynamicDNSClientHostnameParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ int is_vlan_termination_section(const char *name)
|
|||
return 1;
|
||||
}
|
||||
|
||||
void get_bridge_port_linker(struct dmctx *ctx, char *intf_name, char **value)
|
||||
static void get_bridge_port_linker(struct dmctx *ctx, char *intf_name, char **value)
|
||||
{
|
||||
struct uci_section *dmmap_section = NULL, *bridge_port = NULL;
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ static struct uci_section *is_device_section_exist(char *device)
|
|||
return s;
|
||||
}
|
||||
|
||||
static int check_section_in_curr_section(char *curr_section, char *section)
|
||||
int ethernet_check_section_in_curr_section(char *curr_section, char *section)
|
||||
{
|
||||
char *pch = NULL, *pchr = NULL, section_list[256] = {0};
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ static void add_section_in_curr_section(struct uci_section *dmmap_section, char
|
|||
dmuci_set_value_by_section(dmmap_section, "section_name", section_list);
|
||||
}
|
||||
|
||||
static int is_name_exist_in_devices(char *name)
|
||||
int ethernet_name_exists_in_devices(char *name)
|
||||
{
|
||||
struct uci_section *s = NULL;
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ static void create_link(char *sec_name, char *mac_addr)
|
|||
dmuci_get_value_by_section_string(dmmap_section, "section_name", §ion_name);
|
||||
|
||||
/* Check section name exist => if yes, return*/
|
||||
if (check_section_in_curr_section(section_name, sec_name))
|
||||
if (ethernet_check_section_in_curr_section(section_name, sec_name))
|
||||
return;
|
||||
|
||||
/* Update only section name */
|
||||
|
|
@ -869,7 +869,6 @@ static int get_EthernetInterfaceStats_MulticastPacketsReceived(char *refparam, s
|
|||
return eth_port_sysfs(data, "statistics/multicast", value);
|
||||
}
|
||||
|
||||
#ifndef GENERIC_OPENWRT
|
||||
static int eth_port_ubus(const struct eth_port_args *args, const char *name, char **value)
|
||||
{
|
||||
json_object *res = NULL;
|
||||
|
|
@ -915,7 +914,6 @@ static int get_EthernetInterfaceStats_UnknownProtoPacketsReceived(char *refparam
|
|||
{
|
||||
return eth_port_ubus(data, "rx_unknown_packets", value);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int get_EthernetLink_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
|
|
@ -1132,7 +1130,6 @@ static int get_EthernetLinkStats_MulticastPacketsReceived(char *refparam, struct
|
|||
return eth_iface_sysfs(data, "statistics/multicast", value);
|
||||
}
|
||||
|
||||
#ifndef GENERIC_OPENWRT
|
||||
static int eth_iface_ubus(struct uci_section *iface_s, const char *name, char **value)
|
||||
{
|
||||
json_object *res = NULL;
|
||||
|
|
@ -1176,7 +1173,6 @@ static int get_EthernetLinkStats_UnknownProtoPacketsReceived(char *refparam, str
|
|||
{
|
||||
return eth_iface_ubus(data, "rx_unknown_packets", value);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int get_EthernetVLANTermination_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
|
|
@ -1310,7 +1306,7 @@ static int set_EthernetVLANTermination_LowerLayers(char *refparam, struct dmctx
|
|||
snprintf(link_inst, sizeof(link_inst), "%c", value[21]);
|
||||
snprintf(new_name, sizeof(new_name), "%s_%s", vlan_linker, link_inst);
|
||||
|
||||
if (is_name_exist_in_devices(new_name))
|
||||
if (ethernet_name_exists_in_devices(new_name))
|
||||
return -1;
|
||||
|
||||
uci_foreach_option_eq("network", "interface", "ifname", vlan_linker, s) {
|
||||
|
|
@ -1335,7 +1331,7 @@ static int set_EthernetVLANTermination_LowerLayers(char *refparam, struct dmctx
|
|||
else
|
||||
snprintf(new_name, sizeof(new_name), "%s", vlan_linker);
|
||||
|
||||
if (is_name_exist_in_devices(new_name))
|
||||
if (ethernet_name_exists_in_devices(new_name))
|
||||
return -1;
|
||||
|
||||
// if device is lowerlayer to an ip interface, then
|
||||
|
|
@ -1362,7 +1358,7 @@ static int set_EthernetVLANTermination_LowerLayers(char *refparam, struct dmctx
|
|||
break;
|
||||
}
|
||||
snprintf(new_name, sizeof(new_name), "%s.%s.%s", dev_name, inner_vid, vid);
|
||||
if (is_name_exist_in_devices(new_name))
|
||||
if (ethernet_name_exists_in_devices(new_name))
|
||||
return -1;
|
||||
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "ifname", dev_name);
|
||||
|
|
@ -1410,7 +1406,7 @@ static int set_EthernetVLANTermination_VLANID(char *refparam, struct dmctx *ctx,
|
|||
dmasprintf(&name, "%s.%s", ifname, value);
|
||||
}
|
||||
|
||||
if (is_name_exist_in_devices(name))
|
||||
if (ethernet_name_exists_in_devices(name))
|
||||
return -1;
|
||||
|
||||
// set ifname option of the corresponding interface section
|
||||
|
|
@ -1486,108 +1482,6 @@ static int set_EthernetVLANTermination_TPID(char *refparam, struct dmctx *ctx, v
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int get_EthernetVLANTermination_MACVLAN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "type", value);
|
||||
*value = (strcmp(*value, "macvlan") == 0) ? "1" : "0";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_EthernetVLANTermination_MACVLAN(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
char *name, *ifname;
|
||||
bool b;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_boolean(value))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
string_to_bool(value, &b);
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "ifname", &ifname);
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "name", &name);
|
||||
struct uci_section *s = NULL, *dmmap_s = NULL;
|
||||
if (b && *name != '\0') {
|
||||
char *link_instance = NULL, new_name[16] = {0};
|
||||
int name_found = 0;
|
||||
|
||||
uci_foreach_option_eq("network", "interface", "ifname", name, s) {
|
||||
|
||||
get_dmmap_section_of_config_section_eq("dmmap", "link", "device", ifname, &dmmap_s);
|
||||
if (dmmap_s) {
|
||||
dmuci_get_value_by_section_string(dmmap_s, "link_instance", &link_instance);
|
||||
snprintf(new_name, sizeof(new_name), "%s_%s", ifname, link_instance);
|
||||
|
||||
if (is_name_exist_in_devices(new_name))
|
||||
return -1;
|
||||
|
||||
dmuci_set_value_by_section(dmmap_s, "device", new_name);
|
||||
dmuci_set_value_by_section(dmmap_s, "section_name", section_name(s));
|
||||
|
||||
}
|
||||
|
||||
dmuci_set_value_by_section(s, "ifname", new_name);
|
||||
|
||||
name_found = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (name_found == 0) {
|
||||
int ifname_found = 0;
|
||||
struct uci_section *ss = NULL;
|
||||
|
||||
uci_foreach_option_eq("network", "interface", "ifname", ifname, ss) {
|
||||
|
||||
uci_path_foreach_option_eq(bbfdm, "dmmap", "link", "device", ifname, dmmap_s) {
|
||||
char *sec_name;
|
||||
dmuci_get_value_by_section_string(dmmap_s, "section_name", &sec_name);
|
||||
/* Check section name exist => if yes, continue*/
|
||||
if (!check_section_in_curr_section(sec_name, section_name(ss)))
|
||||
continue;
|
||||
|
||||
dmuci_get_value_by_section_string(dmmap_s, "link_instance", &link_instance);
|
||||
snprintf(new_name, sizeof(new_name), "%s_%s", ifname, link_instance);
|
||||
|
||||
if (is_name_exist_in_devices(new_name))
|
||||
return -1;
|
||||
|
||||
dmuci_set_value_by_section(dmmap_s, "device", new_name);
|
||||
dmuci_set_value_by_section(dmmap_s, "section_name", section_name(ss));
|
||||
}
|
||||
|
||||
dmuci_set_value_by_section(ss, "ifname", new_name);
|
||||
|
||||
ifname_found = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ifname_found == 0) {
|
||||
get_dmmap_section_of_config_section_eq("dmmap", "link", "device", ifname, &dmmap_s);
|
||||
if (dmmap_s) {
|
||||
dmuci_get_value_by_section_string(dmmap_s, "link_instance", &link_instance);
|
||||
snprintf(new_name, sizeof(new_name), "%s_%s", ifname, link_instance);
|
||||
|
||||
if (is_name_exist_in_devices(new_name))
|
||||
return -1;
|
||||
|
||||
dmuci_set_value_by_section(dmmap_s, "device", new_name);
|
||||
dmuci_set_value_by_section(dmmap_s, "section_name", "");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "name", new_name);
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "type", "macvlan");
|
||||
} else {
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "type", b ? "macvlan" : "8021q");
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Ethernet.VLANTermination.{i}.Stats.BytesSent!SYSFS:/sys/class/net/@Name/statistics/tx_bytes*/
|
||||
static int get_EthernetVLANTerminationStats_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
|
|
@ -1867,11 +1761,11 @@ static int get_EthernetRMONStats_Packets1024to1518Bytes(char *refparam, struct d
|
|||
***********************************************************************************************************************************/
|
||||
/* *** Device.Ethernet. *** */
|
||||
DMOBJ tEthernetObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Interface", &DMREAD, NULL, NULL, NULL, browseEthernetInterfaceInst, NULL, tEthernetInterfaceObj, tEthernetInterfaceParams, get_linker_interface, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"Link", &DMWRITE, addObjEthernetLink, delObjEthernetLink, NULL, browseEthernetLinkInst, NULL, tEthernetLinkObj, tEthernetLinkParams, get_linker_link, BBFDM_BOTH, LIST_KEY{"Name", "Alias", "MACAddress", NULL}},
|
||||
{"VLANTermination", &DMWRITE, addObjEthernetVLANTermination, delObjEthernetVLANTermination, NULL, browseEthernetVLANTerminationInst, NULL, tEthernetVLANTerminationObj, tEthernetVLANTerminationParams, get_linker_vlan_term, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"RMONStats", &DMREAD, NULL, NULL, "file:/etc/config/ports;ubus:ethernet->rmonstats", browseEthernetRMONStatsInst, NULL, NULL, tEthernetRMONStatsParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "Interface", "VLANID", "Queue", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Interface", &DMREAD, NULL, NULL, NULL, browseEthernetInterfaceInst, NULL, NULL, tEthernetInterfaceObj, tEthernetInterfaceParams, get_linker_interface, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"Link", &DMWRITE, addObjEthernetLink, delObjEthernetLink, NULL, browseEthernetLinkInst, NULL, NULL, tEthernetLinkObj, tEthernetLinkParams, get_linker_link, BBFDM_BOTH, LIST_KEY{"Name", "Alias", "MACAddress", NULL}},
|
||||
{"VLANTermination", &DMWRITE, addObjEthernetVLANTermination, delObjEthernetVLANTermination, NULL, browseEthernetVLANTerminationInst, NULL, NULL, tEthernetVLANTerminationObj, tEthernetVLANTerminationParams, get_linker_vlan_term, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"RMONStats", &DMREAD, NULL, NULL, "file:/etc/config/ports;ubus:ethernet->rmonstats", browseEthernetRMONStatsInst, NULL, NULL, NULL, tEthernetRMONStatsParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "Interface", "VLANID", "Queue", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1886,8 +1780,8 @@ DMLEAF tEthernetParams[] = {
|
|||
|
||||
/* *** Device.Ethernet.Interface.{i}. *** */
|
||||
DMOBJ tEthernetInterfaceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tEthernetInterfaceStatsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tEthernetInterfaceStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1921,21 +1815,19 @@ DMLEAF tEthernetInterfaceStatsParams[] = {
|
|||
{"DiscardPacketsSent", &DMREAD, DMT_UNINT, get_EthernetInterfaceStats_DiscardPacketsSent, NULL, BBFDM_BOTH},
|
||||
{"DiscardPacketsReceived", &DMREAD, DMT_UNINT, get_EthernetInterfaceStats_DiscardPacketsReceived, NULL, BBFDM_BOTH},
|
||||
{"MulticastPacketsReceived", &DMREAD, DMT_UNLONG, get_EthernetInterfaceStats_MulticastPacketsReceived, NULL, BBFDM_BOTH},
|
||||
#ifndef GENERIC_OPENWRT
|
||||
{"MulticastPacketsSent", &DMREAD, DMT_UNLONG, get_EthernetInterfaceStats_MulticastPacketsSent, NULL, BBFDM_BOTH},
|
||||
{"UnicastPacketsSent", &DMREAD, DMT_UNLONG, get_EthernetInterfaceStats_UnicastPacketsSent, NULL, BBFDM_BOTH},
|
||||
{"UnicastPacketsReceived", &DMREAD, DMT_UNLONG, get_EthernetInterfaceStats_UnicastPacketsReceived, NULL, BBFDM_BOTH},
|
||||
{"BroadcastPacketsSent", &DMREAD, DMT_UNLONG, get_EthernetInterfaceStats_BroadcastPacketsSent, NULL, BBFDM_BOTH},
|
||||
{"BroadcastPacketsReceived", &DMREAD, DMT_UNLONG, get_EthernetInterfaceStats_BroadcastPacketsReceived, NULL, BBFDM_BOTH},
|
||||
{"UnknownProtoPacketsReceived", &DMREAD, DMT_UNINT, get_EthernetInterfaceStats_UnknownProtoPacketsReceived, NULL, BBFDM_BOTH},
|
||||
#endif
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.Ethernet.Link.{i}. *** */
|
||||
DMOBJ tEthernetLinkObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tEthernetLinkStatsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tEthernetLinkStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1963,21 +1855,19 @@ DMLEAF tEthernetLinkStatsParams[] = {
|
|||
{"DiscardPacketsSent", &DMREAD, DMT_UNINT, get_EthernetLinkStats_DiscardPacketsSent, NULL, BBFDM_BOTH},
|
||||
{"DiscardPacketsReceived", &DMREAD, DMT_UNINT, get_EthernetLinkStats_DiscardPacketsReceived, NULL, BBFDM_BOTH},
|
||||
{"MulticastPacketsReceived", &DMREAD, DMT_UNLONG, get_EthernetLinkStats_MulticastPacketsReceived, NULL, BBFDM_BOTH},
|
||||
#ifndef GENERIC_OPENWRT
|
||||
{"MulticastPacketsSent", &DMREAD, DMT_UNLONG, get_EthernetLinkStats_MulticastPacketsSent, NULL, BBFDM_BOTH},
|
||||
{"UnicastPacketsSent", &DMREAD, DMT_UNLONG, get_EthernetLinkStats_UnicastPacketsSent, NULL, BBFDM_BOTH},
|
||||
{"UnicastPacketsReceived", &DMREAD, DMT_UNLONG, get_EthernetLinkStats_UnicastPacketsReceived, NULL, BBFDM_BOTH},
|
||||
{"BroadcastPacketsSent", &DMREAD, DMT_UNLONG, get_EthernetLinkStats_BroadcastPacketsSent, NULL, BBFDM_BOTH},
|
||||
{"BroadcastPacketsReceived", &DMREAD, DMT_UNLONG, get_EthernetLinkStats_BroadcastPacketsReceived, NULL, BBFDM_BOTH},
|
||||
{"UnknownProtoPacketsReceived", &DMREAD, DMT_UNINT, get_EthernetLinkStats_UnknownProtoPacketsReceived, NULL, BBFDM_BOTH},
|
||||
#endif
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.Ethernet.VLANTermination.{i}. *** */
|
||||
DMOBJ tEthernetVLANTerminationObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tEthernetVLANTerminationStatsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tEthernetVLANTerminationStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1991,7 +1881,6 @@ DMLEAF tEthernetVLANTerminationParams[] = {
|
|||
{"LowerLayers", &DMWRITE, DMT_STRING, get_EthernetVLANTermination_LowerLayers, set_EthernetVLANTermination_LowerLayers, BBFDM_BOTH},
|
||||
{"VLANID", &DMWRITE, DMT_UNINT, get_EthernetVLANTermination_VLANID, set_EthernetVLANTermination_VLANID, BBFDM_BOTH},
|
||||
{"TPID", &DMWRITE, DMT_UNINT, get_EthernetVLANTermination_TPID, set_EthernetVLANTermination_TPID, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"MACVLAN", &DMWRITE, DMT_BOOL, get_EthernetVLANTermination_MACVLAN, set_EthernetVLANTermination_MACVLAN, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ extern DMLEAF tEthernetVLANTerminationParams[];
|
|||
extern DMLEAF tEthernetVLANTerminationStatsParams[];
|
||||
extern DMLEAF tEthernetRMONStatsParams[];
|
||||
|
||||
void get_bridge_port_linker(struct dmctx *ctx, char *intf_name, char **value);
|
||||
int is_vlan_termination_section(const char *name);
|
||||
int ethernet_check_section_in_curr_section(char *curr_section, char *section);
|
||||
int ethernet_name_exists_in_devices(char *name);
|
||||
|
||||
#endif //__ETHERNET_H
|
||||
|
|
|
|||
|
|
@ -903,8 +903,8 @@ static int get_FASTLineStatsQuarterHour_SuccessTIGA(char *refparam, struct dmctx
|
|||
|
||||
/* *** Device.FAST. *** */
|
||||
DMOBJ tFASTObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Line", &DMREAD, NULL, NULL, NULL, browseFASTLineInst, NULL, tFASTLineObj, tFASTLineParams, get_fast_line_linker, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Line", &DMREAD, NULL, NULL, NULL, browseFASTLineInst, NULL, NULL, tFASTLineObj, tFASTLineParams, get_fast_line_linker, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -916,8 +916,8 @@ DMLEAF tFASTParams[] = {
|
|||
|
||||
/* *** Device.FAST.Line.{i}. *** */
|
||||
DMOBJ tFASTLineObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsObj, tFASTLineStatsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsObj, tFASTLineStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -953,12 +953,12 @@ DMLEAF tFASTLineParams[] = {
|
|||
|
||||
/* *** Device.FAST.Line.{i}.Stats. *** */
|
||||
DMOBJ tFASTLineStatsObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Total", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsTotalParams, NULL, BBFDM_BOTH},
|
||||
{"Showtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsShowtimeParams, NULL, BBFDM_BOTH},
|
||||
{"LastShowtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsLastShowtimeParams, NULL, BBFDM_BOTH},
|
||||
{"CurrentDay", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsCurrentDayParams, NULL, BBFDM_BOTH},
|
||||
{"QuarterHour", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsQuarterHourParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Total", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsTotalParams, NULL, BBFDM_BOTH},
|
||||
{"Showtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsShowtimeParams, NULL, BBFDM_BOTH},
|
||||
{"LastShowtime", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsLastShowtimeParams, NULL, BBFDM_BOTH},
|
||||
{"CurrentDay", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsCurrentDayParams, NULL, BBFDM_BOTH},
|
||||
{"QuarterHour", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tFASTLineStatsQuarterHourParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -335,7 +335,6 @@ static int get_FirewallChainRule_CreationDate(char *refparam, struct dmctx *ctx,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifndef GENERIC_OPENWRT
|
||||
/*#Device.Firewall.Chain.{i}.Rule.{i}.ExpiryDate!UCI:firewall/rule,@i-1/expiry*/
|
||||
static int get_FirewallChainRule_ExpiryDate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
|
|
@ -372,7 +371,6 @@ static int set_FirewallChainRule_ExpiryDate(char *refparam, struct dmctx *ctx, v
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int get_rule_source_interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
|
|
@ -671,68 +669,6 @@ static int get_rule_source_port_range_max(char *refparam, struct dmctx *ctx, voi
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int get_rule_icmp_type(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct uci_list *v= NULL;
|
||||
struct uci_element *e = NULL;
|
||||
char *ptr = NULL;
|
||||
|
||||
dmasprintf(value, "%s", "");
|
||||
dmuci_get_value_by_section_list((struct uci_section *)data, "icmp_type", &v);
|
||||
if (v != NULL) {
|
||||
uci_foreach_element(v, e) {
|
||||
ptr = dmstrdup(*value);
|
||||
dmfree(*value);
|
||||
|
||||
if (strlen(ptr) == 0)
|
||||
dmasprintf(value, "%s", e->name);
|
||||
else {
|
||||
dmasprintf(value, "%s %s", ptr, e->name);
|
||||
dmfree(ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_rule_source_mac(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *v = NULL;
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "src_mac", &v);
|
||||
*value = (v) ? v : "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_time_span_supported_days(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = "mon,tue,wed,thu,fri,sat,sun";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_time_span_days(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *v;
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "weekdays", &v);
|
||||
*value = (v) ? v : "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_time_span_start_time(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *v;
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "start_time", &v);
|
||||
*value = (v) ? v : "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_time_span_stop_time(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *v;
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "stop_time", &v);
|
||||
*value = (v) ? v : "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_firewall_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
bool b;
|
||||
|
|
@ -1384,83 +1320,11 @@ static int set_rule_source_port_range_max(char *refparam, struct dmctx *ctx, voi
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int set_rule_icmp_type(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
int i;
|
||||
size_t length;
|
||||
char **devices = NULL;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "icmp_type", "");
|
||||
devices = strsplit(value, " ", &length);
|
||||
for (i = 0; i < length; i++)
|
||||
dmuci_add_list_value_by_section((struct uci_section *)data, "icmp_type", devices[i]);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_rule_source_mac(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "src_mac", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_time_span_days(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "weekdays", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_time_span_start_time(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "start_time", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_time_span_stop_time(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "stop_time", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* *** Device.Firewall. *** */
|
||||
DMOBJ tFirewallObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Level", &DMREAD, NULL, NULL, NULL, browseLevelInst, NULL, NULL, tFirewallLevelParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"Chain", &DMREAD, NULL, NULL, NULL, browseChainInst, NULL, tFirewallChainObj, tFirewallChainParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Level", &DMREAD, NULL, NULL, NULL, browseLevelInst, NULL, NULL, NULL, tFirewallLevelParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"Chain", &DMREAD, NULL, NULL, NULL, browseChainInst, NULL, NULL, tFirewallChainObj, tFirewallChainParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1488,8 +1352,8 @@ DMLEAF tFirewallLevelParams[] = {
|
|||
|
||||
/* *** Device.Firewall.Chain.{i}. *** */
|
||||
DMOBJ tFirewallChainObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Rule", &DMWRITE, add_firewall_rule, delete_firewall_rule, NULL, browseRuleInst, NULL, tFirewallChainRuleObj, tFirewallChainRuleParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Rule", &DMWRITE, add_firewall_rule, delete_firewall_rule, NULL, browseRuleInst, NULL, NULL, NULL, tFirewallChainRuleParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1504,12 +1368,6 @@ DMLEAF tFirewallChainParams[] = {
|
|||
};
|
||||
|
||||
/* *** Device.Firewall.Chain.{i}.Rule.{i}. *** */
|
||||
DMOBJ tFirewallChainRuleObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{CUSTOM_PREFIX"TimeSpan", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tTimeSpanParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tFirewallChainRuleParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"Enable", &DMWRITE, DMT_BOOL, get_rule_enable, set_rule_enable, BBFDM_BOTH},
|
||||
|
|
@ -1521,9 +1379,7 @@ DMLEAF tFirewallChainRuleParams[] = {
|
|||
//{"TargetChain", &DMWRITE, DMT_STRING, get_rule_target_chain, set_rule_target_chain, BBFDM_BOTH},
|
||||
{"Log", &DMWRITE, DMT_BOOL, get_rule_log, set_rule_log, BBFDM_BOTH},
|
||||
{"CreationDate", &DMREAD, DMT_TIME, get_FirewallChainRule_CreationDate, NULL, BBFDM_BOTH},
|
||||
#ifndef GENERIC_OPENWRT
|
||||
{"ExpiryDate", &DMWRITE, DMT_TIME, get_FirewallChainRule_ExpiryDate, set_FirewallChainRule_ExpiryDate, BBFDM_BOTH},
|
||||
#endif
|
||||
{"SourceInterface", &DMWRITE, DMT_STRING, get_rule_source_interface, set_rule_source_interface, BBFDM_BOTH},
|
||||
{"SourceAllInterfaces", &DMWRITE, DMT_BOOL, get_rule_source_all_interfaces, set_rule_source_all_interfaces, BBFDM_BOTH},
|
||||
{"DestInterface", &DMWRITE, DMT_STRING, get_rule_dest_interface, set_rule_dest_interface, BBFDM_BOTH},
|
||||
|
|
@ -1538,16 +1394,5 @@ DMLEAF tFirewallChainRuleParams[] = {
|
|||
{"DestPortRangeMax", &DMWRITE, DMT_INT, get_rule_dest_port_range_max, set_rule_dest_port_range_max, BBFDM_BOTH},
|
||||
{"SourcePort", &DMWRITE, DMT_INT, get_rule_source_port, set_rule_source_port, BBFDM_BOTH},
|
||||
{"SourcePortRangeMax", &DMWRITE, DMT_INT, get_rule_source_port_range_max, set_rule_source_port_range_max, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"ICMPType", &DMWRITE, DMT_STRING, get_rule_icmp_type, set_rule_icmp_type, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"SourceMACAddress", &DMWRITE, DMT_STRING, get_rule_source_mac, set_rule_source_mac, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tTimeSpanParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"SupportedDays", &DMREAD, DMT_STRING, get_time_span_supported_days, NULL, BBFDM_BOTH},
|
||||
{"Days", &DMWRITE, DMT_STRING, get_time_span_days, set_time_span_days, BBFDM_BOTH},
|
||||
{"StartTime", &DMWRITE, DMT_STRING, get_time_span_start_time, set_time_span_start_time, BBFDM_BOTH},
|
||||
{"StopTime", &DMWRITE, DMT_STRING, get_time_span_stop_time, set_time_span_stop_time, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,5 @@ extern DMLEAF tFirewallLevelParams[];
|
|||
extern DMLEAF tFirewallChainParams[];
|
||||
extern DMOBJ tFirewallChainObj[];
|
||||
extern DMLEAF tFirewallChainRuleParams[];
|
||||
extern DMOBJ tFirewallChainRuleObj[];
|
||||
extern DMLEAF tTimeSpanParams[];
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -416,9 +416,9 @@ static int get_GRETunnelInterfaceStats_ErrorsReceived(char *refparam, struct dmc
|
|||
|
||||
/* *** Device.GRE. *** */
|
||||
DMOBJ tGREObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Tunnel", &DMWRITE, addObjGRETunnel, delObjGRETunnel, NULL, browseGRETunnelInst, NULL, tGRETunnelObj, tGRETunnelParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
//{"Filter", &DMWRITE, addObjGREFilter, delObjGREFilter, NULL, browseGREFilterInst, NULL, NULL, tGREFilterParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Tunnel", &DMWRITE, addObjGRETunnel, delObjGRETunnel, NULL, browseGRETunnelInst, NULL, NULL, tGRETunnelObj, tGRETunnelParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
//{"Filter", &DMWRITE, addObjGREFilter, delObjGREFilter, NULL, browseGREFilterInst, NULL, NULL, NULL, tGREFilterParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -431,9 +431,9 @@ DMLEAF tGREParams[] = {
|
|||
|
||||
/* *** Device.GRE.Tunnel.{i}. *** */
|
||||
DMOBJ tGRETunnelObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tGRETunnelStatsParams, NULL, BBFDM_BOTH},
|
||||
{"Interface", &DMWRITE, addObjGRETunnelInterface, delObjGRETunnelInterface, NULL, browseGRETunnelInterfaceInst, NULL, tGRETunnelInterfaceObj, tGRETunnelInterfaceParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tGRETunnelStatsParams, NULL, BBFDM_BOTH},
|
||||
{"Interface", &DMWRITE, addObjGRETunnelInterface, delObjGRETunnelInterface, NULL, browseGRETunnelInterfaceInst, NULL, NULL, tGRETunnelInterfaceObj, tGRETunnelInterfaceParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -469,8 +469,8 @@ DMLEAF tGRETunnelStatsParams[] = {
|
|||
|
||||
/* *** Device.GRE.Tunnel.{i}.Interface.{i}. *** */
|
||||
DMOBJ tGRETunnelInterfaceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tGRETunnelInterfaceStatsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tGRETunnelInterfaceStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,250 +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: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*/
|
||||
|
||||
#include "os.h"
|
||||
#include "dmentry.h"
|
||||
|
||||
/*************************************************************
|
||||
* ENTRY METHOD
|
||||
**************************************************************/
|
||||
/*#Device.Hosts.Host.{i}.!UBUS:router.network/hosts//hosts*/
|
||||
int os__browseHostsHostInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
json_object *res = NULL, *host_obj = NULL, *arrobj = NULL;
|
||||
char *inst = NULL, *max_inst = NULL;
|
||||
int id = 0, i = 0;
|
||||
|
||||
dmubus_call("router.network", "hosts", UBUS_ARGS{}, 0, &res);
|
||||
dmjson_foreach_obj_in_array(res, arrobj, host_obj, i, 1, "hosts") {
|
||||
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_without_section, 1, ++id);
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)host_obj, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPv4Address.{i}.!UBUS:router.network/hosts//hosts[@i-1].ipv4addr*/
|
||||
int os__browseHostsHostIPv4AddressInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
json_object *ip_arr = NULL, *host_obj = (json_object *)prev_data;
|
||||
char *inst = NULL, *max_inst = NULL, *ipv4addr = NULL;
|
||||
int id = 0, i = 0;
|
||||
|
||||
dmjson_foreach_value_in_array(host_obj, ip_arr, ipv4addr, i, 1, "ipv4addr") {
|
||||
inst = handle_update_instance(2, dmctx, &max_inst, update_instance_without_section, 1, ++id);
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)ipv4addr, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPv6Address.{i}.!UBUS:router.network/hosts//hosts[@i-1].ipv6addr*/
|
||||
int os__browseHostsHostIPv6AddressInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
json_object *ip_arr = NULL, *host_obj = (json_object *)prev_data;
|
||||
char *inst = NULL, *max_inst = NULL, *ipv6addr = NULL;
|
||||
int id = 0, i = 0;
|
||||
|
||||
dmjson_foreach_value_in_array(host_obj, ip_arr, ipv6addr, i, 1, "ipv6addr") {
|
||||
inst = handle_update_instance(2, dmctx, &max_inst, update_instance_without_section, 1, ++id);
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)ipv6addr, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* LINKER
|
||||
**************************************************************/
|
||||
int get_linker_host(char *refparam, struct dmctx *dmctx, void *data, char *instance, char **linker)
|
||||
{
|
||||
*linker = dmjson_get_value((json_object *)data, 1, "ipaddr");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* GET & SET PARAM
|
||||
**************************************************************/
|
||||
/*#Device.Hosts.HostNumberOfEntries!UBUS:router.network/hosts//hosts*/
|
||||
int os__get_Hosts_HostNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res = NULL, *hosts = NULL;
|
||||
size_t nbre_hosts = 0;
|
||||
|
||||
dmubus_call("router.network", "hosts", UBUS_ARGS{}, 0, &res);
|
||||
DM_ASSERT(res, *value = "0");
|
||||
json_object_object_get_ex(res, "hosts", &hosts);
|
||||
nbre_hosts = (hosts) ? json_object_array_length(hosts) : 0;
|
||||
dmasprintf(value, "%d", nbre_hosts);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.PhysAddress!UBUS:router.network/hosts//hosts[@i-1].macaddr*/
|
||||
int os__get_HostsHost_PhysAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "macaddr");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPAddress!UBUS:router.network/hosts//hosts[@i-1].ipaddr*/
|
||||
int os__get_HostsHost_IPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "ipaddr");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_HostsHost_DHCPClient(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *linker = dmjson_get_value((json_object *)data, 1, "macaddr");
|
||||
adm_entry_get_linker_param(ctx, "Device.DHCPv4.Server.Pool.", linker, value);
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_HostsHost_AssociatedDevice(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *linker = dmjson_get_value((json_object *)data, 1, "macaddr");
|
||||
adm_entry_get_linker_param(ctx, "Device.WiFi.AccessPoint.", linker, value);
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_HostsHost_Layer1Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *linker = dmjson_get_value((json_object *)data, 1, "device");
|
||||
char *type = dmjson_get_value((json_object *)data, 1, "type");
|
||||
if (strcmp(type, "wifi") == 0)
|
||||
adm_entry_get_linker_param(ctx, "Device.WiFi.Radio.", linker, value);
|
||||
else
|
||||
adm_entry_get_linker_param(ctx, "Device.Ethernet.Interface.", linker, value);
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_HostsHost_Layer3Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *linker = dmjson_get_value((json_object *)data, 1, "network");
|
||||
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", linker, value);
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.InterfaceType!UBUS:router.network/hosts//hosts[@i-1].type*/
|
||||
int os__get_HostsHost_InterfaceType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "type");
|
||||
*value = (strcmp(*value, "ethernet") == 0) ? "Ethernet" : "Wi-Fi";
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.HostName!UBUS:router.network/hosts//hosts[@i-1].hostname*/
|
||||
int os__get_HostsHost_HostName(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "hostname");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.Active!UBUS:router.network/hosts//hosts[@i-1].active*/
|
||||
int os__get_HostsHost_Active(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "active");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.ActiveLastChange!UBUS:router.network/hosts//hosts[@i-1].activelstch*/
|
||||
int os__get_HostsHost_ActiveLastChange(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = "0001-01-01T00:00:00Z";
|
||||
|
||||
char *lastchange = dmjson_get_value((json_object *)data, 1, "activelstch");
|
||||
if (lastchange && *lastchange != '\0' && atoi(lastchange) > 0) {
|
||||
time_t t_time = atoi(lastchange);
|
||||
if (localtime(&t_time) == NULL)
|
||||
return -1;
|
||||
|
||||
char local_time[32] = {0};
|
||||
|
||||
if (strftime(local_time, sizeof(local_time), "%Y-%m-%dT%H:%M:%SZ", localtime(&t_time)) == 0)
|
||||
return -1;
|
||||
|
||||
*value = dmstrdup(local_time);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPv4AddressNumberOfEntries!UBUS:router.network/hosts//hosts[@i-1].ipv4addr*/
|
||||
int os__get_HostsHost_IPv4AddressNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *ipv4addr = NULL;
|
||||
size_t nbre_addr = 0;
|
||||
|
||||
json_object_object_get_ex((json_object *)data, "ipv4addr", &ipv4addr);
|
||||
nbre_addr = (ipv4addr) ? json_object_array_length(ipv4addr) : 0;
|
||||
dmasprintf(value, "%d", nbre_addr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPv6AddressNumberOfEntries!UBUS:router.network/hosts//hosts[@i-1].ipv6addr*/
|
||||
int os__get_HostsHost_IPv6AddressNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *ipv6addr = NULL;
|
||||
size_t nbre_addr = 0;
|
||||
|
||||
json_object_object_get_ex((json_object *)data, "ipv6addr", &ipv6addr);
|
||||
nbre_addr = (ipv6addr) ? json_object_array_length(ipv6addr) : 0;
|
||||
dmasprintf(value, "%d", nbre_addr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPv4Address.{i}.IPAddress!UBUS:router.network/hosts//hosts[@i-1].ipv4addr[@i-1]*/
|
||||
int os__get_HostsHostIPv4Address_IPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = (char *)data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPv6Address.{i}.IPAddress!UBUS:router.network/hosts//hosts[@i-1].ipv6addr[@i-1]*/
|
||||
int os__get_HostsHostIPv6Address_IPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = (char *)data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.WANStats.BytesSent!UBUS:router.network/hosts//hosts[@i-1].stats.tx_bytes*/
|
||||
int os__get_HostsHostWANStats_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 2, "stats", "tx_bytes");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.WANStats.BytesReceived!UBUS:router.network/hosts//hosts[@i-1].stats.rx_bytes*/
|
||||
int os__get_HostsHostWANStats_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 2, "stats", "rx_bytes");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.WANStats.PacketsSent!UBUS:router.network/hosts//hosts[@i-1].stats.tx_packets*/
|
||||
int os__get_HostsHostWANStats_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 2, "stats", "tx_packets");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.WANStats.PacketsReceived!UBUS:router.network/hosts//hosts[@i-1].stats.rx_packets*/
|
||||
int os__get_HostsHostWANStats_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 2, "stats", "rx_packets");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,131 +0,0 @@
|
|||
#include "os.h"
|
||||
|
||||
static int not_implemented(char **value)
|
||||
{
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* ENTRY METHOD
|
||||
**************************************************************/
|
||||
int os__browseHostsHostInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseHostsHostIPv4AddressInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseHostsHostIPv6AddressInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* LINKER
|
||||
**************************************************************/
|
||||
int get_linker_host(char *refparam, struct dmctx *dmctx, void *data, char *instance, char **linker)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* GET & SET PARAM
|
||||
**************************************************************/
|
||||
int os__get_Hosts_HostNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHost_PhysAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHost_IPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHost_DHCPClient(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHost_AssociatedDevice(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHost_Layer1Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHost_Layer3Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHost_InterfaceType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHost_HostName(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHost_Active(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHost_ActiveLastChange(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHost_IPv4AddressNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHost_IPv6AddressNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHostIPv4Address_IPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHostIPv6Address_IPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHostWANStats_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHostWANStats_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHostWANStats_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_HostsHostWANStats_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
|
@ -9,67 +9,305 @@
|
|||
*/
|
||||
|
||||
#include "hosts.h"
|
||||
#include "os.h"
|
||||
#include "dmentry.h"
|
||||
|
||||
/*************************************************************
|
||||
* ENTRY METHOD
|
||||
**************************************************************/
|
||||
/*#Device.Hosts.Host.{i}.!UBUS:router.network/hosts//hosts*/
|
||||
static int browseHostsHostInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
json_object *res = NULL, *host_obj = NULL, *arrobj = NULL;
|
||||
char *inst = NULL, *max_inst = NULL;
|
||||
int id = 0, i = 0;
|
||||
|
||||
dmubus_call("router.network", "hosts", UBUS_ARGS{}, 0, &res);
|
||||
dmjson_foreach_obj_in_array(res, arrobj, host_obj, i, 1, "hosts") {
|
||||
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_without_section, 1, ++id);
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)host_obj, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPv4Address.{i}.!UBUS:router.network/hosts//hosts[@i-1].ipv4addr*/
|
||||
static int browseHostsHostIPv4AddressInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
json_object *ip_arr = NULL, *host_obj = (json_object *)prev_data;
|
||||
char *inst = NULL, *max_inst = NULL, *ipv4addr = NULL;
|
||||
int id = 0, i = 0;
|
||||
|
||||
dmjson_foreach_value_in_array(host_obj, ip_arr, ipv4addr, i, 1, "ipv4addr") {
|
||||
inst = handle_update_instance(2, dmctx, &max_inst, update_instance_without_section, 1, ++id);
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)ipv4addr, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPv6Address.{i}.!UBUS:router.network/hosts//hosts[@i-1].ipv6addr*/
|
||||
static int browseHostsHostIPv6AddressInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
json_object *ip_arr = NULL, *host_obj = (json_object *)prev_data;
|
||||
char *inst = NULL, *max_inst = NULL, *ipv6addr = NULL;
|
||||
int id = 0, i = 0;
|
||||
|
||||
dmjson_foreach_value_in_array(host_obj, ip_arr, ipv6addr, i, 1, "ipv6addr") {
|
||||
inst = handle_update_instance(2, dmctx, &max_inst, update_instance_without_section, 1, ++id);
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)ipv6addr, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* LINKER
|
||||
**************************************************************/
|
||||
static int get_linker_host(char *refparam, struct dmctx *dmctx, void *data, char *instance, char **linker)
|
||||
{
|
||||
*linker = dmjson_get_value((json_object *)data, 1, "ipaddr");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* GET & SET PARAM
|
||||
**************************************************************/
|
||||
/*#Device.Hosts.HostNumberOfEntries!UBUS:router.network/hosts//hosts*/
|
||||
static int get_Hosts_HostNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res = NULL, *hosts = NULL;
|
||||
size_t nbre_hosts = 0;
|
||||
|
||||
dmubus_call("router.network", "hosts", UBUS_ARGS{}, 0, &res);
|
||||
DM_ASSERT(res, *value = "0");
|
||||
json_object_object_get_ex(res, "hosts", &hosts);
|
||||
nbre_hosts = (hosts) ? json_object_array_length(hosts) : 0;
|
||||
dmasprintf(value, "%d", nbre_hosts);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.PhysAddress!UBUS:router.network/hosts//hosts[@i-1].macaddr*/
|
||||
static int get_HostsHost_PhysAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "macaddr");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPAddress!UBUS:router.network/hosts//hosts[@i-1].ipaddr*/
|
||||
static int get_HostsHost_IPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "ipaddr");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_HostsHost_DHCPClient(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *linker = dmjson_get_value((json_object *)data, 1, "macaddr");
|
||||
adm_entry_get_linker_param(ctx, "Device.DHCPv4.Server.Pool.", linker, value);
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_HostsHost_AssociatedDevice(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *linker = dmjson_get_value((json_object *)data, 1, "macaddr");
|
||||
adm_entry_get_linker_param(ctx, "Device.WiFi.AccessPoint.", linker, value);
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_HostsHost_Layer1Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *linker = dmjson_get_value((json_object *)data, 1, "device");
|
||||
char *type = dmjson_get_value((json_object *)data, 1, "type");
|
||||
if (strcmp(type, "wifi") == 0)
|
||||
adm_entry_get_linker_param(ctx, "Device.WiFi.Radio.", linker, value);
|
||||
else
|
||||
adm_entry_get_linker_param(ctx, "Device.Ethernet.Interface.", linker, value);
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_HostsHost_Layer3Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *linker = dmjson_get_value((json_object *)data, 1, "network");
|
||||
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", linker, value);
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.InterfaceType!UBUS:router.network/hosts//hosts[@i-1].type*/
|
||||
static int get_HostsHost_InterfaceType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "type");
|
||||
*value = (strcmp(*value, "ethernet") == 0) ? "Ethernet" : "Wi-Fi";
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.HostName!UBUS:router.network/hosts//hosts[@i-1].hostname*/
|
||||
static int get_HostsHost_HostName(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "hostname");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.Active!UBUS:router.network/hosts//hosts[@i-1].active*/
|
||||
static int get_HostsHost_Active(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "active");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.ActiveLastChange!UBUS:router.network/hosts//hosts[@i-1].activelstch*/
|
||||
static int get_HostsHost_ActiveLastChange(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = "0001-01-01T00:00:00Z";
|
||||
|
||||
char *lastchange = dmjson_get_value((json_object *)data, 1, "activelstch");
|
||||
if (lastchange && *lastchange != '\0' && atoi(lastchange) > 0) {
|
||||
time_t t_time = atoi(lastchange);
|
||||
if (localtime(&t_time) == NULL)
|
||||
return -1;
|
||||
|
||||
char local_time[32] = {0};
|
||||
|
||||
if (strftime(local_time, sizeof(local_time), "%Y-%m-%dT%H:%M:%SZ", localtime(&t_time)) == 0)
|
||||
return -1;
|
||||
|
||||
*value = dmstrdup(local_time);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPv4AddressNumberOfEntries!UBUS:router.network/hosts//hosts[@i-1].ipv4addr*/
|
||||
static int get_HostsHost_IPv4AddressNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *ipv4addr = NULL;
|
||||
size_t nbre_addr = 0;
|
||||
|
||||
json_object_object_get_ex((json_object *)data, "ipv4addr", &ipv4addr);
|
||||
nbre_addr = (ipv4addr) ? json_object_array_length(ipv4addr) : 0;
|
||||
dmasprintf(value, "%d", nbre_addr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPv6AddressNumberOfEntries!UBUS:router.network/hosts//hosts[@i-1].ipv6addr*/
|
||||
static int get_HostsHost_IPv6AddressNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *ipv6addr = NULL;
|
||||
size_t nbre_addr = 0;
|
||||
|
||||
json_object_object_get_ex((json_object *)data, "ipv6addr", &ipv6addr);
|
||||
nbre_addr = (ipv6addr) ? json_object_array_length(ipv6addr) : 0;
|
||||
dmasprintf(value, "%d", nbre_addr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPv4Address.{i}.IPAddress!UBUS:router.network/hosts//hosts[@i-1].ipv4addr[@i-1]*/
|
||||
static int get_HostsHostIPv4Address_IPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = (char *)data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.IPv6Address.{i}.IPAddress!UBUS:router.network/hosts//hosts[@i-1].ipv6addr[@i-1]*/
|
||||
static int get_HostsHostIPv6Address_IPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = (char *)data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.WANStats.BytesSent!UBUS:router.network/hosts//hosts[@i-1].stats.tx_bytes*/
|
||||
static int get_HostsHostWANStats_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 2, "stats", "tx_bytes");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.WANStats.BytesReceived!UBUS:router.network/hosts//hosts[@i-1].stats.rx_bytes*/
|
||||
static int get_HostsHostWANStats_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 2, "stats", "rx_bytes");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.WANStats.PacketsSent!UBUS:router.network/hosts//hosts[@i-1].stats.tx_packets*/
|
||||
static int get_HostsHostWANStats_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 2, "stats", "tx_packets");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.Hosts.Host.{i}.WANStats.PacketsReceived!UBUS:router.network/hosts//hosts[@i-1].stats.rx_packets*/
|
||||
static int get_HostsHostWANStats_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 2, "stats", "rx_packets");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* *** Device.Hosts. *** */
|
||||
DMOBJ tHostsObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Host", &DMREAD, NULL, NULL, NULL, os__browseHostsHostInst, NULL, tHostsHostObj, tHostsHostParams, get_linker_host, BBFDM_BOTH, LIST_KEY{"PhysAddress", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Host", &DMREAD, NULL, NULL, NULL, browseHostsHostInst, NULL, NULL, tHostsHostObj, tHostsHostParams, get_linker_host, BBFDM_BOTH, LIST_KEY{"PhysAddress", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tHostsParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"HostNumberOfEntries", &DMREAD, DMT_UNINT, os__get_Hosts_HostNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{"HostNumberOfEntries", &DMREAD, DMT_UNINT, get_Hosts_HostNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.Hosts.Host.{i}. *** */
|
||||
DMOBJ tHostsHostObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPv4Address", &DMREAD, NULL, NULL, NULL, os__browseHostsHostIPv4AddressInst, NULL, NULL, tHostsHostIPv4AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"IPAddress", NULL}},
|
||||
{"IPv6Address", &DMREAD, NULL, NULL, NULL, os__browseHostsHostIPv6AddressInst, NULL, NULL, tHostsHostIPv6AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"IPAddress", NULL}},
|
||||
{"WANStats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tHostsHostWANStatsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPv4Address", &DMREAD, NULL, NULL, NULL, browseHostsHostIPv4AddressInst, NULL, NULL, NULL, tHostsHostIPv4AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"IPAddress", NULL}},
|
||||
{"IPv6Address", &DMREAD, NULL, NULL, NULL, browseHostsHostIPv6AddressInst, NULL, NULL, NULL, tHostsHostIPv6AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"IPAddress", NULL}},
|
||||
{"WANStats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tHostsHostWANStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tHostsHostParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"PhysAddress", &DMREAD, DMT_STRING, os__get_HostsHost_PhysAddress, NULL, BBFDM_BOTH},
|
||||
{"IPAddress", &DMREAD, DMT_STRING, os__get_HostsHost_IPAddress, NULL, BBFDM_BOTH},
|
||||
{"DHCPClient", &DMREAD, DMT_STRING, os__get_HostsHost_DHCPClient, NULL, BBFDM_BOTH},
|
||||
{"AssociatedDevice", &DMREAD, DMT_STRING, os__get_HostsHost_AssociatedDevice, NULL, BBFDM_BOTH},
|
||||
{"Layer1Interface", &DMREAD, DMT_STRING, os__get_HostsHost_Layer1Interface, NULL, BBFDM_BOTH},
|
||||
{"Layer3Interface", &DMREAD, DMT_STRING, os__get_HostsHost_Layer3Interface, NULL, BBFDM_BOTH},
|
||||
{"InterfaceType", &DMREAD, DMT_STRING, os__get_HostsHost_InterfaceType, NULL, BBFDM_BOTH},
|
||||
{"HostName", &DMREAD, DMT_STRING, os__get_HostsHost_HostName, NULL, BBFDM_BOTH},
|
||||
{"Active", &DMREAD, DMT_BOOL, os__get_HostsHost_Active, NULL, BBFDM_BOTH},
|
||||
{"ActiveLastChange", &DMREAD, DMT_TIME, os__get_HostsHost_ActiveLastChange, NULL, BBFDM_BOTH},
|
||||
{"IPv4AddressNumberOfEntries", &DMREAD, DMT_UNINT, os__get_HostsHost_IPv4AddressNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{"IPv6AddressNumberOfEntries", &DMREAD, DMT_UNINT, os__get_HostsHost_IPv6AddressNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{"PhysAddress", &DMREAD, DMT_STRING, get_HostsHost_PhysAddress, NULL, BBFDM_BOTH},
|
||||
{"IPAddress", &DMREAD, DMT_STRING, get_HostsHost_IPAddress, NULL, BBFDM_BOTH},
|
||||
{"DHCPClient", &DMREAD, DMT_STRING, get_HostsHost_DHCPClient, NULL, BBFDM_BOTH},
|
||||
{"AssociatedDevice", &DMREAD, DMT_STRING, get_HostsHost_AssociatedDevice, NULL, BBFDM_BOTH},
|
||||
{"Layer1Interface", &DMREAD, DMT_STRING, get_HostsHost_Layer1Interface, NULL, BBFDM_BOTH},
|
||||
{"Layer3Interface", &DMREAD, DMT_STRING, get_HostsHost_Layer3Interface, NULL, BBFDM_BOTH},
|
||||
{"InterfaceType", &DMREAD, DMT_STRING, get_HostsHost_InterfaceType, NULL, BBFDM_BOTH},
|
||||
{"HostName", &DMREAD, DMT_STRING, get_HostsHost_HostName, NULL, BBFDM_BOTH},
|
||||
{"Active", &DMREAD, DMT_BOOL, get_HostsHost_Active, NULL, BBFDM_BOTH},
|
||||
{"ActiveLastChange", &DMREAD, DMT_TIME, get_HostsHost_ActiveLastChange, NULL, BBFDM_BOTH},
|
||||
{"IPv4AddressNumberOfEntries", &DMREAD, DMT_UNINT, get_HostsHost_IPv4AddressNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{"IPv6AddressNumberOfEntries", &DMREAD, DMT_UNINT, get_HostsHost_IPv6AddressNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.Hosts.Host.{i}.IPv4Address.{i}. *** */
|
||||
DMLEAF tHostsHostIPv4AddressParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"IPAddress", &DMREAD, DMT_STRING, os__get_HostsHostIPv4Address_IPAddress, NULL, BBFDM_BOTH},
|
||||
{"IPAddress", &DMREAD, DMT_STRING, get_HostsHostIPv4Address_IPAddress, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.Hosts.Host.{i}.IPv6Address.{i}. *** */
|
||||
DMLEAF tHostsHostIPv6AddressParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"IPAddress", &DMREAD, DMT_STRING, os__get_HostsHostIPv6Address_IPAddress, NULL, BBFDM_BOTH},
|
||||
{"IPAddress", &DMREAD, DMT_STRING, get_HostsHostIPv6Address_IPAddress, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.Hosts.Host.{i}.WANStats. *** */
|
||||
DMLEAF tHostsHostWANStatsParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"BytesSent", &DMREAD, DMT_UNINT, os__get_HostsHostWANStats_BytesSent, NULL, BBFDM_BOTH},
|
||||
{"BytesReceived", &DMREAD, DMT_UNINT, os__get_HostsHostWANStats_BytesReceived, NULL, BBFDM_BOTH},
|
||||
{"PacketsSent", &DMREAD, DMT_UNINT, os__get_HostsHostWANStats_PacketsSent, NULL, BBFDM_BOTH},
|
||||
{"PacketsReceived", &DMREAD, DMT_UNINT, os__get_HostsHostWANStats_PacketsReceived, NULL, BBFDM_BOTH},
|
||||
{"BytesSent", &DMREAD, DMT_UNINT, get_HostsHostWANStats_BytesSent, NULL, BBFDM_BOTH},
|
||||
{"BytesReceived", &DMREAD, DMT_UNINT, get_HostsHostWANStats_BytesReceived, NULL, BBFDM_BOTH},
|
||||
{"PacketsSent", &DMREAD, DMT_UNINT, get_HostsHostWANStats_PacketsSent, NULL, BBFDM_BOTH},
|
||||
{"PacketsReceived", &DMREAD, DMT_UNINT, get_HostsHostWANStats_PacketsReceived, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -109,24 +109,6 @@ static int browseIEEE1905ALNetworkTopologyChangeLogInst(struct dmctx *dmctx, DMN
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int browseIEEE1905ALNetworkTopologyNonIEEE1905NeighborInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
json_object *res = NULL, *arrobj = NULL, *res_self = NULL;
|
||||
char *inst = NULL, *max_inst = NULL, *obj = NULL;
|
||||
int id = 0, i = 0;
|
||||
|
||||
dmubus_call("topology", "dump", UBUS_ARGS{}, 0, &res_self);
|
||||
if (res_self)
|
||||
json_object_object_get_ex(res_self, "self", &res);
|
||||
dmjson_foreach_value_in_array(res, arrobj, obj, i, 1, "non1905_neighbors") {
|
||||
|
||||
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_without_section, 1, ++id);
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)obj, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int browseIEEE1905ALNetworkTopologyIEEE1905DeviceInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
json_object *res = NULL, *node = NULL, *arrobj = NULL;
|
||||
|
|
@ -1034,22 +1016,6 @@ static int get_IEEE1905ALNetworkTopology_ChangeLogNumberOfEntries(char *refparam
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int get_IEEE1905ALNetworkTopology_NonIEEE1905NeighborNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res = NULL, *obj = NULL, *obj_nbr = NULL;
|
||||
size_t num_nodes = 0;
|
||||
|
||||
dmubus_call("topology", "dump", UBUS_ARGS{}, 0, &res);
|
||||
DM_ASSERT(res, *value = "0");
|
||||
json_object_object_get_ex(res, "self", &obj);
|
||||
if (obj) {
|
||||
json_object_object_get_ex(obj, "non1905_neighbors", &obj_nbr);
|
||||
num_nodes = (obj_nbr) ? json_object_array_length(obj_nbr) : 0;
|
||||
}
|
||||
dmasprintf(value, "%d", num_nodes);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_IEEE1905ALNetworkTopologyChangeLog_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "timestamp");
|
||||
|
|
@ -1087,12 +1053,6 @@ static int get_IEEE1905ALNetworkTopologyChangeLog_NeighborId(char *refparam, str
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int get_IEEE1905ALNetworkTopologyNonIEEE1905Neighbor(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = (char *)data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_IEEE1905ALNetworkTopologyIEEE1905Device_IEEE1905Id(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "ieee1905_macaddr");
|
||||
|
|
@ -1539,8 +1499,8 @@ static int get_IEEE1905ALNetworkingRegistrar_Registrar60(char *refparam, struct
|
|||
***********************************************************************************************************************************/
|
||||
/* *** Device.IEEE1905. *** */
|
||||
DMOBJ tIEEE1905Obj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"AL", &DMREAD, NULL, NULL, NULL, NULL, NULL, tIEEE1905ALObj, tIEEE1905ALParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"AL", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIEEE1905ALObj, tIEEE1905ALParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1552,12 +1512,12 @@ DMLEAF tIEEE1905Params[] = {
|
|||
|
||||
/* *** Device.IEEE1905.AL. *** */
|
||||
DMOBJ tIEEE1905ALObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Interface", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALInterfaceInst, NULL, tIEEE1905ALInterfaceObj, tIEEE1905ALInterfaceParams, NULL, BBFDM_BOTH, LIST_KEY{"InterfaceId", NULL}},
|
||||
{"ForwardingTable", &DMREAD, NULL, NULL, NULL, NULL, NULL, tIEEE1905ALForwardingTableObj, tIEEE1905ALForwardingTableParams, NULL, BBFDM_BOTH},
|
||||
{"NetworkTopology", &DMREAD, NULL, NULL, NULL, NULL, NULL, tIEEE1905ALNetworkTopologyObj, tIEEE1905ALNetworkTopologyParams, NULL, BBFDM_BOTH},
|
||||
{"Security", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIEEE1905ALSecurityParams, NULL, BBFDM_BOTH},
|
||||
{"NetworkingRegistrar", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIEEE1905ALNetworkingRegistrarParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Interface", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALInterfaceInst, NULL, NULL, tIEEE1905ALInterfaceObj, tIEEE1905ALInterfaceParams, NULL, BBFDM_BOTH, LIST_KEY{"InterfaceId", NULL}},
|
||||
{"ForwardingTable", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIEEE1905ALForwardingTableObj, tIEEE1905ALForwardingTableParams, NULL, BBFDM_BOTH},
|
||||
{"NetworkTopology", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIEEE1905ALNetworkTopologyObj, tIEEE1905ALNetworkTopologyParams, NULL, BBFDM_BOTH},
|
||||
{"Security", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tIEEE1905ALSecurityParams, NULL, BBFDM_BOTH},
|
||||
{"NetworkingRegistrar", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tIEEE1905ALNetworkingRegistrarParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1574,9 +1534,9 @@ DMLEAF tIEEE1905ALParams[] = {
|
|||
|
||||
/* *** Device.IEEE1905.AL.Interface.{i}. *** */
|
||||
DMOBJ tIEEE1905ALInterfaceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
//{"VendorProperties", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALInterfaceVendorPropertiesInst, NULL, NULL, NULL, tIEEE1905ALInterfaceVendorPropertiesParams, NULL, BBFDM_BOTH},
|
||||
{"Link", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALInterfaceLinkInst, NULL, tIEEE1905ALInterfaceLinkObj, tIEEE1905ALInterfaceLinkParams, NULL, BBFDM_BOTH, LIST_KEY{"InterfaceId", "IEEE1905Id", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
//{"VendorProperties", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALInterfaceVendorPropertiesInst, NULL, NULL, NULL, NULL, tIEEE1905ALInterfaceVendorPropertiesParams, NULL, BBFDM_BOTH},
|
||||
{"Link", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALInterfaceLinkInst, NULL, NULL, tIEEE1905ALInterfaceLinkObj, tIEEE1905ALInterfaceLinkParams, NULL, BBFDM_BOTH, LIST_KEY{"InterfaceId", "IEEE1905Id", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1608,8 +1568,8 @@ DMLEAF tIEEE1905ALInterfaceVendorPropertiesParams[] = {
|
|||
|
||||
/* *** Device.IEEE1905.AL.Interface.{i}.Link.{i}. *** */
|
||||
DMOBJ tIEEE1905ALInterfaceLinkObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Metric", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIEEE1905ALInterfaceLinkMetricParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Metric", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tIEEE1905ALInterfaceLinkMetricParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1641,8 +1601,8 @@ DMLEAF tIEEE1905ALInterfaceLinkMetricParams[] = {
|
|||
|
||||
/* *** Device.IEEE1905.AL.ForwardingTable. *** */
|
||||
DMOBJ tIEEE1905ALForwardingTableObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"ForwardingRule", &DMWRITE, addObjIEEE1905ALForwardingTableForwardingRule, delObjIEEE1905ALForwardingTableForwardingRule, NULL, browseIEEE1905ALForwardingTableForwardingRuleInst, NULL, NULL, tIEEE1905ALForwardingTableForwardingRuleParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"ForwardingRule", &DMWRITE, addObjIEEE1905ALForwardingTableForwardingRule, delObjIEEE1905ALForwardingTableForwardingRule, NULL, browseIEEE1905ALForwardingTableForwardingRuleInst, NULL, NULL, NULL, tIEEE1905ALForwardingTableForwardingRuleParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1672,10 +1632,9 @@ DMLEAF tIEEE1905ALForwardingTableForwardingRuleParams[] = {
|
|||
|
||||
/* *** Device.IEEE1905.AL.NetworkTopology. *** */
|
||||
DMOBJ tIEEE1905ALNetworkTopologyObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"ChangeLog", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyChangeLogInst, NULL, NULL, tIEEE1905ALNetworkTopologyChangeLogParams, NULL, BBFDM_BOTH},
|
||||
{"IEEE1905Device", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceInst, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceObj, tIEEE1905ALNetworkTopologyIEEE1905DeviceParams, NULL, BBFDM_BOTH, LIST_KEY{"IEEE1905Id", NULL}},
|
||||
{CUSTOM_PREFIX"NonIEEE1905Neighbor", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyNonIEEE1905NeighborInst, NULL, NULL, tIEEE1905ALNetworkTopologyNonIEEE1905NeighborParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"ChangeLog", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyChangeLogInst, NULL, NULL, NULL, tIEEE1905ALNetworkTopologyChangeLogParams, NULL, BBFDM_BOTH},
|
||||
{"IEEE1905Device", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceInst, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceObj, tIEEE1905ALNetworkTopologyIEEE1905DeviceParams, NULL, BBFDM_BOTH, LIST_KEY{"IEEE1905Id", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1687,7 +1646,6 @@ DMLEAF tIEEE1905ALNetworkTopologyParams[] = {
|
|||
{"LastChange", &DMREAD, DMT_STRING, get_IEEE1905ALNetworkTopology_LastChange, NULL, BBFDM_BOTH},
|
||||
{"IEEE1905DeviceNumberOfEntries", &DMREAD, DMT_UNINT, get_IEEE1905ALNetworkTopology_IEEE1905DeviceNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{"ChangeLogNumberOfEntries", &DMREAD, DMT_UNINT, get_IEEE1905ALNetworkTopology_ChangeLogNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"NonIEEE1905NeighborNumberOfEntries", &DMREAD, DMT_UNINT, get_IEEE1905ALNetworkTopology_NonIEEE1905NeighborNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1703,24 +1661,17 @@ DMLEAF tIEEE1905ALNetworkTopologyChangeLogParams[] = {
|
|||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.IEEE1905.AL.NetworkTopology.{CUSTOM_PREFIX}NonIEEE1905Neighbor.{i} *** */
|
||||
DMLEAF tIEEE1905ALNetworkTopologyNonIEEE1905NeighborParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"NonIEEE1905NeighborId", &DMREAD, DMT_STRING, get_IEEE1905ALNetworkTopologyNonIEEE1905Neighbor, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.IEEE1905.AL.NetworkTopology.IEEE1905Device.{i}. *** */
|
||||
DMOBJ tIEEE1905ALNetworkTopologyIEEE1905DeviceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPv4Address", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceIPv4AddressInst, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceIPv4AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"MACAddress", "IPv4Address", NULL}},
|
||||
{"IPv6Address", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceIPv6AddressInst, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceIPv6AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"MACAddress", "IPv6Address", NULL}},
|
||||
//{"VendorProperties", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceVendorPropertiesInst, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceVendorPropertiesParams, NULL, BBFDM_BOTH},
|
||||
{"Interface", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceInterfaceInst, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceInterfaceParams, get_linker_topology_interface, BBFDM_BOTH, LIST_KEY{"InterfaceId", NULL}},
|
||||
{"NonIEEE1905Neighbor", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceNonIEEE1905NeighborInst, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceNonIEEE1905NeighborParams, NULL, BBFDM_BOTH, LIST_KEY{"LocalInterface", "NeighborInterfaceId", NULL}},
|
||||
{"L2Neighbor", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceL2NeighborInst, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceL2NeighborParams, NULL, BBFDM_BOTH, (const char*[]){"LocalInterface", "NeighborInterfaceId", NULL}},
|
||||
{"IEEE1905Neighbor", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborInst, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborObj, tIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborParams, NULL, BBFDM_BOTH, LIST_KEY{"LocalInterface", "NeighborDeviceId", NULL}},
|
||||
{"BridgingTuple", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceBridgingTupleInst, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceBridgingTupleParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPv4Address", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceIPv4AddressInst, NULL, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceIPv4AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"MACAddress", "IPv4Address", NULL}},
|
||||
{"IPv6Address", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceIPv6AddressInst, NULL, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceIPv6AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"MACAddress", "IPv6Address", NULL}},
|
||||
//{"VendorProperties", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceVendorPropertiesInst, NULL, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceVendorPropertiesParams, NULL, BBFDM_BOTH},
|
||||
{"Interface", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceInterfaceInst, NULL, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceInterfaceParams, get_linker_topology_interface, BBFDM_BOTH, LIST_KEY{"InterfaceId", NULL}},
|
||||
{"NonIEEE1905Neighbor", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceNonIEEE1905NeighborInst, NULL, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceNonIEEE1905NeighborParams, NULL, BBFDM_BOTH, LIST_KEY{"LocalInterface", "NeighborInterfaceId", NULL}},
|
||||
{"L2Neighbor", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceL2NeighborInst, NULL, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceL2NeighborParams, NULL, BBFDM_BOTH, (const char*[]){"LocalInterface", "NeighborInterfaceId", NULL}},
|
||||
{"IEEE1905Neighbor", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborInst, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborObj, tIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborParams, NULL, BBFDM_BOTH, LIST_KEY{"LocalInterface", "NeighborDeviceId", NULL}},
|
||||
{"BridgingTuple", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceBridgingTupleInst, NULL, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceBridgingTupleParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1810,8 +1761,8 @@ DMLEAF tIEEE1905ALNetworkTopologyIEEE1905DeviceL2NeighborParams[] = {
|
|||
|
||||
/* *** Device.IEEE1905.AL.NetworkTopology.IEEE1905Device.{i}.IEEE1905Neighbor.{i}. *** */
|
||||
DMOBJ tIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Metric", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborMetricInst, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborMetricParams, NULL, BBFDM_BOTH, LIST_KEY{"NeighborMACAddress", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Metric", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborMetricInst, NULL, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceIEEE1905NeighborMetricParams, NULL, BBFDM_BOTH, LIST_KEY{"NeighborMACAddress", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ extern DMLEAF tIEEE1905ALForwardingTableForwardingRuleParams[];
|
|||
extern DMOBJ tIEEE1905ALNetworkTopologyObj[];
|
||||
extern DMLEAF tIEEE1905ALNetworkTopologyParams[];
|
||||
extern DMLEAF tIEEE1905ALNetworkTopologyChangeLogParams[];
|
||||
extern DMLEAF tIEEE1905ALNetworkTopologyNonIEEE1905NeighborParams[];
|
||||
extern DMOBJ tIEEE1905ALNetworkTopologyIEEE1905DeviceObj[];
|
||||
extern DMLEAF tIEEE1905ALNetworkTopologyIEEE1905DeviceParams[];
|
||||
extern DMLEAF tIEEE1905ALNetworkTopologyIEEE1905DeviceIPv4AddressParams[];
|
||||
|
|
|
|||
|
|
@ -66,21 +66,6 @@ static int get_ip_iface_sysfs(const struct uci_section *data, const char *name,
|
|||
return get_net_iface_sysfs(section_name((struct uci_section *)data), name, value);
|
||||
}
|
||||
|
||||
static void create_firewall_zone_config(char *iface)
|
||||
{
|
||||
struct uci_section *s;
|
||||
char name[16];
|
||||
|
||||
snprintf(name, sizeof(name), "fwl_%s", iface);
|
||||
|
||||
dmuci_add_section("firewall", "zone", &s);
|
||||
dmuci_set_value_by_section(s, "name", name);
|
||||
dmuci_set_value_by_section(s, "input", "DROP");
|
||||
dmuci_set_value_by_section(s, "forward", "DROP");
|
||||
dmuci_set_value_by_section(s, "output", "ACCEPT");
|
||||
dmuci_set_value_by_section(s, "network", iface);
|
||||
}
|
||||
|
||||
static int parse_proc_intf6_line(const char *line, const char *device, char *ipstr, size_t str_len)
|
||||
{
|
||||
char ip6buf[INET6_ADDRSTRLEN] = {0}, dev[32] = {0};
|
||||
|
|
@ -1866,50 +1851,6 @@ static int get_IPInterfaceIPv4Address_AddressingType(char *refparam, struct dmct
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int get_IPInterfaceIPv4Address_X_IOPSYS_EU_FirewallEnabled(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct uci_section *s = NULL;
|
||||
char *input = NULL, *forward = NULL;
|
||||
|
||||
*value = "0";
|
||||
uci_foreach_option_cont("firewall", "zone", "network", section_name(((struct intf_ip_args *)data)->interface_sec), s) {
|
||||
dmuci_get_value_by_section_string(s, "input", &input);
|
||||
dmuci_get_value_by_section_string(s, "forward", &forward);
|
||||
if (input && strcmp(input, "ACCEPT") != 0 && forward && strcmp(forward, "ACCEPT") != 0) {
|
||||
*value = "1";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_IPInterfaceIPv4Address_X_IOPSYS_EU_FirewallEnabled(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct uci_section *s = NULL;
|
||||
int cnt = 0;
|
||||
bool b;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_boolean(value))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
string_to_bool(value, &b);
|
||||
value = b ? "DROP" : "ACCEPT";
|
||||
uci_foreach_option_cont("firewall", "zone", "network", section_name(((struct intf_ip_args *)data)->interface_sec), s) {
|
||||
dmuci_set_value_by_section(s, "input", value);
|
||||
dmuci_set_value_by_section(s, "forward", value);
|
||||
cnt++;
|
||||
}
|
||||
if (cnt == 0 && b)
|
||||
create_firewall_zone_config(section_name(((struct intf_ip_args *)data)->interface_sec));
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.IP.Interface.{i}.IPv6Address.{i}.Enable!UCI:network/interface,@i-1/ipv6*/
|
||||
static int get_IPInterfaceIPv6Address_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
|
|
@ -2409,10 +2350,10 @@ static int get_IPInterfaceStats_MulticastPacketsReceived(char *refparam, struct
|
|||
***********************************************************************************************************************************/
|
||||
/* *** Device.IP. *** */
|
||||
DMOBJ tIPObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Interface", &DMWRITE, addObjIPInterface, delObjIPInterface, NULL, browseIPInterfaceInst, NULL, tIPInterfaceObj, tIPInterfaceParams, get_linker_ip_interface, BBFDM_BOTH, LIST_KEY{"Alias", "Name", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Interface", &DMWRITE, addObjIPInterface, delObjIPInterface, NULL, browseIPInterfaceInst, NULL, NULL, tIPInterfaceObj, tIPInterfaceParams, get_linker_ip_interface, BBFDM_BOTH, LIST_KEY{"Alias", "Name", NULL}},
|
||||
#ifdef BBF_TR143
|
||||
{"Diagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsObj, tIPDiagnosticsParams, NULL, BBFDM_BOTH},
|
||||
{"Diagnostics", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsObj, tIPDiagnosticsParams, NULL, BBFDM_BOTH},
|
||||
#endif
|
||||
{0}
|
||||
};
|
||||
|
|
@ -2432,11 +2373,11 @@ DMLEAF tIPParams[] = {
|
|||
|
||||
/* *** Device.IP.Interface.{i}. *** */
|
||||
DMOBJ tIPInterfaceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPv4Address", &DMWRITE, addObjIPInterfaceIPv4Address, delObjIPInterfaceIPv4Address, NULL, browseIPInterfaceIPv4AddressInst, NULL, NULL, tIPInterfaceIPv4AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "IPAddress", "SubnetMask", NULL}},
|
||||
{"IPv6Address", &DMWRITE, addObjIPInterfaceIPv6Address, delObjIPInterfaceIPv6Address, NULL, browseIPInterfaceIPv6AddressInst, NULL, NULL, tIPInterfaceIPv6AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "IPAddress", NULL}},
|
||||
{"IPv6Prefix", &DMWRITE, addObjIPInterfaceIPv6Prefix, delObjIPInterfaceIPv6Prefix, NULL, browseIPInterfaceIPv6PrefixInst, NULL, NULL, tIPInterfaceIPv6PrefixParams, get_linker_ipv6_prefix, BBFDM_BOTH, LIST_KEY{"Alias", "Prefix", NULL}},
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIPInterfaceStatsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPv4Address", &DMWRITE, addObjIPInterfaceIPv4Address, delObjIPInterfaceIPv4Address, NULL, browseIPInterfaceIPv4AddressInst, NULL, NULL, NULL, tIPInterfaceIPv4AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "IPAddress", "SubnetMask", NULL}},
|
||||
{"IPv6Address", &DMWRITE, addObjIPInterfaceIPv6Address, delObjIPInterfaceIPv6Address, NULL, browseIPInterfaceIPv6AddressInst, NULL, NULL, NULL, tIPInterfaceIPv6AddressParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "IPAddress", NULL}},
|
||||
{"IPv6Prefix", &DMWRITE, addObjIPInterfaceIPv6Prefix, delObjIPInterfaceIPv6Prefix, NULL, browseIPInterfaceIPv6PrefixInst, NULL, NULL, NULL, tIPInterfaceIPv6PrefixParams, get_linker_ipv6_prefix, BBFDM_BOTH, LIST_KEY{"Alias", "Prefix", NULL}},
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tIPInterfaceStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -2473,7 +2414,6 @@ DMLEAF tIPInterfaceIPv4AddressParams[] = {
|
|||
{"IPAddress", &DMWRITE, DMT_STRING, get_IPInterfaceIPv4Address_IPAddress, set_IPInterfaceIPv4Address_IPAddress, BBFDM_BOTH},
|
||||
{"SubnetMask", &DMWRITE, DMT_STRING, get_IPInterfaceIPv4Address_SubnetMask, set_IPInterfaceIPv4Address_SubnetMask, BBFDM_BOTH},
|
||||
{"AddressingType", &DMREAD, DMT_STRING, get_IPInterfaceIPv4Address_AddressingType, NULL, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"FirewallEnabled", &DMWRITE, DMT_BOOL, get_IPInterfaceIPv4Address_X_IOPSYS_EU_FirewallEnabled, set_IPInterfaceIPv4Address_X_IOPSYS_EU_FirewallEnabled, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -434,7 +434,6 @@ static int set_nat_port_mapping_all_interface(char *refparam, struct dmctx *ctx,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifndef GENERIC_OPENWRT
|
||||
/*#Device.NAT.PortMapping.{i}.LeaseDuration!UCI:firewall/redirect,@i-1/expiry*/
|
||||
static int get_nat_port_mapping_lease_duration(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
|
|
@ -468,7 +467,6 @@ static int set_nat_port_mapping_lease_duration(char *refparam, struct dmctx *ctx
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*#Device.NAT.PortMapping.{i}.RemoteHost!UCI:firewall/redirect,@i-1/src_dip*/
|
||||
static int get_nat_port_mapping_remote_host(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
|
|
@ -696,9 +694,9 @@ static int browsePortMappingInst(struct dmctx *dmctx, DMNODE *parent_node, void
|
|||
|
||||
/* *** Device.NAT. *** */
|
||||
DMOBJ tNATObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"InterfaceSetting", &DMWRITE, add_NAT_InterfaceSetting, delete_NAT_InterfaceSetting, NULL, browseInterfaceSettingInst, NULL, NULL, tNATInterfaceSettingParams, NULL, BBFDM_BOTH, LIST_KEY{"Interface", "Alias", NULL}},
|
||||
{"PortMapping", &DMWRITE, add_NAT_PortMapping, delete_NAT_PortMapping, NULL, browsePortMappingInst, NULL, NULL, tNATPortMappingParams, NULL, BBFDM_BOTH, LIST_KEY{"RemoteHost", "ExternalPort", "Protocol", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"InterfaceSetting", &DMWRITE, add_NAT_InterfaceSetting, delete_NAT_InterfaceSetting, NULL, browseInterfaceSettingInst, NULL, NULL, NULL, tNATInterfaceSettingParams, NULL, BBFDM_BOTH, LIST_KEY{"Interface", "Alias", NULL}},
|
||||
{"PortMapping", &DMWRITE, add_NAT_PortMapping, delete_NAT_PortMapping, NULL, browsePortMappingInst, NULL, NULL, NULL, tNATPortMappingParams, NULL, BBFDM_BOTH, LIST_KEY{"RemoteHost", "ExternalPort", "Protocol", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -727,9 +725,7 @@ DMLEAF tNATPortMappingParams[] = {
|
|||
{"Alias", &DMWRITE, DMT_STRING, get_nat_port_mapping_alias, set_nat_port_mapping_alias, BBFDM_BOTH},
|
||||
{"Interface", &DMWRITE, DMT_STRING, get_nat_port_mapping_interface, set_nat_port_mapping_interface, BBFDM_BOTH},
|
||||
{"AllInterfaces", &DMWRITE, DMT_BOOL, get_nat_port_mapping_all_interface, set_nat_port_mapping_all_interface, BBFDM_BOTH},
|
||||
#ifndef GENERIC_OPENWRT
|
||||
{"LeaseDuration", &DMWRITE, DMT_UNINT, get_nat_port_mapping_lease_duration, set_nat_port_mapping_lease_duration, BBFDM_BOTH},
|
||||
#endif
|
||||
{"RemoteHost", &DMWRITE, DMT_STRING, get_nat_port_mapping_remote_host, set_nat_port_mapping_remote_host, BBFDM_BOTH},
|
||||
{"ExternalPort", &DMWRITE, DMT_UNINT, get_nat_port_mapping_external_port, set_nat_port_mapping_external_port, BBFDM_BOTH},
|
||||
{"ExternalPortEndRange", &DMWRITE, DMT_UNINT, get_nat_port_mapping_external_port_end_range, set_nat_port_mapping_external_port_end_range, BBFDM_BOTH},
|
||||
|
|
|
|||
|
|
@ -1,397 +0,0 @@
|
|||
#ifndef __BBF_TR181_OPERATING_SYTEM_H
|
||||
#define __BBF_TR181_OPERATING_SYTEM_H
|
||||
|
||||
#include <libbbf_api/dmbbf.h>
|
||||
|
||||
/* IOPSYS-WRT and OpenWrt
|
||||
*/
|
||||
char * os__get_deviceid_manufacturer();
|
||||
char * os__get_deviceid_productclass();
|
||||
char * os__get_deviceid_serialnumber();
|
||||
char * os__get_softwareversion();
|
||||
char * os__get_deviceid_manufactureroui();
|
||||
|
||||
int os__get_device_hardwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_device_devicecategory(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_device_additionalhardwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_device_additionalsoftwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_device_modelname(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_device_description(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_base_mac_addr(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
|
||||
int os__get_memory_status_total(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_memory_status_free(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
|
||||
int os__get_process_cpu_usage(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_process_number_of_entries(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_process_pid(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_process_command(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_process_size(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_process_priority(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_process_cpu_time(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_process_state(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__browseProcessEntriesInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
|
||||
int os__browseHostsHostInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseHostsHostIPv4AddressInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseHostsHostIPv6AddressInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int get_linker_host(char *refparam, struct dmctx *dmctx, void *data, char *instance, char **linker);
|
||||
int os__get_Hosts_HostNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHost_PhysAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHost_IPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHost_DHCPClient(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHost_AssociatedDevice(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHost_Layer1Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHost_Layer3Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHost_InterfaceType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHost_HostName(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHost_Active(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHost_ActiveLastChange(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHost_IPv4AddressNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHost_IPv6AddressNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHostIPv4Address_IPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHostIPv6Address_IPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHostWANStats_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHostWANStats_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHostWANStats_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_HostsHostWANStats_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
|
||||
#include "wifi.h"
|
||||
|
||||
int os__get_wlan_bssid(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiRadioStats_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiRadioStats_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiRadioStats_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiRadioStats_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiRadioStats_ErrorsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiRadioStats_ErrorsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiRadioStats_DiscardPacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiRadioStats_DiscardPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiRadioStats_FCSErrorCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_ErrorsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_ErrorsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_DiscardPacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_DiscardPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_UnicastPacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_UnicastPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_MulticastPacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_MulticastPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_BroadcastPacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_BroadcastPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_RetransCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_FailedRetransCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_RetryCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_MultipleRetryCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_ACKFailureCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_AggregatedPacketCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiSSIDStats_UnknownProtoPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiAccessPointAssociatedDevice_Active(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiAccessPointAssociatedDevice_Noise(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiAccessPointAssociatedDevice_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiAccessPointAssociatedDevice_LastDataDownlinkRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiAccessPointAssociatedDevice_LastDataUplinkRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiAccessPointAssociatedDevice_SignalStrength(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiAccessPointAssociatedDevice_AssociationTime(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_access_point_associative_device_statistics_tx_bytes(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_access_point_associative_device_statistics_rx_bytes(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_access_point_associative_device_statistics_tx_packets(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_access_point_associative_device_statistics_rx_packets(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_access_point_associative_device_statistics_tx_errors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_access_point_associative_device_statistics_retrans_count(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_radio_max_bit_rate (char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_radio_frequency(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_radio_supported_frequency_bands(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_radio_channel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_neighboring_wifi_diagnostics_diagnostics_state(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_neighboring_wifi_diagnostics_result_ssid(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_neighboring_wifi_diagnostics_result_bssid(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_neighboring_wifi_diagnostics_result_number_entries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_neighboring_wifi_diagnostics_result_noise(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_neighboring_wifi_diagnostics_result_operating_frequency_band(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_neighboring_wifi_diagnostics_result_signal_strength(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_neighboring_wifi_diagnostics_result_channel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_radio_possible_channels(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__browseWifiNeighboringWiFiDiagnosticResultInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__get_WiFiRadio_CurrentOperatingChannelBandwidth(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiRadio_SupportedOperatingChannelBandwidths(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_radio_supported_standard(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_access_point_total_associations(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__browse_wifi_associated_device(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
char * os__get_radio_frequency_nocache(const struct wifi_radio_args *args);
|
||||
char * os__get_radio_channel_nocache(const struct wifi_radio_args *args);
|
||||
void os__wifi_start_scan(const char *radio);
|
||||
int os_get_wifi_access_point_status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_radio_operating_standard(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_supported_modes(const char *ubus_method, const char *ifname, char **value);
|
||||
char * os__get_default_wpa_key();
|
||||
int os__get_WiFiDataElementsNetwork_ID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__set_WiFiDataElementsNetwork_ID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os__get_WiFiDataElementsNetwork_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetwork_ControllerID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__set_WiFiDataElementsNetwork_ControllerID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os__get_WiFiDataElementsNetwork_DeviceNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDevice_ID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDevice_MultiAPCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDevice_CollectionInterval(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDevice_RadioNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_ID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_Enabled(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_Noise(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_Utilization(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_Transmit(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_ReceiveSelf(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_ReceiveOther(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_CurrentOperatingClassProfileNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_UnassociatedSTANumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_BSSNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_ScanResultNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBackhaulSta_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilities_HTCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilities_VHTCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilities_HECapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilities_CapableOperatingClassProfileNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilitiesCapableOperatingClassProfile_Class(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilitiesCapableOperatingClassProfile_MaxTxPower(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilitiesCapableOperatingClassProfile_NonOperable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilitiesCapableOperatingClassProfile_NumberOfNonOperChan(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCurrentOperatingClassProfile_Class(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCurrentOperatingClassProfile_Channel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCurrentOperatingClassProfile_TxPower(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCurrentOperatingClassProfile_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_BSSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_SSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_Enabled(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_LastChange(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_UnicastBytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_UnicastBytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_MulticastBytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_MulticastBytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_BroadcastBytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_BroadcastBytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_EstServiceParametersBE(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_EstServiceParametersBK(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_EstServiceParametersVI(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_EstServiceParametersVO(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_STANumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_HTCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_VHTCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_HECapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_LastDataDownlinkRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_LastDataUplinkRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_UtilizationReceive(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_UtilizationTransmit(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_EstMACDataRateDownlink(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_EstMACDataRateUplink(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_SignalStrength(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_LastConnectTime(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_ErrorsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_ErrorsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_RetransCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_MeasurementReport(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_NumberOfMeasureReports(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_IPV4Address(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_IPV6Address(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_Hostname(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResult_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResult_OpClassScanNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScan_OperatingClass(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScan_ChannelScanNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScan_Channel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScan_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScan_Utilization(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScan_Noise(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScan_NeighborBSSNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSS_BSSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSS_SSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSS_SignalStrength(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSS_ChannelBandwidth(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSS_ChannelUtilization(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSS_StationCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioUnassociatedSTA_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioUnassociatedSTA_SignalStrength(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsAssociationEvent_AssociationEventDataNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_BSSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_StatusCode(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_HTCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_VHTCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_HECapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsDisassociationEvent_DisassociationEventDataNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_BSSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_ReasonCode(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_ErrorsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_ErrorsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_RetransCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__browseWiFiDataElementsNetworkDeviceInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioCurrentOperatingClassProfileInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioBSSInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioScanResultInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioUnassociatedSTAInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioCapabilitiesCapableOperatingClassProfileInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioBSSSTAInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioScanResultOpClassScanInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSSInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseWiFiDataElementsAssociationEventAssociationEventDataInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os__browseWiFiDataElementsDisassociationEventDisassociationEventDataInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
|
||||
int os_browseQoSClassificationInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os_browseQoSQueueStatsInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os_addObjQoSClassification(char *refparam, struct dmctx *ctx, void *data, char **instance);
|
||||
int os_delObjQoSClassification(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action);
|
||||
int os_addObjQoSQueueStats(char *refparam, struct dmctx *ctx, void *data, char **instance);
|
||||
int os_delObjQoSQueueStats(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action);
|
||||
int os_get_QoS_ClassificationNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_QoS_QueueStatsNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_QoSClassification_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_DestIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_DestIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_DestMask(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_DestMask(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_SourceIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_SourceIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_SourceMask(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_SourceMask(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_Protocol(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_Protocol(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_DestPort(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_DestPort(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_DestPortRangeMax(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_DestPortRangeMax(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_SourcePort(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_SourcePort(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_SourcePortRangeMax(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_SourcePortRangeMax(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_SourceMACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_SourceMACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_DestMACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_DestMACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_Ethertype(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_Ethertype(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_IPLengthMin(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_IPLengthMin(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_IPLengthMax(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_IPLengthMax(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_DSCPCheck(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_DSCPCheck(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_DSCPMark(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_DSCPMark(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_EthernetPriorityCheck(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_EthernetPriorityCheck(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_VLANIDCheck(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_VLANIDCheck(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_TrafficClass(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_TrafficClass(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_SourceVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_SourceVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_DestVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_DestVendorClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_SourceClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_SourceClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_DestClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_DestClientID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_SourceUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_SourceUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSClassification_DestUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_DestUserClassID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSQueueStats_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSQueueStats_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSQueueStats_Status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_QoSQueueStats_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSQueueStats_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSQueueStats_Queue(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSQueueStats_Queue(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSQueueStats_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSQueueStats_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSQueueStats_OutputPackets(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_QoSQueueStats_OutputBytes(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_QoSQueueStats_DroppedPackets(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_QoSQueueStats_DroppedBytes(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_browseQoSQueueInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os_browseQoSShaperInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
int os_addObjQoSQueue(char *refparam, struct dmctx *ctx, void *data, char **instance);
|
||||
int os_delObjQoSQueue(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action);
|
||||
int os_addObjQoSShaper(char *refparam, struct dmctx *ctx, void *data, char **instance);
|
||||
int os_delObjQoSShaper(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action);
|
||||
int os_get_QoS_PolicerNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_QoS_QueueNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_QoS_ShaperNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_QoSQueue_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSQueue_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSQueue_Status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_QoSQueue_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSQueue_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSQueue_TrafficClasses(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSQueue_TrafficClasses(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSQueue_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSQueue_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSQueue_Weight(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSQueue_Weight(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSQueue_Precedence(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSQueue_Precedence(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSQueue_SchedulerAlgorithm(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSQueue_SchedulerAlgorithm(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSQueue_ShapingRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSQueue_ShapingRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSQueue_ShapingBurstSize(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSQueue_ShapingBurstSize(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSShaper_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSShaper_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSShaper_Status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_QoSShaper_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSShaper_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSShaper_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSShaper_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSShaper_ShapingRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSShaper_ShapingRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSShaper_ShapingBurstSize(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSShaper_ShapingBurstSize(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_linker_qos_queue(char *refparam, struct dmctx *dmctx, void *data, char *instance, char **linker);
|
||||
int os_get_QoSClassification_Policer(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSClassification_Policer(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSPolicer_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSPolicer_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSPolicer_Status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_get_QoSPolicer_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSPolicer_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSPolicer_CommittedRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSPolicer_CommittedRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSPolicer_CommittedBurstSize(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSPolicer_CommittedBurstSize(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSPolicer_ExcessBurstSize(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSPolicer_ExcessBurstSize(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSPolicer_PeakRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSPolicer_PeakRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSPolicer_PeakBurstSize(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSPolicer_PeakBurstSize(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSPolicer_MeterType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_set_QoSPolicer_MeterType(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
|
||||
int os_get_QoSPolicer_PossibleMeterTypes(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os_addObjQoSPolicer(char *refparam, struct dmctx *ctx, void *data, char **instance);
|
||||
int os_delObjQoSPolicer(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action);
|
||||
int os_browseQoSPolicerInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
#endif
|
||||
|
|
@ -528,8 +528,8 @@ static int browseInterfaceInst(struct dmctx *dmctx, DMNODE *parent_node, void *p
|
|||
|
||||
/* *** Device.PPP. *** */
|
||||
DMOBJ tPPPObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Interface", &DMWRITE, add_ppp_interface, delete_ppp_interface, NULL, browseInterfaceInst, NULL, tPPPInterfaceObj, tPPPInterfaceParams, get_linker_ppp_interface, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Interface", &DMWRITE, add_ppp_interface, delete_ppp_interface, NULL, browseInterfaceInst, NULL, NULL, tPPPInterfaceObj, tPPPInterfaceParams, get_linker_ppp_interface, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -541,11 +541,11 @@ DMLEAF tPPPParams[] = {
|
|||
|
||||
/* *** Device.PPP.Interface.{i}. *** */
|
||||
DMOBJ tPPPInterfaceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"PPPoE", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tPPPInterfacePPPoEParams, NULL, BBFDM_BOTH},
|
||||
{"IPCP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tPPPInterfaceIPCPParams, NULL, BBFDM_BOTH},
|
||||
{"IPv6CP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tPPPInterfaceIPv6CPParams, NULL, BBFDM_BOTH},
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tPPPInterfaceStatsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"PPPoE", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tPPPInterfacePPPoEParams, NULL, BBFDM_BOTH},
|
||||
{"IPCP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tPPPInterfaceIPCPParams, NULL, BBFDM_BOTH},
|
||||
{"IPv6CP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tPPPInterfaceIPv6CPParams, NULL, BBFDM_BOTH},
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tPPPInterfaceStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -328,15 +328,15 @@ static int browsePtmLinkInst(struct dmctx *dmctx, DMNODE *parent_node, void *pre
|
|||
|
||||
/* *** Device.PTM. *** */
|
||||
DMOBJ tPTMObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Link", &DMWRITE, add_ptm_link, delete_ptm_link, NULL, browsePtmLinkInst, NULL, tPTMLinkObj, tPTMLinkParams, get_ptm_linker, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Link", &DMWRITE, add_ptm_link, delete_ptm_link, NULL, browsePtmLinkInst, NULL, NULL, tPTMLinkObj, tPTMLinkParams, get_ptm_linker, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.PTM.Link.{i}. *** */
|
||||
DMOBJ tPTMLinkObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tPTMLinkStatsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tPTMLinkStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
2113
dmtree/tr181/qos.c
2113
dmtree/tr181/qos.c
File diff suppressed because it is too large
Load diff
|
|
@ -1346,9 +1346,9 @@ static int browseRoutingRouteInformationInterfaceSettingInst(struct dmctx *dmctx
|
|||
|
||||
/* *** Device.Routing. *** */
|
||||
DMOBJ tRoutingObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Router", &DMREAD, NULL, NULL, NULL, browseRouterInst, NULL, tRoutingRouterObj, tRoutingRouterParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"RouteInformation", &DMREAD, NULL, NULL, NULL, NULL, NULL, tRoutingRouteInformationObj, tRoutingRouteInformationParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Router", &DMREAD, NULL, NULL, NULL, browseRouterInst, NULL, NULL, tRoutingRouterObj, tRoutingRouterParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"RouteInformation", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tRoutingRouteInformationObj, tRoutingRouteInformationParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1360,9 +1360,9 @@ DMLEAF tRoutingParams[] = {
|
|||
|
||||
/* *** Device.Routing.Router.{i}. *** */
|
||||
DMOBJ tRoutingRouterObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPv4Forwarding", &DMWRITE, add_ipv4forwarding, delete_ipv4forwarding, NULL, browseIPv4ForwardingInst, NULL, NULL, tRoutingRouterIPv4ForwardingParams, NULL, BBFDM_BOTH, LIST_KEY{"DestIPAddress", "DestSubnetMask", "ForwardingPolicy", "GatewayIPAddress", "Interface", "ForwardingMetric", "Alias", NULL}},
|
||||
{"IPv6Forwarding", &DMWRITE, add_ipv6Forwarding, delete_ipv6Forwarding, NULL, browseIPv6ForwardingInst, NULL, NULL, tRoutingRouterIPv6ForwardingParams, NULL, BBFDM_BOTH, LIST_KEY{"DestIPPrefix", "ForwardingPolicy", "NextHop", "Interface", "ForwardingMetric", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"IPv4Forwarding", &DMWRITE, add_ipv4forwarding, delete_ipv4forwarding, NULL, browseIPv4ForwardingInst, NULL, NULL, NULL, tRoutingRouterIPv4ForwardingParams, NULL, BBFDM_BOTH, LIST_KEY{"DestIPAddress", "DestSubnetMask", "ForwardingPolicy", "GatewayIPAddress", "Interface", "ForwardingMetric", "Alias", NULL}},
|
||||
{"IPv6Forwarding", &DMWRITE, add_ipv6Forwarding, delete_ipv6Forwarding, NULL, browseIPv6ForwardingInst, NULL, NULL, NULL, tRoutingRouterIPv6ForwardingParams, NULL, BBFDM_BOTH, LIST_KEY{"DestIPPrefix", "ForwardingPolicy", "NextHop", "Interface", "ForwardingMetric", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1411,8 +1411,8 @@ DMLEAF tRoutingRouterIPv6ForwardingParams[] = {
|
|||
|
||||
/* *** Device.Routing.RouteInformation. *** */
|
||||
DMOBJ tRoutingRouteInformationObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"InterfaceSetting", &DMREAD, NULL, NULL, NULL, browseRoutingRouteInformationInterfaceSettingInst, NULL, NULL, tRoutingRouteInformationInterfaceSettingParams, NULL, BBFDM_BOTH, LIST_KEY{"Interface", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"InterfaceSetting", &DMREAD, NULL, NULL, NULL, browseRoutingRouteInformationInterfaceSettingInst, NULL, NULL, NULL, tRoutingRouteInformationInterfaceSettingParams, NULL, BBFDM_BOTH, LIST_KEY{"Interface", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -429,8 +429,8 @@ static int get_SecurityCertificate_SignatureAlgorithm(char *refparam, struct dmc
|
|||
|
||||
/* *** Device.Security. *** */
|
||||
DMOBJ tSecurityObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Certificate", &DMREAD, NULL, NULL, NULL, browseSecurityCertificateInst, NULL, NULL, tSecurityCertificateParams, NULL, BBFDM_BOTH, LIST_KEY{"SerialNumber", "Issuer", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Certificate", &DMREAD, NULL, NULL, NULL, browseSecurityCertificateInst, NULL, NULL, NULL, tSecurityCertificateParams, NULL, BBFDM_BOTH, LIST_KEY{"SerialNumber", "Issuer", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -670,10 +670,10 @@ static int get_SoftwareModulesExecutionUnit_ExecutionEnvRef(char *refparam, stru
|
|||
|
||||
/* *** Device.SoftwareModules. *** */
|
||||
DMOBJ tSoftwareModulesObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"ExecEnv", &DMREAD, NULL, NULL, NULL, browseSoftwareModulesExecEnvInst, NULL, NULL, tSoftwareModulesExecEnvParams, get_exe_cenv_linker, BBFDM_BOTH, LIST_KEY{"Alias", "Name", NULL}},
|
||||
{"DeploymentUnit", &DMREAD, NULL, NULL, NULL, browseSoftwareModulesDeploymentUnitInst, NULL, NULL, tSoftwareModulesDeploymentUnitParams, get_du_linker, BBFDM_BOTH, LIST_KEY{"UUID", "Version", "ExecutionEnvRef", "Alias", NULL}},
|
||||
{"ExecutionUnit", &DMREAD, NULL, NULL, NULL, browseSoftwareModulesExecutionUnitInst, NULL, tSoftwareModulesExecutionUnitObj, tSoftwareModulesExecutionUnitParams, NULL, BBFDM_BOTH, LIST_KEY{"EUID", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"ExecEnv", &DMREAD, NULL, NULL, NULL, browseSoftwareModulesExecEnvInst, NULL, NULL, NULL, tSoftwareModulesExecEnvParams, get_exe_cenv_linker, BBFDM_BOTH, LIST_KEY{"Alias", "Name", NULL}},
|
||||
{"DeploymentUnit", &DMREAD, NULL, NULL, NULL, browseSoftwareModulesDeploymentUnitInst, NULL, NULL, NULL, tSoftwareModulesDeploymentUnitParams, get_du_linker, BBFDM_BOTH, LIST_KEY{"UUID", "Version", "ExecutionEnvRef", "Alias", NULL}},
|
||||
{"ExecutionUnit", &DMREAD, NULL, NULL, NULL, browseSoftwareModulesExecutionUnitInst, NULL, NULL, tSoftwareModulesExecutionUnitObj, tSoftwareModulesExecutionUnitParams, NULL, BBFDM_BOTH, LIST_KEY{"EUID", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -732,8 +732,8 @@ DMLEAF tSoftwareModulesDeploymentUnitParams[] = {
|
|||
|
||||
/* *** Device.SoftwareModules.ExecutionUnit.{i}. *** */
|
||||
DMOBJ tSoftwareModulesExecutionUnitObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
//{"Extensions", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
//{"Extensions", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -85,12 +85,6 @@ static int set_time_LocalTimeZone(char *refparam, struct dmctx *ctx, void *data,
|
|||
return 0;
|
||||
}
|
||||
|
||||
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);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_time_ntpserver(char *refparam, struct dmctx *ctx, char **value, int index)
|
||||
{
|
||||
bool found = 0;
|
||||
|
|
@ -120,19 +114,6 @@ static int get_time_ntpserver(char *refparam, struct dmctx *ctx, char **value, i
|
|||
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);
|
||||
if (*iface == '\0' || strlen(iface) == 0)
|
||||
return 0;
|
||||
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", iface, value);
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_time_ntpserver1(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return get_time_ntpserver(refparam, ctx, value, 1);
|
||||
|
|
@ -158,24 +139,6 @@ static int get_time_ntpserver5(char *refparam, struct dmctx *ctx, void *data, ch
|
|||
return get_time_ntpserver(refparam, ctx, value, 5);
|
||||
}
|
||||
|
||||
static int set_time_source_interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
char *iface = NULL;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
adm_entry_get_linker_value(ctx, value, &iface);
|
||||
if (iface == NULL || iface[0] == '\0')
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
adm_entry_get_linker_value(ctx, value, &iface);
|
||||
dmuci_set_value("system", "ntp", "interface", iface);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_time_ntpserver(char *refparam, struct dmctx *ctx, int action, char *value, int index)
|
||||
{
|
||||
struct uci_list *v;
|
||||
|
|
@ -256,7 +219,5 @@ DMLEAF tTimeParams[] = {
|
|||
{"NTPServer5", &DMWRITE, DMT_STRING, get_time_ntpserver5, set_time_ntpserver5, BBFDM_BOTH},
|
||||
{"CurrentLocalTime", &DMREAD, DMT_TIME, get_time_CurrentLocalTime, NULL, BBFDM_BOTH},
|
||||
{"LocalTimeZone", &DMWRITE, DMT_STRING, get_time_LocalTimeZone, set_time_LocalTimeZone, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"LocalTimeZoneName", &DMREAD, DMT_STRING, get_local_time_zone_name, NULL, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"SourceInterface", &DMWRITE, DMT_STRING, get_time_source_interface, set_time_source_interface, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -382,13 +382,6 @@ static int set_UPnPDevice_Enable(char *refparam, struct dmctx *ctx, void *data,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int get_upnp_status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
pid_t pid = get_pid("miniupnpd");
|
||||
*value = (pid < 0) ? "Down" : "Up";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_UPnPDevice_UPnPMediaServer(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *path = "/etc/rc.d/*minidlna";
|
||||
|
|
@ -798,24 +791,23 @@ static int get_UPnPDescriptionServiceInstance_EventSubURL(char *refparam, struct
|
|||
|
||||
/* *** Device.UPnP. *** */
|
||||
DMOBJ tUPnPObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Device", &DMREAD, NULL, NULL, NULL, NULL, NULL, tUPnPDeviceObj, tUPnPDeviceParams, NULL, BBFDM_BOTH},
|
||||
{"Discovery", &DMREAD, NULL, NULL, NULL, NULL, NULL, tUPnPDiscoveryObj, tUPnPDiscoveryParams, NULL, BBFDM_BOTH},
|
||||
{"Description", &DMREAD, NULL, NULL, NULL, NULL, NULL, tUPnPDescriptionObj, tUPnPDescriptionParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Device", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tUPnPDeviceObj, tUPnPDeviceParams, NULL, BBFDM_BOTH},
|
||||
{"Discovery", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tUPnPDiscoveryObj, tUPnPDiscoveryParams, NULL, BBFDM_BOTH},
|
||||
{"Description", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tUPnPDescriptionObj, tUPnPDescriptionParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.UPnP.Device. *** */
|
||||
DMOBJ tUPnPDeviceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Capabilities", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tUPnPDeviceCapabilitiesParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Capabilities", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tUPnPDeviceCapabilitiesParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tUPnPDeviceParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"Enable", &DMWRITE, DMT_BOOL, get_UPnPDevice_Enable, set_UPnPDevice_Enable, BBFDM_BOTH},
|
||||
{CUSTOM_PREFIX"Status", &DMREAD, DMT_STRING, get_upnp_status, NULL, BBFDM_BOTH},
|
||||
{"UPnPMediaServer", &DMWRITE, DMT_BOOL, get_UPnPDevice_UPnPMediaServer, set_UPnPDevice_UPnPMediaServer, BBFDM_BOTH},
|
||||
//{"UPnPMediaRenderer", &DMWRITE, DMT_BOOL, get_UPnPDevice_UPnPMediaRenderer, set_UPnPDevice_UPnPMediaRenderer, BBFDM_BOTH},
|
||||
//{"UPnPWLANAccessPoint", &DMWRITE, DMT_BOOL, get_UPnPDevice_UPnPWLANAccessPoint, set_UPnPDevice_UPnPWLANAccessPoint, BBFDM_BOTH},
|
||||
|
|
@ -848,10 +840,10 @@ DMLEAF tUPnPDeviceCapabilitiesParams[] = {
|
|||
|
||||
/* *** Device.UPnP.Discovery. *** */
|
||||
DMOBJ tUPnPDiscoveryObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"RootDevice", &DMREAD, NULL, NULL, NULL, browseUPnPDiscoveryRootDeviceInst, NULL, NULL, tUPnPDiscoveryRootDeviceParams, get_root_device_linker, BBFDM_BOTH, LIST_KEY{"UUID", NULL}},
|
||||
{"Device", &DMREAD, NULL, NULL, NULL, browseUPnPDiscoveryDeviceInst, NULL, NULL, tUPnPDiscoveryDeviceParams, get_device_linker, BBFDM_BOTH, LIST_KEY{"UUID", NULL}},
|
||||
{"Service", &DMREAD, NULL, NULL, NULL, browseUPnPDiscoveryServiceInst, NULL, NULL, tUPnPDiscoveryServiceParams, get_service_linker, BBFDM_BOTH, LIST_KEY{"USN", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"RootDevice", &DMREAD, NULL, NULL, NULL, browseUPnPDiscoveryRootDeviceInst, NULL, NULL, NULL, tUPnPDiscoveryRootDeviceParams, get_root_device_linker, BBFDM_BOTH, LIST_KEY{"UUID", NULL}},
|
||||
{"Device", &DMREAD, NULL, NULL, NULL, browseUPnPDiscoveryDeviceInst, NULL, NULL, NULL, tUPnPDiscoveryDeviceParams, get_device_linker, BBFDM_BOTH, LIST_KEY{"UUID", NULL}},
|
||||
{"Service", &DMREAD, NULL, NULL, NULL, browseUPnPDiscoveryServiceInst, NULL, NULL, NULL, tUPnPDiscoveryServiceParams, get_service_linker, BBFDM_BOTH, LIST_KEY{"USN", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -907,10 +899,10 @@ DMLEAF tUPnPDiscoveryServiceParams[] = {
|
|||
|
||||
/* *** Device.UPnP.Description. *** */
|
||||
DMOBJ tUPnPDescriptionObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"DeviceDescription", &DMREAD, NULL, NULL, NULL, browseUPnPDescriptionDeviceDescriptionInst, NULL, NULL, tUPnPDescriptionDeviceDescriptionParams, NULL, BBFDM_BOTH, LIST_KEY{"URLBase", NULL}},
|
||||
{"DeviceInstance", &DMREAD, NULL, NULL, NULL, browseUPnPDescriptionDeviceInstanceInst, NULL, NULL, tUPnPDescriptionDeviceInstanceParams, get_device_instance_linker, BBFDM_BOTH, LIST_KEY{"UDN", NULL}},
|
||||
{"ServiceInstance", &DMREAD, NULL, NULL, NULL, browseUPnPDescriptionServiceInstanceInst, NULL, NULL, tUPnPDescriptionServiceInstanceParams, NULL, BBFDM_BOTH, LIST_KEY{"ParentDevice", "ServiceId", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"DeviceDescription", &DMREAD, NULL, NULL, NULL, browseUPnPDescriptionDeviceDescriptionInst, NULL, NULL, NULL, tUPnPDescriptionDeviceDescriptionParams, NULL, BBFDM_BOTH, LIST_KEY{"URLBase", NULL}},
|
||||
{"DeviceInstance", &DMREAD, NULL, NULL, NULL, browseUPnPDescriptionDeviceInstanceInst, NULL, NULL, NULL, tUPnPDescriptionDeviceInstanceParams, get_device_instance_linker, BBFDM_BOTH, LIST_KEY{"UDN", NULL}},
|
||||
{"ServiceInstance", &DMREAD, NULL, NULL, NULL, browseUPnPDescriptionServiceInstanceInst, NULL, NULL, NULL, tUPnPDescriptionServiceInstanceParams, NULL, BBFDM_BOTH, LIST_KEY{"ParentDevice", "ServiceId", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1089,10 +1089,10 @@ static int get_linker_usb_host_device(char *refparam, struct dmctx *dmctx, void
|
|||
|
||||
/* *** Device.USB. *** */
|
||||
DMOBJ tUSBObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Interface", &DMREAD, NULL, NULL, NULL, browseUSBInterfaceInst, NULL, tUSBInterfaceObj, tUSBInterfaceParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"Port", &DMREAD, NULL, NULL, NULL, browseUSBPortInst, NULL, NULL, tUSBPortParams, get_linker_usb_port, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"USBHosts", &DMREAD, NULL, NULL, NULL, NULL, NULL, tUSBUSBHostsObj, tUSBUSBHostsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Interface", &DMREAD, NULL, NULL, NULL, browseUSBInterfaceInst, NULL, NULL, tUSBInterfaceObj, tUSBInterfaceParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"Port", &DMREAD, NULL, NULL, NULL, browseUSBPortInst, NULL, NULL, NULL, tUSBPortParams, get_linker_usb_port, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{"USBHosts", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tUSBUSBHostsObj, tUSBUSBHostsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1105,8 +1105,8 @@ DMLEAF tUSBParams[] = {
|
|||
|
||||
/* *** Device.USB.Interface.{i}. *** */
|
||||
DMOBJ tUSBInterfaceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tUSBInterfaceStatsParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Stats", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tUSBInterfaceStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1161,8 +1161,8 @@ DMLEAF tUSBPortParams[] = {
|
|||
|
||||
/* *** Device.USB.USBHosts. *** */
|
||||
DMOBJ tUSBUSBHostsObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Host", &DMREAD, NULL, NULL, NULL, browseUSBUSBHostsHostInst, NULL, tUSBUSBHostsHostObj, tUSBUSBHostsHostParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Host", &DMREAD, NULL, NULL, NULL, browseUSBUSBHostsHostInst, NULL, NULL, tUSBUSBHostsHostObj, tUSBUSBHostsHostParams, NULL, BBFDM_BOTH, LIST_KEY{"Name", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1174,8 +1174,8 @@ DMLEAF tUSBUSBHostsParams[] = {
|
|||
|
||||
/* *** Device.USB.USBHosts.Host.{i}. *** */
|
||||
DMOBJ tUSBUSBHostsHostObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Device", &DMREAD, NULL, NULL, NULL, browseUSBUSBHostsHostDeviceInst, NULL, tUSBUSBHostsHostDeviceObj, tUSBUSBHostsHostDeviceParams, get_linker_usb_host_device, BBFDM_BOTH, LIST_KEY{"DeviceNumber", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Device", &DMREAD, NULL, NULL, NULL, browseUSBUSBHostsHostDeviceInst, NULL, NULL, tUSBUSBHostsHostDeviceObj, tUSBUSBHostsHostDeviceParams, get_linker_usb_host_device, BBFDM_BOTH, LIST_KEY{"DeviceNumber", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1194,8 +1194,8 @@ DMLEAF tUSBUSBHostsHostParams[] = {
|
|||
|
||||
/* *** Device.USB.USBHosts.Host.{i}.Device.{i}. *** */
|
||||
DMOBJ tUSBUSBHostsHostDeviceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Configuration", &DMREAD, NULL, NULL, NULL, browseUSBUSBHostsHostDeviceConfigurationInst, NULL, tUSBUSBHostsHostDeviceConfigurationObj, tUSBUSBHostsHostDeviceConfigurationParams, NULL, BBFDM_BOTH, LIST_KEY{"ConfigurationNumber", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Configuration", &DMREAD, NULL, NULL, NULL, browseUSBUSBHostsHostDeviceConfigurationInst, NULL, NULL, tUSBUSBHostsHostDeviceConfigurationObj, tUSBUSBHostsHostDeviceConfigurationParams, NULL, BBFDM_BOTH, LIST_KEY{"ConfigurationNumber", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1225,8 +1225,8 @@ DMLEAF tUSBUSBHostsHostDeviceParams[] = {
|
|||
|
||||
/* *** Device.USB.USBHosts.Host.{i}.Device.{i}.Configuration.{i}. *** */
|
||||
DMOBJ tUSBUSBHostsHostDeviceConfigurationObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Interface", &DMREAD, NULL, NULL, NULL, browseUSBUSBHostsHostDeviceConfigurationInterfaceInst, NULL, NULL, tUSBUSBHostsHostDeviceConfigurationInterfaceParams, NULL, BBFDM_BOTH, LIST_KEY{"InterfaceNumber", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Interface", &DMREAD, NULL, NULL, NULL, browseUSBUSBHostsHostDeviceConfigurationInterfaceInst, NULL, NULL, NULL, tUSBUSBHostsHostDeviceConfigurationInterfaceParams, NULL, BBFDM_BOTH, LIST_KEY{"InterfaceNumber", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -256,8 +256,8 @@ static int set_user_language(char *refparam, struct dmctx *ctx, void *data, char
|
|||
|
||||
/* *** Device.Users. *** */
|
||||
DMOBJ tUsersObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"User", &DMWRITE, add_users_user, delete_users_user, NULL, browseUserInst, NULL, NULL, tUsersUserParams, NULL, BBFDM_BOTH, LIST_KEY{"Username", "Alias", NULL}},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"User", &DMWRITE, add_users_user, delete_users_user, NULL, browseUserInst, NULL, NULL, NULL, tUsersUserParams, NULL, BBFDM_BOTH, LIST_KEY{"Username", "Alias", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,987 +0,0 @@
|
|||
#include "os.h"
|
||||
|
||||
static int not_implemented(char **value)
|
||||
{
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_wlan_bssid(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiRadioStats_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiRadioStats_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiRadioStats_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiRadioStats_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiRadioStats_ErrorsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiRadioStats_ErrorsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiRadioStats_DiscardPacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiRadioStats_DiscardPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiRadioStats_FCSErrorCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_ErrorsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_ErrorsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_DiscardPacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_DiscardPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_UnicastPacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_UnicastPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_MulticastPacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_MulticastPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_BroadcastPacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_BroadcastPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_RetransCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_FailedRetransCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_RetryCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_MultipleRetryCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_ACKFailureCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_AggregatedPacketCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiSSIDStats_UnknownProtoPacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiAccessPointAssociatedDevice_Active(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiAccessPointAssociatedDevice_Noise(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiAccessPointAssociatedDevice_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiAccessPointAssociatedDevice_LastDataDownlinkRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiAccessPointAssociatedDevice_LastDataUplinkRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiAccessPointAssociatedDevice_SignalStrength(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiAccessPointAssociatedDevice_AssociationTime(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_access_point_associative_device_statistics_tx_bytes(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_access_point_associative_device_statistics_rx_bytes(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_access_point_associative_device_statistics_tx_packets(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_access_point_associative_device_statistics_rx_packets(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_access_point_associative_device_statistics_tx_errors(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_access_point_associative_device_statistics_retrans_count(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os_get_wifi_access_point_status (char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_radio_max_bit_rate (char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_radio_frequency(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_radio_supported_frequency_bands(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_radio_channel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
char * os__get_radio_channel_nocache(const struct wifi_radio_args *args)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
char * os__get_radio_frequency_nocache(const struct wifi_radio_args *args)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
int os__get_neighboring_wifi_diagnostics_diagnostics_state(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_neighboring_wifi_diagnostics_result_number_entries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_neighboring_wifi_diagnostics_result_ssid(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_neighboring_wifi_diagnostics_result_bssid(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_neighboring_wifi_diagnostics_result_channel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_neighboring_wifi_diagnostics_result_signal_strength(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_neighboring_wifi_diagnostics_result_operating_frequency_band(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_neighboring_wifi_diagnostics_result_noise(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_radio_possible_channels(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiRadio_SupportedOperatingChannelBandwidths(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiRadio_CurrentOperatingChannelBandwidth(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
void os__wifi_start_scan(const char *radio)
|
||||
{
|
||||
}
|
||||
|
||||
int os__browseWifiNeighboringWiFiDiagnosticResultInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os_get_radio_operating_standard(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_radio_supported_standard(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_access_point_total_associations(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__browse_wifi_associated_device(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
char * os__get_default_wpa_key()
|
||||
{
|
||||
return "OpenWrt";
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetwork_ID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__set_WiFiDataElementsNetwork_ID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetwork_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetwork_ControllerID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__set_WiFiDataElementsNetwork_ControllerID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetwork_DeviceNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDevice_ID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
#if 0
|
||||
int os__get_WiFiDataElementsNetworkDevice_MultiAPCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
#endif
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDevice_CollectionInterval(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDevice_RadioNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_ID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_Enabled(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_Noise(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_Utilization(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_Transmit(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_ReceiveSelf(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_ReceiveOther(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_CurrentOperatingClassProfileNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_UnassociatedSTANumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_BSSNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadio_ScanResultNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBackhaulSta_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilities_HTCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilities_VHTCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilities_HECapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilities_CapableOperatingClassProfileNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilitiesCapableOperatingClassProfile_Class(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilitiesCapableOperatingClassProfile_MaxTxPower(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilitiesCapableOperatingClassProfile_NonOperable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCapabilitiesCapableOperatingClassProfile_NumberOfNonOperChan(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCurrentOperatingClassProfile_Class(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCurrentOperatingClassProfile_Channel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCurrentOperatingClassProfile_TxPower(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioCurrentOperatingClassProfile_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_BSSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_SSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_Enabled(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_LastChange(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_UnicastBytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_UnicastBytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_MulticastBytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_MulticastBytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_BroadcastBytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_BroadcastBytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_EstServiceParametersBE(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_EstServiceParametersBK(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_EstServiceParametersVI(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_EstServiceParametersVO(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSS_STANumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_HTCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_VHTCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_HECapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_LastDataDownlinkRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_LastDataUplinkRate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_UtilizationReceive(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_UtilizationTransmit(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_EstMACDataRateDownlink(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_EstMACDataRateUplink(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_SignalStrength(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_LastConnectTime(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_ErrorsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_ErrorsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
#if 0
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_RetransCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
#endif
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_MeasurementReport(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_NumberOfMeasureReports(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
#if 0
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_IPV4Address(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_IPV6Address(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
#endif
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioBSSSTA_Hostname(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResult_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResult_OpClassScanNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScan_OperatingClass(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScan_ChannelScanNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScan_Channel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScan_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScan_Utilization(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScan_Noise(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScan_NeighborBSSNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSS_BSSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSS_SSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSS_SignalStrength(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSS_ChannelBandwidth(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSS_ChannelUtilization(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSS_StationCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioUnassociatedSTA_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsNetworkDeviceRadioUnassociatedSTA_SignalStrength(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsAssociationEvent_AssociationEventDataNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_BSSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_StatusCode(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_HTCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_VHTCapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_HECapabilities(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsAssociationEventAssociationEventData_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsDisassociationEvent_DisassociationEventDataNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_BSSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_ReasonCode(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_BytesSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_BytesReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_PacketsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_PacketsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_ErrorsSent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_ErrorsReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_RetransCount(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__get_WiFiDataElementsDisassociationEventDisassociationEventData_TimeStamp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
|
||||
int os__browseWiFiDataElementsNetworkDeviceInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioCurrentOperatingClassProfileInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioBSSInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioScanResultInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioUnassociatedSTAInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioCapabilitiesCapableOperatingClassProfileInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioBSSSTAInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioScanResultOpClassScanInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseWiFiDataElementsNetworkDeviceRadioScanResultOpClassScanChannelScanNeighborBSSInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseWiFiDataElementsAssociationEventAssociationEventDataInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os__browseWiFiDataElementsDisassociationEventDisassociationEventDataInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os_get_supported_modes(const char *ubus_method, const char *ifname, char **value)
|
||||
{
|
||||
return not_implemented(value);
|
||||
}
|
||||
3018
dmtree/tr181/wifi.c
3018
dmtree/tr181/wifi.c
File diff suppressed because it is too large
Load diff
|
|
@ -1,167 +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 <imen.bhiri@pivasoftware.com>
|
||||
* Author Omar Kallel <omar.kallel@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "x_iopsys_eu_buttons.h"
|
||||
|
||||
int browseXIopsysEuButton(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
char *inst = NULL, *max_inst = NULL;
|
||||
struct dmmap_dup *p = NULL;
|
||||
LIST_HEAD(dup_list);
|
||||
|
||||
synchronize_specific_config_sections_with_dmmap("buttons", "button", "dmmap_buttons", &dup_list);
|
||||
list_for_each_entry(p, &dup_list, list) {
|
||||
|
||||
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_alias, 3,
|
||||
p->dmmap_section, "buttoninstance", "buttonalias");
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)p->config_section, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
free_dmmap_config_dup_list(&dup_list);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************************
|
||||
**** function related to button ****
|
||||
**************************************************************************************/
|
||||
|
||||
static int get_x_iopsys_eu_button_name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmasprintf(value, "%s", section_name((struct uci_section *)data));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_button_gpio(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct uci_list *val = NULL;
|
||||
|
||||
dmuci_get_value_by_section_list((struct uci_section *)data, "button", &val);
|
||||
*value = dmuci_list_to_string(val, " ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_button_hotplug(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "hotplug", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_button_hotplug_long(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "hotplug_long", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_button_minpress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "minpress", "0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_button_minpress(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "minpress", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_button_longpress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "longpress", "0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_button_longpress(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "longpress", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int get_x_iopsys_eu_button_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "enable", "1");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_button_enable(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_by_section((struct uci_section *)data, "enable", b ? "1" : "0");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
////////////////////////SET AND GET ALIAS/////////////////////////////////
|
||||
static int get_x_iopsys_eu_button_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct uci_section *dmmap_section = NULL;
|
||||
|
||||
get_dmmap_section_of_config_section("dmmap_buttons", "button", section_name((struct uci_section *)data), &dmmap_section);
|
||||
dmuci_get_value_by_section_string(dmmap_section, "buttonalias", value);
|
||||
if ((*value)[0] == '\0')
|
||||
dmasprintf(value, "cpe-%s", instance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_button_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct uci_section *dmmap_section = NULL;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 64, NULL, NULL))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
get_dmmap_section_of_config_section("dmmap_buttons", "button", section_name((struct uci_section *)data), &dmmap_section);
|
||||
dmuci_set_value_by_section(dmmap_section, "buttonalias", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*** DMROOT.X_IOPSYS_EU_Buttons.{i}. ****/
|
||||
DMLEAF X_IOPSYS_EU_ButtonParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"Alias", &DMWRITE, DMT_STRING, get_x_iopsys_eu_button_alias, set_x_iopsys_eu_button_alias, BBFDM_BOTH},
|
||||
{"Enable", &DMWRITE, DMT_BOOL, get_x_iopsys_eu_button_enable, set_x_iopsys_eu_button_enable, BBFDM_BOTH},
|
||||
{"Name", &DMREAD, DMT_STRING, get_x_iopsys_eu_button_name, NULL, BBFDM_BOTH},
|
||||
{"GPIOButton", &DMREAD, DMT_STRING, get_x_iopsys_eu_button_gpio, NULL, BBFDM_BOTH},
|
||||
{"HotplugInterface", &DMREAD, DMT_STRING, get_x_iopsys_eu_button_hotplug, NULL, BBFDM_BOTH},
|
||||
{"HotplugInterfaceForLongPress", &DMREAD, DMT_STRING, get_x_iopsys_eu_button_hotplug_long, NULL, BBFDM_BOTH},
|
||||
{"MinPressTime", &DMWRITE, DMT_UNINT, get_x_iopsys_eu_button_minpress, set_x_iopsys_eu_button_minpress, BBFDM_BOTH},
|
||||
{"LongPressTime", &DMWRITE, DMT_UNINT, get_x_iopsys_eu_button_longpress, set_x_iopsys_eu_button_longpress, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
|
@ -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 Imen Bhiri <imen.bhiri@pivasoftware.com>
|
||||
* Author Omar Kallel <omar.kallel@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __SE_BUTTONS_H
|
||||
#define __SE_BUTTONS_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMLEAF X_IOPSYS_EU_ButtonParams[];
|
||||
|
||||
int browseXIopsysEuButton(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,483 +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 <imen.bhiri@pivasoftware.com>
|
||||
* Author Omar Kallel <omar.kallel@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "dmentry.h"
|
||||
#include "x_iopsys_eu_owsd.h"
|
||||
|
||||
static int browseXIopsysEuOWSDVirtualHost(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
char *inst = NULL, *max_inst = NULL;
|
||||
struct dmmap_dup *p = NULL;
|
||||
LIST_HEAD(dup_list);
|
||||
|
||||
synchronize_specific_config_sections_with_dmmap("owsd", "owsd-listen", "dmmap_owsd", &dup_list);
|
||||
list_for_each_entry(p, &dup_list, list) {
|
||||
|
||||
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_alias, 3,
|
||||
p->dmmap_section, "olisteninstance", "olistenalias");
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)p->config_section, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
free_dmmap_config_dup_list(&dup_list);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************************
|
||||
**** function related to owsd_origin ****
|
||||
**************************************************************************************/
|
||||
static int get_x_iopsys_eu_owsd_global_sock(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_option_value_string("owsd", "global", "sock", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_global_sock(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value("owsd", "global", "sock", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_owsd_global_redirect(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_option_value_string("owsd", "global", "redirect", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_global_redirect(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value("owsd", "global", "redirect", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************************
|
||||
**** function related to owsd_websocket_interface ****
|
||||
**************************************************************************************/
|
||||
static int get_x_iopsys_eu_owsd_virtualhost_port(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "port", "0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_virtualhost_port(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "port", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_owsd_virtualhost_interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *iface;
|
||||
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "interface", &iface);
|
||||
if (iface[0] != '\0') {
|
||||
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", iface, value); // MEM WILL BE FREED IN DMMEMCLEAN
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_virtualhost_interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
char *linker = NULL;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
adm_entry_get_linker_value(ctx, value, &linker);
|
||||
if (linker && *linker) {
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "interface", linker);
|
||||
dmfree(linker);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_owsd_virtualhost_ipv6_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *res = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "ipv6", "1");
|
||||
*value = (strcmp(res, "on") == 0) ? "1" : "0";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_virtualhost_ipv6_enable(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_by_section((struct uci_section *)data, "ipv6", b ? "on" : "off");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_owsd_virtualhost_whitelist_interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "whitelist_interface_as_origin", "0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_virtualhost_whitelist_interface(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_by_section((struct uci_section *)data, "whitelist_interface_as_origin", b ? "1" : "0");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_owsd_virtualhost_whitelist_dhcp(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "whitelist_dhcp_domains", "0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_virtualhost_whitelist_dhcp(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_by_section((struct uci_section *)data, "whitelist_dhcp_domains", b ? "1" : "0");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_owsd_virtualhost_origin(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct uci_list *val = NULL;
|
||||
|
||||
dmuci_get_value_by_section_list((struct uci_section *)data, "origin", &val);
|
||||
*value = dmuci_list_to_string(val, " ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_virtualhost_origin(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
char *pch, *spch;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_delete_by_section((struct uci_section *)data, "origin", NULL);
|
||||
value = dmstrdup(value);
|
||||
pch = strtok_r(value, " ", &spch);
|
||||
while (pch != NULL) {
|
||||
dmuci_add_list_value_by_section((struct uci_section *)data, "origin", pch);
|
||||
pch = strtok_r(NULL, " ", &spch);
|
||||
}
|
||||
dmfree(value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
////////////////////////SET AND GET ALIAS/////////////////////////////////
|
||||
static int get_x_iopsys_eu_owsd_virtualhost_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct uci_section *dmmap_section = NULL;
|
||||
|
||||
get_dmmap_section_of_config_section("dmmap_owsd", "owsd-listen", section_name((struct uci_section *)data), &dmmap_section);
|
||||
dmuci_get_value_by_section_string(dmmap_section, "olistenalias", value);
|
||||
if ((*value)[0] == '\0')
|
||||
dmasprintf(value, "cpe-%s", instance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_virtualhost_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct uci_section *dmmap_section = NULL;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 64, NULL, NULL))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
get_dmmap_section_of_config_section("dmmap_owsd", "owsd-listen", section_name((struct uci_section *)data), &dmmap_section);
|
||||
dmuci_set_value_by_section(dmmap_section, "olistenalias", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_owsd_ubus_proxy_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_option_value_fallback_def("owsd","ubusproxy","enable", "1");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_ubus_proxy_enable(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("owsd", "ubusproxy", "enable", b ? "1" : "0");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_owsd_ubus_proxy_cert(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_option_value_string("owsd","ubusproxy","peer_cert", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_ubus_proxy_cert(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value("owsd", "ubusproxy", "peer_cert", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_owsd_ubus_proxy_key(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_option_value_string("owsd","ubusproxy","peer_key", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_ubus_proxy_key(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value("owsd", "ubusproxy", "peer_key", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_owsd_ubus_proxy_ca(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_option_value_string("owsd","ubusproxy","peer_ca", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_ubus_proxy_ca(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value("owsd", "ubusproxy", "peer_ca", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_owsd_virtualhost_certificate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "cert", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_virtualhost_certificate(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "cert", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_owsd_virtualhost_key(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "key", value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_virtualhost_key(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "key", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_owsd_virtualhost_ca(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "ca", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_owsd_virtualhost_ca(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "ca", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***** ADD DEL OBJ *******/
|
||||
static int add_owsd_listen(char *refparam, struct dmctx *ctx, void *data, char **instancepara)
|
||||
{
|
||||
struct uci_section *listen_sec = NULL, *dmmap_sec = NULL;
|
||||
|
||||
char *instance = get_last_instance_bbfdm("dmmap_owsd", "owsd-listen", "olisteninstance");
|
||||
|
||||
dmuci_add_section("owsd", "owsd-listen", &listen_sec);
|
||||
dmuci_set_value_by_section(listen_sec, "ipv6", "on");
|
||||
dmuci_set_value_by_section(listen_sec, "whitelist_interface_as_origin", "1");
|
||||
dmuci_add_list_value_by_section(listen_sec, "origin", "*");
|
||||
|
||||
dmuci_add_section_bbfdm("dmmap_owsd", "owsd-listen", &dmmap_sec);
|
||||
dmuci_set_value_by_section(dmmap_sec, "section_name", section_name(listen_sec));
|
||||
*instancepara = update_instance(instance, 2, dmmap_sec, "olisteninstance");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int delete_owsd_listen_instance(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action)
|
||||
{
|
||||
struct uci_section *s = NULL, *ss = NULL, *dmmap_section = NULL;
|
||||
|
||||
int found = 0;
|
||||
switch (del_action) {
|
||||
case DEL_INST:
|
||||
if (is_section_unnamed(section_name((struct uci_section *)data))) {
|
||||
LIST_HEAD(dup_list);
|
||||
delete_sections_save_next_sections("dmmap_owsd", "owsd-listen", "olisteninstance", section_name((struct uci_section *)data), atoi(instance), &dup_list);
|
||||
update_dmmap_sections(&dup_list, "olisteninstance", "dmmap_owsd", "owsd-listen");
|
||||
dmuci_delete_by_section_unnamed((struct uci_section *)data, NULL, NULL);
|
||||
} else {
|
||||
get_dmmap_section_of_config_section("dmmap_owsd", "owsd-listen", section_name((struct uci_section *)data), &dmmap_section);
|
||||
if (dmmap_section)
|
||||
dmuci_delete_by_section_unnamed_bbfdm(dmmap_section, NULL, NULL);
|
||||
dmuci_delete_by_section((struct uci_section *)data, NULL, NULL);
|
||||
}
|
||||
break;
|
||||
case DEL_ALL:
|
||||
uci_foreach_sections("owsd", "owsd-listen", s) {
|
||||
if (found != 0) {
|
||||
get_dmmap_section_of_config_section("dmmap_owsd", "listen", section_name(s), &dmmap_section);
|
||||
if (dmmap_section)
|
||||
dmuci_delete_by_section(dmmap_section, NULL, NULL);
|
||||
dmuci_delete_by_section(ss, NULL, NULL);
|
||||
}
|
||||
ss = s;
|
||||
found++;
|
||||
}
|
||||
if (ss != NULL) {
|
||||
get_dmmap_section_of_config_section("dmmap_owsd", "listen", section_name(ss), &dmmap_section);
|
||||
if (dmmap_section)
|
||||
dmuci_delete_by_section(dmmap_section, NULL, NULL);
|
||||
dmuci_delete_by_section(ss, NULL, NULL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*** DMROOT.X_IOPSYS_EU_OWSD. ***/
|
||||
DMLEAF X_IOPSYS_EU_OWSDParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"UnixSocket", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_global_sock, set_x_iopsys_eu_owsd_global_sock, BBFDM_BOTH},
|
||||
{"URLRedirect", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_global_redirect, set_x_iopsys_eu_owsd_global_redirect, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMOBJ X_IOPSYS_EU_OWSDObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"UbusProxy", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, UbusProxyParams, NULL, BBFDM_BOTH},
|
||||
{"VirtualHost", &DMWRITE, add_owsd_listen, delete_owsd_listen_instance, NULL, browseXIopsysEuOWSDVirtualHost, NULL, NULL, VirtualHostParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF UbusProxyParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"Enable", &DMWRITE, DMT_BOOL, get_x_iopsys_eu_owsd_ubus_proxy_enable, set_x_iopsys_eu_owsd_ubus_proxy_enable, BBFDM_BOTH},
|
||||
{"PeerCertificate", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_ubus_proxy_cert, set_x_iopsys_eu_owsd_ubus_proxy_cert, BBFDM_BOTH},
|
||||
{"PeerKey", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_ubus_proxy_key, set_x_iopsys_eu_owsd_ubus_proxy_key, BBFDM_BOTH},
|
||||
{"PeerCA", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_ubus_proxy_ca, set_x_iopsys_eu_owsd_ubus_proxy_ca, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF VirtualHostParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"Alias", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_virtualhost_alias, set_x_iopsys_eu_owsd_virtualhost_alias, BBFDM_BOTH},
|
||||
{"Interface", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_virtualhost_interface, set_x_iopsys_eu_owsd_virtualhost_interface, BBFDM_BOTH},
|
||||
{"Port", &DMWRITE, DMT_UNINT, get_x_iopsys_eu_owsd_virtualhost_port, set_x_iopsys_eu_owsd_virtualhost_port, BBFDM_BOTH},
|
||||
{"IPv6Enable", &DMWRITE, DMT_BOOL, get_x_iopsys_eu_owsd_virtualhost_ipv6_enable, set_x_iopsys_eu_owsd_virtualhost_ipv6_enable, BBFDM_BOTH},
|
||||
{"AllowInterfaceIPAddressAsOrigin", &DMWRITE, DMT_BOOL, get_x_iopsys_eu_owsd_virtualhost_whitelist_interface, set_x_iopsys_eu_owsd_virtualhost_whitelist_interface, BBFDM_BOTH},
|
||||
{"AllowDHCPDomainsAsOrigin", &DMWRITE, DMT_BOOL, get_x_iopsys_eu_owsd_virtualhost_whitelist_dhcp, set_x_iopsys_eu_owsd_virtualhost_whitelist_dhcp, BBFDM_BOTH},
|
||||
{"AllowedOrigins", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_virtualhost_origin, set_x_iopsys_eu_owsd_virtualhost_origin, BBFDM_BOTH},
|
||||
{"Certificate", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_virtualhost_certificate, set_x_iopsys_eu_owsd_virtualhost_certificate, BBFDM_BOTH},
|
||||
{"Key", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_virtualhost_key, set_x_iopsys_eu_owsd_virtualhost_key, BBFDM_BOTH},
|
||||
{"CA", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_virtualhost_ca, set_x_iopsys_eu_owsd_virtualhost_ca, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
|
@ -1,23 +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 <imen.bhiri@pivasoftware.com>
|
||||
* Author Omar Kallel <omar.kallel@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __SE_OWSD_H
|
||||
#define __SE_OWSD_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMLEAF X_IOPSYS_EU_OWSDParams[];
|
||||
extern DMOBJ X_IOPSYS_EU_OWSDObj[];
|
||||
extern DMLEAF VirtualHostParams[];
|
||||
extern DMLEAF UbusProxyParams[];
|
||||
|
||||
#endif
|
||||
|
|
@ -1,76 +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 <imen.bhiri@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "x_iopsys_eu_syslog.h"
|
||||
|
||||
|
||||
static int get_server_ip_address(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_option_value_string("system", "@system[0]", "log_ip", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_server_ip_address(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value("system", "@system[0]", "log_ip", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_server_port_number(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_option_value_fallback_def("system", "@system[0]", "log_port", "514");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_server_port_number(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value("system", "@system[0]", "log_port", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_remote_log_level(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_option_value_fallback_def("system", "@system[0]", "conloglevel", "7");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_remote_log_level(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value("system", "@system[0]", "conloglevel", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*** DMROOT.X_IOPSYS_EU_Syslog. ***/
|
||||
DMLEAF tSe_SyslogParam[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"ServerIPAddress", &DMWRITE, DMT_STRING, get_server_ip_address, set_server_ip_address, BBFDM_BOTH},
|
||||
{"ServerPort", &DMWRITE, DMT_UNINT, get_server_port_number, set_server_port_number, BBFDM_BOTH},
|
||||
{"ConsoleLogLevel", &DMWRITE, DMT_UNINT, get_remote_log_level, set_remote_log_level, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
65
dmtree/vendor/iopsys/tr181/bridging.c
vendored
Normal file
65
dmtree/vendor/iopsys/tr181/bridging.c
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* 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 "tr181/bridging.h"
|
||||
#include "bridging.h"
|
||||
|
||||
static int get_BridgingBridgePort_Egress_PriorityRegeneration(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
bridging_get_priority_list("egress_qos_mapping", data, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_BridgingBridgePort_Egress_PriorityRegeneration(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt_list(value, 8, 8, -1, RANGE_ARGS{{"0","7"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
|
||||
case VALUESET:
|
||||
bridging_set_priority_list("egress_qos_mapping", data, value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_BridgingBridgePort_DSCP_Eth_Priority_Map(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
bridging_get_priority_list("dscp2pbit", data, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_BridgingBridgePort_DSCP_Eth_Priority_Map(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt_list(value, 1, 64, -1, RANGE_ARGS{{"0","7"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
|
||||
case VALUESET:
|
||||
bridging_set_priority_list("dscp2pbit", data, value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
DMLEAF tIOPSYS_BridgingBridgePortParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{BBF_VENDOR_PREFIX"EgressPriorityRegeneration", &DMWRITE, DMT_STRING, get_BridgingBridgePort_Egress_PriorityRegeneration, set_BridgingBridgePort_Egress_PriorityRegeneration, BBFDM_BOTH},
|
||||
{BBF_VENDOR_PREFIX"DSCPEthernetPriorityMapping", &DMWRITE, DMT_STRING, get_BridgingBridgePort_DSCP_Eth_Priority_Map, set_BridgingBridgePort_DSCP_Eth_Priority_Map, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
19
dmtree/vendor/iopsys/tr181/bridging.h
vendored
Normal file
19
dmtree/vendor/iopsys/tr181/bridging.h
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* 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_BRIDGING_H
|
||||
#define __IOPSYS_BRIDGING_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMLEAF tIOPSYS_BridgingBridgePortParams[];
|
||||
|
||||
#endif //__IOPSYS_BRIDGING_H
|
||||
21
dmtree/vendor/iopsys/tr181/device.c
vendored
Normal file
21
dmtree/vendor/iopsys/tr181/device.c
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* 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 "device.h"
|
||||
#include "x_iopsys_eu_igmp.h"
|
||||
#include "x_iopsys_eu_mld.h"
|
||||
|
||||
DMOBJ tIOPSYS_DeviceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{BBF_VENDOR_PREFIX"IGMP", &DMREAD, NULL, NULL, "file:/etc/config/mcast", NULL, NULL, NULL, X_IOPSYS_EU_IGMPObj, X_IOPSYS_EU_IGMPParams, NULL, BBFDM_BOTH},
|
||||
{BBF_VENDOR_PREFIX"MLD", &DMREAD, NULL, NULL, "file:/etc/config/mcast", NULL, NULL, NULL, X_IOPSYS_EU_MLDObj, X_IOPSYS_EU_MLDParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
19
dmtree/vendor/iopsys/tr181/device.h
vendored
Normal file
19
dmtree/vendor/iopsys/tr181/device.h
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* 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_DEVICE_H
|
||||
#define __IOPSYS_DEVICE_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMOBJ tIOPSYS_DeviceObj[];
|
||||
|
||||
#endif //__IOPSYS_DEVICE_H
|
||||
27
dmtree/vendor/iopsys/tr181/deviceinfo.c
vendored
Normal file
27
dmtree/vendor/iopsys/tr181/deviceinfo.c
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* 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 "deviceinfo.h"
|
||||
|
||||
static int get_base_mac_addr(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
db_get_value_string("device", "deviceinfo", "BaseMACAddress", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
DMLEAF tIOPSYS_DeviceInfoParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{BBF_VENDOR_PREFIX"BaseMACAddress", &DMREAD, DMT_STRING, get_base_mac_addr, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
19
dmtree/vendor/iopsys/tr181/deviceinfo.h
vendored
Normal file
19
dmtree/vendor/iopsys/tr181/deviceinfo.h
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* 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_DEVICEINFO_H
|
||||
#define __IOPSYS_DEVICEINFO_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMLEAF tIOPSYS_DeviceInfoParams[];
|
||||
|
||||
#endif //__IOPSYS_DEVICEINFO_H
|
||||
124
dmtree/vendor/iopsys/tr181/ethernet.c
vendored
Normal file
124
dmtree/vendor/iopsys/tr181/ethernet.c
vendored
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
/*
|
||||
* 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 "tr181/ethernet.h"
|
||||
#include "ethernet.h"
|
||||
|
||||
static int get_EthernetVLANTermination_MACVLAN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "type", value);
|
||||
*value = (strcmp(*value, "macvlan") == 0) ? "1" : "0";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_EthernetVLANTermination_MACVLAN(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
char *name, *ifname;
|
||||
bool b;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_boolean(value))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
string_to_bool(value, &b);
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "ifname", &ifname);
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "name", &name);
|
||||
struct uci_section *s = NULL, *dmmap_s = NULL;
|
||||
if (b && *name != '\0') {
|
||||
char *link_instance = NULL, new_name[16] = {0};
|
||||
int name_found = 0;
|
||||
|
||||
uci_foreach_option_eq("network", "interface", "ifname", name, s) {
|
||||
|
||||
get_dmmap_section_of_config_section_eq("dmmap", "link", "device", ifname, &dmmap_s);
|
||||
if (dmmap_s) {
|
||||
dmuci_get_value_by_section_string(dmmap_s, "link_instance", &link_instance);
|
||||
snprintf(new_name, sizeof(new_name), "%s_%s", ifname, link_instance);
|
||||
|
||||
if (ethernet_name_exists_in_devices(new_name))
|
||||
return -1;
|
||||
|
||||
dmuci_set_value_by_section(dmmap_s, "device", new_name);
|
||||
dmuci_set_value_by_section(dmmap_s, "section_name", section_name(s));
|
||||
|
||||
}
|
||||
|
||||
dmuci_set_value_by_section(s, "ifname", new_name);
|
||||
|
||||
name_found = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (name_found == 0) {
|
||||
int ifname_found = 0;
|
||||
struct uci_section *ss = NULL;
|
||||
|
||||
uci_foreach_option_eq("network", "interface", "ifname", ifname, ss) {
|
||||
|
||||
uci_path_foreach_option_eq(bbfdm, "dmmap", "link", "device", ifname, dmmap_s) {
|
||||
char *sec_name;
|
||||
dmuci_get_value_by_section_string(dmmap_s, "section_name", &sec_name);
|
||||
/* Check section name exist => if yes, continue*/
|
||||
if (!ethernet_check_section_in_curr_section(sec_name, section_name(ss)))
|
||||
continue;
|
||||
|
||||
dmuci_get_value_by_section_string(dmmap_s, "link_instance", &link_instance);
|
||||
snprintf(new_name, sizeof(new_name), "%s_%s", ifname, link_instance);
|
||||
|
||||
if (ethernet_name_exists_in_devices(new_name))
|
||||
return -1;
|
||||
|
||||
dmuci_set_value_by_section(dmmap_s, "device", new_name);
|
||||
dmuci_set_value_by_section(dmmap_s, "section_name", section_name(ss));
|
||||
}
|
||||
|
||||
dmuci_set_value_by_section(ss, "ifname", new_name);
|
||||
|
||||
ifname_found = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ifname_found == 0) {
|
||||
get_dmmap_section_of_config_section_eq("dmmap", "link", "device", ifname, &dmmap_s);
|
||||
if (dmmap_s) {
|
||||
dmuci_get_value_by_section_string(dmmap_s, "link_instance", &link_instance);
|
||||
snprintf(new_name, sizeof(new_name), "%s_%s", ifname, link_instance);
|
||||
|
||||
if (ethernet_name_exists_in_devices(new_name))
|
||||
return -1;
|
||||
|
||||
dmuci_set_value_by_section(dmmap_s, "device", new_name);
|
||||
dmuci_set_value_by_section(dmmap_s, "section_name", "");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "name", new_name);
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "type", "macvlan");
|
||||
} else {
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "type", b ? "macvlan" : "8021q");
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
DMLEAF tIOPSYS_EthernetVLANTerminationParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{BBF_VENDOR_PREFIX"MACVLAN", &DMWRITE, DMT_BOOL, get_EthernetVLANTermination_MACVLAN, set_EthernetVLANTermination_MACVLAN, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
19
dmtree/vendor/iopsys/tr181/ethernet.h
vendored
Normal file
19
dmtree/vendor/iopsys/tr181/ethernet.h
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* 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_ETHERNET_H
|
||||
#define __IOPSYS_ETHERNET_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMLEAF tIOPSYS_EthernetVLANTerminationParams[];
|
||||
|
||||
#endif //__IOPSYS_ETHERNET_H
|
||||
75
dmtree/vendor/iopsys/tr181/ieee1905.c
vendored
Normal file
75
dmtree/vendor/iopsys/tr181/ieee1905.c
vendored
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* 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 "ieee1905.h"
|
||||
|
||||
static int browseIEEE1905ALNetworkTopologyNonIEEE1905NeighborInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
json_object *res = NULL, *arrobj = NULL, *res_self = NULL;
|
||||
char *inst = NULL, *max_inst = NULL, *obj = NULL;
|
||||
int id = 0, i = 0;
|
||||
|
||||
dmubus_call("topology", "dump", UBUS_ARGS{}, 0, &res_self);
|
||||
if (res_self)
|
||||
json_object_object_get_ex(res_self, "self", &res);
|
||||
dmjson_foreach_value_in_array(res, arrobj, obj, i, 1, "non1905_neighbors") {
|
||||
|
||||
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_without_section, 1, ++id);
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)obj, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_IEEE1905ALNetworkTopology_NonIEEE1905NeighborNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res = NULL, *obj = NULL, *obj_nbr = NULL;
|
||||
size_t num_nodes = 0;
|
||||
|
||||
dmubus_call("topology", "dump", UBUS_ARGS{}, 0, &res);
|
||||
DM_ASSERT(res, *value = "0");
|
||||
json_object_object_get_ex(res, "self", &obj);
|
||||
if (obj) {
|
||||
json_object_object_get_ex(obj, "non1905_neighbors", &obj_nbr);
|
||||
num_nodes = (obj_nbr) ? json_object_array_length(obj_nbr) : 0;
|
||||
}
|
||||
dmasprintf(value, "%d", num_nodes);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_IEEE1905ALNetworkTopologyNonIEEE1905Neighbor(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = (char *)data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
/* *** Device.IEEE1905.AL.NetworkTopology. *** */
|
||||
DMOBJ tIOPSYS_IEEE1905ALNetworkTopologyObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{BBF_VENDOR_PREFIX"NonIEEE1905Neighbor", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyNonIEEE1905NeighborInst, NULL, NULL, NULL, tIEEE1905ALNetworkTopologyNonIEEE1905NeighborParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tIOPSYS_IEEE1905ALNetworkTopologyParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{BBF_VENDOR_PREFIX"NonIEEE1905NeighborNumberOfEntries", &DMREAD, DMT_UNINT, get_IEEE1905ALNetworkTopology_NonIEEE1905NeighborNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.IEEE1905.AL.NetworkTopology.X_IOPSYS_EU_NonIEEE1905Neighbor.{i}. *** */
|
||||
DMLEAF tIEEE1905ALNetworkTopologyNonIEEE1905NeighborParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"NonIEEE1905NeighborId", &DMREAD, DMT_STRING, get_IEEE1905ALNetworkTopologyNonIEEE1905Neighbor, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
21
dmtree/vendor/iopsys/tr181/ieee1905.h
vendored
Normal file
21
dmtree/vendor/iopsys/tr181/ieee1905.h
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* 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_IEEE1905_H
|
||||
#define __IOPSYS_IEEE1905_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMOBJ tIOPSYS_IEEE1905ALNetworkTopologyObj[];
|
||||
extern DMLEAF tIOPSYS_IEEE1905ALNetworkTopologyParams[];
|
||||
extern DMLEAF tIEEE1905ALNetworkTopologyNonIEEE1905NeighborParams[];
|
||||
|
||||
#endif //__IOPSYS_IEEE1905_H
|
||||
60
dmtree/vendor/iopsys/tr181/times.c
vendored
Normal file
60
dmtree/vendor/iopsys/tr181/times.c
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* 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 "dmentry.h"
|
||||
#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);
|
||||
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);
|
||||
if (*iface == '\0' || strlen(iface) == 0)
|
||||
return 0;
|
||||
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", iface, value);
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_time_source_interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
char *iface = NULL;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
adm_entry_get_linker_value(ctx, value, &iface);
|
||||
if (iface == NULL || iface[0] == '\0')
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
adm_entry_get_linker_value(ctx, value, &iface);
|
||||
dmuci_set_value("system", "ntp", "interface", iface);
|
||||
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},
|
||||
{0}
|
||||
};
|
||||
19
dmtree/vendor/iopsys/tr181/times.h
vendored
Normal file
19
dmtree/vendor/iopsys/tr181/times.h
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* 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 <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMLEAF tIOPSYS_TimeParams[];
|
||||
|
||||
#endif //__IOPSYS_TIMES_H
|
||||
30
dmtree/vendor/iopsys/tr181/vendor.c
vendored
Normal file
30
dmtree/vendor/iopsys/tr181/vendor.c
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* 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 "device.h"
|
||||
#include "deviceinfo.h"
|
||||
#include "bridging.h"
|
||||
#include "ethernet.h"
|
||||
#include "ieee1905.h"
|
||||
#include "ip.h"
|
||||
#include "times.h"
|
||||
#include "vendor.h"
|
||||
|
||||
DM_MAP_OBJ tVendorExtensionIOPSYS[] = {
|
||||
/* parentobj, nextobject, parameter */
|
||||
{"Device.", tIOPSYS_DeviceObj, NULL},
|
||||
{"Device.DeviceInfo.", NULL, tIOPSYS_DeviceInfoParams},
|
||||
{"Device.Ethernet.VLANTermination.{i}.", NULL, tIOPSYS_EthernetVLANTerminationParams},
|
||||
{"Device.Time.", NULL, tIOPSYS_TimeParams},
|
||||
{"Device.IEEE1905.AL.NetworkTopology.", tIOPSYS_IEEE1905ALNetworkTopologyObj, tIOPSYS_IEEE1905ALNetworkTopologyParams},
|
||||
{"Device.Bridging.Bridge.{i}.Port.{i}.", NULL, tIOPSYS_BridgingBridgePortParams},
|
||||
{0}
|
||||
};
|
||||
19
dmtree/vendor/iopsys/tr181/vendor.h
vendored
Normal file
19
dmtree/vendor/iopsys/tr181/vendor.h
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* 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_VENDOR_H
|
||||
#define __IOPSYS_VENDOR_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DM_MAP_OBJ tVendorExtensionIOPSYS[];
|
||||
|
||||
#endif //__IOPSYS_VENDOR_H
|
||||
|
|
@ -10,7 +10,6 @@
|
|||
*/
|
||||
|
||||
#include "dmentry.h"
|
||||
#include "ethernet.h"
|
||||
#include "x_iopsys_eu_igmp.h"
|
||||
|
||||
static void get_mcast_iface_key(char *p_ifname, char *key, size_t key_size)
|
||||
|
|
@ -95,6 +94,28 @@ static void add_empty_mcast_iface_to_list(char *dmmap_package, char *dmmap_sec,
|
|||
}
|
||||
}
|
||||
|
||||
void get_mcast_bridge_port_linker(struct dmctx *ctx, char *intf_name, char **value)
|
||||
{
|
||||
struct uci_section *dmmap_br_section = NULL, *bridge_port_s = NULL;
|
||||
|
||||
*value = NULL;
|
||||
get_dmmap_section_of_config_section("dmmap_bridge", "bridge", intf_name, &dmmap_br_section);
|
||||
if (dmmap_br_section != NULL) {
|
||||
char *br_inst, *mg;
|
||||
dmuci_get_value_by_section_string(dmmap_br_section, "bridge_instance", &br_inst);
|
||||
uci_path_foreach_option_eq(bbfdm, "dmmap_bridge_port", "bridge_port", "br_inst", br_inst, bridge_port_s) {
|
||||
dmuci_get_value_by_section_string(bridge_port_s, "management", &mg);
|
||||
if (strcmp(mg, "1") == 0) {
|
||||
char *device, linker[512] = "";
|
||||
dmuci_get_value_by_section_string(bridge_port_s, "device", &device);
|
||||
snprintf(linker, sizeof(linker), "br_%s:%s+%s", br_inst, section_name(bridge_port_s), device);
|
||||
adm_entry_get_linker_param(ctx, "Device.Bridging.Bridge.", linker, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void synchronize_specific_config_sections_with_dmmap_mcast_iface(char *package, char *section_type,
|
||||
void *data, char *dmmap_package, char *dmmap_sec, char *proto,
|
||||
struct list_head *dup_list)
|
||||
|
|
@ -944,7 +965,7 @@ int get_mcast_snooping_interface(char *refparam, struct dmctx *ctx, void *data,
|
|||
DM_STRNCPY(sec_name, end, sizeof(sec_name));
|
||||
// In the dmmap_bridge file, the details related to the instance id etc. associated with this bridge
|
||||
// is stored, we now switch our focus to it to extract the necessary information.
|
||||
get_bridge_port_linker(ctx, sec_name, value);
|
||||
get_mcast_bridge_port_linker(ctx, sec_name, value);
|
||||
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
|
|
@ -1823,7 +1844,7 @@ static int get_igmpp_interface_iface(char *refparam, struct dmctx *ctx, void *da
|
|||
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", sec_name, value);
|
||||
} else {
|
||||
// It is a L2 bridge, get the linker accordingly
|
||||
get_bridge_port_linker(ctx, sec_name, value);
|
||||
get_mcast_bridge_port_linker(ctx, sec_name, value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -1980,11 +2001,14 @@ int set_mcastp_iface_snoop_mode(char *refparam, struct dmctx *ctx, void *data, c
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
/* ***Device.X_IOPSYS_EU_IGMP. *** */
|
||||
DMOBJ X_IOPSYS_EU_IGMPObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Snooping", &DMWRITE, add_igmp_snooping_obj, del_igmp_snooping_obj, NULL, browse_igmp_snooping_inst, NULL, X_IOPSYS_EU_IGMPSnoopingObj, X_IOPSYS_EU_IGMPSnoopingParams, NULL, BBFDM_BOTH},
|
||||
{"Proxy", &DMWRITE, add_igmp_proxy_obj, del_igmp_proxy_obj, NULL, browse_igmp_proxy_inst, NULL, X_IOPSYS_EU_IGMPProxyObj, X_IOPSYS_EU_IGMPProxyParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Snooping", &DMWRITE, add_igmp_snooping_obj, del_igmp_snooping_obj, NULL, browse_igmp_snooping_inst, NULL, NULL, X_IOPSYS_EU_IGMPSnoopingObj, X_IOPSYS_EU_IGMPSnoopingParams, NULL, BBFDM_BOTH},
|
||||
{"Proxy", &DMWRITE, add_igmp_proxy_obj, del_igmp_proxy_obj, NULL, browse_igmp_proxy_inst, NULL, NULL, X_IOPSYS_EU_IGMPProxyObj, X_IOPSYS_EU_IGMPProxyParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -1995,14 +2019,14 @@ DMLEAF X_IOPSYS_EU_IGMPParams[] = {
|
|||
};
|
||||
|
||||
DMOBJ X_IOPSYS_EU_IGMPSnoopingObj[] = {
|
||||
{"ClientGroup", &DMREAD, NULL, NULL, NULL, browse_igmp_cgrp_inst, NULL, IGMPSnoopingCLientGroupObj, IGMPSnoopingClientGroupParams, NULL, BBFDM_BOTH},
|
||||
{"Filter", &DMWRITE, add_igmps_filter_obj, del_mcasts_filter_obj, NULL, browse_igmps_filter_inst, NULL, NULL, IGMPSnoopingFilterParams, NULL, BBFDM_BOTH},
|
||||
{"ClientGroup", &DMREAD, NULL, NULL, NULL, browse_igmp_cgrp_inst, NULL, NULL, IGMPSnoopingCLientGroupObj, IGMPSnoopingClientGroupParams, NULL, BBFDM_BOTH},
|
||||
{"Filter", &DMWRITE, add_igmps_filter_obj, del_mcasts_filter_obj, NULL, browse_igmps_filter_inst, NULL, NULL, NULL, IGMPSnoopingFilterParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMOBJ IGMPSnoopingCLientGroupObj[] = {
|
||||
{"AssociatedDevice", &DMREAD, NULL, NULL, NULL, browse_igmp_cgrp_assoc_dev_inst, NULL, NULL, IGMPSnoopingClientGroupAssociatedDeviceParams, NULL, BBFDM_BOTH},
|
||||
//{"ClientGroupStats", &DMREAD, NULL, NULL, NULL, browse_igmps_cgrp_stats_inst, NULL, NULL, NULL, IGMPSnoopingClientGroupStatsParams, NULL, BBFDM_BOTH},
|
||||
{"AssociatedDevice", &DMREAD, NULL, NULL, NULL, browse_igmp_cgrp_assoc_dev_inst, NULL, NULL, NULL, IGMPSnoopingClientGroupAssociatedDeviceParams, NULL, BBFDM_BOTH},
|
||||
//{"ClientGroupStats", &DMREAD, NULL, NULL, NULL, browse_igmps_cgrp_stats_inst, NULL, NULL, NULL, NULL, IGMPSnoopingClientGroupStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -2050,15 +2074,15 @@ DMLEAF X_IOPSYS_EU_IGMPSnoopingParams[] = {
|
|||
};
|
||||
|
||||
DMOBJ X_IOPSYS_EU_IGMPProxyObj[] = {
|
||||
{"Interface", &DMWRITE, add_igmpp_interface_obj, del_igmpp_interface_obj, NULL, browse_igmpp_interface_inst, NULL, NULL, IGMPProxyInterfaceParams, NULL, BBFDM_BOTH},
|
||||
{"ClientGroup", &DMREAD, NULL, NULL, NULL, browse_igmp_cgrp_inst, NULL, IGMPProxyCLientGroupObj, IGMPProxyClientGroupParams, NULL, BBFDM_BOTH},
|
||||
{"Filter", &DMWRITE, add_igmpp_filter_obj, del_mcastp_filter_obj, NULL, browse_igmpp_filter_inst, NULL, NULL, IGMPProxyFilterParams, NULL, BBFDM_BOTH},
|
||||
{"Interface", &DMWRITE, add_igmpp_interface_obj, del_igmpp_interface_obj, NULL, browse_igmpp_interface_inst, NULL, NULL, NULL, IGMPProxyInterfaceParams, NULL, BBFDM_BOTH},
|
||||
{"ClientGroup", &DMREAD, NULL, NULL, NULL, browse_igmp_cgrp_inst, NULL, NULL, IGMPProxyCLientGroupObj, IGMPProxyClientGroupParams, NULL, BBFDM_BOTH},
|
||||
{"Filter", &DMWRITE, add_igmpp_filter_obj, del_mcastp_filter_obj, NULL, browse_igmpp_filter_inst, NULL, NULL, NULL, IGMPProxyFilterParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMOBJ IGMPProxyCLientGroupObj[] = {
|
||||
{"AssociatedDevice", &DMREAD, NULL, NULL, NULL, browse_igmp_cgrp_assoc_dev_inst, NULL, NULL, IGMPProxyClientGroupAssociatedDeviceParams, NULL, BBFDM_BOTH},
|
||||
//{"ClientGroupStats", &DMREAD, NULL, NULL, NULL, browse_igmpp_cgrp_stats_inst, NULL, NULL, IGMPProxyClientGroupStatsParams, NULL, BBFDM_BOTH},
|
||||
{"AssociatedDevice", &DMREAD, NULL, NULL, NULL, browse_igmp_cgrp_assoc_dev_inst, NULL, NULL, NULL, IGMPProxyClientGroupAssociatedDeviceParams, NULL, BBFDM_BOTH},
|
||||
//{"ClientGroupStats", &DMREAD, NULL, NULL, NULL, browse_igmpp_cgrp_stats_inst, NULL, NULL, NULL, IGMPProxyClientGroupStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -9,8 +9,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef __SE_IGMP_H
|
||||
#define __SE_IGMP_H
|
||||
#ifndef __IOPSYS_IGMP_H
|
||||
#define __IOPSYS_IGMP_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
|
|
@ -84,6 +84,7 @@ void update_snooping_mode(struct uci_section *s);
|
|||
int get_mcast_snooping_interface_val(char *value, char *ifname, size_t s_ifname);
|
||||
int del_proxy_obj(void *data, char *proto, unsigned char del_action);
|
||||
int del_snooping_obj(void *data, char *proto, unsigned char del_action);
|
||||
void get_mcast_bridge_port_linker(struct dmctx *ctx, char *intf_name, char **value);
|
||||
int browse_proxy_interface_inst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *proto);
|
||||
int browse_filter_inst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *section_type,
|
||||
char *option_name, char *option_value);
|
||||
|
|
@ -94,4 +95,4 @@ void synchronize_specific_config_sections_with_dmmap_mcast_filter(char *package,
|
|||
void *data, char *dmmap_package, char *dmmap_sec, char *proto,
|
||||
struct list_head *dup_list);
|
||||
|
||||
#endif
|
||||
#endif //__IOPSYS_IGMP_H
|
||||
|
|
@ -10,7 +10,6 @@
|
|||
*/
|
||||
|
||||
#include "dmentry.h"
|
||||
#include "ethernet.h"
|
||||
#include "x_iopsys_eu_mld.h"
|
||||
#include "x_iopsys_eu_igmp.h"
|
||||
|
||||
|
|
@ -579,7 +578,7 @@ static int get_mldp_interface_iface(char *refparam, struct dmctx *ctx, void *dat
|
|||
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", sec_name, value);
|
||||
} else {
|
||||
// It is a L2 bridge, get the linker accordingly
|
||||
get_bridge_port_linker(ctx, sec_name, value);
|
||||
get_mcast_bridge_port_linker(ctx, sec_name, value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -641,11 +640,14 @@ static int set_mldp_interface_upstream(char *refparam, struct dmctx *ctx, void *
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
/* ***Device.X_IOPSYS_EU_MLD. *** */
|
||||
DMOBJ X_IOPSYS_EU_MLDObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Snooping", &DMWRITE, add_mld_snooping_obj, del_mld_snooping_obj, NULL, browse_mld_snooping_inst, NULL, X_IOPSYS_EU_MLDSnoopingObj, X_IOPSYS_EU_MLDSnoopingParams, NULL, BBFDM_BOTH},
|
||||
{"Proxy", &DMWRITE, add_mld_proxy_obj, del_mld_proxy_obj, NULL, browse_mld_proxy_inst, NULL, X_IOPSYS_EU_MLDProxyObj, X_IOPSYS_EU_MLDProxyParams, NULL, BBFDM_BOTH},
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Snooping", &DMWRITE, add_mld_snooping_obj, del_mld_snooping_obj, NULL, browse_mld_snooping_inst, NULL, NULL, X_IOPSYS_EU_MLDSnoopingObj, X_IOPSYS_EU_MLDSnoopingParams, NULL, BBFDM_BOTH},
|
||||
{"Proxy", &DMWRITE, add_mld_proxy_obj, del_mld_proxy_obj, NULL, browse_mld_proxy_inst, NULL, NULL, X_IOPSYS_EU_MLDProxyObj, X_IOPSYS_EU_MLDProxyParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -656,14 +658,14 @@ DMLEAF X_IOPSYS_EU_MLDParams[] = {
|
|||
};
|
||||
|
||||
DMOBJ X_IOPSYS_EU_MLDSnoopingObj[] = {
|
||||
//{"ClientGroup", &DMREAD, NULL, NULL, NULL, browse_mlds_cgrp_inst, NULL, NULL, MLDSnoopingCLientGroupObj, MLDSnoopingClientGroupParams, NULL, BBFDM_BOTH},
|
||||
{"Filter", &DMWRITE, add_mlds_filter_obj, del_mcasts_filter_obj, NULL, browse_mlds_filter_inst, NULL, NULL, MLDSnoopingFilterParams, NULL, BBFDM_BOTH},
|
||||
//{"ClientGroup", &DMREAD, NULL, NULL, NULL, browse_mlds_cgrp_inst, NULL, NULL, NULL, MLDSnoopingCLientGroupObj, MLDSnoopingClientGroupParams, NULL, BBFDM_BOTH},
|
||||
{"Filter", &DMWRITE, add_mlds_filter_obj, del_mcasts_filter_obj, NULL, browse_mlds_filter_inst, NULL, NULL, NULL, MLDSnoopingFilterParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMOBJ MLDSnoopingCLientGroupObj[] = {
|
||||
//{"AssociatedDevice", &DMREAD, NULL, NULL, NULL, browse_mlds_cgrp_assoc_dev_inst, NULL, NULL, MLDSnoopingClientGroupAssociatedDeviceParams, NULL, BBFDM_BOTH},
|
||||
//{"ClientGroupStats", &DMREAD, NULL, NULL, NULL, browse_mlds_cgrp_stats_inst, NULL, NULL, MLDSnoopingClientGroupStatsParams, NULL, BBFDM_BOTH},
|
||||
//{"AssociatedDevice", &DMREAD, NULL, NULL, NULL, browse_mlds_cgrp_assoc_dev_inst, NULL, NULL, NULL, MLDSnoopingClientGroupAssociatedDeviceParams, NULL, BBFDM_BOTH},
|
||||
//{"ClientGroupStats", &DMREAD, NULL, NULL, NULL, browse_mlds_cgrp_stats_inst, NULL, NULL, NULL, MLDSnoopingClientGroupStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -709,15 +711,15 @@ DMLEAF X_IOPSYS_EU_MLDSnoopingParams[] = {
|
|||
};
|
||||
|
||||
DMOBJ X_IOPSYS_EU_MLDProxyObj[] = {
|
||||
{"Interface", &DMWRITE, add_mldp_interface_obj, del_mldp_interface_obj, NULL, browse_mldp_interface_inst, NULL, NULL, MLDProxyInterfaceParams, NULL, BBFDM_BOTH},
|
||||
//{"ClientGroup", &DMREAD, NULL, NULL, NULL, browse_mldp_cgrp_inst, NULL, MLDProxyCLientGroupObj, MLDProxyClientGroupParams, NULL, BBFDM_BOTH},
|
||||
{"Filter", &DMWRITE, add_mldp_filter_obj, del_mcastp_filter_obj, NULL, browse_mldp_filter_inst, NULL, NULL, MLDProxyFilterParams, NULL, BBFDM_BOTH},
|
||||
{"Interface", &DMWRITE, add_mldp_interface_obj, del_mldp_interface_obj, NULL, browse_mldp_interface_inst, NULL, NULL, NULL, MLDProxyInterfaceParams, NULL, BBFDM_BOTH},
|
||||
//{"ClientGroup", &DMREAD, NULL, NULL, NULL, browse_mldp_cgrp_inst, NULL, NULL, MLDProxyCLientGroupObj, MLDProxyClientGroupParams, NULL, BBFDM_BOTH},
|
||||
{"Filter", &DMWRITE, add_mldp_filter_obj, del_mcastp_filter_obj, NULL, browse_mldp_filter_inst, NULL, NULL, NULL, MLDProxyFilterParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMOBJ MLDProxyCLientGroupObj[] = {
|
||||
//{"AssociatedDevice", &DMREAD, NULL, NULL, NULL, browse_mldp_cgrp_assoc_dev_inst, NULL, NULL, MLDProxyClientGroupAssociatedDeviceParams, NULL, BBFDM_BOTH},
|
||||
//{"ClientGroupStats", &DMREAD, NULL, NULL, NULL, browse_mldp_cgrp_stats_inst, NULL, NULL, MLDProxyClientGroupStatsParams, NULL, BBFDM_BOTH},
|
||||
//{"AssociatedDevice", &DMREAD, NULL, NULL, NULL, browse_mldp_cgrp_assoc_dev_inst, NULL, NULL, NULL, MLDProxyClientGroupAssociatedDeviceParams, NULL, BBFDM_BOTH},
|
||||
//{"ClientGroupStats", &DMREAD, NULL, NULL, NULL, browse_mldp_cgrp_stats_inst, NULL, NULL, NULL, MLDProxyClientGroupStatsParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -9,8 +9,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef __SE_MLD_H
|
||||
#define __SE_MLD_H
|
||||
#ifndef __IOPSYS_MLD_H
|
||||
#define __IOPSYS_MLD_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
|
|
@ -33,4 +33,5 @@ extern DMLEAF MLDProxyClientGroupParams[];
|
|||
extern DMLEAF MLDProxyClientGroupStatsParams[];
|
||||
extern DMLEAF MLDProxyClientGroupAssociatedDeviceParams[];
|
||||
extern DMLEAF MLDProxyFilterParams[];
|
||||
#endif
|
||||
|
||||
#endif //__IOPSYS_MLD_H
|
||||
95
dmtree/vendor/openwrt/tr181/deviceinfo.c
vendored
Normal file
95
dmtree/vendor/openwrt/tr181/deviceinfo.c
vendored
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
#include "deviceinfo.h"
|
||||
|
||||
static char *get_uci_deviceinfo(char *opt)
|
||||
{
|
||||
char *v;
|
||||
|
||||
dmuci_get_option_value_string("cwmp", "@deviceinfo[0]", opt, &v);
|
||||
return v;
|
||||
}
|
||||
|
||||
static int openwrt__get_device_manufacturer(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("Manufacturer");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_device_manufactureroui(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("ManufacturerOUI");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_device_productclass(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("ProductClass");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_device_serialnumber(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("SerialNumber");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_device_softwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("SoftwareVersion");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_device_hardwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("HardwareVersion");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_device_devicecategory(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("DeviceCategory");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_device_additionalhardwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("AdditionalHardwareVersion");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_device_additionalsoftwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("AdditionalSoftwareVersion");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_device_modelname(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("ModelName");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_device_description(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("Description");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
/* *** Device.DeviceInfo. *** */
|
||||
DMLEAF tOPENWRT_DeviceInfoParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"DeviceCategory", &DMREAD, DMT_STRING, openwrt__get_device_devicecategory, NULL, BBFDM_BOTH},
|
||||
{"Manufacturer", &DMREAD, DMT_STRING, openwrt__get_device_manufacturer, NULL, BBFDM_BOTH},
|
||||
{"ManufacturerOUI", &DMREAD, DMT_STRING, openwrt__get_device_manufactureroui, NULL, BBFDM_BOTH},
|
||||
{"ModelName", &DMREAD, DMT_STRING, openwrt__get_device_modelname, NULL, BBFDM_BOTH},
|
||||
{"Description", &DMREAD, DMT_STRING, openwrt__get_device_description, NULL, BBFDM_BOTH},
|
||||
{"ProductClass", &DMREAD, DMT_STRING, openwrt__get_device_productclass, NULL, BBFDM_BOTH},
|
||||
{"SerialNumber", &DMREAD, DMT_STRING, openwrt__get_device_serialnumber, NULL, BBFDM_BOTH},
|
||||
{"HardwareVersion", &DMREAD, DMT_STRING, openwrt__get_device_hardwareversion, NULL, BBFDM_BOTH},
|
||||
{"SoftwareVersion", &DMREAD, DMT_STRING, openwrt__get_device_softwareversion, NULL, BBFDM_BOTH},
|
||||
{"AdditionalHardwareVersion", &DMREAD, DMT_STRING, openwrt__get_device_additionalhardwareversion, NULL, BBFDM_BOTH},
|
||||
{"AdditionalSoftwareVersion", &DMREAD, DMT_STRING, openwrt__get_device_additionalsoftwareversion, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
8
dmtree/vendor/openwrt/tr181/deviceinfo.h
vendored
Normal file
8
dmtree/vendor/openwrt/tr181/deviceinfo.h
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef __OPENWRT_DEVICEINFO_H
|
||||
#define __OPENWRT_DEVICEINFO_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMLEAF tOPENWRT_DeviceInfoParams[];
|
||||
|
||||
#endif //__OPENWRT_DEVICEINFO_H
|
||||
564
dmtree/vendor/openwrt/tr181/qos.c
vendored
Normal file
564
dmtree/vendor/openwrt/tr181/qos.c
vendored
Normal file
|
|
@ -0,0 +1,564 @@
|
|||
/*
|
||||
* 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: Omar Kallel <omar.kallel@pivasoftware.com>
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*/
|
||||
|
||||
#include "qos.h"
|
||||
|
||||
struct queuestats
|
||||
{
|
||||
struct uci_section *dmsect;
|
||||
char dev[50];
|
||||
char user[50];
|
||||
char priomap[50];
|
||||
int noqueue;
|
||||
int pfifo_fast;
|
||||
int refcnt;
|
||||
int bands;
|
||||
int bytes_sent;
|
||||
int pkt_sent;
|
||||
int pkt_dropped;
|
||||
int pkt_overlimits;
|
||||
int pkt_requeues;
|
||||
int backlog_b;
|
||||
int backlog_p;
|
||||
int backlog_requeues;
|
||||
};
|
||||
|
||||
/**************************************************************************
|
||||
* Browse functions
|
||||
***************************************************************************/
|
||||
/*#Device.QoS.Classification.{i}.!UCI:qos/classify/dmmap_qos*/
|
||||
static int openwrt__browseQoSClassificationInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
char *inst = NULL, *max_inst = NULL;
|
||||
struct dmmap_dup *p = NULL;
|
||||
LIST_HEAD(dup_list);
|
||||
|
||||
synchronize_specific_config_sections_with_dmmap("qos", "classify", "dmmap_qos", &dup_list);
|
||||
list_for_each_entry(p, &dup_list, list) {
|
||||
|
||||
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_alias, 3,
|
||||
p->dmmap_section, "classifinstance", "classifalias");
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)p, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
free_dmmap_config_dup_list(&dup_list);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct uci_section *get_dup_qstats_section_in_dmmap(char *dmmap_package, char *section_type, char *dev)
|
||||
{
|
||||
struct uci_section *s = NULL;
|
||||
|
||||
uci_path_foreach_option_eq(bbfdm, dmmap_package, section_type, "dev_link", dev, s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int openwrt__browseQoSQueueStatsInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
struct uci_section *dmmap_sect;
|
||||
char *questatsout[256], *inst = NULL, *max_inst = NULL, *lastinstancestore = NULL, dev[50] = "", user[50] = "";
|
||||
static int length = 0, i, ret = 0;
|
||||
struct queuestats queuests = {0}, emptyquestats = {0};
|
||||
regex_t regex1 = {}, regex2 = {};
|
||||
|
||||
regcomp(®ex1, "^qdisc noqueue [0-9]*: dev [[:alnum:]]* [[:alnum:]]* refcnt [0-9]*", 0);
|
||||
regcomp(®ex2, "^qdisc pfifo_fast [0-9]*: dev [[:alnum:]]* [[:alnum:]]* refcnt [0-9]*", 0);
|
||||
|
||||
command_exec_output_to_array("tc -s qdisc", questatsout, &length);
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
switch (i%3) {
|
||||
case 0: ret = regexec(®ex1, questatsout[i], 0, NULL, 0);
|
||||
if (ret == 0)
|
||||
sscanf(questatsout[i], "qdisc noqueue %d: dev %49s %49s refcnt %d\n", &queuests.noqueue, dev, user, &queuests.refcnt);
|
||||
else {
|
||||
ret= regexec(®ex2, questatsout[i], 0, NULL, 0);
|
||||
if (ret == 0)
|
||||
sscanf(questatsout[i], "qdisc pfifo_fast %d: dev %49s %49s refcnt %d\n", &queuests.pfifo_fast, dev, user, &queuests.refcnt);
|
||||
}
|
||||
DM_STRNCPY(queuests.dev, dev, sizeof(queuests.dev));
|
||||
break;
|
||||
case 1: sscanf(questatsout[i], " Sent %d bytes %d pkt (dropped %d, overlimits %d requeues %d)\n", &queuests.bytes_sent, &queuests.pkt_sent, &queuests.pkt_dropped, &queuests.pkt_overlimits, &queuests.pkt_requeues);
|
||||
break;
|
||||
case 2: sscanf(questatsout[i], " backlog %db %dp requeues %d\n", &queuests.backlog_b, &queuests.backlog_p, &queuests.backlog_requeues);
|
||||
if ((dmmap_sect = get_dup_qstats_section_in_dmmap("dmmap_qos", "qqueue_stats", queuests.dev)) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_qos", "qqueue_stats", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "dev_link", queuests.dev);
|
||||
}
|
||||
|
||||
queuests.dmsect= dmmap_sect;
|
||||
|
||||
if (lastinstancestore != NULL && max_inst != NULL)
|
||||
max_inst = dmstrdup(lastinstancestore);
|
||||
|
||||
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_alias, 3,
|
||||
dmmap_sect, "queuestatsinstance", "queuestatsalias");
|
||||
|
||||
lastinstancestore = dmstrdup(max_inst);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&queuests, inst) == DM_STOP)
|
||||
goto end;
|
||||
|
||||
queuests = emptyquestats;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
regfree(®ex1);
|
||||
regfree(®ex2);
|
||||
end:
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__addObjQoSClassification(char *refparam, struct dmctx *ctx, void *data, char **instance)
|
||||
{
|
||||
struct uci_section *s, *dmmap_qclassify;
|
||||
char qcomment[32];
|
||||
|
||||
char *last_inst = get_last_instance_bbfdm("dmmap_qos", "classify", "classifinstance");
|
||||
snprintf(qcomment, sizeof(qcomment), "QoS classify %s", (last_inst) ? last_inst : "1");
|
||||
|
||||
dmuci_add_section("qos", "classify", &s);
|
||||
dmuci_set_value_by_section(s, "comment", qcomment);
|
||||
|
||||
dmuci_add_section_bbfdm("dmmap_qos", "classify", &dmmap_qclassify);
|
||||
dmuci_set_value_by_section(dmmap_qclassify, "section_name", section_name(s));
|
||||
*instance = update_instance(last_inst, 2, dmmap_qclassify, "classifinstance");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__delObjQoSClassification(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action)
|
||||
{
|
||||
struct dmmap_dup *p = (struct dmmap_dup*)data;
|
||||
struct uci_section *s = NULL, *stmp = NULL, *dmmap_section = NULL;
|
||||
|
||||
switch (del_action) {
|
||||
case DEL_INST:
|
||||
if(is_section_unnamed(section_name(p->config_section))){
|
||||
LIST_HEAD(dup_list);
|
||||
delete_sections_save_next_sections("dmmap_qos", "classify", "classifinstance", section_name(p->config_section), atoi(instance), &dup_list);
|
||||
update_dmmap_sections(&dup_list, "classifinstance", "dmmap_qos", "classify");
|
||||
dmuci_delete_by_section_unnamed(p->config_section, NULL, NULL);
|
||||
} else {
|
||||
get_dmmap_section_of_config_section("dmmap_qos", "classify", section_name(p->config_section), &dmmap_section);
|
||||
dmuci_delete_by_section_unnamed_bbfdm(dmmap_section, NULL, NULL);
|
||||
|
||||
dmuci_delete_by_section(p->config_section, NULL, NULL);
|
||||
}
|
||||
break;
|
||||
case DEL_ALL:
|
||||
uci_foreach_sections_safe("qos", "classify", stmp, s) {
|
||||
get_dmmap_section_of_config_section("dmmap_qos", "classify", section_name(s), &dmmap_section);
|
||||
dmuci_delete_by_section(dmmap_section, NULL, NULL);
|
||||
|
||||
dmuci_delete_by_section(s, NULL, NULL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__addObjQoSQueueStats(char *refparam, struct dmctx *ctx, void *data, char **instance)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__delObjQoSQueueStats(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.QoS.ClassificationNumberOfEntries!UCI:qos/classify/*/
|
||||
static int openwrt__get_QClassificationNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct uci_section *s = NULL;
|
||||
static int nbre= 0;
|
||||
|
||||
uci_foreach_sections("qos", "classify", s) {
|
||||
nbre++;
|
||||
}
|
||||
|
||||
dmasprintf(value, "%d", nbre);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_QQueueStatsNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *questatsout[256];
|
||||
static int length = 0;
|
||||
|
||||
command_exec_output_to_array("tc -s qdisc", questatsout, &length);
|
||||
dmasprintf(value, "%d", length/3);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_QoSClassification_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
dmuci_get_value_by_section_string(p->dmmap_section, "classifalias", value);
|
||||
if ((*value)[0] == '\0')
|
||||
dmasprintf(value, "cpe-%s", instance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__set_QoSClassification_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 64, NULL, NULL))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(p->dmmap_section, "classifalias", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_QoSClassification_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct dmmap_dup *p = (struct dmmap_dup *)data;
|
||||
struct uci_section *s = NULL;
|
||||
char *classes = NULL, **classesarr = NULL, *classgroup = NULL, *ifaceclassgrp = NULL, *targetclass = NULL;
|
||||
size_t length;
|
||||
|
||||
dmuci_get_value_by_section_string(p->config_section, "target", &targetclass);
|
||||
uci_foreach_sections("qos", "classgroup", s) {
|
||||
dmuci_get_value_by_section_string(s, "classes", &classes);
|
||||
classesarr = strsplit(classes, " ", &length);
|
||||
if (classes != NULL && elt_exists_in_array(classesarr, targetclass, length)) {
|
||||
dmasprintf(&classgroup, "%s", section_name(s));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (classgroup == NULL)
|
||||
return 0;
|
||||
uci_foreach_sections("qos", "interface", s) {
|
||||
dmuci_get_value_by_section_string(s, "classgroup", &ifaceclassgrp);
|
||||
if (ifaceclassgrp != NULL && strcmp(ifaceclassgrp, classgroup) == 0) {
|
||||
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", section_name(s), value);
|
||||
if (*value == NULL)
|
||||
adm_entry_get_linker_param(ctx, "Device.PPP.Interface.", section_name(s), value);
|
||||
if (*value == NULL)
|
||||
adm_entry_get_linker_param(ctx, "Device.Ethernet.Interface.", section_name(s), value);
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__set_QoSClassification_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 256, NULL, NULL))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.QoS.Classification.{i}.DestIP!UCI:qos/classify,@i-1/dsthost*/
|
||||
static int openwrt__get_QoSClassification_DestIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
dmuci_get_value_by_section_string(p->config_section, "dsthost", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__set_QoSClassification_DestIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 45, NULL, IPAddress))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(p->config_section, "dsthost", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*#Device.QoS.Classification.{i}.SourceIP!UCI:qos/classify,@i-1/srchost*/
|
||||
static int openwrt__get_QoSClassification_SourceIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
dmuci_get_value_by_section_string(p->config_section, "srchost", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__set_QoSClassification_SourceIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 45, NULL, IPAddress))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(p->config_section, "srchost", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.QoS.Classification.{i}.Protocol!UCI:qos/classify,@i-1/proto*/
|
||||
static int openwrt__get_QoSClassification_Protocol(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
dmuci_get_value_by_section_string(p->config_section, "proto", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__set_QoSClassification_Protocol(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","255"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(p->config_section, "proto", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.QoS.Classification.{i}.DestPort!UCI:qos/classify,@i-1/dstports*/
|
||||
static int openwrt__get_QoSClassification_DestPort(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
dmuci_get_value_by_section_string(p->config_section, "dstports", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__set_QoSClassification_DestPort(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(p->config_section, "dstports", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.QoS.Classification.{i}.DestPortRangeMax!UCI:qos/classify,@i-1/portrange*/
|
||||
static int openwrt__get_QoSClassification_DestPortRangeMax(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
dmuci_get_value_by_section_string(p->config_section, "portrange", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__set_QoSClassification_DestPortRangeMax(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(p->config_section, "portrange", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.QoS.Classification.{i}.SourcePort!UCI:qos/classify,@i-1/srcports*/
|
||||
static int openwrt__get_QoSClassification_SourcePort(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct dmmap_dup *p = (struct dmmap_dup*)data;
|
||||
dmuci_get_value_by_section_string(p->config_section, "srcports", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__set_QoSClassification_SourcePort(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(p->config_section, "srcports", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.QoS.Classification.{i}.DSCPMark!UCI:qos/classify,@i-1/dscp*/
|
||||
static int openwrt__get_QoSClassification_DSCPMark(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct dmmap_dup *p = (struct dmmap_dup *)data;
|
||||
dmuci_get_value_by_section_string(p->config_section, "dscp", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__set_QoSClassification_DSCPMark(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct dmmap_dup *p= (struct dmmap_dup *)data;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(p->config_section, "dscp", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_QoSQueueStats_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct queuestats *qts= (struct queuestats*)data;
|
||||
dmuci_get_value_by_section_string(qts->dmsect, "queuestatsalias", value);
|
||||
if ((*value)[0] == '\0')
|
||||
dmasprintf(value, "cpe-%s", instance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__set_QoSQueueStats_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct queuestats *qts= (struct queuestats*)data;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 64, NULL, NULL))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(qts->dmsect, "queuestatsalias", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_QoSQueueStats_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct queuestats *qts = (struct queuestats*)data;
|
||||
|
||||
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", qts->dev, value);
|
||||
if (*value == NULL)
|
||||
adm_entry_get_linker_param(ctx, "Device.PPP.Interface.", qts->dev, value);
|
||||
if (*value == NULL)
|
||||
adm_entry_get_linker_param(ctx, "Device.Ethernet.Interface.", qts->dev, value);
|
||||
if (*value == NULL)
|
||||
adm_entry_get_linker_param(ctx, "Device.WiFi.Radio.", qts->dev, value);
|
||||
if (*value == NULL)
|
||||
*value = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__set_QoSQueueStats_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 256, NULL, NULL))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_QoSQueueStats_OutputPackets(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct queuestats *queuests = (struct queuestats*)data;
|
||||
dmasprintf(value, "%d", queuests->pkt_sent);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_QoSQueueStats_OutputBytes(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct queuestats *queuests = (struct queuestats*)data;
|
||||
dmasprintf(value, "%d", queuests->bytes_sent);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int openwrt__get_QoSQueueStats_DroppedPackets(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct queuestats *queuests = (struct queuestats*)data;
|
||||
dmasprintf(value, "%d", queuests->pkt_dropped);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
/* *** Device.QoS. *** */
|
||||
DMOBJ tOPENWRT_QoSObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"Classification", &DMWRITE, openwrt__addObjQoSClassification, openwrt__delObjQoSClassification, NULL, openwrt__browseQoSClassificationInst, NULL, NULL, NULL, tOPENWRT_QoSClassificationParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
|
||||
{"QueueStats", &DMWRITE, openwrt__addObjQoSQueueStats, openwrt__delObjQoSQueueStats, NULL, openwrt__browseQoSQueueStatsInst, NULL, NULL, NULL, tOPENWRT_QoSQueueStatsParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "Queue", "Interface", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tOPENWRT_QoSParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"ClassificationNumberOfEntries", &DMREAD, DMT_UNINT, openwrt__get_QClassificationNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{"QueueStatsNumberOfEntries", &DMREAD, DMT_UNINT, openwrt__get_QQueueStatsNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.QoS.Classification.{i}. *** */
|
||||
DMLEAF tOPENWRT_QoSClassificationParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"Alias", &DMWRITE, DMT_STRING, openwrt__get_QoSClassification_Alias, openwrt__set_QoSClassification_Alias, BBFDM_BOTH},
|
||||
{"Interface", &DMWRITE, DMT_STRING, openwrt__get_QoSClassification_Interface, openwrt__set_QoSClassification_Interface, BBFDM_BOTH},
|
||||
{"DestIP", &DMWRITE, DMT_STRING, openwrt__get_QoSClassification_DestIP, openwrt__set_QoSClassification_DestIP, BBFDM_BOTH},
|
||||
{"SourceIP", &DMWRITE, DMT_STRING, openwrt__get_QoSClassification_SourceIP, openwrt__set_QoSClassification_SourceIP, BBFDM_BOTH},
|
||||
{"Protocol", &DMWRITE, DMT_INT, openwrt__get_QoSClassification_Protocol, openwrt__set_QoSClassification_Protocol, BBFDM_BOTH},
|
||||
{"DestPort", &DMWRITE, DMT_INT, openwrt__get_QoSClassification_DestPort, openwrt__set_QoSClassification_DestPort, BBFDM_BOTH},
|
||||
{"DestPortRangeMax", &DMWRITE, DMT_INT, openwrt__get_QoSClassification_DestPortRangeMax, openwrt__set_QoSClassification_DestPortRangeMax, BBFDM_BOTH},
|
||||
{"SourcePort", &DMWRITE, DMT_INT, openwrt__get_QoSClassification_SourcePort, openwrt__set_QoSClassification_SourcePort, BBFDM_BOTH},
|
||||
{"DSCPMark", &DMWRITE, DMT_INT, openwrt__get_QoSClassification_DSCPMark, openwrt__set_QoSClassification_DSCPMark, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.QoS.QueueStats.{i}. *** */
|
||||
DMLEAF tOPENWRT_QoSQueueStatsParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"Alias", &DMWRITE, DMT_STRING, openwrt__get_QoSQueueStats_Alias, openwrt__set_QoSQueueStats_Alias, BBFDM_BOTH},
|
||||
{"Interface", &DMWRITE, DMT_STRING, openwrt__get_QoSQueueStats_Interface, openwrt__set_QoSQueueStats_Interface, BBFDM_BOTH},
|
||||
{"OutputPackets", &DMREAD, DMT_UNINT, openwrt__get_QoSQueueStats_OutputPackets, NULL, BBFDM_BOTH},
|
||||
{"OutputBytes", &DMREAD, DMT_UNINT, openwrt__get_QoSQueueStats_OutputBytes, NULL, BBFDM_BOTH},
|
||||
{"DroppedPackets", &DMREAD, DMT_UNINT, openwrt__get_QoSQueueStats_DroppedPackets, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
23
dmtree/vendor/openwrt/tr181/qos.h
vendored
Normal file
23
dmtree/vendor/openwrt/tr181/qos.h
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* 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: Omar Kallel <omar.kallel@pivasoftware.com>
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*/
|
||||
|
||||
#ifndef __OPENWRT_QOS_H
|
||||
#define __OPENWRT_QOS_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMOBJ tOPENWRT_QoSObj[];
|
||||
extern DMLEAF tOPENWRT_QoSParams[];
|
||||
extern DMLEAF tOPENWRT_QoSClassificationParams[];
|
||||
extern DMLEAF tOPENWRT_QoSQueueStatsParams[];
|
||||
|
||||
#endif //__OPENWRT_QOS_H
|
||||
|
||||
91
dmtree/vendor/openwrt/tr181/vendor.c
vendored
Normal file
91
dmtree/vendor/openwrt/tr181/vendor.c
vendored
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* 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 "deviceinfo.h"
|
||||
#include "qos.h"
|
||||
#include "vendor.h"
|
||||
|
||||
DM_MAP_OBJ tVendorExtensionOverwriteOPENWRT[] = {
|
||||
/* parentobj, nextobject, parameter */
|
||||
{"Device.DeviceInfo.", NULL, tOPENWRT_DeviceInfoParams},
|
||||
{"Device.QoS.", tOPENWRT_QoSObj, tOPENWRT_QoSParams},
|
||||
{0}
|
||||
};
|
||||
|
||||
char *VendorExtensionExcludeOPENWRT[] = {
|
||||
"Device.Hosts.", //Object
|
||||
"Device.WiFi.Radio.{i}.Stats.", //Object
|
||||
"Device.WiFi.SSID.{i}.Stats.", //Object
|
||||
"Device.WiFi.AccessPoint.{i}.AssociatedDevice.", //Object
|
||||
"Device.WiFi.NeighboringWiFiDiagnostic.", //Object
|
||||
"Device.WiFi.DataElements.Network.", //Object
|
||||
"Device.DeviceInfo.MemoryStatus.", //Object
|
||||
"Device.DeviceInfo.ProcessStatus.", //Object
|
||||
"Device.QoS.Policer.{i}.", //Object
|
||||
"Device.QoS.Queue.{i}.", //Object
|
||||
"Device.QoS.Shaper.{i}.", //Object
|
||||
|
||||
"Device.Ethernet.Interface.{i}.Stats.MulticastPacketsSent", //Parameter
|
||||
"Device.Ethernet.Interface.{i}.Stats.UnicastPacketsSent", //Parameter
|
||||
"Device.Ethernet.Interface.{i}.Stats.UnicastPacketsReceived", //Parameter
|
||||
"Device.Ethernet.Interface.{i}.Stats.BroadcastPacketsSent", //Parameter
|
||||
"Device.Ethernet.Interface.{i}.Stats.BroadcastPacketsReceived", //Parameter
|
||||
"Device.Ethernet.Interface.{i}.Stats.UnknownProtoPacketsReceived", //Parameter
|
||||
"Device.Ethernet.Link.{i}.Stats.MulticastPacketsSent", //Parameter
|
||||
"Device.Ethernet.Link.{i}.Stats.UnicastPacketsSent", //Parameter
|
||||
"Device.Ethernet.Link.{i}.Stats.UnicastPacketsReceived", //Parameter
|
||||
"Device.Ethernet.Link.{i}.Stats.BroadcastPacketsSent", //Parameter
|
||||
"Device.Ethernet.Link.{i}.Stats.BroadcastPacketsReceived", //Parameter
|
||||
"Device.Ethernet.Link.{i}.Stats.UnknownProtoPacketsReceived", //Parameter
|
||||
"Device.Firewall.Chain.{i}.Rule.{i}.ExpiryDate", //Parameter
|
||||
"Device.NAT.PortMapping.{i}.LeaseDuration", //Parameter
|
||||
"Device.WiFi.Radio.{i}.MaxBitRate", //Parameter
|
||||
"Device.WiFi.Radio.{i}.OperatingFrequencyBand", //Parameter
|
||||
"Device.WiFi.Radio.{i}.SupportedFrequencyBands", //Parameter
|
||||
"Device.WiFi.Radio.{i}.SupportedStandards", //Parameter
|
||||
"Device.WiFi.Radio.{i}.OperatingStandards", //Parameter
|
||||
"Device.WiFi.Radio.{i}.ChannelsInUse", //Parameter
|
||||
"Device.WiFi.Radio.{i}.Channel", //Parameter
|
||||
"Device.WiFi.Radio.{i}.PossibleChannels", //Parameter
|
||||
"Device.WiFi.Radio.{i}.SupportedOperatingChannelBandwidths", //Parameter
|
||||
"Device.WiFi.Radio.{i}.CurrentOperatingChannelBandwidth", //Parameter
|
||||
"Device.WiFi.SSID.{i}.BSSID", //Parameter
|
||||
"Device.WiFi.AccessPoint.{i}.Status", //Parameter
|
||||
"Device.WiFi.AccessPoint.{i}.AssociatedDeviceNumberOfEntries", //Parameter
|
||||
"Device.QoS.ShaperNumberOfEntries", //Parameter
|
||||
"Device.QoS.QueueNumberOfEntries", //Parameter
|
||||
"Device.QoS.PolicerNumberOfEntries", //Parameter
|
||||
"Device.QoS.QueueStats.{i}.Enable", //Parameter
|
||||
"Device.QoS.QueueStats.{i}.Status", //Parameter
|
||||
"Device.QoS.QueueStats.{i}.Queue", //Parameter
|
||||
"Device.QoS.QueueStats.{i}.DroppedBytes", //Parameter
|
||||
"Device.QoS.Classification.{i}.Enable", //Parameter
|
||||
"Device.QoS.Classification.{i}.DestMask", //Parameter
|
||||
"Device.QoS.Classification.{i}.SourceMask", //Parameter
|
||||
"Device.QoS.Classification.{i}.SourcePortRangeMax", //Parameter
|
||||
"Device.QoS.Classification.{i}.SourceMACAddress", //Parameter
|
||||
"Device.QoS.Classification.{i}.DestMACAddress", //Parameter
|
||||
"Device.QoS.Classification.{i}.Ethertype", //Parameter
|
||||
"Device.QoS.Classification.{i}.SourceVendorClassID", //Parameter
|
||||
"Device.QoS.Classification.{i}.DestVendorClassID", //Parameter
|
||||
"Device.QoS.Classification.{i}.SourceClientID", //Parameter
|
||||
"Device.QoS.Classification.{i}.DestClientID", //Parameter
|
||||
"Device.QoS.Classification.{i}.SourceUserClassID", //Parameter
|
||||
"Device.QoS.Classification.{i}.DestUserClassID", //Parameter
|
||||
"Device.QoS.Classification.{i}.IPLengthMin", //Parameter
|
||||
"Device.QoS.Classification.{i}.IPLengthMax", //Parameter
|
||||
"Device.QoS.Classification.{i}.DSCPCheck", //Parameter
|
||||
"Device.QoS.Classification.{i}.EthernetPriorityCheck", //Parameter
|
||||
"Device.QoS.Classification.{i}.VLANIDCheck", //Parameter
|
||||
"Device.QoS.Classification.{i}.TrafficClass", //Parameter
|
||||
"Device.QoS.Classification.{i}.Policer", //Parameter
|
||||
NULL
|
||||
};
|
||||
20
dmtree/vendor/openwrt/tr181/vendor.h
vendored
Normal file
20
dmtree/vendor/openwrt/tr181/vendor.h
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* 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 __OPENWRT_VENDOR_H
|
||||
#define __OPENWRT_VENDOR_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DM_MAP_OBJ tVendorExtensionOverwriteOPENWRT[];
|
||||
extern char *VendorExtensionExcludeOPENWRT[];
|
||||
|
||||
#endif //__OPENWRT_VENDOR_H
|
||||
19
dmtree/vendor/test/tr181/device.c
vendored
Normal file
19
dmtree/vendor/test/tr181/device.c
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* 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 "device.h"
|
||||
#include "x_test_com_dropbear.h"
|
||||
|
||||
DMOBJ tTEST_DeviceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{BBF_VENDOR_PREFIX"Dropbear", &DMWRITE, add_dropbear_instance, delete_dropbear_instance, "file:/etc/config/dropbear", browse_dropbear_instance, NULL, NULL, NULL, X_TEST_COM_DropbearParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
/*
|
||||
* Copyright (C) 2019 iopsys Software Solutions AB
|
||||
* 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 Imen Bhiri <imen.bhiri@pivasoftware.com>
|
||||
* Author Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __SE_SYSLOG_H
|
||||
#define __SE_SYSLOG_H
|
||||
#ifndef __TEST_DEVICE_H
|
||||
#define __TEST_DEVICE_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMLEAF tSe_SyslogParam[];
|
||||
extern DMOBJ tTEST_DeviceObj[];
|
||||
|
||||
#endif
|
||||
#endif //__TEST_DEVICE_H
|
||||
25
dmtree/vendor/test/tr181/deviceinfo.c
vendored
Normal file
25
dmtree/vendor/test/tr181/deviceinfo.c
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include "deviceinfo.h"
|
||||
|
||||
static char *get_uci_deviceinfo(char *opt)
|
||||
{
|
||||
char *v;
|
||||
|
||||
dmuci_get_option_value_string("cwmp", "@deviceinfotest[0]", opt, &v);
|
||||
return v;
|
||||
}
|
||||
|
||||
static int test__get_device_manufacturer(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("Manufacturer");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
/* *** Device.DeviceInfo. *** */
|
||||
DMLEAF tTEST_DeviceInfoParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"Manufacturer", &DMREAD, DMT_STRING, test__get_device_manufacturer, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
8
dmtree/vendor/test/tr181/deviceinfo.h
vendored
Normal file
8
dmtree/vendor/test/tr181/deviceinfo.h
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef __TEST_DEVICEINFO_H
|
||||
#define __TEST_DEVICEINFO_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMLEAF tTEST_DeviceInfoParams[];
|
||||
|
||||
#endif //__TEST_DEVICEINFO_H
|
||||
197
dmtree/vendor/test/tr181/firewall.c
vendored
Normal file
197
dmtree/vendor/test/tr181/firewall.c
vendored
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
/*
|
||||
* 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 "firewall.h"
|
||||
|
||||
static int get_rule_icmp_type(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct uci_list *v= NULL;
|
||||
struct uci_element *e = NULL;
|
||||
char *ptr = NULL;
|
||||
|
||||
dmasprintf(value, "%s", "");
|
||||
dmuci_get_value_by_section_list((struct uci_section *)data, "icmp_type", &v);
|
||||
if (v != NULL) {
|
||||
uci_foreach_element(v, e) {
|
||||
ptr = dmstrdup(*value);
|
||||
dmfree(*value);
|
||||
|
||||
if (strlen(ptr) == 0)
|
||||
dmasprintf(value, "%s", e->name);
|
||||
else {
|
||||
dmasprintf(value, "%s %s", ptr, e->name);
|
||||
dmfree(ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_rule_source_mac(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *v = NULL;
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "src_mac", &v);
|
||||
*value = (v) ? v : "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_time_span_supported_days(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = "mon,tue,wed,thu,fri,sat,sun";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_time_span_days(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *v;
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "weekdays", &v);
|
||||
*value = (v) ? v : "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_time_span_start_time(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *v;
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "start_time", &v);
|
||||
*value = (v) ? v : "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_time_span_stop_time(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *v;
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "stop_time", &v);
|
||||
*value = (v) ? v : "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_rule_icmp_type(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
int i;
|
||||
size_t length;
|
||||
char **devices = NULL;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "icmp_type", "");
|
||||
devices = strsplit(value, " ", &length);
|
||||
for (i = 0; i < length; i++)
|
||||
dmuci_add_list_value_by_section((struct uci_section *)data, "icmp_type", devices[i]);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_rule_source_mac(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "src_mac", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_time_span_supported_days(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_time_span_days(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "weekdays", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_time_span_start_time(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "start_time", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_time_span_stop_time(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
//TODO
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "stop_time", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int test__get_firewall_expriydate(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = "2030-07-02T14:33:51Z";
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
/* *** Device.Firewall.Chain.{i}.Rule.{i}. *** */
|
||||
DMLEAF tTEST_FirewallRuleParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"ExpiryDate", &DMWRITE, DMT_TIME, test__get_firewall_expriydate, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMOBJ tTEST_FirewallChainRuleObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{BBF_VENDOR_PREFIX"TimeSpan", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tTEST_FirewallChainRuleTimeSpanParams, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tTEST_FirewallChainRuleParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{BBF_VENDOR_PREFIX"ICMPType", &DMWRITE, DMT_STRING, get_rule_icmp_type, set_rule_icmp_type, BBFDM_BOTH},
|
||||
{BBF_VENDOR_PREFIX"SourceMACAddress", &DMWRITE, DMT_STRING, get_rule_source_mac, set_rule_source_mac, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tTEST_FirewallChainRuleTimeSpanParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"SupportedDays", &DMWRITE, DMT_STRING, get_time_span_supported_days, set_time_span_supported_days, BBFDM_BOTH},
|
||||
{"Days", &DMWRITE, DMT_STRING, get_time_span_days, set_time_span_days, BBFDM_BOTH},
|
||||
{"StartTime", &DMWRITE, DMT_STRING, get_time_span_start_time, set_time_span_start_time, BBFDM_BOTH},
|
||||
{"StopTime", &DMWRITE, DMT_STRING, get_time_span_stop_time, set_time_span_stop_time, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
22
dmtree/vendor/test/tr181/firewall.h
vendored
Normal file
22
dmtree/vendor/test/tr181/firewall.h
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* 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 __TEST_FIREWALL_H
|
||||
#define __TEST_FIREWALL_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMLEAF tTEST_FirewallRuleParams[];
|
||||
extern DMOBJ tTEST_FirewallChainRuleObj[];
|
||||
extern DMLEAF tTEST_FirewallChainRuleParams[];
|
||||
extern DMLEAF tTEST_FirewallChainRuleTimeSpanParams[];
|
||||
|
||||
#endif //__TEST_FIREWALL_H
|
||||
41
dmtree/vendor/test/tr181/vendor.c
vendored
Normal file
41
dmtree/vendor/test/tr181/vendor.c
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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 "device.h"
|
||||
#include "deviceinfo.h"
|
||||
#include "firewall.h"
|
||||
#include "vendor.h"
|
||||
|
||||
DM_MAP_OBJ tVendorExtensionOverwriteTEST[] = {
|
||||
/* parentobj, nextobject, parameter */
|
||||
{"Device.DeviceInfo.", NULL, tTEST_DeviceInfoParams},
|
||||
{"Device.Firewall.Chain.{i}.Rule.{i}.", NULL, tTEST_FirewallRuleParams},
|
||||
{0}
|
||||
};
|
||||
|
||||
DM_MAP_OBJ tVendorExtensionTEST[] = {
|
||||
/* parentobj, nextobject, parameter */
|
||||
{"Device.", tTEST_DeviceObj, NULL},
|
||||
{"Device.Firewall.Chain.{i}.Rule.{i}.", tTEST_FirewallChainRuleObj, NULL},
|
||||
{0}
|
||||
};
|
||||
|
||||
char *VendorExtensionExcludeTEST[] = {
|
||||
"Device.USB.", //Object
|
||||
"Device.DeviceInfo.VendorConfigFile.{i}.", //Object
|
||||
"Device.DSL.Channel.{i}.Stats.", //Object
|
||||
|
||||
"Device.QoS.Queue.{i}.SchedulerAlgorithm", //Parameter
|
||||
"Device.FAST.Line.{i}.Stats.CurrentDay.ErroredSecs", //Parameter
|
||||
"Device.Ethernet.RMONStats.{i}.Packets1024to1518Bytes", //Parameter
|
||||
|
||||
NULL
|
||||
};
|
||||
21
dmtree/vendor/test/tr181/vendor.h
vendored
Normal file
21
dmtree/vendor/test/tr181/vendor.h
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* 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 __TEST_VENDOR_H
|
||||
#define __TEST_VENDOR_H
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DM_MAP_OBJ tVendorExtensionOverwriteTEST[];
|
||||
extern DM_MAP_OBJ tVendorExtensionTEST[];
|
||||
extern char *VendorExtensionExcludeTEST[];
|
||||
|
||||
#endif //__TEST_VENDOR_H
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2019 iopsys Software Solutions AB
|
||||
* 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
|
||||
|
|
@ -9,10 +9,12 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "x_iopsys_eu_dropbear.h"
|
||||
#include "x_test_com_dropbear.h"
|
||||
|
||||
|
||||
int browseXIopsysEuDropbear(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
/*************************************************************
|
||||
* ENTRY METHOD
|
||||
**************************************************************/
|
||||
int browse_dropbear_instance(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
char *inst = NULL, *max_inst = NULL;
|
||||
struct dmmap_dup *p = NULL;
|
||||
|
|
@ -30,303 +32,12 @@ int browseXIopsysEuDropbear(struct dmctx *dmctx, DMNODE *parent_node, void *prev
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************************
|
||||
**** function ****
|
||||
**************************************************************************************/
|
||||
static int get_x_iopsys_eu_dropbear_password_auth(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *res = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "PasswordAuth", "1");
|
||||
*value = ((strcmp(res, "on") == 0) || *res == '1') ? "1" : "0";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_dropbear_password_auth(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_by_section((struct uci_section *)data, "PasswordAuth", b ? "1" : "0");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_dropbear_root_password_auth(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *res = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "RootPasswordAuth", "1");
|
||||
*value = ((strcmp(res, "on") == 0) || *res == '1') ? "1" : "0";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_dropbear_root_password_auth(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_by_section((struct uci_section *)data, "RootPasswordAuth", b ? "1" : "0");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_dropbear_port(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "Port", "22");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_dropbear_port(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "Port", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_dropbear_root_login(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "RootLogin", value);
|
||||
if ((*value)[0] == '\0' || ((*value)[0] == 'o' && (*value)[1] == 'n') || (*value)[0] == '1' )
|
||||
*value = "1";
|
||||
else
|
||||
*value = "0";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_dropbear_root_login(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_by_section((struct uci_section *)data, "RootLogin", b ? "1" : "0");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_dropbear_verbose(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "verbose", "0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_dropbear_verbose(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_by_section((struct uci_section *)data, "verbose", b ? "1" : "0");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_dropbear_gateway_ports(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "GatewayPorts", "0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_dropbear_gateway_ports(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_by_section((struct uci_section *)data, "GatewayPorts", b ? "1" : "");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_dropbear_interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "Interface", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_dropbear_interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "Interface", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_dropbear_rsakeyfile(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "rsakeyfile", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_dropbear_rsakeyfile(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "rsakeyfile", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_dropbear_dsskeyfile(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "dsskeyfile", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_dropbear_dsskeyfile(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "dsskeyfile", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_dropbear_ssh_keepalive(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "SSHKeepAlive", "300");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_dropbear_ssh_keepalive(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
if (strcmp(value, "300") == 0)
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "SSHKeepAlive", "");
|
||||
else
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "SSHKeepAlive", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_dropbear_idle_timeout(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "IdleTimeout", "300");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_dropbear_idle_timeout(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
if (value[0] == '0')
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "IdleTimeout", "");
|
||||
else
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "IdleTimeout", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_iopsys_eu_dropbear_banner_file(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "BannerFile", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_dropbear_banner_file(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "BannerFile", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
////////////////////////SET AND GET ALIAS/////////////////////////////////
|
||||
|
||||
static int get_x_iopsys_eu_dropbear_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct uci_section *dmmap_section = NULL;
|
||||
|
||||
get_dmmap_section_of_config_section("dmmap_dropbear", "dropbear", section_name((struct uci_section *)data), &dmmap_section);
|
||||
dmuci_get_value_by_section_string(dmmap_section, "dropbearalias", value);
|
||||
if ((*value)[0] == '\0')
|
||||
dmasprintf(value, "cpe-%s", instance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_iopsys_eu_dropbear_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct uci_section *dmmap_section = NULL;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 64, NULL, NULL))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
get_dmmap_section_of_config_section("dmmap_dropbear", "dropbear", section_name((struct uci_section *)data), &dmmap_section);
|
||||
dmuci_set_value_by_section(dmmap_section, "dropbearalias", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***** ADD DEL OBJ *******/
|
||||
/*************************************************************
|
||||
* ADD & DEL OBJ
|
||||
**************************************************************/
|
||||
int add_dropbear_instance(char *refparam, struct dmctx *ctx, void *data, char **instancepara)
|
||||
{
|
||||
struct uci_section *dropbear_sec = NULL, *dmmap_sec= NULL;
|
||||
struct uci_section *dropbear_sec = NULL, *dmmap_sec = NULL;
|
||||
|
||||
char *instance = get_last_instance_bbfdm("dmmap_dropbear", "dropbear", "dropbearinstance");
|
||||
|
||||
|
|
@ -382,21 +93,305 @@ int delete_dropbear_instance(char *refparam, struct dmctx *ctx, void *data, char
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*** DMROOT.X_IOPSYS_EU_Dropbear.{i}. ****/
|
||||
DMLEAF X_IOPSYS_EU_DropbearParams[] = {
|
||||
/*************************************************************
|
||||
* GET & SET PARAM
|
||||
**************************************************************/
|
||||
static int get_x_test_com_dropbear_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct uci_section *dmmap_section = NULL;
|
||||
|
||||
get_dmmap_section_of_config_section("dmmap_dropbear", "dropbear", section_name((struct uci_section *)data), &dmmap_section);
|
||||
dmuci_get_value_by_section_string(dmmap_section, "dropbearalias", value);
|
||||
if ((*value)[0] == '\0')
|
||||
dmasprintf(value, "cpe-%s", instance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_test_com_dropbear_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct uci_section *dmmap_section = NULL;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 64, NULL, NULL))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
get_dmmap_section_of_config_section("dmmap_dropbear", "dropbear", section_name((struct uci_section *)data), &dmmap_section);
|
||||
dmuci_set_value_by_section(dmmap_section, "dropbearalias", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_test_com_dropbear_password_auth(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *res = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "PasswordAuth", "1");
|
||||
*value = ((strcmp(res, "on") == 0) || *res == '1') ? "1" : "0";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_test_com_dropbear_password_auth(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_by_section((struct uci_section *)data, "PasswordAuth", b ? "1" : "0");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_test_com_dropbear_root_password_auth(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *res = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "RootPasswordAuth", "1");
|
||||
*value = ((strcmp(res, "on") == 0) || *res == '1') ? "1" : "0";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_test_com_dropbear_root_password_auth(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_by_section((struct uci_section *)data, "RootPasswordAuth", b ? "1" : "0");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_test_com_dropbear_port(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "Port", "22");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_test_com_dropbear_port(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "Port", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_test_com_dropbear_root_login(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "RootLogin", value);
|
||||
if ((*value)[0] == '\0' || ((*value)[0] == 'o' && (*value)[1] == 'n') || (*value)[0] == '1' )
|
||||
*value = "1";
|
||||
else
|
||||
*value = "0";
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_test_com_dropbear_root_login(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_by_section((struct uci_section *)data, "RootLogin", b ? "1" : "0");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_test_com_dropbear_verbose(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "verbose", "0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_test_com_dropbear_verbose(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_by_section((struct uci_section *)data, "verbose", b ? "1" : "0");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_test_com_dropbear_gateway_ports(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "GatewayPorts", "0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_test_com_dropbear_gateway_ports(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_by_section((struct uci_section *)data, "GatewayPorts", b ? "1" : "");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_test_com_dropbear_interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "Interface", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_test_com_dropbear_interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "Interface", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_test_com_dropbear_rsakeyfile(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "rsakeyfile", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_test_com_dropbear_rsakeyfile(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "rsakeyfile", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_test_com_dropbear_dsskeyfile(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "dsskeyfile", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_test_com_dropbear_dsskeyfile(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "dsskeyfile", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_test_com_dropbear_ssh_keepalive(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "SSHKeepAlive", "300");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_test_com_dropbear_ssh_keepalive(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "SSHKeepAlive", (strcmp(value, "300") == 0) ? "" : value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_test_com_dropbear_idle_timeout(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "IdleTimeout", "300");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_test_com_dropbear_idle_timeout(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "IdleTimeout", (value[0] == '0') ? "" : value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_x_test_com_dropbear_banner_file(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "BannerFile", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_x_test_com_dropbear_banner_file(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "BannerFile", value);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
/*** Device.X_TEST_COM_Dropbear.{i}. ****/
|
||||
DMLEAF X_TEST_COM_DropbearParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"Alias", &DMWRITE, DMT_STRING, get_x_iopsys_eu_dropbear_alias, set_x_iopsys_eu_dropbear_alias, BBFDM_BOTH},
|
||||
{"PasswordAuth", &DMWRITE, DMT_BOOL, get_x_iopsys_eu_dropbear_password_auth, set_x_iopsys_eu_dropbear_password_auth, BBFDM_BOTH},
|
||||
{"RootPasswordAuth", &DMWRITE, DMT_BOOL, get_x_iopsys_eu_dropbear_root_password_auth, set_x_iopsys_eu_dropbear_root_password_auth, BBFDM_BOTH},
|
||||
{"Port", &DMWRITE, DMT_UNINT, get_x_iopsys_eu_dropbear_port, set_x_iopsys_eu_dropbear_port, BBFDM_BOTH},
|
||||
{"RootLogin", &DMWRITE, DMT_BOOL, get_x_iopsys_eu_dropbear_root_login, set_x_iopsys_eu_dropbear_root_login, BBFDM_BOTH},
|
||||
{"GatewayPorts", &DMWRITE, DMT_BOOL, get_x_iopsys_eu_dropbear_gateway_ports, set_x_iopsys_eu_dropbear_gateway_ports, BBFDM_BOTH},
|
||||
{"Interface", &DMWRITE, DMT_STRING, get_x_iopsys_eu_dropbear_interface, set_x_iopsys_eu_dropbear_interface, BBFDM_BOTH},
|
||||
{"RSAKeyFile", &DMWRITE, DMT_STRING, get_x_iopsys_eu_dropbear_rsakeyfile, set_x_iopsys_eu_dropbear_rsakeyfile, BBFDM_BOTH},
|
||||
{"DSSKeyFile", &DMWRITE, DMT_STRING, get_x_iopsys_eu_dropbear_dsskeyfile, set_x_iopsys_eu_dropbear_dsskeyfile, BBFDM_BOTH},
|
||||
{"SSHKeepAlive", &DMWRITE, DMT_UNINT, get_x_iopsys_eu_dropbear_ssh_keepalive, set_x_iopsys_eu_dropbear_ssh_keepalive, BBFDM_BOTH},
|
||||
{"IdleTimeout", &DMWRITE, DMT_UNINT, get_x_iopsys_eu_dropbear_idle_timeout, set_x_iopsys_eu_dropbear_idle_timeout, BBFDM_BOTH},
|
||||
{"Verbose", &DMWRITE, DMT_BOOL, get_x_iopsys_eu_dropbear_verbose, set_x_iopsys_eu_dropbear_verbose, BBFDM_BOTH},
|
||||
{"BannerFile", &DMWRITE, DMT_STRING, get_x_iopsys_eu_dropbear_banner_file, set_x_iopsys_eu_dropbear_banner_file, BBFDM_BOTH},
|
||||
{"Alias", &DMWRITE, DMT_STRING, get_x_test_com_dropbear_alias, set_x_test_com_dropbear_alias, BBFDM_BOTH},
|
||||
{"PasswordAuth", &DMWRITE, DMT_BOOL, get_x_test_com_dropbear_password_auth, set_x_test_com_dropbear_password_auth, BBFDM_BOTH},
|
||||
{"RootPasswordAuth", &DMWRITE, DMT_BOOL, get_x_test_com_dropbear_root_password_auth, set_x_test_com_dropbear_root_password_auth, BBFDM_BOTH},
|
||||
{"Port", &DMWRITE, DMT_UNINT, get_x_test_com_dropbear_port, set_x_test_com_dropbear_port, BBFDM_BOTH},
|
||||
{"RootLogin", &DMWRITE, DMT_BOOL, get_x_test_com_dropbear_root_login, set_x_test_com_dropbear_root_login, BBFDM_BOTH},
|
||||
{"GatewayPorts", &DMWRITE, DMT_BOOL, get_x_test_com_dropbear_gateway_ports, set_x_test_com_dropbear_gateway_ports, BBFDM_BOTH},
|
||||
{"Interface", &DMWRITE, DMT_STRING, get_x_test_com_dropbear_interface, set_x_test_com_dropbear_interface, BBFDM_BOTH},
|
||||
{"RSAKeyFile", &DMWRITE, DMT_STRING, get_x_test_com_dropbear_rsakeyfile, set_x_test_com_dropbear_rsakeyfile, BBFDM_BOTH},
|
||||
{"DSSKeyFile", &DMWRITE, DMT_STRING, get_x_test_com_dropbear_dsskeyfile, set_x_test_com_dropbear_dsskeyfile, BBFDM_BOTH},
|
||||
{"SSHKeepAlive", &DMWRITE, DMT_UNINT, get_x_test_com_dropbear_ssh_keepalive, set_x_test_com_dropbear_ssh_keepalive, BBFDM_BOTH},
|
||||
{"IdleTimeout", &DMWRITE, DMT_UNINT, get_x_test_com_dropbear_idle_timeout, set_x_test_com_dropbear_idle_timeout, BBFDM_BOTH},
|
||||
{"Verbose", &DMWRITE, DMT_BOOL, get_x_test_com_dropbear_verbose, set_x_test_com_dropbear_verbose, BBFDM_BOTH},
|
||||
{"BannerFile", &DMWRITE, DMT_STRING, get_x_test_com_dropbear_banner_file, set_x_test_com_dropbear_banner_file, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue