Documentation ¶
Index ¶
- func UnpackPDU(raw asn1.RawValue) (PDUMeta, PDU, error)
- type ApplicationValueType
- type BulkPDU
- type Counter32
- type Counter64
- type ErrorStatus
- type ErrorValue
- type Gauge32
- type GenericPDU
- type GenericTrap
- type IPAddress
- type OID
- type Opaque
- type PDU
- type PDUError
- type PDUMeta
- type PDUType
- type Packet
- type TimeTicks32
- type TrapPDU
- type VarBind
- func (varBind VarBind) ErrorValue() error
- func (varBind VarBind) OID() OID
- func (varBind *VarBind) Set(genericValue interface{}) error
- func (varBind *VarBind) SetError(errorValue ErrorValue) error
- func (varBind *VarBind) SetNull()
- func (varBind VarBind) String() string
- func (varBind VarBind) Value() (interface{}, error)
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApplicationValueType ¶
type ApplicationValueType int // application-specific values in VarBind.Value
const ( IPAddressType ApplicationValueType = 0 Counter32Type ApplicationValueType = 1 Gauge32Type ApplicationValueType = 2 TimeTicks32Type ApplicationValueType = 3 OpaqueType ApplicationValueType = 4 Counter64Type ApplicationValueType = 6 )
type BulkPDU ¶
Very similar to the PDU type, but the error fields are replaced by parameters
func (BulkPDU) GetRequestID ¶
type ErrorStatus ¶
type ErrorStatus int
const ( Success ErrorStatus = 0 TooBigError ErrorStatus = 1 NoSuchNameError ErrorStatus = 2 BadValueError ErrorStatus = 3 ReadOnlyError ErrorStatus = 4 GenericError ErrorStatus = 5 )
func (ErrorStatus) Error ¶
func (err ErrorStatus) Error() string
func (ErrorStatus) String ¶
func (err ErrorStatus) String() string
type ErrorValue ¶
type ErrorValue int // context-specific NULLs in VarBind.Value
const ( NoSuchObjectValue ErrorValue = 0 NoSuchInstanceValue ErrorValue = 1 EndOfMibViewValue ErrorValue = 2 )
func (ErrorValue) Error ¶
func (err ErrorValue) Error() string
func (ErrorValue) String ¶
func (err ErrorValue) String() string
type GenericPDU ¶
type GenericPDU struct { RequestID int ErrorStatus ErrorStatus ErrorIndex int VarBinds []VarBind }
func (GenericPDU) GetError ¶
func (pdu GenericPDU) GetError() PDUError
func (GenericPDU) GetRequestID ¶
func (pdu GenericPDU) GetRequestID() int
func (GenericPDU) GetVarBind ¶
func (pdu GenericPDU) GetVarBind(index int) VarBind
func (GenericPDU) String ¶
func (pdu GenericPDU) String() string
type GenericTrap ¶
type GenericTrap int
const ( TrapColdStart GenericTrap = 0 TrapWarmStart GenericTrap = 1 TrapLinkDown GenericTrap = 2 TrapLinkUp GenericTrap = 3 TrapAuthenticationFailure GenericTrap = 4 TrapEgpNeighborLoss GenericTrap = 5 TrapEnterpriseSpecific GenericTrap = 6 )
type OID ¶
type OID []int
type PDUError ¶
type PDUError struct { ErrorStatus ErrorStatus VarBind VarBind }
type TimeTicks32 ¶
type TimeTicks32 uint32 // duration of 1/100 s
type TrapPDU ¶
type TrapPDU struct { Enterprise asn1.ObjectIdentifier AgentAddr net.IP // []byte GenericTrap GenericTrap SpecificTrap int TimeStamp time.Duration // int64 VarBinds []VarBind }
SNMPv1 Trap-PDU
type VarBind ¶
type VarBind struct { Name asn1.ObjectIdentifier RawValue asn1.RawValue }
func MakeVarBind ¶
panics if unable to pack value
func (VarBind) ErrorValue ¶
Return ErrorValue if exists, otherwise nil
func (*VarBind) SetError ¶
func (varBind *VarBind) SetError(errorValue ErrorValue) error
Click to show internal directories.
Click to hide internal directories.