Files
agentx
config
go-agentx
marshaler
pdu
allocate_index.go
close.go
deallocate_index.go
error.go
flags.go
get.go
get_next.go
header.go
header_packet.go
object_identifier.go
octet_string.go
open.go
packet.go
range.go
ranges.go
reason.go
register.go
response.go
timeout.go
type.go
unregister.go
variable.go
variable_type.go
variables.go
value
.gitignore
AUTHORS
LICENSE
README.md
client.go
environment_test.go
go.mod
go.sum
handler.go
helper_test.go
list_handler.go
list_handler_test.go
list_item.go
request.go
session.go
session_test.go
shell.nix
snmpd.conf
ifmib
logger
vppstats
.gitignore
LICENSE
README.md
go.mod
go.sum
main.go
main_test.go
govpp-snmp-agentx/go-agentx/pdu/error.go

63 lines
1.7 KiB
Go

// Copyright 2018 The agentx authors
// Licensed under the LGPLv3 with static-linking exception.
// See LICENCE file for details.
package pdu
import "fmt"
// The various pdu packet errors.
const (
ErrorNone Error = 0
ErrorOpenFailed Error = 256
ErrorNotOpen Error = 257
ErrorIndexWrongType Error = 258
ErrorIndexAlreadyAllocated Error = 259
ErrorIndexNoneAvailable Error = 260
ErrorIndexNotAllocated Error = 261
ErrorUnsupportedContext Error = 262
ErrorDuplicateRegistration Error = 263
ErrorUnknownRegistration Error = 264
ErrorUnknownAgentCaps Error = 265
ErrorParse Error = 266
ErrorRequestDenied Error = 267
ErrorProcessing Error = 268
)
// Error defines a pdu packet error.
type Error uint16
func (e Error) String() string {
switch e {
case ErrorNone:
return "ErrorNone"
case ErrorOpenFailed:
return "ErrorOpenFailed"
case ErrorNotOpen:
return "ErrorNotOpen"
case ErrorIndexWrongType:
return "ErrorIndexWrongType"
case ErrorIndexAlreadyAllocated:
return "ErrorIndexAlreadyAllocated"
case ErrorIndexNoneAvailable:
return "ErrorIndexNoneAvailable"
case ErrorIndexNotAllocated:
return "ErrorIndexNotAllocated"
case ErrorUnsupportedContext:
return "ErrorUnsupportedContext"
case ErrorDuplicateRegistration:
return "ErrorDuplicateRegistration"
case ErrorUnknownRegistration:
return "ErrorUnknownRegistration"
case ErrorUnknownAgentCaps:
return "ErrorUnknownAgentCaps"
case ErrorParse:
return "ErrorParse"
case ErrorRequestDenied:
return "ErrorRequestDenied"
case ErrorProcessing:
return "ErrorProcessing"
}
return fmt.Sprintf("ErrorUnknown (%d)", e)
}