Files
authentik/internal/outpost/radius/eap/debug/debug.go
Jens Langhammer ad57c66a32 better log
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
2025-07-01 22:42:54 +02:00

28 lines
525 B
Go

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 {
return fmt.Sprintf("% x", d)
}