From be7204e16e9357151313e5f0a7677af4c33780e2 Mon Sep 17 00:00:00 2001 From: Amin Ben Ramdhane Date: Fri, 21 Feb 2020 18:49:28 +0100 Subject: [PATCH] Update json file + upnp: add mapping parameters --- dmtree/tr181/upnp.c | 137 ++++---- json/tr181.json | 749 ++++++++++++++++++++++++++++++++------------ 2 files changed, 620 insertions(+), 266 deletions(-) diff --git a/dmtree/tr181/upnp.c b/dmtree/tr181/upnp.c index 7ab30b05..2336b7ee 100644 --- a/dmtree/tr181/upnp.c +++ b/dmtree/tr181/upnp.c @@ -246,9 +246,9 @@ int browseUPnPDiscoveryRootDeviceInst(struct dmctx *dmctx, DMNODE *parent_node, return 0; size_t nbre_devices = json_object_array_length(devices); - if(nbre_devices>0){ + if (nbre_devices > 0) { check_create_dmmap_package("dmmap_upnp"); - for(i=0; i0){ + if (nbre_devices > 0) { check_create_dmmap_package("dmmap_upnp"); for(i=0; i0){ + if (nbre_services > 0) { check_create_dmmap_package("dmmap_upnp"); - for(i=0; i0){ + if (nbre_descriptions > 0) { check_create_dmmap_package("dmmap_upnp"); - for(i=0; i0){ + if (nbre_devices_inst > 0) { check_create_dmmap_package("dmmap_upnp"); - for(i=0; i0){ + if (nbre_devices_inst > 0) { check_create_dmmap_package("dmmap_upnp"); - for(i=0; i 0){ for (i = 0; i < nbre_devices; i++){ @@ -824,16 +823,15 @@ int get_UPnPDiscovery_DeviceNumberOfEntries(char *refparam, struct dmctx *ctx, v { json_object *res, *devices; + *value = "0"; dmubus_call("upnpc", "discovery", UBUS_ARGS{{}}, 0, &res); - if (res == NULL) { - *value = "0"; + if (res == NULL) return 0; - } + json_object_object_get_ex(res, "devices", &devices); - if (devices == NULL) { - *value = "0"; + if (devices == NULL) return 0; - } + size_t nbre_devices = json_object_array_length(devices); dmasprintf(value, "%d", nbre_devices); return 0; @@ -843,16 +841,15 @@ int get_UPnPDiscovery_ServiceNumberOfEntries(char *refparam, struct dmctx *ctx, { json_object *res, *services; + *value = "0"; dmubus_call("upnpc", "discovery", UBUS_ARGS{{}}, 0, &res); - if (res == NULL) { - *value = "0"; + if (res == NULL) return 0; - } + json_object_object_get_ex(res, "services", &services); - if (services == NULL) { - *value = "0"; + if (services == NULL) return 0; - } + size_t nbre_services = json_object_array_length(services); dmasprintf(value, "%d", nbre_services); return 0; @@ -864,12 +861,14 @@ int get_UPnPDiscoveryRootDevice_Status(char *refparam, struct dmctx *ctx, void * return 0; } +/*#Device.UPnP.Discovery.RootDevice.{i}.UUID!UBUS:upnpc/discovery//devices[i-1].st*/ int get_UPnPDiscoveryRootDevice_UUID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnpdiscovery *)data)->uuid; return 0; } +/*#Device.UPnP.Discovery.RootDevice.{i}.USN!UBUS:upnpc/discovery//devices[i-1].usn*/ int get_UPnPDiscoveryRootDevice_USN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnpdiscovery *)data)->usn; @@ -882,6 +881,7 @@ int get_UPnPDiscoveryRootDevice_LeaseTime(char *refparam, struct dmctx *ctx, voi return 0; } +/*#Device.UPnP.Discovery.RootDevice.{i}.Location!UBUS:upnpc/discovery//devices[i-1].descurl*/ int get_UPnPDiscoveryRootDevice_Location(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnpdiscovery *)data)->descurl; @@ -912,12 +912,14 @@ int get_UPnPDiscoveryDevice_Status(char *refparam, struct dmctx *ctx, void *data return 0; } +/*#Device.UPnP.Discovery.Device.{i}.UUID!UBUS:upnpc/discovery//devices[i-1].st*/ int get_UPnPDiscoveryDevice_UUID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnpdiscovery *)data)->uuid; return 0; } +/*#Device.UPnP.Discovery.Device.{i}.USN!UBUS:upnpc/discovery//devices[i-1].usn*/ int get_UPnPDiscoveryDevice_USN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnpdiscovery *)data)->usn; @@ -930,6 +932,7 @@ int get_UPnPDiscoveryDevice_LeaseTime(char *refparam, struct dmctx *ctx, void *d return 0; } +/*#Device.UPnP.Discovery.Device.{i}.Location!UBUS:upnpc/discovery//devices[i-1].descurl*/ int get_UPnPDiscoveryDevice_Location(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnpdiscovery *)data)->descurl; @@ -960,6 +963,7 @@ int get_UPnPDiscoveryService_Status(char *refparam, struct dmctx *ctx, void *dat return 0; } +/*#Device.UPnP.Discovery.Service.{i}.USN!UBUS:upnpc/discovery//services[i-1].usn*/ int get_UPnPDiscoveryService_USN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnpdiscovery *)data)->usn; @@ -972,6 +976,7 @@ int get_UPnPDiscoveryService_LeaseTime(char *refparam, struct dmctx *ctx, void * return 0; } +/*#Device.UPnP.Discovery.Service.{i}.Location!UBUS:upnpc/discovery//services[i-1].descurl*/ int get_UPnPDiscoveryService_Location(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnpdiscovery *)data)->descurl; @@ -1018,16 +1023,15 @@ int get_UPnPDescription_DeviceDescriptionNumberOfEntries(char *refparam, struct { json_object *res, *descriptions; + *value = "0"; dmubus_call("upnpc", "description", UBUS_ARGS{{}}, 0, &res); - if (res == NULL) { - *value = "0"; + if (res == NULL) return 0; - } + json_object_object_get_ex(res, "descriptions", &descriptions); - if (descriptions == NULL) { - *value = "0"; + if (descriptions == NULL) return 0; - } + size_t nbre_descriptions = json_object_array_length(descriptions); dmasprintf(value, "%d", nbre_descriptions); return 0; @@ -1037,16 +1041,15 @@ int get_UPnPDescription_DeviceInstanceNumberOfEntries(char *refparam, struct dmc { json_object *res, *devicesinstances; + *value = "0"; dmubus_call("upnpc", "description", UBUS_ARGS{{}}, 0, &res); - if (res == NULL) { - *value = "0"; + if (res == NULL) return 0; - } + json_object_object_get_ex(res, "devicesinstances", &devicesinstances); - if (devicesinstances == NULL) { - *value = "0"; + if (devicesinstances == NULL) return 0; - } + size_t nbre_devinstances = json_object_array_length(devicesinstances); dmasprintf(value, "%d", nbre_devinstances); return 0; @@ -1056,22 +1059,21 @@ int get_UPnPDescription_ServiceInstanceNumberOfEntries(char *refparam, struct dm { json_object *res, *servicesinstances; + *value = "0"; dmubus_call("upnpc", "description", UBUS_ARGS{{}}, 0, &res); - if (res == NULL) { - *value = "0"; + if (res == NULL) return 0; - } + json_object_object_get_ex(res, "servicesinstances", &servicesinstances); - if (servicesinstances == NULL) { - *value = "0"; + if (servicesinstances == NULL) return 0; - } + size_t nbre_servinstances = json_object_array_length(servicesinstances); dmasprintf(value, "%d", nbre_servinstances); return 0; - return 0; } +/*#Device.UPnP.Description.DeviceDescription.{i}.URLBase!UBUS:upnpc/description//descriptions[i-1].descurl*/ int get_UPnPDescriptionDeviceDescription_URLBase(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_description_file_info *)data)->desc_url; @@ -1090,6 +1092,7 @@ int get_UPnPDescriptionDeviceDescription_Host(char *refparam, struct dmctx *ctx, return 0; } +/*#Device.UPnP.Description.DeviceInstance.{i}.UDN!UBUS:upnpc/description//devicesinstances[i-1].UDN*/ int get_UPnPDescriptionDeviceInstance_UDN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_device_inst *)data)->udn; @@ -1101,10 +1104,8 @@ int get_UPnPDescriptionDeviceInstance_ParentDevice(char *refparam, struct dmctx char *devinstlink = NULL; adm_entry_get_linker_param(ctx, dm_print_path("%s%cUPnP%cDescription%cDeviceInstance%c", dmroot, dm_delim, dm_delim, dm_delim, dm_delim), ((struct upnp_device_inst *)data)->parentudn, &devinstlink); - if (devinstlink != NULL) { + if (devinstlink != NULL) *value = devinstlink; - return 0; - } return 0; } @@ -1117,26 +1118,27 @@ int get_UPnPDescriptionDeviceInstance_DiscoveryDevice(char *refparam, struct dmc if (upnpdevinst->udn && upnpdevinst->udn[0]) { udnarray = strsplit(upnpdevinst->udn, ":", &length); adm_entry_get_linker_param(ctx, dm_print_path("%s%cUPnP%cDiscovery%cRootDevice%c", dmroot, dm_delim, dm_delim, dm_delim, dm_delim), udnarray[1], &rootdevlink); - if(rootdevlink != NULL){ + if (rootdevlink != NULL) { *value = rootdevlink; return 0; } adm_entry_get_linker_param(ctx, dm_print_path("%s%cUPnP%cDiscovery%cDevice%c", dmroot, dm_delim, dm_delim, dm_delim, dm_delim), udnarray[1], &devlink); - if(devlink != NULL){ + if (devlink != NULL) { *value =devlink; return 0; } } - *value = ""; return 0; } +/*#Device.UPnP.Description.DeviceInstance.{i}.DeviceType!UBUS:upnpc/description//devicesinstances[i-1].deviceType*/ int get_UPnPDescriptionDeviceInstance_DeviceType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_device_inst *)data)->device_type; return 0; } +/*#Device.UPnP.Description.DeviceInstance.{i}.FriendlyName!UBUS:upnpc/description//devicesinstances[i-1].friendlyName*/ int get_UPnPDescriptionDeviceInstance_FriendlyName(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_device_inst *)data)->friendly_name; @@ -1149,6 +1151,7 @@ int get_UPnPDescriptionDeviceInstance_DeviceCategory(char *refparam, struct dmct return 0; } +/*#Device.UPnP.Description.DeviceInstance.{i}.Manufacturer!UBUS:upnpc/description//devicesinstances[i-1].manufacturer*/ int get_UPnPDescriptionDeviceInstance_Manufacturer(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_device_inst *)data)->manufacturer; @@ -1161,48 +1164,56 @@ int get_UPnPDescriptionDeviceInstance_ManufacturerOUI(char *refparam, struct dmc return 0; } +/*#Device.UPnP.Description.DeviceInstance.{i}.ManufacturerURL!UBUS:upnpc/description//devicesinstances[i-1].manufacturerURL*/ int get_UPnPDescriptionDeviceInstance_ManufacturerURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_device_inst *)data)->manufacturer_url; return 0; } +/*#Device.UPnP.Description.DeviceInstance.{i}.ModelDescription!UBUS:upnpc/description//devicesinstances[i-1].modelDescription*/ int get_UPnPDescriptionDeviceInstance_ModelDescription(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_device_inst *)data)->model_description; return 0; } +/*#Device.UPnP.Description.DeviceInstance.{i}.ModelName!UBUS:upnpc/description//devicesinstances[i-1].modelName*/ int get_UPnPDescriptionDeviceInstance_ModelName(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_device_inst *)data)->model_name; return 0; } +/*#Device.UPnP.Description.DeviceInstance.{i}.ModelNumber!UBUS:upnpc/description//devicesinstances[i-1].modelNumber*/ int get_UPnPDescriptionDeviceInstance_ModelNumber(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_device_inst *)data)->model_number; return 0; } +/*#Device.UPnP.Description.DeviceInstance.{i}.ModelURL!UBUS:upnpc/description//devicesinstances[i-1].modelURL*/ int get_UPnPDescriptionDeviceInstance_ModelURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_device_inst *)data)->model_url; return 0; } +/*#Device.UPnP.Description.DeviceInstance.{i}.SerialNumber!UBUS:upnpc/description//devicesinstances[i-1].serialNumber*/ int get_UPnPDescriptionDeviceInstance_SerialNumber(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_device_inst *)data)->serial_number; return 0; } +/*#Device.UPnP.Description.DeviceInstance.{i}.UPC!UBUS:upnpc/description//devicesinstances[i-1].UPC*/ int get_UPnPDescriptionDeviceInstance_UPC(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_device_inst *)data)->upc; return 0; } +/*#Device.UPnP.Description.DeviceInstance.{i}.PresentationURL!UBUS:upnpc/description//devicesinstances[i-1].preentation_url*/ int get_UPnPDescriptionDeviceInstance_PresentationURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_device_inst *)data)->preentation_url; @@ -1214,13 +1225,12 @@ int get_UPnPDescriptionServiceInstance_ParentDevice(char *refparam, struct dmctx char *devinstlink = NULL; adm_entry_get_linker_param(ctx, dm_print_path("%s%cUPnP%cDescription%cDeviceInstance%c", dmroot, dm_delim, dm_delim, dm_delim, dm_delim), ((struct upnp_service_inst *)data)->parentudn, &devinstlink); - if (devinstlink != NULL) { + if (devinstlink != NULL) *value = devinstlink; - return 0; - } return 0; } +/*#Device.UPnP.Description.ServiceInstance.{i}.ServiceId!UBUS:upnpc/description//servicesinstances[i-1].serviceId*/ int get_UPnPDescriptionServiceInstance_ServiceId(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_service_inst *)data)->serviceid; @@ -1234,33 +1244,34 @@ int get_UPnPDescriptionServiceInstance_ServiceDiscovery(char *refparam, struct d dmasprintf(&usn, "%s::%s", ((struct upnp_service_inst *)data)->parentudn, ((struct upnp_service_inst *)data)->servicetype); if (usn && usn[0]) { adm_entry_get_linker_param(ctx, dm_print_path("%s%cUPnP%cDiscovery%cService%c", dmroot, dm_delim, dm_delim, dm_delim, dm_delim), usn, &devlink); - if (devlink != NULL) { + if (devlink != NULL) *value = devlink; - return 0; - } } - *value = ""; return 0; } +/*#Device.UPnP.Description.ServiceInstance.{i}.ServiceType!UBUS:upnpc/description//servicesinstances[i-1].serviceType*/ int get_UPnPDescriptionServiceInstance_ServiceType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_service_inst *)data)->servicetype; return 0; } +/*#Device.UPnP.Description.ServiceInstance.{i}.SCPDURL!UBUS:upnpc/description//servicesinstances[i-1].SCPDURL*/ int get_UPnPDescriptionServiceInstance_SCPDURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_service_inst *)data)->scpdurl; return 0; } +/*#Device.UPnP.Description.ServiceInstance.{i}.ControlURL!UBUS:upnpc/description//servicesinstances[i-1].controlURL*/ int get_UPnPDescriptionServiceInstance_ControlURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_service_inst *)data)->controlurl; return 0; } +/*#Device.UPnP.Description.ServiceInstance.{i}.EventSubURL!UBUS:upnpc/description//servicesinstances[i-1].eventSubURL*/ int get_UPnPDescriptionServiceInstance_EventSubURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = ((struct upnp_service_inst *)data)->eventsuburl; diff --git a/json/tr181.json b/json/tr181.json index c2982b00..79c9e61b 100644 --- a/json/tr181.json +++ b/json/tr181.json @@ -15580,20 +15580,7 @@ "cwmp", "usp" ], - "datatype": "unsignedInt", - "mapping": [ - { - "type": "ubus", - "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.rx_over_errors" - } - } - ] + "datatype": "unsignedInt" } } }, @@ -16279,20 +16266,7 @@ "cwmp", "usp" ], - "datatype": "unsignedInt", - "mapping": [ - { - "type": "ubus", - "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.rx_over_errors" - } - } - ] + "datatype": "unsignedInt" } } }, @@ -26573,12 +26547,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.tx_bytes" + "object": "wifi.radio.@Name", + "method": "stats", + "args": {}, + "key": "tx_bytes" } } ] @@ -26596,12 +26568,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.rx_bytes" + "object": "wifi.radio.@Name", + "method": "stats", + "args": {}, + "key": "rx_bytes" } } ] @@ -26619,12 +26589,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.tx_packets" + "object": "wifi.radio.@Name", + "method": "stats", + "args": {}, + "key": "tx_packets" } } ] @@ -26642,12 +26610,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.rx_packets" + "object": "wifi.radio.@Name", + "method": "stats", + "args": {}, + "key": "rx_packets" } } ] @@ -26665,12 +26631,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.tx_errors" + "object": "wifi.radio.@Name", + "method": "stats", + "args": {}, + "key": "tx_error_packets" } } ] @@ -26688,12 +26652,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.rx_errors" + "object": "wifi.radio.@Name", + "method": "stats", + "args": {}, + "key": "rx_error_packets" } } ] @@ -26711,12 +26673,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.tx_dropped" + "object": "wifi.radio.@Name", + "method": "stats", + "args": {}, + "key": "tx_dropped_packets" } } ] @@ -26734,12 +26694,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.rx_dropped" + "object": "wifi.radio.@Name", + "method": "stats", + "args": {}, + "key": "rx_dropped_packets" } } ] @@ -26762,7 +26720,18 @@ "cwmp", "usp" ], - "datatype": "unsignedInt" + "datatype": "unsignedInt", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.radio.@Name", + "method": "stats", + "args": {}, + "key": "rx_fcs_error_packets" + } + } + ] }, "InvalidMACCount": { "type": "unsignedInt", @@ -27382,12 +27351,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.tx_bytes" + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "tx_bytes" } } ] @@ -27405,12 +27372,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.rx_bytes" + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "rx_bytes" } } ] @@ -27428,12 +27393,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.tx_packets" + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "tx_packets" } } ] @@ -27451,12 +27414,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.rx_packets" + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "rx_packets" } } ] @@ -27474,12 +27435,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.tx_errors" + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "tx_error_packets" } } ] @@ -27492,7 +27451,18 @@ "cwmp", "usp" ], - "datatype": "unsignedInt" + "datatype": "unsignedInt", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "tx_retrans_packets" + } + } + ] }, "FailedRetransCount": { "type": "unsignedInt", @@ -27502,7 +27472,18 @@ "cwmp", "usp" ], - "datatype": "unsignedInt" + "datatype": "unsignedInt", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "tx_retrans_fail_packets" + } + } + ] }, "RetryCount": { "type": "unsignedInt", @@ -27512,7 +27493,18 @@ "cwmp", "usp" ], - "datatype": "unsignedInt" + "datatype": "unsignedInt", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "tx_retry_packets" + } + } + ] }, "MultipleRetryCount": { "type": "unsignedInt", @@ -27522,7 +27514,18 @@ "cwmp", "usp" ], - "datatype": "unsignedInt" + "datatype": "unsignedInt", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "tx_multi_retry_packets" + } + } + ] }, "ACKFailureCount": { "type": "unsignedInt", @@ -27532,7 +27535,18 @@ "cwmp", "usp" ], - "datatype": "unsignedInt" + "datatype": "unsignedInt", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "ack_fail_packets" + } + } + ] }, "AggregatedPacketCount": { "type": "unsignedInt", @@ -27542,7 +27556,18 @@ "cwmp", "usp" ], - "datatype": "unsignedInt" + "datatype": "unsignedInt", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "aggregate_packets" + } + } + ] }, "ErrorsReceived": { "type": "unsignedInt", @@ -27557,12 +27582,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.rx_errors" + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "rx_error_packets" } } ] @@ -27575,7 +27598,18 @@ "cwmp", "usp" ], - "datatype": "unsignedLong" + "datatype": "unsignedLong", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "tx_unicast_packets" + } + } + ] }, "UnicastPacketsReceived": { "type": "unsignedLong", @@ -27585,7 +27619,18 @@ "cwmp", "usp" ], - "datatype": "unsignedLong" + "datatype": "unsignedLong", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "rx_unicast_packets" + } + } + ] }, "DiscardPacketsSent": { "type": "unsignedInt", @@ -27600,12 +27645,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.tx_dropped" + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "tx_dropped_packets" } } ] @@ -27623,12 +27666,10 @@ { "type": "ubus", "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.rx_dropped" + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "rx_dropped_packets" } } ] @@ -27641,7 +27682,18 @@ "cwmp", "usp" ], - "datatype": "unsignedLong" + "datatype": "unsignedLong", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "tx_multicast_packets" + } + } + ] }, "MulticastPacketsReceived": { "type": "unsignedLong", @@ -27651,7 +27703,18 @@ "cwmp", "usp" ], - "datatype": "unsignedLong" + "datatype": "unsignedLong", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "rx_multicast_packets" + } + } + ] }, "BroadcastPacketsSent": { "type": "unsignedLong", @@ -27661,7 +27724,18 @@ "cwmp", "usp" ], - "datatype": "unsignedLong" + "datatype": "unsignedLong", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "tx_broadcast_packets" + } + } + ] }, "BroadcastPacketsReceived": { "type": "unsignedLong", @@ -27671,7 +27745,18 @@ "cwmp", "usp" ], - "datatype": "unsignedLong" + "datatype": "unsignedLong", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "rx_broadcast_packets" + } + } + ] }, "UnknownProtoPacketsReceived": { "type": "unsignedInt", @@ -27681,7 +27766,18 @@ "cwmp", "usp" ], - "datatype": "unsignedInt" + "datatype": "unsignedInt", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "wifi.ap.@Name", + "method": "stats", + "args": {}, + "key": "rx_unknown_packets" + } + } + ] } } }, @@ -32153,20 +32249,7 @@ "cwmp", "usp" ], - "datatype": "unsignedInt", - "mapping": [ - { - "type": "ubus", - "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.rx_over_errors" - } - } - ] + "datatype": "unsignedInt" } }, "Device.Bridging.Bridge.{i}.Port.{i}.PriorityCodePoint.": { @@ -33954,20 +34037,7 @@ "cwmp", "usp" ], - "datatype": "unsignedInt", - "mapping": [ - { - "type": "ubus", - "ubus": { - "object": "network.device", - "method": "status", - "args": { - "name": "@Name" - }, - "key": "statistics.rx_over_errors" - } - } - ] + "datatype": "unsignedInt" } }, "Device.PPP.Interface.{i}.PPPoA.": { @@ -34311,20 +34381,7 @@ "range": { "min": 64, "max": 65535 - }, - "mapping": [ - { - "type": "ubus", - "ubus": { - "object": "network.interface", - "method": "status", - "args": { - "interface": "@Name" - }, - "key": "mtu" - } - } - ] + } }, "Type": { "type": "string", @@ -52733,6 +52790,17 @@ }, "pattern": [ "[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}" + ], + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "discovery", + "args": {}, + "key": "devices[i-1].st" + } + } ] }, "USN": { @@ -52746,7 +52814,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "discovery", + "args": {}, + "key": "devices[i-1].usn" + } + } + ] }, "LeaseTime": { "type": "unsignedInt", @@ -52770,7 +52849,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "discovery", + "args": {}, + "key": "devices[i-1].descurl" + } + } + ] }, "Server": { "type": "string", @@ -52849,6 +52939,17 @@ }, "pattern": [ "[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}" + ], + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "discovery", + "args": {}, + "key": "devices[i-1].st" + } + } ] }, "USN": { @@ -52862,7 +52963,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "discovery", + "args": {}, + "key": "devices[i-1].usn" + } + } + ] }, "LeaseTime": { "type": "unsignedInt", @@ -52886,7 +52998,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "discovery", + "args": {}, + "key": "devices[i-1].descurl" + } + } + ] }, "Server": { "type": "string", @@ -52962,7 +53085,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "discovery", + "args": {}, + "key": "services[i-1].usn" + } + } + ] }, "LeaseTime": { "type": "unsignedInt", @@ -52986,7 +53120,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "discovery", + "args": {}, + "key": "services[i-1].descurl" + } + } + ] }, "Server": { "type": "string", @@ -53099,7 +53244,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "descriptions[i-1].descurl" + } + } + ] }, "SpecVersion": { "type": "string", @@ -53157,6 +53313,17 @@ }, "pattern": [ "[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}" + ], + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "devicesinstances[i-1].UDN" + } + } ] }, "ParentDevice": { @@ -53196,7 +53363,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "devicesinstances[i-1].deviceType" + } + } + ] }, "FriendlyName": { "type": "string", @@ -53209,7 +53387,18 @@ "datatype": "string", "range": { "max": 128 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "devicesinstances[i-1].friendlyName" + } + } + ] }, "DeviceCategory": { "type": "string", @@ -53234,7 +53423,18 @@ "datatype": "string", "range": { "max": 128 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "devicesinstances[i-1].manufacturer" + } + } + ] }, "ManufacturerOUI": { "type": "string", @@ -53264,7 +53464,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "devicesinstances[i-1].manufacturerURL" + } + } + ] }, "ModelDescription": { "type": "string", @@ -53277,7 +53488,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "devicesinstances[i-1].modelDescription" + } + } + ] }, "ModelName": { "type": "string", @@ -53290,7 +53512,18 @@ "datatype": "string", "range": { "max": 64 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "devicesinstances[i-1].modelName" + } + } + ] }, "ModelNumber": { "type": "string", @@ -53303,7 +53536,18 @@ "datatype": "string", "range": { "max": 64 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "devicesinstances[i-1].modelNumber" + } + } + ] }, "ModelURL": { "type": "string", @@ -53316,7 +53560,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "devicesinstances[i-1].modelURL" + } + } + ] }, "SerialNumber": { "type": "string", @@ -53329,7 +53584,18 @@ "datatype": "string", "range": { "max": 128 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "devicesinstances[i-1].serialNumber" + } + } + ] }, "UPC": { "type": "string", @@ -53342,7 +53608,18 @@ "datatype": "string", "range": { "max": 12 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "devicesinstances[i-1].UPC" + } + } + ] }, "PresentationURL": { "type": "string", @@ -53355,7 +53632,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "devicesinstances[i-1].preentation_url" + } + } + ] } }, "Device.UPnP.Description.ServiceInstance.{i}.": { @@ -53390,7 +53678,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "servicesinstances[i-1].serviceId" + } + } + ] }, "ServiceDiscovery": { "type": "string", @@ -53416,7 +53715,18 @@ "datatype": "string", "range": { "max": 256 - } + }, + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "servicesinstances[i-1].serviceType" + } + } + ] }, "SCPDURL": { "type": "string", @@ -53426,7 +53736,18 @@ "cwmp", "usp" ], - "datatype": "string" + "datatype": "string", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "servicesinstances[i-1].SCPDURL" + } + } + ] }, "ControlURL": { "type": "string", @@ -53436,7 +53757,18 @@ "cwmp", "usp" ], - "datatype": "string" + "datatype": "string", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "servicesinstances[i-1].controlURL" + } + } + ] }, "EventSubURL": { "type": "string", @@ -53446,7 +53778,18 @@ "cwmp", "usp" ], - "datatype": "string" + "datatype": "string", + "mapping": [ + { + "type": "ubus", + "ubus": { + "object": "upnpc", + "method": "description", + "args": {}, + "key": "servicesinstances[i-1].eventSubURL" + } + } + ] } } }