Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer
2025-05-24 18:27:54 +02:00
parent 3027cdcc4b
commit 7b97e92094
7 changed files with 67 additions and 68 deletions

View File

@ -2,26 +2,8 @@ package debug
import (
"fmt"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
log "github.com/sirupsen/logrus"
"layeh.com/radius"
)
func DebugPacket(p *radius.Packet) {
log.Debug(p)
log.Debug(p.Attributes)
n, _ := p.Encode()
log.Debug(n)
packet := gopacket.NewPacket(n, layers.LayerTypeRADIUS, gopacket.Default)
layer := packet.Layer(layers.LayerTypeRADIUS)
if layer == nil {
return
}
log.Debug(layer.(*layers.RADIUS))
}
func FormatBytes(d []byte) string {
b := d
if len(b) > 32 {