internal

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnknownLabel = "<unknown>"
)
View Source
const WellKnownModuleName types.SmiIdentifier = "<well-known>"

Variables

View Source
var (
	WellKnownIdCcitt         types.SmiSubId = 0
	WellKnownIdIso           types.SmiSubId = 1
	WellKnownIdJointIsoCcitt types.SmiSubId = 2
)

Functions

func AppendFS

func AppendFS(fs ...NamedFS)

func Exit

func Exit()

func GetFlags

func GetFlags() int

func GetModuleFile

func GetModuleFile(name string) (string, io.ReadCloser, error)

func GetPath

func GetPath() string

func GetValue

func GetValue(value string, baseType types.BaseType) types.SmiValue

func GetValueInt32

func GetValueInt32(value string) int32

func GetValueInt64

func GetValueInt64(value string) int64

func GetValueUint32

func GetValueUint32(value string) uint32

func GetValueUint64

func GetValueUint64(value string) uint64

func Init

func Init(handleName string) bool

func Initialized

func Initialized() bool

func PrependFS

func PrependFS(fs ...NamedFS)

func SetErrorHandler

func SetErrorHandler(smiErrorHandler types.SmiErrorHandler)

func SetErrorLevel

func SetErrorLevel(level int)

func SetFS

func SetFS(fs ...NamedFS)

func SetFlags

func SetFlags(userflags int)

func SetPath

func SetPath(path ...string)

func SetSeverity

func SetSeverity(pattern string, severity int)

Types

type DirEntry

type DirEntry = fs.DirEntry

type FS

type FS = fs.ReadDirFS

type File

type File = fs.File

type Flags

type Flags uint16
const (
	FlagRoot         Flags = 0x0001 // Mark node tree's root
	FlagSeqType      Flags = 0x0002 // Type is set from SMIv1/2 SEQUENCE
	FlagRegistered   Flags = 0x0004 // On an Object: this is registered
	FlagIncomplete   Flags = 0x0008 // Just defined by a forward referenced type or object
	FlagCreatable    Flags = 0x0040 // On a Row: new rows can be created
	FlagInGroup      Flags = 0x0080 // Node is contained in a group
	FlagInCompliance Flags = 0x0100 // Group is mentioned in a compliance statement. In case of ImportFlags: the import is done through a compliance MODULE phrase
	FlagInSyntax     Flags = 0x0200 // Type is mentioned in a syntax statement
)

func (Flags) Has

func (x Flags) Has(flag Flags) bool

type Handle

type Handle struct {
	Name                 string
	Prev                 *Handle
	Next                 *Handle
	Modules              ModuleMap
	RootNode             *Node
	TypeBits             *Type
	TypeEnum             *Type
	TypeInteger32        *Type
	TypeInteger64        *Type
	TypeObjectIdentifier *Type
	TypeOctetString      *Type
	TypeUnsigned32       *Type
	TypeUnsigned64       *Type
	Flags                Flags
	Paths                []NamedFS
	Cache                string
	CacheProg            string
	ErrorLevel           int
	ErrorHandler         types.SmiErrorHandler
}

type Import

type Import struct {
	types.SmiImport
	ModulePtr *Module
	Flags     Flags
	Prev      *Import
	Next      *Import
	Kind      Kind
	Used      bool
	Line      int
}

type ImportMap

type ImportMap struct {
	First *Import
	// contains filtered or unexported fields
}

func (*ImportMap) Add

func (x *ImportMap) Add(i *Import)

func (*ImportMap) Get

func (x *ImportMap) Get(name types.SmiIdentifier) *Import

func (*ImportMap) GetName

func (x *ImportMap) GetName(name string) *Import

type Index

type Index struct {
	Implied   int
	IndexKind types.IndexKind
	List      *List
	Row       *Object
}

type Kind

type Kind int
const (
	KindUnknown  Kind = 0
	KindModule   Kind = 1
	KindMacro    Kind = 2
	KindType     Kind = 3
	KindObject   Kind = 4
	KindImport   Kind = 5
	KindImported Kind = 6
	KindNotFound Kind = 7
)

type List

type List struct {
	types.SmiElement
	Ptr  interface{}
	Next *List
}

type Macro

type Macro struct {
	types.SmiMacro
	Module *Module
	Flags  Flags
	Next   *Macro
	Prev   *Macro
	Line   int
}

type MacroMap

type MacroMap struct {
	First *Macro
	// contains filtered or unexported fields
}

func (*MacroMap) Add

func (x *MacroMap) Add(m *Macro)

func (*MacroMap) Get

func (x *MacroMap) Get(name types.SmiIdentifier) *Macro

func (*MacroMap) GetName

func (x *MacroMap) GetName(name string) *Macro

type Module

type Module struct {
	types.SmiModule
	LastUpdated            time.Time
	Identity               *Object
	Objects                ObjectMap
	Types                  TypeMap
	Macros                 MacroMap
	Imports                ImportMap
	FirstRevision          *Revision
	LastRevision           *Revision
	Flags                  Flags
	NumImportedIdentifiers int
	NumStatements          int
	NumModuleIdentities    int
	Prev                   *Module
	Next                   *Module
	PrefixNode             *Node
	// contains filtered or unexported fields
}

func BuildModule

func BuildModule(path string, in *parser.Module) (*Module, error)

func FindModuleByName

func FindModuleByName(modulename string) *Module

func GetFirstModule

func GetFirstModule() *Module

