[RADIATOR] DB connections in hook code?

Heikki Vatiainen hvn at open.com.au
Wed Dec 21 15:19:28 CST 2011


On 12/21/2011 11:01 PM, Jared Watkins wrote:

> In regard to Radius::AuthGeneric::find... is there somewhere these
> routines are documented?  I saw references in the pdf doc to
> AuthGeneric.. but not anything that told me it could be used in this way
> or that it could return a db connection handle.. or what the subsequent
> calls to use that handle should be.  I did see a few things in the
> example code about these but that's hardly a complete reference.  

There is no reference for APIs Radiator uses internally. For SQL calls
the file to see is Radius/SqlDb.pm

Most common calls are likely these:
sub prepareAndExecute
sub do
sub getOneRow

For things like $p->get_attr() see Radius/AttrVal.pm

> For instance.. I see an example of someone calling fetchrow in one of
> the goodies.. but that is not a standard DBI call.  In this case it
> looks like it's returning the data in an array.. but that's only one of
> many choices the DBI interface gives you. 

fetchrow used to be a DBI call. The current DBI module now has this:

	fetchrow   	  => undef, # old alias for fetchrow_array

> Am I just missing something here? 

I think you are on the right track. You can use the DBI calls supported
by system DBI, for example.

Thanks!
Heikki

-- 
Heikki Vatiainen <hvn at open.com.au>

Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS,
NetWare etc.


More information about the radiator mailing list