snmp

package
v0.0.0-...-86b787e Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

README

This is a fork of github.com/PromonLogicalis/snmp (MIT licensed, copyright (c) 2016 PromonLogicalis).

Documentation

Overview

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	NoError             = 0
	TooBig              = 1
	NoSuchName          = 2
	BadValue            = 3
	ReadOnly            = 4
	GenErr              = 5
	NoAccess            = 6
	WrongType           = 7
	WrongLength         = 8
	WrongEncoding       = 9
	WrongValue          = 10
	NoCreation          = 11
	InconsistentValue   = 12
	ResourceUnavailable = 13
	CommitFailed        = 14
	UndoFailed          = 15
	AuthorizationError  = 16
	NotWritable         = 17
	InconsistentName    = 18
)

SNMP error codes.

Variables

This section is empty.

Functions

func Asn1Context

func Asn1Context() *asn1.Context

Asn1Context returns a new allocated asn1.Context and registers all the choice types necessary for SNMPv1 and SNMPv2.

func SNMP

func SNMP(options ...services.ServicerFunc) services.Servicer

Types

type BulkPdu

type BulkPdu struct {
	Identifier     int
	NonRepeaters   int
	MaxRepetitions int
	Variables      []Variable
}

BulkPdu is a generic type for other Protocol Data Units.

type Counter32

type Counter32 uint32

Counter32 is a counter type.

type Counter64

type Counter64 uint64

Counter64 is a counter type.

type EndOfMibView

type EndOfMibView asn1.Null

EndOfMibView exception.

func (EndOfMibView) String

func (e EndOfMibView) String() string

type GetBulkRequestPdu

type GetBulkRequestPdu BulkPdu

GetBulkRequestPdu is used for bulk requests.

type GetNextRequestPdu

type GetNextRequestPdu Pdu

GetNextRequestPdu works similarly to GetRequestPdu, but it's returned the value for the next valid Oid.

type GetRequestPdu

type GetRequestPdu Pdu

GetRequestPdu is used to request data.

type GetResponsePdu

type GetResponsePdu Pdu

GetResponsePdu is used in responses to SNMP requests.

type IPAddress

type IPAddress [4]byte

IPAddress is a IPv4 address.

func (IPAddress) String

func (ip IPAddress) String() string

String returns a representation of IPAddress in dot notation.

type InformRequestPdu

type InformRequestPdu Pdu

InformRequestPdu is used for inform requests.

type Message

type Message struct {
	Version   int
	Community string
	Pdu       interface{} `asn1:"choice:pdu"`
}

Message is the top level element of the SNMP protocol.

type NoSuchInstance

type NoSuchInstance asn1.Null

NoSuchInstance exception.

func (NoSuchInstance) String

func (e NoSuchInstance) String() string

type NoSuchObject

type NoSuchObject asn1.Null

NoSuchObject exception.

func (NoSuchObject) String

func (e NoSuchObject) String() string

type Opaque

type Opaque []byte

Opaque is a type for blobs.

type Pdu

type Pdu struct {
	Identifier  int
	ErrorStatus int
	ErrorIndex  int
	Variables   []Variable
}

Pdu is a generic type for other Protocol Data Units.

type SetRequestPdu

type SetRequestPdu Pdu

SetRequestPdu is used to request data to be updated.

type TimeTicks

type TimeTicks uint32

TimeTicks is a type for time.

type Unsigned32

type Unsigned32 uint32

Unsigned32 is an integer type.

type V1TrapPdu

type V1TrapPdu struct {
	Enterprise   asn1.Oid
	AgentAddr    IPAddress
	GenericTrap  int
	SpecificTrap int
	Timestamp    TimeTicks
	Variables    []Variable
}

V1TrapPdu is used when sending a trap in SNMPv1.

type V2TrapPdu

type V2TrapPdu Pdu

V2TrapPdu is used when sending a trap in SNMPv2.

type Variable

type Variable struct {
	Name  asn1.Oid
	Value interface{} `asn1:"choice:val"`
}

Variable represents an entry of the variable bindings

Jump to

Keyboard shortcuts

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