coreconf

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package coreconf carries SCHC rule sets in the CORECONF form: RFC 9363 instance data encoded in CBOR with YANG Schema Item iDentifiers (SIDs), as RFC 9254 specifies, for rule management over CoAP (CORECONF).

Map keys are SID deltas from the parent node's SID (RFC 9254 3.2); identityref leaves are SIDs (6.10.1), and in the field-length union they carry CBOR tag 45 (6.12); binary leaves are byte strings. The decoder also takes identities as names (6.10.2).

RFC 9363 assigned no SIDs. Default uses openschc's assignment for ietf-schc@2023-01-28 (entry point 5000) and ietf-schc-oam@2021-11-10 (2000000), and ours for the cb-sigma-schc extension module (60000) and RFC 9441's ietf-schc-compound-ack (60100), both in the experimental range of RFC 9595. None of them is IANA-registered, so a peer must use the same SID files: LoadSIDFile reads others, in the RFC 9595 format or openschc's older one.

The CBOR codec is github.com/fxamacker/cbor/v2; this package is separate so that the schc package itself has no dependency outside the standard library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromJSON

func FromJSON(js []byte, sids *SIDs) ([]byte, error)

FromJSON converts ietf-schc instance data from RFC 7951 JSON to CBOR with SIDs.

func Marshal

func Marshal(rs *schc.RuleSet, sids *SIDs) ([]byte, error)

Marshal writes a compiled rule set in the CORECONF form with sids (nil for Default).

func ToJSON

func ToJSON(b []byte, sids *SIDs) ([]byte, error)

ToJSON converts ietf-schc instance data from CBOR with SIDs to RFC 7951 JSON.

func Unmarshal

func Unmarshal(b []byte, sids *SIDs, opt schc.YANGOptions) (rs *schc.RuleSet, skipped []error, err error)

Unmarshal reads a rule set in the CORECONF form and compiles it, with opt as for schc.ParseYANGWith; skipped lists rules left out.

Types

type SIDs

type SIDs struct {
	// contains filtered or unexported fields
}

SIDs maps schema items to SIDs: data nodes by schema path ("/ietf-schc:schc/rule/entry/field-id") and identities by "module:identity".

func Default

func Default() *SIDs

Default is the table of the embedded SID files (see the package documentation). It must not be changed; Clone it to add to it.

func NewSIDs

func NewSIDs() *SIDs

NewSIDs is an empty table.

func (*SIDs) Clone

func (s *SIDs) Clone() *SIDs

Clone copies the table.

func (*SIDs) LoadSIDFile

func (s *SIDs) LoadSIDFile(b []byte) error

LoadSIDFile adds the items of a SID file: RFC 9595's {"ietf-sid-file:sid-file": {…}} or the older form openschc uses.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL