oid

package
v0.0.0-...-8a9cd57 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2015 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package oid implements SNMP OID and related data structures.

Index

Constants

View Source
const (
	PrinterSubUnitAvailableAndIdle         PrinterSubUnitStatusTC = 0
	PrinterSubUnitAvailableAndStandby                             = 2
	PrinterSubUnitAvailableAndActive                              = 4
	PrinterSubUnitAvailableAndBusy                                = 6
	PrinterSubUnitUnavailable                                     = 1
	PrinterSubUnitUnavailableAndOnRequest                         = 1
	PrinterSubUnitUnavailableBecauseBroken                        = 3
	PrinterSubUnitUnknown                                         = 5
	PrinterSubUnitNonCritical                                     = 8
	PrinterSubUnitCritical                                        = 16
	PrinterSubUnitOffline                                         = 32
	PrinterSubUnitTransitioning                                   = 64
)
View Source
const (
	PrinterMarkerSuppliesClassOther    PrinterMarkerSuppliesClassTC = "1" // other
	PrinterMarkerSuppliesClassConsumed                              = "3" // supplyThatIsConsumed
	PrinterMarkerSuppliesClassFilled                                = "4" // receptacleThatIsFilled
)

Variables

View Source
var (
	PrinterMIB                       OID = OID{1, 3, 6, 1, 2, 1, 43}
	PrinterMIBGeneral                    = append(PrinterMIB, OID{5}...)
	PrinterGeneralSerialNumber           = append(PrinterMIBGeneral, OID{1, 1, 17, 1}...)
	PrinterMIBCover                      = append(PrinterMIB, OID{6}...)
	PrinterCoverDescription              = append(PrinterMIBCover, OID{1, 1, 2, 1}...)
	PrinterCoverStatus                   = append(PrinterMIBCover, OID{1, 1, 3, 1}...)
	PrinterMIBInput                      = append(PrinterMIB, OID{8}...)
	PrinterInputMaxCapacity              = append(PrinterMIBInput, OID{2, 1, 9, 1}...)
	PrinterInputCurrentLevel             = append(PrinterMIBInput, OID{2, 1, 10, 1}...)
	PrinterInputStatus                   = append(PrinterMIBInput, OID{2, 1, 11, 1}...)
	PrinterInputName                     = append(PrinterMIBInput, OID{2, 1, 13, 1}...)
	PrinterMIBOutput                     = append(PrinterMIB, OID{9}...)
	PrinterOutputMaxCapacity             = append(PrinterMIBOutput, OID{2, 1, 4, 1}...)
	PrinterOutputRemainingCapacity       = append(PrinterMIBOutput, OID{2, 1, 5, 1}...)
	PrinterOutputStatus                  = append(PrinterMIBOutput, OID{2, 1, 6, 1}...)
	PrinterOutputName                    = append(PrinterMIBOutput, OID{2, 1, 7, 1}...)
	PrinterMIBMarker                     = append(PrinterMIB, OID{11}...)
	PrinterMarkerSuppliesClass           = append(PrinterMIBMarker, OID{1, 1, 4, 1}...)
	PrinterMarkerSuppliesType            = append(PrinterMIBMarker, OID{1, 1, 5, 1}...)
	PrinterMarkerSuppliesDescription     = append(PrinterMIBMarker, OID{1, 1, 6, 1}...)
	PrinterMarkerSuppliesSupplyUnit      = append(PrinterMIBMarker, OID{1, 1, 7, 1}...)
	PrinterMarkerSuppliesMaxCapacity     = append(PrinterMIBMarker, OID{1, 1, 8, 1}...)
	PrinterMarkerSuppliesLevel           = append(PrinterMIBMarker, OID{1, 1, 9, 1}...)
	PrinterMIBMarkerColorant             = append(PrinterMIB, OID{12}...)
	PrinterMarkerColorantValue           = append(PrinterMIBMarkerColorant, OID{1, 1, 4, 1}...)
)

Some MIB definitions from Printer-MIB (RFC 3805).

View Source
var PrinterCoverStatusTC map[string]string = map[string]string{
	"1": "other",
	"2": "unknown",
	"3": "coverOpen",
	"4": "coverClosed",
	"5": "interlockOpen",
	"6": "interlockClosed",
}

Printer cover status TC.

Printer cover status to cdd.CoverStateType.

View Source
var PrinterMarkerSuppliesSupplyUnitTC map[string]string = map[string]string{
	"1":  "other",
	"2":  "unknown",
	"3":  "tenThousandthsOfInches",
	"4":  "micrometers",
	"7":  "impressions",
	"8":  "sheets",
	"11": "hours",
	"12": "thousandthsOfOunces",
	"13": "tenthsOfGrams",
	"14": "hundrethsOfFluidOunces",
	"15": "tenthsOfMilliliters",
	"16": "feet",
	"17": "meters",
	"18": "items",
	"19": "percent",
}

Printer marker supplies supply unit TC.

View Source
var PrinterMarkerSuppliesTypeTC map[string]string = map[string]string{
	"1":  "other",
	"2":  "unknown",
	"3":  "toner",
	"4":  "wasteToner",
	"5":  "ink",
	"6":  "inkCartridge",
	"7":  "inkRibbon",
	"8":  "wasteInk",
	"9":  "opc",
	"10": "developer",
	"11": "fuserOil",
	"12": "solidWax",
	"13": "ribbonWax",
	"14": "wasteWax",
	"15": "fuser",
	"16": "coronaWire",
	"17": "fuserOilWick",
	"18": "cleanerUnit",
	"19": "fuserCleaningPad",
	"20": "transferUnit",
	"21": "tonerCartridge",
	"22": "fuserOiler",
	"23": "water",
	"24": "wasteWater",
	"25": "glueWaterAdditive",
	"26": "wastePaper",
	"27": "bindingSupply",
	"28": "bandingSupply",
	"29": "stitchingWire",
	"30": "shrinkWrap",
	"31": "paperWrap",
	"32": "staples",
	"33": "inserts",
	"34": "covers",
}

Printer marker supplies type TC.

View Source
var PrinterMarkerSuppliesTypeToGCP map[string]cdd.MarkerType = map[string]cdd.MarkerType{
	"1":  "",
	"2":  "",
	"3":  cdd.MarkerToner,
	"4":  "",
	"5":  cdd.MarkerInk,
	"6":  cdd.MarkerInk,
	"7":  cdd.MarkerInk,
	"8":  "",
	"9":  "",
	"10": "",
	"11": "",
	"12": "",
	"13": "",
	"14": "",
	"15": "",
	"16": "",
	"17": "",
	"18": "",
	"19": "",
	"20": "",
	"21": cdd.MarkerToner,
	"22": "",
	"23": "",
	"24": "",
	"25": "",
	"26": "",
	"27": "",
	"28": "",
	"29": "",
	"30": "",
	"31": "",
	"32": cdd.MarkerStaples,
	"33": "",
	"34": "",
}

Functions

This section is empty.

Types

type OID

type OID []uint

OID reprents a numeric object ID.

func (OID) AsString

func (o OID) AsString() string

AsString formats the OID as a string.

func (OID) ComesBefore

func (a OID) ComesBefore(b OID) bool

ComesBefore answers the question "does this OID sort before that OID?"

func (OID) HasPrefix

func (a OID) HasPrefix(b OID) bool

HasPrefix answers the question "does this OID have this prefix?"

func (OID) IsEqualTo

func (a OID) IsEqualTo(b OID) bool

IsEqualTo checks whether this OID == that OID.

type PrinterMarkerSuppliesClassTC

type PrinterMarkerSuppliesClassTC string

type PrinterSubUnitStatusTC

type PrinterSubUnitStatusTC uint8

type Variable

type Variable struct {
	Name  OID
	Value string
}

Variable represents an OID name:value pair.

func (*Variable) NameAsString

func (v *Variable) NameAsString() string

NameAsString formats OID.Name as a string.

type VariableSet

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

VariableSet represents an ordered set of OID variables.

func (*VariableSet) AddVariable

func (vs *VariableSet) AddVariable(name OID, value string)

AddVariable adds a variable to this set.

func (*VariableSet) GetCovers

func (vs *VariableSet) GetCovers() (*[]cdd.Cover, *cdd.CoverState, bool)

func (*VariableSet) GetInputTrays

func (vs *VariableSet) GetInputTrays() (*[]cdd.InputTrayUnit, *cdd.InputTrayState, bool)

func (*VariableSet) GetMarkers

func (vs *VariableSet) GetMarkers() (*[]cdd.Marker, *cdd.MarkerState, *cdd.VendorState, bool)

func (*VariableSet) GetOutputBins

func (vs *VariableSet) GetOutputBins() (*[]cdd.OutputBinUnit, *cdd.OutputBinState, bool)

func (*VariableSet) GetSerialNumber

func (vs *VariableSet) GetSerialNumber() (string, bool)

GetSerialNumber gets the printer serial number, if available.

func (*VariableSet) GetSubtree

func (vs *VariableSet) GetSubtree(prefix OID) *VariableSet

GetSubtree gets the subtree of variables whose OID name has prefix.

func (*VariableSet) GetValue

func (vs *VariableSet) GetValue(o OID) (string, bool)

GetValue gets the value of a single variable, by OID.

func (*VariableSet) GetValues

func (vs *VariableSet) GetValues() []string

GetValues gets all values in this set.

func (*VariableSet) GetVariable

func (vs *VariableSet) GetVariable(o OID) (*Variable, bool)

GetVariable gets a single variable, by OID.

func (*VariableSet) Size

func (vs *VariableSet) Size() int

Size gets the current size of this set.

func (*VariableSet) Variables

func (vs *VariableSet) Variables() []Variable

Returns the variables in this set.

Jump to

Keyboard shortcuts

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