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

38
go-agentx/pdu/reason.go Normal file
View File

@ -0,0 +1,38 @@
// 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 reasons.
const (
ReasonOther Reason = 1
ReasonParseError Reason = 2
ReasonProtocolError Reason = 3
ReasonTimeouts Reason = 4
ReasonShutdown Reason = 5
ReasonByManager Reason = 6
)
// Reason defines a reason.
type Reason byte
func (r Reason) String() string {
switch r {
case ReasonOther:
return "ReasonOther"
case ReasonParseError:
return "ReasonParseError"
case ReasonProtocolError:
return "ReasonProtocolError"
case ReasonTimeouts:
return "ReasonTimeouts"
case ReasonShutdown:
return "ReasonShutdown"
case ReasonByManager:
return "ReasonByManager"
}
return fmt.Sprintf("ReasonUnknown (%d)", r)
}