func GetModule

func GetModule(name string) (*Module, error)

func LoadModule

func LoadModule(name string) (*Module, error)

func (*Module) AddRevision

func (x *Module) AddRevision(revision *Revision)

func (*Module) GetObject

func (x *Module) GetObject(name types.SmiIdentifier) *Object

func (*Module) GetType

func (x *Module) GetType(name types.SmiIdentifier) *Type

func (*Module) IsWellKnown

func (x *Module) IsWellKnown() bool

func (*Module) SetPrefixNode

func (x *Module) SetPrefixNode(n *Node)

type ModuleMap

type ModuleMap struct {
	First *Module
	// contains filtered or unexported fields
}

func (*ModuleMap) Add

func (x *ModuleMap) Add(m *Module)

func (*ModuleMap) Get

func (x *ModuleMap) Get(name types.SmiIdentifier) *Module

func (*ModuleMap) GetName

func (x *ModuleMap) GetName(name string) *Module

type NamedFS

type NamedFS struct {
	Name string
	FS   FS
}

type NamedNumber

type NamedNumber struct {
	types.SmiNamedNumber
	Type *Type
	List *List
}

type Node

type Node struct {
	SubId       types.SmiSubId
	Flags       Flags
	OidLen      int
	Oid         types.Oid
	Parent      *Node
	Prev        *Node
	Next        *Node
	Children    NodeChildMap
	FirstObject *Object
	LastObject  *Object
}

func FindNodeByOid

func FindNodeByOid(oidlen int, oid types.Oid) *Node

func Root

func Root() *Node

func (*Node) AddObject

func (x *Node) AddObject(obj *Object)

func (*Node) IsRoot

func (x *Node) IsRoot() bool

type NodeChildMap

type NodeChildMap struct {
	First *Node
	// contains filtered or unexported fields
}

func (*NodeChildMap) Add

func (x *NodeChildMap) Add(n *Node)

func (*NodeChildMap) Get

func (x *NodeChildMap) Get(id types.SmiSubId) *Node

type Object

type Object struct {
	types.SmiNode
	Module         *Module
	Flags          Flags
	Type           *Type
	Related        *Object
	List           *List
	OptionList     *List
	RefinementList *List
	Node           *Node
	Prev           *Object
	Next           *Object
	PrevSameNode   *Object
	NextSameNode   *Object
	UniquenessPtr  *List
	Line           int
	// contains filtered or unexported fields
}

func FindObjectByModuleAndNode

func FindObjectByModuleAndNode(modulePtr *Module, nodePtr *Node) *Object

func FindObjectByModuleNameAndNode

func FindObjectByModuleNameAndNode(module string, nodePtr *Node) *Object

func FindObjectByNode

func FindObjectByNode(nodePtr *Node) *Object

func GetNextChildObject

func GetNextChildObject(startNodePtr *Node, modulePtr *Module, nodekind types.NodeKind) *Object

func (*Object) AddElement

func (x *Object) AddElement(obj *Object)

func (*Object) AddElements

func (x *Object) AddElements(ids []types.SmiIdentifier)

func (*Object) AddOption

func (x *Object) AddOption(option *Option)

func (*Object) AddRefinement

func (x *Object) AddRefinement(refinement *Refinement)

func (*Object) GetSmiNode

func (x *Object) GetSmiNode() *types.SmiNode

type ObjectMap

type ObjectMap struct {
	First *Object
	// contains filtered or unexported fields
}

func (*ObjectMap) Add

func (x *ObjectMap) Add(o *Object)

func (*ObjectMap) AddWithOid

func (x *ObjectMap) AddWithOid(o *Object, oid parser.Oid)

func (*ObjectMap) Get

func (x *ObjectMap) Get(name types.SmiIdentifier) *Object

func (*ObjectMap) GetName

func (x *ObjectMap) GetName(name string) *Object

type Option

type Option struct {
	types.SmiOption
	Compliance *Object
	Object     *Object
	Line       int
	List       *List
}

type Range

type Range struct {
	types.SmiRange
	Type *Type
	List *List
}

type Refinement

type Refinement struct {
	types.SmiRefinement
	Compliance *Object
	Object     *Object
	Type       *Type
	WriteType  *Type
	Line       int
	List       *List
}

type Revision

type Revision struct {
	types.SmiRevision
	Module *Module
	Prev   *Revision
	Next   *Revision
	Line   int
}

type Type

type Type struct {
	types.SmiType
	Module *Module
	Parent *Type
	List   *List
	Flags  Flags
	Prev   *Type
	Next   *Type
	Line   int
	// contains filtered or unexported fields
}

func GetBaseTypeFromSyntax

func GetBaseTypeFromSyntax(syntax parser.SyntaxType) *Type

func (*Type) AddList

func (x *Type) AddList(list *List)

func (*Type) AddNamedNumber

func (x *Type) AddNamedNumber(name types.SmiIdentifier, value types.SmiValue)

func (*Type) AddRange

func (x *Type) AddRange(min types.SmiValue, max types.SmiValue)

type TypeMap

type TypeMap struct {
	First *Type
	// contains filtered or unexported fields
}

func (*TypeMap) Add

func (x *TypeMap) Add(t *Type)

func (*TypeMap) Get

func (x *TypeMap) Get(name types.SmiIdentifier) *Type

func (*TypeMap) GetName

func (x *TypeMap) GetName(name string) *Type

Jump to

Keyboard shortcuts

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