mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Update documentation
This commit is contained in:
parent
2e9101cb0e
commit
4d922c12c4
28 changed files with 1623 additions and 105 deletions
85
README.md
85
README.md
|
|
@ -1,53 +1,66 @@
|
|||
# BroadBand Forum Data Models (BBFDM)
|
||||
|
||||
`bbfdm` is a data model library implementation which includes a list of objects, parameters and operates used for CPE management through remote control protocols such as [TR-069/CWMP](https://cwmp-data-models.broadband-forum.org/) or [TR-369/USP](https://usp.technology/).
|
||||
This package comprises of the below libraries:
|
||||
`bbfdm` is an implementation developed by iopsys that conforms to Broadband Forum Data Models and which includes a list objects, parameters, events and operates used for CPE management through remote control protocols such as [TR-069/CWMP](https://cwmp-data-models.broadband-forum.org/) or [TR-369/USP](https://usp.technology/).
|
||||
|
||||
|
||||
This implementation comprises of the three main components:
|
||||
|
||||
| Component | Description |
|
||||
| ---------- | ------------------------------------------------- |
|
||||
| libbbfdm-api | It is a library that provides many APIs used to interact with UCI configurations, Ubus objects, JSON schema, CLI commands and memory management. It also provides a mechanism to add new objects, parameters, events and operates or extend the existing DM tree using json plugin or shared library plugin. |
|
||||
| libbbfdm | It's a libarry that provides the different data models supported by iopsys |
|
||||
| bbfdmd | It's a deamon which used to expose data model objects over ubus |
|
||||
|
||||
| Library | Description |
|
||||
| ------- | ------------------------------------------------- |
|
||||
| libbbfdm | This provides the mechanism to add new parameters or extend the existing DM tree using json plugin or shared library plugin. |
|
||||
| libbbfdm-api | This provides the APIs for UCI, Ubus, JSON, CLI and memory management. |
|
||||
|
||||
## Design of bbfdm
|
||||
|
||||
`bbfdm` library is structred as follow :
|
||||
`bbfdm` package is structred as follow:
|
||||
|
||||
|
||||
```bash
|
||||
├── dm...(.c and .h)
|
||||
├── dmtree
|
||||
│ ├── json
|
||||
│ ├── tr104
|
||||
│ ├── tr143
|
||||
│ ├── tr181
|
||||
│ └── vendor
|
||||
│ ├── iopsys
|
||||
│ └── vendor.h
|
||||
├── bbfdmd
|
||||
├── docs
|
||||
├── libbbfdm-api
|
||||
├── scripts
|
||||
├── libbbfdm
|
||||
│ ├── dmtree
|
||||
│ │ ├── json
|
||||
│ │ ├── tr104
|
||||
│ │ ├── tr143
|
||||
│ │ ├── tr181
|
||||
│ │ ├── tr471
|
||||
│ │ ├── vendor
|
||||
│ ├── scripts
|
||||
└── tools
|
||||
```
|
||||
|
||||
- `dmtree` folder which includes all supported Data Models. It contains 5 folders:
|
||||
- `bbfdmd` folder which contains the source code of bbfdm deamon.
|
||||
More explanation on how this daemon works and all supported methods are presented in this file [BBFDMD](./bbfdmd/README.md)
|
||||
|
||||
- `tr181` folder : TR-181 Data Model files
|
||||
- `libbbfdm` folder which contains the different data models supported by iopsys
|
||||
|
||||
- `tr104` folder : Voice Services Data Model files
|
||||
- `dmtree` folder which includes all supported Data Models and vendor extension objects. It contains 6 folders:
|
||||
|
||||
- `tr143` folder : Diagnostics Data Model files
|
||||
- `tr181` folder : TR-181 Data Model files
|
||||
|
||||
- `vendor` folder : Vendor Data Model files
|
||||
- `tr104` folder : Voice Services Data Model files
|
||||
|
||||
- `json` folder : TR-181 and TR-104 JSON files
|
||||
- `tr143` folder : Diagnostics Data Model files
|
||||
|
||||
- `tr471` folder : IPLayerCapacityMetrics Diagnostics Data Model files
|
||||
|
||||
- `vendor` folder : Vendor Data Model files
|
||||
|
||||
- `json` folder : TR-181 and TR-104 JSON files
|
||||
|
||||
- `scripts` folder which contains all the scripts used to run the different types of diagnostics.
|
||||
|
||||
- `libbbfdm-api` folder which contains the source code of all API functions (UCI, Ubus, JSON, CLI and memory management). These API are used for GET/SET/ADD/Delete/Operate calls which can be called in internal or external packages.
|
||||
All APIs exposed by libbbfdm-api are presented in this header file [libbbfdm-api.h](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/libbbfdm-api/include/libbbfdm-api.h).
|
||||
All APIs exposed by libbbfdm-api are presented in this header file [libbbfdm_api.h](./libbbfdm-api/include/libbbfdm_api.h).
|
||||
|
||||
- `scripts` folder which contains the Diagnostics scripts
|
||||
- `tools` folder which contains some tools to generate Data Model in C, JSON, XML and Excel format.
|
||||
All supported tools are presented in this file[BBFDM Tools](./docs/guide/tools.md)
|
||||
|
||||
- `tools` folder which contains some tools to generate Data Model in C, JSON, XML and Excel format
|
||||
|
||||
- `dm...(.c and .h)` files which contains the `bbfdm` engine (operate, diagnostics) functions
|
||||
- `docs` folder which contains all documentation files.
|
||||
|
||||
|
||||
## Important Topics
|
||||
|
|
@ -58,18 +71,22 @@ All APIs exposed by libbbfdm-api are presented in this header file [libbbfdm-api
|
|||
* [How to add new vendor](./docs/guide/vendor.md)
|
||||
* [Dynamic Object/Parameter/Operate/Event](./docs/guide/dynamic_dm.md)
|
||||
* [BBFDM Tools](./docs/guide/tools.md)
|
||||
* [Expose datamodel over UBUS using libbbf APIs](./docs/guide/dm_expose_over_ubus.md)
|
||||
* [Wireless Configuration handling](./docs/guide/wireless_easymesh.md)
|
||||
* [Explain the different Network Deployment Scenarios](./docs/guide/network_depoyment_scenarios.md)
|
||||
* [How to Configure MACVLAN](./docs/guide/macvlan_interface.md)
|
||||
* [Explain Policy Based Routing Management](./docs/guide/policy_based_routing.md)
|
||||
|
||||
|
||||
## External dependencies for datamodel objects
|
||||
|
||||
| Datamodel | Package | Link |
|
||||
| ---------------------------------------- | -------------- | -------------------------------------------- |
|
||||
| Device.BulkData. | bulkdata | https://dev.iopsys.eu/bbf/bulkdata.git |
|
||||
| Device.CWMPManagementServer. | icwmp | https://dev.iopsys.eu/bbf/icwmp.git |
|
||||
| Device.IP.Diagnostics.UDPEchoConfig. | udpecho-server | https://dev.iopsys.eu/bbf/udpecho.git |
|
||||
| Device.IP.Diagnostics.UDPEchoDiagnostics.| udpecho-client | https://dev.iopsys.eu/bbf/udpecho.git |
|
||||
| Device.IP.Interface.{i}.TWAMPReflector. | twamp | https://dev.iopsys.eu/bbf/twamp-light.git |
|
||||
| Device.BulkData. | bulkdata | https://dev.iopsys.eu/bbf/bulkdata.git |
|
||||
| Device.ManagementServer. | icwmp | https://dev.iopsys.eu/bbf/icwmp.git |
|
||||
| Device.CWMPManagementServer. | icwmp | https://dev.iopsys.eu/bbf/icwmp.git |
|
||||
| Device.IP.Diagnostics.UDPEchoConfig. | udpecho-server | https://dev.iopsys.eu/bbf/udpecho.git |
|
||||
| Device.IP.Diagnostics.UDPEchoDiagnostics.| udpecho-client | https://dev.iopsys.eu/bbf/udpecho.git |
|
||||
| Device.IP.Interface.{i}.TWAMPReflector. | twamp | https://dev.iopsys.eu/bbf/twamp-light.git |
|
||||
| Device.XMPP. | xmppc | https://dev.iopsys.eu/bbf/xmppc.git |
|
||||
| Device.USPAgent. | obuspa | https://dev.iopsys.eu/bbf/obuspa.git |
|
||||
| STUN parameters | stunc | https://dev.iopsys.eu/bbf/stunc.git |
|
||||
|
|
|
|||
78
bbfdmd/README.md
Normal file
78
bbfdmd/README.md
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
# BBFDM Daemon (bbfdmd)
|
||||
|
||||
`bbfdmd` is daemon which exposes data-model objects over ubus as required by [TR-069/cwmp](https://cwmp-data-models.broadband-forum.org/) or [TR-369/USP](https://usp.technology/).
|
||||
|
||||
> Note 1: The command outputs shown in this readme are examples only, actual output may differ based on device and configuration.
|
||||
|
||||
> Note 2: Long command outputs are compressed for better readability
|
||||
|
||||
## UCI Config
|
||||
|
||||
The configuration file is an `uci` file `/etc/config/bbfdm`. Sample configuration file is provided below.
|
||||
|
||||
```bash
|
||||
config bbfdmd 'bbfdmd'
|
||||
option loglevel '2'
|
||||
option sock '/tmp/usp.sock'
|
||||
option transaction_timeout 10
|
||||
option subprocess_level '1'
|
||||
option refresh_time '10'
|
||||
```
|
||||
|
||||
In the above uci, loglevel can have below value:
|
||||
|
||||
|loglevel | Meaning |
|
||||
|---------| -----------------------------------------|
|
||||
| 0 | Disabled logging |
|
||||
| 1 | Only errors will be logged |
|
||||
| 2 | Only errors and warnings will be logged |
|
||||
| 3 | Log everything except debug |
|
||||
| 4 | Everything will be logged |
|
||||
|
||||
For more info on the `bbfdmd` UCI configuration visit [uci documentation](../docs/api/uci/bbfdm.md) OR [raw uci schema](../schemas/uci/bbfdm.json)
|
||||
|
||||
## Concepts and Workflow
|
||||
|
||||
`bbfdmd` internally uses both `libbbfdm-api` and `libbbfdm` to get the data-model objects. On startup it parses the uci file to check the different configurations and then based on that it registers the `bbfdm` ubus namespace.
|
||||
|
||||
When a ubus method is called it first fills `usp_data_t` structure with the necessary information, then proceeds the `Get/Set/Operate/Add/Del` operation based on that information.
|
||||
|
||||
`bbfdmd` uses `bbf_entry_method` API from `libbbfdm-api` and `tEntryRoot`, `tVendorExtension`, `tVendorExtensionOverwrite` and `tVendorExtensionExclude` global shared arrays from `libbbfdm` to get the device tree schema and its values.
|
||||
|
||||
In short, it covers/supports all methods introduced in `TR-069` and `TR-369` by using the `bbf_entry_method` API from `libbbfdm-api` with the differents methods and the existing data-model available with `libbbfdm`.
|
||||
|
||||
## Important topics
|
||||
* [UBUS methods](../docs/guide/bbfdm_ubus_methods.md)
|
||||
* [UBUS Errors](../docs/guide/bbfdm_ubus_errors.md)
|
||||
* [Parallel UBUS call](../docs/guide/bbfdm_ubus_parallel_call.md)
|
||||
* [Third party datamodel integration](../docs/guide/bbfdm_dm_integration.md)
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
### Build-Time Dependencies
|
||||
|
||||
To successfully build bbfdmd, following libraries are needed:
|
||||
|
||||
| Dependency | Link | License |
|
||||
| ---------- | ------------------------------------------- | -------------- |
|
||||
| libuci | https://git.openwrt.org/project/uci.git | LGPL 2.1 |
|
||||
| libubox | https://git.openwrt.org/project/libubox.git | BSD |
|
||||
| libubus | https://git.openwrt.org/project/ubus.git | LGPL 2.1 |
|
||||
| libjson-c | https://s3.amazonaws.com/json-c_releases | MIT |
|
||||
| libbbfdm-api | https://dev.iopsys.eu/bbf/bbfdm.git | BSD-3 |
|
||||
| libbbfdm | https://dev.iopsys.eu/bbf/bbfdm.git | BSD-3 |
|
||||
|
||||
|
||||
### Run-Time Dependencies
|
||||
|
||||
In order to run the `bbfdmd`, following dependencies are needed to be running/available before `bbfdmd`.
|
||||
|
||||
| Dependency | Link | License |
|
||||
| ---------- | ---------------------------------------- | -------- |
|
||||
| ubusd | https://git.openwrt.org/project/ubus.git | LGPL 2.1 |
|
||||
| libbbfdm-api | https://dev.iopsys.eu/bbf/bbfdm.git | BSD-3 |
|
||||
| libbbfdm | https://dev.iopsys.eu/bbf/bbfdm.git | BSD-3 |
|
||||
|
||||
|
||||
System daemon `ubusd` is used to expose the BBFDM functionality over `ubus`.
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
#include "libbbfdm/dmtree/tr181/device.h"
|
||||
#include "libbbfdm/dmtree/vendor/vendor.h"
|
||||
|
||||
DMOBJ *DM_ROOT_OBJ = tEntry181Obj;
|
||||
DMOBJ *DM_ROOT_OBJ = tEntryRoot;
|
||||
DM_MAP_VENDOR *DM_VENDOR_EXTENSION[2] = {
|
||||
tVendorExtension,
|
||||
tVendorExtensionOverwrite
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# bbf Schema
|
||||
|
||||
```
|
||||
https://dev.iopsys.eu/bbf/bbfdm/-/blob/devel/docs/api/bbfdm.md
|
||||
https://dev.iopsys.eu/bbf/bbfdm/-/blob/devel/docs/api/ubus/bbfdm.md
|
||||
```
|
||||
|
||||
| Custom Properties | Additional Properties |
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="td_row_even">
|
||||
<div class="td_row_even">globals</div>
|
||||
<div class="td_row_even">bbfdmd</div>
|
||||
</td>
|
||||
<td class="td_row_even">
|
||||
<div class="td_row_even">BBF daemon Settings</div>
|
||||
<div class="td_row_even">BBFDM daemon Settings</div>
|
||||
</td>
|
||||
<td class="td_row_even">
|
||||
<div class="td_row_even">false</div>
|
||||
|
|
@ -34,7 +34,7 @@ root@iopsys-44d43771aff0:~#
|
|||
|
||||
```
|
||||
|
||||
For those cron jobs it is required to give the handler script to be executed which is in our case [bbf_activate_handler.sh](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/scripts/bbf_activate_handler.sh). And, it is located under '/usr/share/bbfdm/' in the device.
|
||||
For those cron jobs it is required to give the handler script to be executed which is in our case [bbf_activate_handler.sh](../../libbbfdm/scripts/bbf_activate_handler.sh). And, it is located under '/usr/share/bbfdm/' in the device.
|
||||
|
||||
|
||||
## Cron job specification
|
||||
|
|
@ -62,7 +62,7 @@ For each cron job related to the activated firmware, it is needed to define it a
|
|||
|
||||
## Activate Handler script
|
||||
|
||||
As described, we create a cron job for each TimeWindow in order to activate the required firmware within a specified time by running the [bbf_activate_handler.sh](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/scripts/bbf_activate_handler.sh) handler script.
|
||||
As described, we create a cron job for each TimeWindow in order to activate the required firmware within a specified time by running the [bbf_activate_handler.sh](../../libbbfdm/scripts/bbf_activate_handler.sh) handler script.
|
||||
|
||||
In fact, the aim of this script is to manage firmware images based on the **mode** and the other passed arguments.
|
||||
|
||||
|
|
@ -73,22 +73,22 @@ For these modes and based on the firmware bank id, the required firmware image w
|
|||
|
||||
### 2. How to handle 'WhenIdle' mode:
|
||||
|
||||
Definition of WhenIdle may vary for each deployment and customer, to make it customizable [bbf_check_idle.sh](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/scripts/bbf_check_idle.sh) script is used. It is assumed that customer shall overwrite this file using customer-config to match with there requirement.
|
||||
Definition of WhenIdle may vary for each deployment and customer, to make it customizable [bbf_check_idle.sh](../../libbbfdm/scripts/bbf_check_idle.sh) script is used. It is assumed that customer shall overwrite this file using customer-config to match with there requirement.
|
||||
|
||||
In this mode, [bbf_activate_handler.sh](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/scripts/bbf_activate_handler.sh) script calls this script [bbf_check_idle.sh](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/scripts/bbf_check_idle.sh) to determine the idle state of the device. [bbf_activate_handler.sh](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/scripts/bbf_activate_handler.sh) assumes the device as idle if the exit status of the above script is 0, or if the [bbf_check_idle.sh](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/scripts/bbf_check_idle.sh) is not present in the predefined path "ACTIVATE_HANDLER_FILE@dmcommon.h".
|
||||
In this mode, [bbf_activate_handler.sh](../../libbbfdm/scripts/bbf_activate_handler.sh) script calls this script [bbf_check_idle.sh](../../libbbfdm/scripts/bbf_check_idle.sh) to determine the idle state of the device. [bbf_activate_handler.sh](../../libbbfdm/scripts/bbf_activate_handler.sh) assumes the device as idle if the exit status of the above script is 0, or if the [bbf_check_idle.sh](../../libbbfdm/scripts/bbf_check_idle.sh) is not present in the predefined path "ACTIVATE_HANDLER_FILE@dmcommon.h".
|
||||
|
||||
|
||||
If the exit code from the idle script is zero then firmware image can be activated. Otherwise, it has to wait for next time slot which is defined by 'RETRY_TIME' variable.
|
||||
|
||||
> Note1: The time slot is set through 'RETRY_TIME' variable which is defined under '/usr/share/bbfdm/bbf_activate_handler.sh' script.
|
||||
|
||||
> Note2: The exit status of the script [bbf_check_idle.sh](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/scripts/bbf_check_idle.sh) is important because based on it, the '[bbf_activate_handler.sh](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/scripts/bbf_activate_handler.sh) script will decide whether the image can be activated or not.
|
||||
> Note2: The exit status of the script [bbf_check_idle.sh](../../libbbfdm/scripts/bbf_check_idle.sh) is important because based on it, the '[bbf_activate_handler.sh](../../libbbfdm/scripts/bbf_activate_handler.sh) script will decide whether the image can be activated or not.
|
||||
|
||||
> Note3: Algorithm/Logic to determine the Idle state of device is out of scope of this document and it is expected that users overwrite this script with the logic to determine the same in actual deployment.
|
||||
|
||||
> Note4: If 1 or more TimeWindow.{i}.Mode is set to 'WhenIdle' and all of them fails to get the idle state. The latest TimeWindow instance will force the device to activate the firmware image.
|
||||
|
||||
> Note5: If the idle script [bbf_check_idle.sh](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/scripts/bbf_check_idle.sh) not present in the pre-defined path "ACTIVATE_HANDLER_FILE@dmcommon.h", then the device is assumed to be in ideal state and the firmware shall be activated instantly.
|
||||
> Note5: If the idle script [bbf_check_idle.sh](../../libbbfdm/scripts/bbf_check_idle.sh) not present in the pre-defined path "ACTIVATE_HANDLER_FILE@dmcommon.h", then the device is assumed to be in ideal state and the firmware shall be activated instantly.
|
||||
|
||||
> Note6: It is very likely that TimeWindow with 'WhenIdle' mode might not find any suitable Idle state, in that case firmware shall not be activated. If users/operators want to make sure that firmware gets activated at the end, then they can add a TimeWindow with 'AnyTime/Immediate' mode at the end, to activate the firmware.
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ If the exit code from the idle script is zero then firmware image can be activat
|
|||
|
||||
* If TimeWindow.{i}.Start is set, TimeWindow.{i}.End and TimeWindow.{i}.Mode become mondatory.
|
||||
|
||||
* The firmware activation is done by [bbf_activate_handler.sh](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/scripts/bbf_activate_handler.sh) script as per the defined Mode in TimeWindow, but if the TimeWindow is not defined, it will activate the requested FirmwareImage instance immediately.
|
||||
* The firmware activation is done by [bbf_activate_handler.sh](../../libbbfdm/scripts/bbf_activate_handler.sh) script as per the defined Mode in TimeWindow, but if the TimeWindow is not defined, it will activate the requested FirmwareImage instance immediately.
|
||||
|
||||
* If the customer wants to be sure that the required firmware is getting activated at the end then they can define the TimeWindow.{i}.Mode as 'AnyTime' or 'Immediately' in the last TimeWindow instance.
|
||||
|
||||
|
|
|
|||
172
docs/guide/bbfdm_dm_integration.md
Normal file
172
docs/guide/bbfdm_dm_integration.md
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
# Third party data model integration
|
||||
|
||||
It is also possible to itegrate thrid party data model to the bbfdmd to expose it to the ubus. To do so certain APIs in libbbfdm-api needs to be implemented to make the data model compatible with bbfdmd. APIs are described below.
|
||||
|
||||
|
||||
## List of libbbfdm-api methods used in bbfdmd to integrate third party data model
|
||||
|
||||
### Refernces
|
||||
Deatils of libbbfdm-api can be found at [link](../../docs)
|
||||
|
||||
following are the libbbfdm-api methods used in bbfdmd to access the data model defined in libbbfdm
|
||||
|
||||
```
|
||||
bbf_entry_method
|
||||
bbf_ctx_init
|
||||
bbf_ctx_init_sub
|
||||
bbf_ctx_clean
|
||||
bbf_ctx_clean_sub
|
||||
bbf_entry_restart_services
|
||||
bbf_entry_revert_changes
|
||||
bbf_debug_browse_path
|
||||
```
|
||||
|
||||
## Methods
|
||||
Description of the methods are given below
|
||||
|
||||
### bbf_entry_method
|
||||
|
||||
used to read the data model based on the input given
|
||||
|
||||
```
|
||||
int bbf_entry_method(struct dmctx *ctx, int cmd)
|
||||
|
||||
inputs
|
||||
struct dmctx *ctx
|
||||
pointer to struct dmctx strunture. The list of parameter will be updated in ctx.list_parameter. each node in the list is of type
|
||||
struct dm_parameter which contains char *name, char *data, char *type and char *additional_data;
|
||||
the content of fields are updated based on the cmd and are as follows-
|
||||
cmd | Name | Type | Data | Addtional Data |
|
||||
|------------- |------------- |------------- |------------ |--------------------- |
|
||||
|BBF_GET_VALUE |Parameter |$ref(type) |Value | NA |
|
||||
|BBF_GET_NAME |Parameter |$ref(type) |writable(0/1) | NA |
|
||||
|BBF_SET_VALUE |path | NA | NA | NA |
|
||||
|BBF_ADD_OBJECT |path | NA | NA | NA |
|
||||
|BBF_DEL_OBJECT |path | NA | NA | NA |
|
||||
|BBF_OPERATE |path | NA | NA | NA |
|
||||
|BBF_SCHEMA |paramter ||$ref(type) |writable(0/1) |unique keys |
|
||||
|BBF_INSTANCES |parameter | NA |NA |NA |
|
||||
|
||||
int cmd
|
||||
command to API to tell how the data model is to be read, possible values are
|
||||
BBF_GET_VALUE - Read the values of the parameters from data model
|
||||
BBF_GET_NAME - Read the names of the parameters from data model
|
||||
BBF_SET_VALUE - Set value of specified parameters in the data model
|
||||
BBF_ADD_OBJECT - Add object in a multi instance parameter in the data model
|
||||
BBF_DEL_OBJECT - Delete object from a multi instance parameter in the data model
|
||||
BBF_OPERATE - execute the specified command
|
||||
BBF_SCHEMA - Read all the parameter type parameter from data model.
|
||||
BBF_INSTANCES - Read all the instance of multi instance parameter from data model.
|
||||
|
||||
return
|
||||
int fault
|
||||
contains the fault code if API is not able to read the data model. returns 0 on success.
|
||||
```
|
||||
|
||||
### bbf_ctx_init
|
||||
|
||||
This method is used to initialize the dmctx structure object to read the data model.
|
||||
|
||||
```
|
||||
void bbf_ctx_init(struct dmctx *ctx, DMOBJ *tEntryObj, DM_MAP_VENDOR *tVendorExtension[], DM_MAP_VENDOR_EXCLUDE *tVendorExtensionExclude);
|
||||
inputs
|
||||
struct dmctx *ctx
|
||||
pointer to struct dmctx strunture to be initialized.
|
||||
|
||||
return
|
||||
None
|
||||
```
|
||||
|
||||
### bbf_ctx_init_sub
|
||||
|
||||
This method is an extension of bbf_ctx_init method. only difference it only intializes dmctx structure object and does not intializes other resources used in reading data model
|
||||
|
||||
```
|
||||
void bbf_ctx_init_sub(struct dmctx *ctx, DMOBJ *tEntryObj, DM_MAP_VENDOR *tVendorExtension[], DM_MAP_VENDOR_EXCLUDE *tVendorExtensionExclude)
|
||||
inputs
|
||||
struct dmctx *ctx
|
||||
pointer to struct dmctx strunture to be initialized.
|
||||
|
||||
return
|
||||
None
|
||||
```
|
||||
|
||||
|
||||
### bbf_ctx_clean
|
||||
|
||||
This method is used to free the dmctx structure object and other resources post reading the data model.
|
||||
|
||||
```
|
||||
void bbf_ctx_clean(struct dmctx *ctx)
|
||||
|
||||
input
|
||||
struct dmctx *ctx
|
||||
pointer to struct dmctx strunture to be freed.
|
||||
|
||||
return
|
||||
None
|
||||
```
|
||||
|
||||
### bbf_ctx_clean_sub
|
||||
|
||||
This method is an extension of bbf_ctx_clean method. only difference is it frees the dmctx structure and does not free other resources used in reading data model
|
||||
|
||||
```
|
||||
void bbf_ctx_clean_sub(struct dmctx *ctx)
|
||||
|
||||
input
|
||||
struct dmctx *ctx
|
||||
pointer to struct dmctx strunture to be freed.
|
||||
|
||||
return
|
||||
None
|
||||
```
|
||||
|
||||
### bbf_entry_restart_services
|
||||
|
||||
This method is used to restart the state of data model whenever its state is changed
|
||||
|
||||
```
|
||||
void bbf_entry_restart_services(struct blob_buf *bb, bool restart_services)
|
||||
|
||||
input
|
||||
struct blob_buf *bb
|
||||
pointer to the struct blob_buf object. contains all the packages updated.
|
||||
|
||||
bool restart_services
|
||||
if true packages will be updated through ubus call.
|
||||
if false packages will be updated through uci.
|
||||
|
||||
return
|
||||
None
|
||||
```
|
||||
### bbf_entry_revert_changes
|
||||
|
||||
This method is used to revert the changes whenever its state is changed
|
||||
|
||||
```
|
||||
void bbf_entry_revert_changes(struct blob_buf *bb)
|
||||
|
||||
input
|
||||
struct blob_buf *bb
|
||||
pointer to the struct blob_buf object. contains all the packages updated.
|
||||
|
||||
return
|
||||
None
|
||||
```
|
||||
|
||||
### bbf_debug_browse_path
|
||||
|
||||
This method returns the last accessed path in the data model
|
||||
|
||||
```
|
||||
int bbf_debug_browse_path(char *buff, size_t len)
|
||||
input
|
||||
char *buff
|
||||
pointer to the buffer in which the path will be returned
|
||||
size_t len
|
||||
length of the buffer
|
||||
return
|
||||
int
|
||||
returns 0 on success.
|
||||
```
|
||||
107
docs/guide/bbfdm_ubus_errors.md
Normal file
107
docs/guide/bbfdm_ubus_errors.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# UBUS Errors
|
||||
|
||||
## Path syntax and possible error cases
|
||||
|
||||
Please note some error scenerios with the uspd.
|
||||
|
||||
1. The path parameter value must start with 'Device.'. The command below doesn't have Device before path "Users.User."
|
||||
|
||||
```console
|
||||
root@iopsys:~# ubus call bbfdm get '{"path":"Users.User.", "optional": {"format":"raw", "proto":"usp"}}'
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"path": "Users.User.",
|
||||
"fault": 7026,
|
||||
"fault_msg": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
2. The path parameter must end with a '.' if the path element is not a leaf element e.g.,
|
||||
Note that first two commands doesn't end with a '.' while the command with Alias is correct, due to Alias
|
||||
being the leaf element. To find correct schema path user can check with dump_schema option.
|
||||
|
||||
```console
|
||||
root@iopsys:~#
|
||||
root@iopsys:~# ubus call bbfdm get '{"path":"Device.Users.User.4", "optional": {"format":"raw", "proto":"usp"}}'
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"path": "Device.Users.User.4",
|
||||
"fault": 7026,
|
||||
"fault_msg": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
root@iopsys:~#
|
||||
root@iopsys:~# ubus call bbfdm get '{"path":"Device.Users.User.*", "optional": {"format":"raw", "proto":"usp"}}'
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"path": "Device.Users.User.*",
|
||||
"fault": 7026,
|
||||
"fault_msg": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
root@iopsys:~#
|
||||
root@iopsys:~# ubus call bbfdm get '{"path":"Device.Users.User.4.Alias", "optional": {"format":"raw", "proto":"usp"}}'
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"path": "Device.Users.User.4.Alias",
|
||||
"data": "cpe-4",
|
||||
"type": "xsd:string"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
3. The path parameter value must use proper '.' separated path search expression. Note that a '.' is missing between User and *
|
||||
|
||||
```console
|
||||
root@eagle-44d43771b550:~# ubus call bbfdm get '{"path":"Device.Users.User.*", "optional": {"format":"raw", "proto":"usp"}}'
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"path": "Device.Users.User.*",
|
||||
"fault": 7026,
|
||||
"fault_msg": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
4. The path parameter value must be a valid path schema, in example below SSID is used which is invalid schema element for Device.Users.User.{i}.
|
||||
|
||||
```console
|
||||
root@iopsys:~# ubus call bbfdm get '{"path":"Device.Users.User.1.SSID", "optional": {"format":"raw", "proto":"usp"}}'
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"path": "Device.Users.User.1.SSID",
|
||||
"fault": 7026,
|
||||
"fault_msg": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Errors Codes
|
||||
|
||||
| Error Code | Meaning |
|
||||
|------------|--------------------------------------------------------------|
|
||||
| 7003 | Message failed due to an internal error. |
|
||||
| 7004 | Message failed due to invalid values in the request elements and/or failure to update one or more parameters during Add or Set requests. |
|
||||
| 7005 | Message failed due to memory or processing limitations. |
|
||||
| 7008 | Requested path was invalid or a reference was invalid. |
|
||||
| 7010 | Requested Path Name associated with this ParamError did not match any instantiated parameters. |
|
||||
| 7011 | Unable to convert string value to correct data type. |
|
||||
| 7012 | Out of range or invalid enumeration. |
|
||||
| 7022 | Command failed to operate. |
|
||||
| 7026 | Path is not present in the data model schema. |
|
||||
|
||||
|
||||
1124
docs/guide/bbfdm_ubus_methods.md
Normal file
1124
docs/guide/bbfdm_ubus_methods.md
Normal file
File diff suppressed because it is too large
Load diff
20
docs/guide/bbfdm_ubus_parallel_call.md
Normal file
20
docs/guide/bbfdm_ubus_parallel_call.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Parallel UBUS calls
|
||||
|
||||
All `operate` operation and `get` operation with a depth up to 'USP_SUBPROCESS_DEPTH(2)'
|
||||
runs in a parallel subprocess to avoid blocking the next call.
|
||||
|
||||
```console
|
||||
root@iopsys:~# time ubus call bbfdm get '{"path":"Device."}' >/dev/null &
|
||||
root@iopsys:~# time ubus call bbfdm get '{"path":"Device.Users."}' >/dev/null
|
||||
real 0m 0.07s
|
||||
user 0m 0.00s
|
||||
sys 0m 0.00s
|
||||
root@iopsys:~#
|
||||
real 0m 1.86s
|
||||
user 0m 0.05s
|
||||
sys 0m 0.00s
|
||||
|
||||
[1]+ Done time ubus call bbfdm get "{\"path\":\"Device.\"}" >/dev/null
|
||||
root@iopsys:~#
|
||||
```
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# BBFDM Dynamic Object/Parameter/Operate/Event
|
||||
|
||||
`bbfdm` library allows all applications installed on the box to import its own Data Model parameters at run time in two formats:
|
||||
`bbf_dm` library allows all applications installed on the box to import its own Data Model parameters at run time in two formats:
|
||||
|
||||
- **Shared library**
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ For the other tables, they are defined in the same way as the Object and Paramet
|
|||
|
||||
> Note2: Shared library is not allowed to overwrite objects/parameters
|
||||
|
||||
- For more examples on the external packages, you can see these links: [BulkData](https://dev.iopsys.eu/iopsys/bulkdata/-/blob/master/datamodel.c), [XMPP](https://dev.iopsys.eu/iopsys/xmppc/-/blob/master/datamodel.c)
|
||||
- For more examples on the external packages, you can see these links: [BulkData](https://dev.iopsys.eu/bbf/bulkdata/-/blob/master/datamodel.c), [XMPP](https://dev.iopsys.eu/bbf/xmppc/-/blob/master/datamodel.c)
|
||||
|
||||
### 2. JSON File via external package
|
||||
|
||||
|
|
@ -424,6 +424,6 @@ The application should bring its JSON file under **'/etc/bbfdm/json/'** path wit
|
|||
|
||||
> Note4: Each object definition in JSON file must begin with "Device." and should have the full parent path if it is under another object
|
||||
|
||||
- For more examples on JSON files, you can see these links: [X_IOPSYS_EU_MCPD](https://dev.iopsys.eu/feed/broadcom/-/blob/devel/mcpd/files/etc/bbfdm/json/X_IOPSYS_EU_MCPD.json), [UserInterface](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/test/files/etc/bbfdm/json/UserInterface.json), [X_IOPSYS_EU_Dropbear](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/test/files/etc/bbfdm/json/X_IOPSYS_EU_Dropbear.json), [X_IOPSYS_EU_TEST](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/test/files/etc/bbfdm/json/X_IOPSYS_EU_TEST.json)
|
||||
- For more examples on JSON files, you can see these links: [X_IOPSYS_EU_MCPD](https://dev.iopsys.eu/feed/broadcom/-/blob/devel/mcpd/files/etc/bbfdm/json/X_IOPSYS_EU_MCPD.json), [UserInterface](../../test/files/etc/bbfdm/json/UserInterface.json), [X_IOPSYS_EU_Dropbear](../../test/files/etc/bbfdm/json/X_IOPSYS_EU_Dropbear.json), [X_IOPSYS_EU_TEST](../../test/files/etc/bbfdm/json/X_IOPSYS_EU_TEST.json)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
As mentioned in README, all Data Models are stored in the **'dmtree'** folder. In order to implement a new object/parameter, you need to expand its get/set/add/delete functions and then save them in the right folder.
|
||||
|
||||
`bbfdm` library offers a tool to generate templates of the source code from json files placed under **'dmtree/json'**. So, any developer can fill these json files ([tr181](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/libbbfdm/dmtree/json/tr181.json) or [tr104](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/libbbfdm/dmtree/json/tr104.json)) with mapping field according to UCI, UBUS or CLI commands then generate the source code in C.
|
||||
`bbfdm` library offers a tool to generate templates of the source code from json files placed under **'dmtree/json'**. So, any developer can fill these json files ([tr181](../../libbbfdm/dmtree/json/tr181.json) or [tr104](../../libbbfdm/dmtree/json/tr104.json)) with mapping field according to UCI, UBUS or CLI commands then generate the source code in C.
|
||||
|
||||
```bash
|
||||
$ ./convert_dm_json_to_c.py
|
||||
|
|
@ -174,5 +174,5 @@ In this function, there are two functions that need to be defined:
|
|||
|
||||
> Note2: you can read the next section `BBF API` below to find the definition of the functions used in the browse.
|
||||
|
||||
> Note3: you can use [bbf_test plugin](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/test/bbf_test/bbf_test.c) as a reference in order to develop any new object/leaf/browse.
|
||||
> Note3: you can use [bbf_test plugin](../../test/bbf_test/bbf_test.c) as a reference in order to develop any new object/leaf/browse.
|
||||
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ config interface 'lan'
|
|||
|
||||
config interface 'wan'
|
||||
option proto 'dhcp'
|
||||
option device 'eth4.1'
|
||||
option device 'eth0'
|
||||
|
||||
config interface 'wan6'
|
||||
option proto 'dhcpv6'
|
||||
option device '@wan'
|
||||
option device 'eth0'
|
||||
```
|
||||
|
||||
Its table id should be 254 according to rt_tables as defined below:
|
||||
|
|
@ -88,13 +88,13 @@ config interface 'lan'
|
|||
|
||||
config interface 'wan'
|
||||
option proto 'dhcp'
|
||||
option device 'eth4.1'
|
||||
option device 'eth0'
|
||||
option ip4table '256'
|
||||
option ip6table '256'
|
||||
|
||||
config interface 'wan6'
|
||||
option proto 'dhcpv6'
|
||||
option device '@wan'
|
||||
option device 'eth0'
|
||||
option ip4table '256'
|
||||
option ip6table '256'
|
||||
```
|
||||
|
|
@ -129,13 +129,13 @@ config interface 'lan'
|
|||
|
||||
config interface 'wan'
|
||||
option proto 'dhcp'
|
||||
option device 'eth4.1'
|
||||
option device 'eth0'
|
||||
option ip4table '256'
|
||||
option ip6table '256'
|
||||
|
||||
config interface 'wan6'
|
||||
option proto 'dhcpv6'
|
||||
option device '@wan'
|
||||
option device 'eth0'
|
||||
option ip4table '256'
|
||||
option ip6table '256'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# BBFDM Tools
|
||||
|
||||
BBF tools are written in python3 and has below dependencies.
|
||||
BBFDM tools are written in python3 and has below dependencies.
|
||||
|
||||
System utilities: python3-pip, libxml2-utils
|
||||
```bash
|
||||
|
|
@ -24,7 +24,7 @@ $ pip3 install jsonschema xlwt
|
|||
> Note: Currently all the tools needs to be executed in tools directory.
|
||||
|
||||
## XML->JSON convertor
|
||||
It is a [python script](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/tools/convert_dm_xml_to_json.py) to convert Data Model from Broadband Forum XML format to JSON format.
|
||||
It is a [python script](../../tools/convert_dm_xml_to_json.py) to convert Data Model from Broadband Forum XML format to JSON format.
|
||||
|
||||
```bash
|
||||
$ ./convert_dm_xml_to_json.py
|
||||
|
|
@ -42,18 +42,18 @@ Example of xml data model file: https://www.broadband-forum.org/cwmp/tr-181-2-15
|
|||
|
||||
## XML generator
|
||||
|
||||
[Python script](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/tools/generate_dm_xml.py) to generator list of supported and un-supported Data Model tree in XML for acs supported format: **Broadband Forum schema** and **HDM**.
|
||||
[Python script](../../tools/generate_dm_xml.py) to generator list of supported and un-supported Data Model tree in XML for acs supported format: **Broadband Forum schema** and **HDM**.
|
||||
|
||||
```bash
|
||||
$ ./generate_dm_xml.py -h
|
||||
usage: generate_dm_xml.py [-h] [-r git^https://dev.iopsys.eu/iopsys/stunc.git^devel] [-v iopsys] [-p X_IOPSYS_EU_] [-d DEVICE_PROTOCOL_DSLFTR069v1] [-m iopsys] [-u 002207] [-c DG400PRIME] [-n DG400PRIME-A]
|
||||
usage: generate_dm_xml.py [-h] [-r git^https://dev.iopsys.eu/bbf/stunc.git^devel] [-v iopsys] [-p X_IOPSYS_EU_] [-d DEVICE_PROTOCOL_DSLFTR069v1] [-m iopsys] [-u 002207] [-c DG400PRIME] [-n DG400PRIME-A]
|
||||
[-s 1.2.3.4] [-f BBF] [-o datamodel.xml]
|
||||
|
||||
Script to generate list of supported and non-supported parameter in xml format
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-r git^https://dev.iopsys.eu/iopsys/stunc.git^devel, --remote-dm git^https://dev.iopsys.eu/iopsys/stunc.git^devel
|
||||
-r git^https://dev.iopsys.eu/bbf/stunc.git^devel, --remote-dm git^https://dev.iopsys.eu/bbf/stunc.git^devel
|
||||
Includes OBJ/PARAM defined under remote repositories defined as bbf plugin
|
||||
-v iopsys, --vendor-list iopsys
|
||||
Generate data model tree with vendor extension OBJ/PARAM.
|
||||
|
|
@ -80,26 +80,26 @@ Part of BBF-tools, refer Readme for more examples
|
|||
|
||||
More examples:
|
||||
```bash
|
||||
$ ./generate_dm_xml.py -v iopsys -v openwrt
|
||||
$ ./generate_dm_xml.py -v iopsys -p X_IOPSYS_EU_ -r git^https://dev.iopsys.eu/iopsys/stunc.git^devel
|
||||
$ ./generate_dm_xml.py -v iopsys -v test
|
||||
$ ./generate_dm_xml.py -v iopsys -p X_IOPSYS_EU_ -r git^https://dev.iopsys.eu/bbf/stunc.git^devel
|
||||
$ ./generate_dm_xml.py -f HDM -v iopsys -p X_IOPSYS_EU_ -o iopsys.xml
|
||||
```
|
||||
|
||||
> Note: For the remote data model, *git* is the only proto allowed to use in the *generate_dm_xml.py* script. Therefore, if you want to use vendor extensions from a local repository, you must use the *generate_dm.py* script.
|
||||
|
||||
## Excel generator
|
||||
[Python script](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/tools/generate_dm_excel.py) to generate list of supported and un-supported parameters in excel sheet.
|
||||
[Python script](../../tools/generate_dm_excel.py) to generate list of supported and un-supported parameters in excel sheet.
|
||||
|
||||
```bash
|
||||
$ ./generate_dm_excel.py -h
|
||||
usage: generate_dm_excel.py [-h] -d tr181 [-r git^https://dev.iopsys.eu/iopsys/stunc.git^devel] [-v iopsys] [-p X_IOPSYS_EU_] [-o supported_datamodel.xls]
|
||||
usage: generate_dm_excel.py [-h] -d tr181 [-r git^https://dev.iopsys.eu/bbf/stunc.git^devel] [-v iopsys] [-p X_IOPSYS_EU_] [-o supported_datamodel.xls]
|
||||
|
||||
Script to generate list of supported and non-supported parameter in xls format
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-d tr181, --datamodel tr181
|
||||
-r git^https://dev.iopsys.eu/iopsys/stunc.git^devel, --remote-dm git^https://dev.iopsys.eu/iopsys/stunc.git^devel
|
||||
-r git^https://dev.iopsys.eu/bbf/stunc.git^devel, --remote-dm git^https://dev.iopsys.eu/bbf/stunc.git^devel
|
||||
Includes OBJ/PARAM defined under remote repositories defined as bbf plugin
|
||||
-v iopsys, --vendor-list iopsys
|
||||
Generate data model tree with vendor extension OBJ/PARAM
|
||||
|
|
@ -115,11 +115,11 @@ More examples:
|
|||
```bash
|
||||
$ ./generate_dm_excel.py -d tr181 -v iopsys -o datamodel.xls
|
||||
$ ./generate_dm_excel.py -d tr181 -d tr104 -v iopsys -o datamodel.xls
|
||||
$ ./generate_dm_excel.py -d tr181 -v iopsys -p X_IOPSYS_EU_ -r git^https://dev.iopsys.eu/iopsys/xmppc.git^devel -o datamodel_iopsys.xls
|
||||
$ ./generate_dm_excel.py -d tr181 -v iopsys -p X_IOPSYS_EU_ -r git^https://dev.iopsys.eu/bbf/xmppc.git^devel -o datamodel_iopsys.xls
|
||||
```
|
||||
|
||||
## Validate JSON plugin
|
||||
It is a [python script](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/tools/validate_json_plugin.py) to validate JSON plugin files for dynamic library or standard data model [TR181](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/libbbfdm/dmtree/json/tr181.json), [TR104](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/libbbfdm/dmtree/json/tr104.json), etc..
|
||||
It is a [python script](../../tools/validate_json_plugin.py) to validate JSON plugin files for dynamic library or standard data model [TR181](./libbbfdm/dmtree/json/tr181.json), [TR104](./libbbfdm/dmtree/json/tr104.json), etc..
|
||||
|
||||
```bash
|
||||
$ ./tools/validate_json_plugin.py test/files/etc/bbfdm/json/UserInterface.json
|
||||
|
|
@ -130,7 +130,7 @@ $ ./tools/validate_json_plugin.py dmtree/json/tr181.json
|
|||
## Data Model generator
|
||||
|
||||
This is a pipeline friendly master script to generate the list of supported and un-supported datamodels in xml and xls formats based on provided input in a json file.
|
||||
Example json file available [here](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/tools/tools_input.json).
|
||||
Example json file available [here](../../tools/tools_input.json).
|
||||
|
||||
```bash
|
||||
$ Usage: generate_dm.py <input json file>
|
||||
|
|
@ -151,7 +151,7 @@ The parameters/keys used in tools_input.json file are mostly self-explanatory bu
|
|||
| | default: This contains the generic definition which has the capability to define more descriptive DM objects/parameters |
|
||||
| output.file_format | xls: An excel file listing the supported and unsupported DM objects/parameters |
|
||||
|
||||
> Note: To add more description about the vendor extended DM objects/parameters, it is required to add the definition of the required/related DM objects/parameters in a json file (The json structure should follow same format as given in [tr181.json](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/libbbfdm/dmtree/json/tr181.json)), The same json file need to be defined in dm_json_files list.
|
||||
> Note: To add more description about the vendor extended DM objects/parameters, it is required to add the definition of the required/related DM objects/parameters in a json file (The json structure should follow same format as given in [tr181.json](../../libbbfdm/dmtree/json/tr181.json)), The same json file need to be defined in dm_json_files list.
|
||||
|
||||
The input json file should be defined as follow:
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ The input json file should be defined as follow:
|
|||
"vendor_prefix": "X_IOPSYS_EU_",
|
||||
"plugins": [
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/iopsys/mydatamodel.git",
|
||||
"repo": "https://dev.iopsys.eu/bbf/mydatamodel.git",
|
||||
"proto": "git",
|
||||
"version": "tag/hash/branch",
|
||||
"dm_files": [
|
||||
|
|
@ -183,7 +183,7 @@ The input json file should be defined as follow:
|
|||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/iopsys/mybbfplugin.git",
|
||||
"repo": "https://dev.iopsys.eu/bbf/mybbfplugin.git",
|
||||
"proto": "git",
|
||||
"version": "tag/hash/branch",
|
||||
"dm_files": [
|
||||
|
|
@ -191,7 +191,7 @@ The input json file should be defined as follow:
|
|||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/iopsys/mydatamodeljson.git",
|
||||
"repo": "https://dev.iopsys.eu/bbf/mydatamodeljson.git",
|
||||
"proto": "git",
|
||||
"version": "tag/hash/branch",
|
||||
"dm_files": [
|
||||
|
|
@ -234,5 +234,5 @@ The input json file should be defined as follow:
|
|||
|
||||
> Note2: If proto is not defined in the json config file, then git is used by default as proto option.
|
||||
|
||||
- For more examples of tools input json file, you can see this link: [tools_input.json](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/tools/tools_input.json)
|
||||
- For more examples of tools input json file, you can see this link: [tools_input.json](../../tools/tools_input.json)
|
||||
|
||||
|
|
|
|||
|
|
@ -28,13 +28,13 @@ The **DM_MAP_OBJ** structure contains three arguments:
|
|||
|
||||
Each entry in the exclude table is a string which could be a path of object or parameter that need to be excluded from the tree
|
||||
|
||||
The following [link](https://dev.iopsys.eu/iopsys/bbf/-/blob/devel/libbbfdm/dmtree/vendor/test/tr181/vendor.c) contains example of Extend, Overwrite and Exclude table.
|
||||
The following [link](../../libbbfdm/dmtree/vendor/test/tr181/vendor.c) contains example of Extend, Overwrite and Exclude table.
|
||||
|
||||
### 3. Adding vendor and standard objects/Parameters
|
||||
|
||||
Implement the new vendor/standard objects and parameters as defined above in the first section.
|
||||
|
||||
Example: [Custom Vendor Object Dropbear](https://dev.iopsys.eu/iopsys/bbf/-/blob/devel/libbbfdm/dmtree/vendor/test/tr181/x_test_com_dropbear.c)
|
||||
Example: [Custom Vendor Object Dropbear](../../libbbfdm/dmtree/vendor/test/tr181/x_test_com_dropbear.c)
|
||||
|
||||
### 4. link vendor tables to the main tree
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ To register the new vendor tables, you need to link them in the main three table
|
|||
|
||||
These tables are defined in the file **'dmtree/vendor/vendor.c'**.
|
||||
|
||||
Example: [Link vendor tables to the main tree](https://dev.iopsys.eu/iopsys/bbf/-/blob/devel/libbbfdm/dmtree/vendor/vendor.c)
|
||||
Example: [Link vendor tables to the main tree](../../libbbfdm/dmtree/vendor/vendor.c)
|
||||
|
||||
### 5. Enable vendor
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ rm /usr/share/rpcd/schemas/bbf.json
|
|||
fault=0
|
||||
|
||||
# run functional on bbf object validation
|
||||
cp -r ./schemas/ubus/bbf.json /usr/share/rpcd/schemas/bbf.json
|
||||
cp -r ./schemas/ubus/bbfdm.json /usr/share/rpcd/schemas/bbf.json
|
||||
ubus-api-validator -t 5 -f ./test/funl/validation/bbf.validation.json > ./funl-result.log
|
||||
fault=$(( $fault + $? ))
|
||||
generate_report bbf_positive ./funl-result.log
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ static int operate_Device_FactoryReset(char *refparam, struct dmctx *ctx, void *
|
|||
* OBJ & LEAF DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
/* *** BBFDM *** */
|
||||
DMOBJ tEntry181Obj[] = {
|
||||
DMOBJ tEntryRoot[] = {
|
||||
/* 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}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "libbbfdm-api/dmcommon.h"
|
||||
|
||||
extern DMOBJ tEntry181Obj[];
|
||||
extern DMOBJ tEntryRoot[];
|
||||
extern DMOBJ tDeviceObj[];
|
||||
extern DMLEAF tDeviceParams[];
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@
|
|||
}
|
||||
},
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://dev.iopsys.eu/bbf/bbfdm/-/blob/devel/docs/api/bbfdm.md",
|
||||
"$id": "https://dev.iopsys.eu/bbf/bbfdm/-/blob/devel/docs/api/ubus/bbfdm.md",
|
||||
"type": "object",
|
||||
"title": "bbf",
|
||||
"object": "bbf",
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
"bbfdmd": [
|
||||
{
|
||||
"section": "bbfdmd",
|
||||
"description": "BBF daemon Settings",
|
||||
"description": "BBFDM daemon Settings",
|
||||
"multi": false,
|
||||
"options": [
|
||||
{
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
#include <libbbfdm/device.h>
|
||||
#include <libbbfdm/vendor.h>
|
||||
|
||||
static DMOBJ *TR181_ROOT_TREE = tEntry181Obj;
|
||||
static DMOBJ *TR181_ROOT_TREE = tEntryRoot;
|
||||
static DM_MAP_VENDOR *TR181_VENDOR_EXTENSION[2] = {
|
||||
tVendorExtension,
|
||||
tVendorExtensionOverwrite
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include <libbbfdm/device.h>
|
||||
#include <libbbfdm/vendor.h>
|
||||
|
||||
static DMOBJ *TR181_ROOT_TREE = tEntry181Obj;
|
||||
static DMOBJ *TR181_ROOT_TREE = tEntryRoot;
|
||||
static DM_MAP_VENDOR *TR181_VENDOR_EXTENSION[2] = {
|
||||
tVendorExtension,
|
||||
tVendorExtensionOverwrite
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include <libbbfdm/device.h>
|
||||
#include <libbbfdm/vendor.h>
|
||||
|
||||
static DMOBJ *TR181_ROOT_TREE = tEntry181Obj;
|
||||
static DMOBJ *TR181_ROOT_TREE = tEntryRoot;
|
||||
static DM_MAP_VENDOR *TR181_VENDOR_EXTENSION[2] = {
|
||||
tVendorExtension,
|
||||
tVendorExtensionOverwrite
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ config interface 'wan'
|
|||
|
||||
config interface 'wan6'
|
||||
option proto 'dhcpv6'
|
||||
option device '@wan'
|
||||
option device 'eth0'
|
||||
|
||||
config device 'br_test_1'
|
||||
option name 'br-test'
|
||||
|
|
|
|||
|
|
@ -511,7 +511,7 @@ def generate_supported_dm(vendor_prefix=None, vendor_list=None, plugins=None):
|
|||
|
||||
remove_folder(".repo")
|
||||
try:
|
||||
subprocess.run(["git", "clone", repo, ".repo"],
|
||||
subprocess.run(["git", "clone", "--depth", "1", repo, ".repo"],
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check = True)
|
||||
except (OSError, subprocess.SubprocessError) as _e:
|
||||
print(f' Failed to clone {repo} !!!!!')
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ if __name__ == '__main__':
|
|||
parser.add_argument(
|
||||
'-r', '--remote-dm',
|
||||
action='append',
|
||||
metavar = 'git^https://dev.iopsys.eu/iopsys/stunc.git^devel',
|
||||
metavar = 'git^https://dev.iopsys.eu/bbf/stunc.git^devel',
|
||||
help= 'Includes OBJ/PARAM defined under remote repositories defined as bbf plugin'
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ if __name__ == '__main__':
|
|||
parser.add_argument(
|
||||
'-r', '--remote-dm',
|
||||
action='append',
|
||||
metavar = 'git^https://dev.iopsys.eu/iopsys/stunc.git^devel',
|
||||
metavar = 'git^https://dev.iopsys.eu/bbf/stunc.git^devel',
|
||||
help= 'Includes OBJ/PARAM defined under remote repositories defined as bbf plugin'
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -17,18 +17,18 @@
|
|||
"vendor_prefix": "X_IOPSYS_EU_",
|
||||
"plugins": [
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/iopsys/bulkdata.git",
|
||||
"repo": "https://dev.iopsys.eu/bbf/bulkdata.git",
|
||||
"proto": "git",
|
||||
"dm_files": [
|
||||
"bbf_plugin/bulkdata.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/iopsys/xmppc.git",
|
||||
"repo": "https://dev.iopsys.eu/bbf/xmppc.git",
|
||||
"proto": "git"
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/iopsys/stunc.git",
|
||||
"repo": "https://dev.iopsys.eu/bbf/stunc.git",
|
||||
"proto": "git",
|
||||
"version": "devel",
|
||||
"dm_files": [
|
||||
|
|
@ -36,15 +36,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/iopsys/udpechoserver.git",
|
||||
"proto": "git",
|
||||
"version": "master",
|
||||
"dm_files": [
|
||||
"datamodel.c"
|
||||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/iopsys/twamp-light.git",
|
||||
"repo": "https://dev.iopsys.eu/bbf/udpecho.git",
|
||||
"proto": "git",
|
||||
"version": "devel",
|
||||
"dm_files": [
|
||||
|
|
@ -52,7 +44,15 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/iopsys/periodicstats.git",
|
||||
"repo": "https://dev.iopsys.eu/bbf/twamp-light.git",
|
||||
"proto": "git",
|
||||
"version": "devel",
|
||||
"dm_files": [
|
||||
"src/datamodel.c"
|
||||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/bbf/periodicstats.git",
|
||||
"proto": "git",
|
||||
"version": "devel",
|
||||
"dm_files": [
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/iopsys/swmodd.git",
|
||||
"repo": "https://dev.iopsys.eu/lcm/swmodd.git",
|
||||
"proto": "git",
|
||||
"version": "devel",
|
||||
"dm_files": [
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/iopsys/usermngr.git",
|
||||
"repo": "https://dev.iopsys.eu/bbf/usermngr.git",
|
||||
"proto": "git",
|
||||
"version": "devel",
|
||||
"dm_files": [
|
||||
|
|
@ -88,7 +88,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"repo": "https://dev.iopsys.eu/iopsys/icwmp.git",
|
||||
"repo": "https://dev.iopsys.eu/bbf/icwmp.git",
|
||||
"proto": "git",
|
||||
"version": "devel",
|
||||
"dm_files": [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue