Documentation ¶
Overview ¶
Package oid implements SNMP OID and related data structures.
Index ¶
- Constants
- Variables
- type OID
- type PrinterMarkerSuppliesClassTC
- type PrinterSubUnitStatusTC
- type Variable
- type VariableSet
- func (vs *VariableSet) AddVariable(name OID, value string)
- func (vs *VariableSet) GetCovers() (*[]cdd.Cover, *cdd.CoverState, bool)
- func (vs *VariableSet) GetInputTrays() (*[]cdd.InputTrayUnit, *cdd.InputTrayState, bool)
- func (vs *VariableSet) GetMarkers() (*[]cdd.Marker, *cdd.MarkerState, *cdd.VendorState, bool)
- func (vs *VariableSet) GetOutputBins() (*[]cdd.OutputBinUnit, *cdd.OutputBinState, bool)
- func (vs *VariableSet) GetSerialNumber() (string, bool)
- func (vs *VariableSet) GetSubtree(prefix OID) *VariableSet
- func (vs *VariableSet) GetValue(o OID) (string, bool)
- func (vs *VariableSet) GetValues() []string
- func (vs *VariableSet) GetVariable(o OID) (*Variable, bool)
- func (vs *VariableSet) Size() int
- func (vs *VariableSet) Variables() []Variable
Constants ¶
const ( PrinterSubUnitAvailableAndIdle PrinterSubUnitStatusTC = 0 PrinterSubUnitAvailableAndStandby = 2 PrinterSubUnitAvailableAndActive = 4 PrinterSubUnitAvailableAndBusy = 6 PrinterSubUnitUnknown = 5 PrinterSubUnitNonCritical = 8 PrinterSubUnitCritical = 16 PrinterSubUnitOffline = 32 PrinterSubUnitTransitioning = 64 )
const ( PrinterMarkerSuppliesClassOther PrinterMarkerSuppliesClassTC = "1" // other PrinterMarkerSuppliesClassConsumed = "3" // supplyThatIsConsumed PrinterMarkerSuppliesClassFilled = "4" // receptacleThatIsFilled )
Variables ¶
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).
var PrinterCoverStatusTC map[string]string = map[string]string{
"1": "other",
"2": "unknown",
"3": "coverOpen",
"4": "coverClosed",
"5": "interlockOpen",
"6": "interlockClosed",
}
Printer cover status TC.
var PrinterCoverStatusToGCP map[string]cdd.CoverStateType = map[string]cdd.CoverStateType{ "1": cdd.CoverStateFailure, "2": cdd.CoverStateFailure, "3": cdd.CoverStateOpen, "4": cdd.CoverStateOK, "5": cdd.CoverStateOpen, "6": cdd.CoverStateOK, }
Printer cover status to cdd.CoverStateType.
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.
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.
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) ComesBefore ¶
ComesBefore answers the question "does this OID sort before that OID?"
type PrinterMarkerSuppliesClassTC ¶
type PrinterMarkerSuppliesClassTC string
type PrinterSubUnitStatusTC ¶
type PrinterSubUnitStatusTC uint8
type Variable ¶
Variable represents an OID name:value pair.
func (*Variable) NameAsString ¶
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.