Repository navigation
Conversation
Vendor the vss-tools him-support datamodel (typed NodeTypes_t covering all HIM profiles) into utils and adapt treeutils.go to it, keeping the VISSR hardening and forest handling. Adds utils/TREEUTILS.md describing the previous implementation and the changes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors VISSR's Go tree parser (
utils/treeutils.go) to use the updated, HIM-profile aware binary parser from the vss-toolshim-supportbranch (binary/go_parserdatamodel + parserlib, commit ca5b158). The VISSR tree handling predates that update and only knew the VSS-era node types as strings.The parser data model is vendored into
utils(utils/datamodel.go) rather than imported as a module, because thehim-supportchanges are not yet inCOVESA/vss-toolsand the existingreplacedirectives ingo.modwere commented out. The VISSR-specific hardening (error propagation, depth/node caps, mutex, nil guards) and the forest handling (InitForest, service tree registration) are kept.How it worked before (short version)
Full write-up is in
utils/TREEUTILS.md.treeutils.goheld a private copy of the vss-tools Go binary parser, with VISSR additions (forest of trees fromviss.him, hardening, constructors for dynamically registered service trees).Node_t.NodeTypewas astring; the known types (sensor, actuator, attribute, branch, struct, property, procedure, iostruct) were string constants.ro,rw,symlink,typedefhad none. The default value was inDefaultValue.leafNodesOnly, every node that was not abranchcounted as a leaf, sostruct,procedureandiostructnodes were reported as leaves.branch/struct.What changed
Node_t.NodeTypestringNodeTypes_twith constants for all HIM node types (addsRO, RW, SYMLINK, TYPEDEF)StringToNodetype()/NodetypeToString(); unknown type in a binary file is now a parse errorDefaultValueDefaultAllowed(vss-tools name)VSSgetType()stringNodeTypes_t(useNodetypeToString()for JSON/log output)branchIsContainerType()false (branch, struct, procedure, iostructare never leaves)symlinkviaIsTypeWithoutDatatype()NewSignalNode()stringNodeTypes_t(existing callers compile unchanged, constants are untyped)Callers updated:
vissv2server.go,vissServiceMgr.go,setvalidate.go, and the affected tests.Unchanged: binary file format,
viss.himformat, search algorithm, exported function names apart from the type changes above.Behavior change to review
struct,procedureandiostructnodes are no longer included in leaf searches (path list files via--pathlist, Data profileget). Non-leaf searches return the same nodes as before.Verification
server/vissv2server/forest/with the old and new parser and diffed a dump of every node (name, type, datatype, unit, min, max, allowed, default, validate, children, uuid, description), the default lists, and wildcard searches. Node dumps, default lists and non-leaf searches are identical. The only difference is the 26 container nodes (3 procedure, 17 iostruct, 6 struct) that are now excluded from leaf lists/searches; nothing was added.go vetis clean for./utilsand./server/vissv2server/....go testpasses forserver/vissv2server,server/vissv2server/vissServiceMgrandserver/vissv2server/atServer.go test ./utilshas 3 failures that are pre-existing on the v3.2.5 tip and unrelated to this change (verified before making any edits):TestExportKeyPair_PrivateFileIs0600,TestExportKeyPair_ECDSA_FileIs0600(file mode 0666 vs 0600) andTestInitLog_WithLogFile. These look Windows-specific.