(RADIATOR) Changing parameter name

Ricardo Martinez rmartinez at redvoiss.net
Thu Oct 14 15:47:40 CDT 2004


Hugh.
	Thanks for the tip.  I finally was able to parse the information
that i wanted.  I do it, as you recommend me, with a preClientHook.  Now i
have another question regarding this issue.    Can i use different
preClientHook depending on what "hadler" is going to hadle the packet?.  

Thanks in advance.

Ricardo Martinez



> -----Mensaje original-----
> De:	Hugh Irvine [SMTP:hugh at open.com.au]
> Enviado el:	Sábado, 09 de Octubre de 2004 01:34 a.m.
> Para:	Ricardo Martinez
> CC:	'radiator at open.com.au'
> Asunto:	Re: (RADIATOR) Changing parameter name
> 
> 
> Hello Ricardo -
> 
> To improve your proficiency with Perl I suggest "Learning Perl" and 
> "Programming Perl" (the Llama book and the Camel book) from O'Reilly 
> (www.oreilly.com). And of course reading the Radiator source code is 
> also very informative.
> 
> regards
> 
> Hugh
> 
> 
> On 9 Oct 2004, at 00:27, Ricardo Martinez wrote:
> 
> > Hugh.
> > 	I made a simple prehook.pl based on the goodies/hooks file
> >
> > sub
> > {
> >         my $p = ${$_[0]};
> >
> >         my $digestattr;
> >
> >         if ($digestattr = $p->get_attr('Digest-Attributes'))
> >         {
> >                 &main::log($main::LOG_DEBUG,"Digest-Attribute =
> > $digestattr");
> >         }
> >         return;
> > }
> >
> > When i see the DEBUG in my RADAR i obtain :
> >
> > Code:       Access-Request
> > Identifier: 176
> > Authentic:  *~<156><197>9<172><186><254><20>t<151><242><231><212>_"
> > Attributes:
> > 	User-Name = "javier at mydomain.com"
> > 	Digest-Attributes = "<10><8>javier"
> > 	Digest-Attributes = "<1><21>mydomain.com"
> > 	Digest-Attributes = "<2>*4166f0eb0d4835657409ea069796b3df70846ccc"
> > 	Digest-Attributes = "<4><25>sip:mydomain.com"
> > 	Digest-Attributes = "<3><10>REGISTER"
> > 	Digest-Attributes = "<5><6>auth"
> > 	Digest-Attributes = "<9><10>00000001"
> > 	Digest-Attributes = "<8><10>d2ca0362"
> > 	Digest-Response = "22624b52fd28dacadfd6b245a5141da5"
> > 	Service-Type = Sip-Session
> > 	Sip-Uri-User = "5555832351"
> > 	NAS-IP-Address = 127.0.0.1
> > 	NAS-Port = 5060
> >
> > Fri Oct  8 15:51:27 2004: DEBUG: Digest-Attribute =
> > javier
> > Fri Oct  8 15:51:27 2004: DEBUG: Handling request with Handler 
> > 'Request-Type
> > = Access-Request'
> > Fri Oct  8 15:51:27 2004: DEBUG:  Deleting session for 
> > javier at mydomain.com,
> > 127.0.0.1, 5060
> > Fri Oct  8 15:51:27 2004: DEBUG: Handling with Radius::AuthSQL
> > Fri Oct  8 15:51:27 2004: DEBUG: Handling with Radius::AuthSQL:
> > Fri Oct  8 15:51:27 2004: DEBUG: Query is: 'select a.gaterik_Cod from
> > gateway_nub where radiator.use(a.terminal_alias)='javier at mydomain.com' 
> > and
> > a.gate_cod=b.numero='5555832351'':
> >
> > Fri Oct  8 15:51:27 2004: DEBUG: Radius::AuthSQL looks for match with
> > javier at mydomain.com
> > Fri Oct  8 15:51:27 2004: DEBUG: Radius::AuthSQL ACCEPT:
> > Fri Oct  8 15:51:27 2004: DEBUG: Access accepted for 
> > javier at mydomain.com
> > Fri Oct  8 15:51:27 2004: DEBUG: Packet dump:
> >
> >
> > As you can see i get a wierd character before the parameter =
> > Digest-Attribute = javier
> >
> > How can read the Digest-Attributes = "<10><8>javier" and parse the 
> > "<10>" to
> > check it and chage the Digest-Attribute for Digest-Username ?
> > I'm not good in perl.. i hope that someone can help me
> >
> > Thanks in advance
> >
> > Ricardo.
> >
> >> -----Mensaje original-----
> >> De:	Hugh Irvine [SMTP:hugh at open.com.au]
> >> Enviado el:	Jueves, 07 de Octubre de 2004 01:51 a.m.
> >> Para:	Ricardo Martinez
> >> CC:	'radiator at open.com.au'
> >> Asunto:	Re: (RADIATOR) Changing parameter name
> >>
> >>
> >> Hello Ricardo -
> >>
> >> You will need to do this in a PreClientHook which parses the 
> >> attributes
> >> and does what you describe.
> >>
> >> There are some example hooks in the file "goodies/hooks.txt" and
> >> someone posted something similar for dealing with cisco-avpairs to the
> >> mailing list relatively recently.
> >>
> >> regards
> >>
> >> Hugh
> >>
> >>
> >>
> >> On 7 Oct 2004, at 00:48, Ricardo Martinez wrote:
> >>
> >>> Hello list.
> >>> 	I have a acc and auth messages coming to my RADIATOR server.  These
> >>> messages look like this:
> >>> Attributes:
> >>> 	User-Name = "ricardo at sipproxy.mydomain.com"
> >>> 	Digest-Attributes = "<1><21>sipproxy.mydomain.com"
> >>> 	Digest-Attributes = "<2>*41646f972e82fcbf472f434aeee4c3f8e9ca608c"
> >>> 	Digest-Attributes = "<4><25>sip:sipproxy.mydomain.com"
> >>> 	Digest-Attributes = "<3><10>REGISTER"
> >>> 	Digest-Attributes = "<5><6>auth"
> >>> 	Digest-Response = "6b578f793a921c390a708f0feede320f"
> >>> 	Service-Type = Sip-Session
> >>> 	Sip-Uri-User = "5555832352"
> >>> 	NAS-IP-Address = 127.0.0.1
> >>> 	NAS-Port = 5060
> >>>
> >>> Is possible to make some manipulation of this particular message and
> >>> turn it
> >>> into this:?
> >>>
> >>> Attributes:
> >>> 	User-Name = "ricardo at sipproxy.mydomain.com"
> >>> 	Realm = "<1><21>sipproxy.mydomain.com"
> >>> 	Call-id = "<2>*41646f972e82fcbf472f434aeee4c3f8e9ca608c"
> >>> 	Uri = "<4><25>sip:sipproxy.mydomain.com"
> >>> 	Method = "<3><10>REGISTER"
> >>> 	Type = "<5><6>auth"
> >>> 	Nonce = "6b578f793a921c390a708f0feede320f"
> >>> 	Service-Type = Sip-Session
> >>> 	Sip-Uri-User = "5555832352"
> >>> 	NAS-IP-Address = 127.0.0.1
> >>> 	NAS-Port = 5060
> >>>
> >>>
> >>> I want change the parameters named "Digest-Attributes" in those 
> >>> listed
> >>> before.
> >>>
> >>> Can someone give an example of how i can do this?
> >>> Thanks in advance.
> >>> Best Regards
> >>>
> >>> Ricardo
> >>>
> >>> --
> >>> Archive at http://www.open.com.au/archives/radiator/
> >>> Announcements on radiator-announce at open.com.au
> >>> To unsubscribe, email 'majordomo at open.com.au' with
> >>> 'unsubscribe radiator' in the body of the message.
> >>>
> >>>
> >>
> >> NB: I am travelling this week, so there may be delays in our
> >> correspondence.
> >>
> >> -- 
> >> Radiator: the most portable, flexible and configurable RADIUS server
> >> anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
> >> -
> >> Nets: internetwork inventory and management - graphical, extensible,
> >> flexible with hardware, software, platform and database independence.
> >> -
> >> CATool: Private Certificate Authority for Unix and Unix-like systems.
> >>
> >> --
> >> Archive at http://www.open.com.au/archives/radiator/
> >> Announcements on radiator-announce at open.com.au
> >> To unsubscribe, email 'majordomo at open.com.au' with
> >> 'unsubscribe radiator' in the body of the message.
> >
> >
> 
> NB: I am travelling this week, so there may be delays in our 
> correspondence.
> 
> -- 
> Radiator: the most portable, flexible and configurable RADIUS server
> anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
> -
> Nets: internetwork inventory and management - graphical, extensible,
> flexible with hardware, software, platform and database independence.
> -
> CATool: Private Certificate Authority for Unix and Unix-like systems.
> 
> --
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.

--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list