packet dump module for debugging

Matthew Newton mcn4 at leicester.ac.uk
Tue Apr 24 00:39:43 CEST 2012


Hi,

I was wondering a while ago exactly what AVPs were going through
freeradius at a particular point, and it wasn't easy (that I could
find) to just dump the lot out - detail or linelog will write
certain AVPs, but not everything that's currently known. Maybe
there's a way to do it, but I missed it :)

So I hacked up a really quick module to do it. Whenever it's
called in the server, it just dumps out all pairs in request,
reply, control, and proxy lists as well if available. Made it much
easier for me to see what state the packet was in at a particular
point.

Not submitting this necessarily for inclusion in the main tree,
but just thought I'd tidy it up and push it out in case it's of
any use to anyone else.

https://github.com/mcnewton/freeradius-server/tree/rlm_debugpacket

Example - include 'debugpacket' in post-auth, you might get
debug output containing something like the following (obviously,
you can call it as many times as you like, but after a couple or
so it gets a bit confusing!):

...
(0) debugpacket : ---------------------------------------------------- PACKET DEBUG -----v-v-v-v-v
(0) debugpacket : Request:
        User-Name = "bob"
        User-Password = "Test"
        NAS-IP-Address = 127.0.0.1
        NAS-Port = 0
        Message-Authenticator = 0x57c4fc026b2c741303aa0931f21b81f1
(0) debugpacket : Reply:
        Reply-Message = "Hi, come on in."
(0) debugpacket : Control:
        Cleartext-Password := "Test"
        Auth-Type = PAP
(0) debugpacket : -----------------------------------------------------------------------^-^-^-^-^
(0)   [debugpacket] = noop
...

I'm fully expecting there to already exist a better way - in which
case I'd be pleased to be informed :)

Cheers,

Matthew

-- 
Matthew Newton, Ph.D. <mcn4 at le.ac.uk>

Systems Architect (UNIX and Networks), Network Services,
I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom

For IT help contact helpdesk extn. 2253, <ithelp at le.ac.uk>


More information about the Freeradius-Devel mailing list