mirror of
https://dev.iopsys.eu/bbf/obuspa.git
synced 2025-12-20 00:51:21 +08:00
Updated vendor integration details
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
## Getting Started
|
||||
### Some Ways to Contribute
|
||||
* Report potential bugs.
|
||||
* Improve our guides and documentation. OB-USP-Agents's [QUICK_START_GUIDE](https://github.com/BroadbandForum/obuspa/blob/master/QUICK_START_GUIDE.md) is deployed from this repo.
|
||||
* Improve our guides and documentation. OB-USP-Agents's [QUICK_START_GUIDE](QUICK_START_GUIDE.md) is deployed from this repo.
|
||||
* Respond to questions about usage on the issue tracker or mailing list.
|
||||
|
||||
### Reporting an Issue:
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
## Building OB-USP-Agent
|
||||
|
||||
For build instructions, please refer to [QUICK_START_GUIDE](https://github.com/BroadbandForum/obuspa/blob/master/QUICK_START_GUIDE.md).
|
||||
For build instructions, please refer to [QUICK_START_GUIDE](QUICK_START_GUIDE.md).
|
||||
|
||||
## Contributor License Agreement
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ Device.MQTT.Client.
|
||||
Device.STOMP.Connection.
|
||||
```
|
||||
Below is an example uci, complete list of supported uci parameters is available [link](./docs/api/obuspa.md), which is generated from [uci schema](./schemas/uci/obuspa.json)
|
||||
```bash
|
||||
```shellscript
|
||||
config obuspa 'global'
|
||||
option enabled '1'
|
||||
option interface 'wan'
|
||||
@@ -67,6 +67,32 @@ OBUSPA in itself has support for below datamodel objects
|
||||
|
||||
For rest of datamodel objects it depends on vendor integrations. Which mostly make the whole USP solution a monolithic block. To make it modular, we did the integration which gets the data over ubus(default rpc bus in openwrt), so that it can easily integrate with any 3rd party data-store. Currently it usages uspd as a data-store which exposes the datamodel object over ubus.
|
||||
|
||||
### Theory of operation
|
||||
OBUSPA operations divided in three blocks {Init, Start, Stop}, vendor integration also follows the same.
|
||||
- Vendor_Init
|
||||
- Calculate and update cached time for multi-instance objects
|
||||
- Loads objects in memory for which caching is disabled
|
||||
- Reads mandatory objects from uspd, list of parameters available in (uspd_cache_mandatory_data)
|
||||
- Gets schema from uspd and register each parameter based on type
|
||||
- Registers below vendor hooks
|
||||
- Reboot
|
||||
- Factory Reset
|
||||
- Transaction start
|
||||
- Transaction commit
|
||||
- Transaction abort
|
||||
- ControllerTrust roles registration
|
||||
|
||||
- Vendor_Start
|
||||
- Starts a ubus thread
|
||||
- Responsible for getting the data exposed over ubus
|
||||
- Registered for `usp.event` ubus event to signal generated event
|
||||
- Registered for `usp.AddObj` ubus event to signal newly added object instances
|
||||
- Registered for `usp.DelObj` ubus event to signal deleted object instances
|
||||
- Setup a socket pair to interact with Ubus thread
|
||||
|
||||
- Vendor_Stop
|
||||
- Free-up the dynamic allocated data and return
|
||||
|
||||
## How-to guide
|
||||
### How to add controller trust roles
|
||||
Currently OBUSPA does not support adding a new Role in the Role table, they are read-only and needed to be pre-created during init process. By default it support two roles, named
|
||||
@@ -78,6 +104,37 @@ By using vendor-hooks we have added support to add more roles by defining them i
|
||||
### How to override the default role definitions
|
||||
Default roles (full_access, Untrusted) can be overridden by defining a role in json with same name. This [example json](./test/files/etc/obuspa/roles.json) has overridden Untrusted role.
|
||||
|
||||
### How to change the max caching interval for multi-instance objects
|
||||
Max caching internal is controlled by `MAX_CACHE_TIME` in `vendor_uspd.c`. Max caching interval is calculated at the runtime, it usually
|
||||
|
||||
```
|
||||
max_cache_tme = MAX_CACHE_TIME + Time to get Device. from uspd
|
||||
```
|
||||
|
||||
### How to optimize the group calls
|
||||
OBUSPA provides mechanism to define the groups, so that the IPC cost can be minimised with Vendor integration. Currently the groups are created based on `MAX_GROUP_SEP(2)` meaning, objects are grouped with upto two delim(.) points, meaning, we have groups for Device.IP., Device.WiFi., Device.Ethernet. etc.
|
||||
|
||||
Now each call to a parameter result into calling the complete group, which is again not very efficient. So to optimize this, 'MIN_NUM_TO_GROUP(10)' is used.
|
||||
So that, if the number of parameters are less than 'MIN_NUM_TO_GROUP', then only these parameters are get otherwise complete group is fetched from uspd and then required parameters are set accordingly.
|
||||
|
||||
### How to configure the ubus timeouts
|
||||
All calls except operates usages `ubus_invoke` which requires a timeout value, which is handled by `USPD_TIMEOUT(10s)` in `vendor_uspd.c`.
|
||||
|
||||
### How does obuspa registers for new schema
|
||||
In OBUSPA, registering new schema at runtime (after Start call) is not allowed, so to update the schema procd hooks used.
|
||||
uspd pools for schema updates, once it detects schema change, it sends an ubus notification on usp.raw with '{"action":"schema_update_available"}' which reloads the obuspa services and thus it registers the new schema.
|
||||
|
||||
### How to define a multi-instance object in no caching list
|
||||
It is supported to define the list of object for which obuspa shall not cache the instances using a json, meaning get value shall result in instance updates and then get_value from lower layer. Below is an example json:
|
||||
```json
|
||||
{
|
||||
"dmcaching_exclude": [
|
||||
"Device.DeviceInfo.ProcessStatus.Process.",
|
||||
"Device.Hosts.Host."
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
OBUSPA has some compile time dependency and some run time dependencies as listed below:
|
||||
|
||||
|
||||
@@ -4,12 +4,17 @@ Open Broadband-User Services Platform-Agent (OB-USP-Agent) is an open source pro
|
||||
|
||||
## Quick Start
|
||||
|
||||
For build instructions, please refer to [QUICK_START_GUIDE](https://github.com/BroadbandForum/obuspa/blob/master/QUICK_START_GUIDE.md).
|
||||
For build instructions, please refer to [QUICK_START_GUIDE](QUICK_START_GUIDE.md).
|
||||
|
||||
## Contributing
|
||||
|
||||
Thank you for your interest in contributing! Please refer to [CONTRIBUTING.md](https://github.com/BroadbandForum/obuspa/blob/master/CONTRIBUTING.md) for guidance.
|
||||
Thank you for your interest in contributing! Please refer to [CONTRIBUTING.md](CONTRIBUTING.md) for guidance.
|
||||
|
||||
## Wiki Access
|
||||
|
||||
Please also see our [WIKI](https://github.com/BroadbandForum/obuspa/wiki) for more details about the project.
|
||||
|
||||
## Vendor Integration
|
||||
### Ubus Integration
|
||||
|
||||
Please also see [Readme](README-iopsys.md) for more details about the integration done using uspd.
|
||||
|
||||
Reference in New Issue
Block a user