Temporarily add go-agentx (w/ fixes to lexico ordering)

This commit is contained in:
Pim van Pelt
2025-06-09 17:14:28 +02:00
parent 824496c402
commit 771cc6ff48
45 changed files with 2477 additions and 0 deletions

62
go-agentx/pdu/error.go Normal file
View File

@ -0,0 +1,62 @@
// 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)
}