Skip to content

Latest commit

 

History

History
68 lines (51 loc) · 2.73 KB

API-Overview.md

File metadata and controls

68 lines (51 loc) · 2.73 KB

API Overview

Source Examples

  • src/com/comcast/oscar/examples/

Typical API Flow

  1. Parse/import config text or binary into TLV structures.
  2. Modify values or insert TLVs.
  3. Export back to text or binary.

Key Classes

  • ConfigurationFileImport
  • ConfigurationFileExport
  • ConfigurationFile
  • TlvBuilder
  • TlvDisassemble
  • TlvAssembler
  • DocsisMicVerifier

Notes

  • CLI is the easiest path for operational usage.
  • API is best for embedded tooling, automation, and custom transforms.

Check a shared secret against a binary

Call DocsisMicVerifier.verify(binary, profile, secretBytes) with the original binary and Profile.DOCSIS_31 or Profile.DOCSIS_40. Do not recompile the file before verification: doing so generates new MICs with the supplied key.

The result has separate cm(), cmts() and extended() statuses. A CM match alone does not check the secret. A mismatch can indicate either a different key or modified covered data. Missing and unsupported MICs are reported explicitly. For separate legacy and extended keys, use the four-argument overload.

See MIC verification and generation for imports, examples, status definitions and supported algorithms. This checker is a Java API; it is not exposed by the CLI or OSCAR-UI yet.

Generate extended MICs

Construct ConfigurationFile with DOCSIS_VER_31 or DOCSIS_VER_40, the imported TLVs and a nonempty shared secret, then call commit() before reading toByteArray(). Include TLV 43.6 parameters to select implicit or explicit HMAC-MD5/MMH. The generation guide shows the D3.1 names and bitmap syntax. D4.0 retains its separate catalog names.

Damaged binary diagnostics

See Binary TLV diagnostics for bounded, read-only partial inspection through TlvDisassemble.diagnose.

Complete DOCSIS file validation

Use the public minimum validator for text or binary files and in-memory editor content. It checks top-level required settings without generating MICs or requiring a secret. Compilation enforces the same rule.

Dictionary lookups

Use new TlvDictionary(TlvDictionary.DOCSIS_DICTIONARY_TABLE_NAME) for DOCSIS lookups, or the corresponding family constant. Definitions load from the bundled JSON registry; no database setup or dictionary export is needed. DictionaryTLV.getTypeHierarchyStack(path, dictionary) accepts this lookup API. The old SQL query classes and database helpers are removed in this revamp; clients using those APIs must migrate and recompile.

See data type formats for accepted literals, named pattern groups, byte examples and malformed-input behavior.