DBDelve
Dive deep into your data. A fast, native, multi-engine database client written in Rust. Free and open source, no telemetry.
翻译准备中
尚未检测到更新。GitHub 发布版本后会显示在这里。
制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗A small C99 tool (tr181ctl) that exposes an embedded Linux device as a
TR-181 (Device:2) data model. It reads /proc and /sys/class/net, answers
ubus-cli-style get/set queries, and prints USP (TR-369)-style GetResp JSON.
Ships with an OpenWrt package Makefile and a Yocto recipe.
Live playground: docs/index.html (enable GitHub Pages on the docs/ folder).
| Object | Access | Source |
|---|---|---|
Device.DeviceInfo. (Manufacturer, ModelName, SoftwareVersion, UpTime, MemoryStatus.Total) | R | uname, /proc/uptime, /proc/meminfo |
Device.Ethernet.Interface.{i}. (Name, Status, MACAddress, MaxMTUSize) | R | /sys/class/net/<if>/ |
Device.Ethernet.Interface.{i}.Stats. (Bytes/Packets/Errors Sent/Received) | R | /sys/class/net/<if>/statistics/ |
Device.ManagementServer. (URL, PeriodicInformEnable, PeriodicInformInterval) | RW | in memory, persisted to $TR181_STATE |
make && make test
./tr181ctl get Device.DeviceInfo. # partial path -> whole object
./tr181ctl get Device.Ethernet.Interface.1.Status
./tr181ctl set Device.ManagementServer.URL https://acs.example.net
./tr181ctl json Device.DeviceInfo. # USP-style GetResp
./tr181ctl schema # every param, type, access
./tr181ctl shell # interactive prompt
Example:
$ ./tr181ctl json Device.DeviceInfo.
{
"get_resp": {
"requested_path": "Device.DeviceInfo.",
"err_code": 0,
"result_params": {
"Device.DeviceInfo.Manufacturer": "OpenSource CPE",
"Device.DeviceInfo.UpTime": 145,
...
}
}
}
Errors follow the data model rules: unknown paths fail, read-only parameters
reject set, and values are type-checked (unsignedInt, boolean, string).
An invalid path in json returns USP error code 7026.
src/datamodel.c – every parameter is produced by a getter and passed to a
visitor callback, so get, json, schema and state saving share one walk.operstate is mapped to the TR-181 Status enum (Up, Down, Dormant, ...).src/main.c – CLI, JSON formatter, state persistence, interactive shell.OpenWrt – copy packaging/openwrt/Makefile to package/tr181-agent/ in your
OpenWrt tree, then make package/tr181-agent/compile.
Yocto – add packaging/yocto/tr181-agent_1.0.0.bb to your layer (point
SRC_URI at this repo) and run bitbake tr181-agent.
Cross-compile by hand – make CC=aarch64-linux-gnu-gcc.
ubus (libubus) so ubus call can query it.Device.IP.Interface.{i}.IPv4Address. from netlink.