Re: Issue with a new module and radiusd: symbol lookup error
..moved from freeradius-users to freeradius-devel
I would suggest *not* re-writing the SQL module.
Instead, look at rlm_sqlippool in git.freeradius.org. It leverages an existing SQL module to do additional queries. It means that you don't have to duplicate all of the functionality of rlm_sql. And you don't have to duplicate all of the MySQL/PostgreSQL/Oracle/etc drivers, either.
Plus, rlm_sqlippool.c is a *lot* easier to understand than rlm_sql.
Alan DeKok.
Hi again, my goal is to implement a module compliant with the Wimax Forum for what concerns authentication and authorization of supplicants. For this reason I needed to access the database where I store the various root-key (I mean DHCP-RK, and MIP-RK) as well as all the other keying- related items needed by the WF St.3. My module so have to interact with MySQL, and with OpenSSL (for key-gen) and operate both in postauth and in authorize (to handle request coming from unconventional NAS such as DHCP-Servers or Home Agents asking for keys). I found it simpler at the beginning to write down a new module (please note that we started our development when the current version of FreeRADIUS was 2.0.4...i.e. no rlm_wimax module was present) instead of getting one of the other working properly. I think that youìre right when you say that the code of sql_init_socketpool is missing from my module and this can also explain why it works only in postauth. In my opinion when the sql module is called (for example during authentication) it creates the symbols it needs (among them sql_init_socketpool). But if I try to call my module before sql (i.e. at the beginning of authorize) the symbols are missing and the symbol lookup error occurs. Am i right? I'll try to follow your guideline and to look at the existent modules. My schema is the default one with a bunch of tables used for WiMAX dynamic keys. I mean that the original structure is conserved and that I'm using the header file and the conf.h file to "load" the queries. Anyway if you need the schema I'll mail to you. Luca PS Pasting the sql_init_socketpool() in my module simply shift the "symbol lookup error" on the following symbol. It seems I have to paste into my module half sql.c and I don't want to do that since you're right when u say that it is pointless to rewrite sql.c.
Luca Adamo wrote:
my goal is to implement a module compliant with the Wimax Forum for what concerns authentication and authorization of supplicants. For this reason I needed to access the database where I store the various root-key (I mean DHCP-RK, and MIP-RK) as well as all the other keying-related items needed by the WF St.3. My module so have to interact with MySQL, and with OpenSSL (for key-gen) and operate both in postauth and in authorize (to handle request coming from unconventional NAS such as DHCP-Servers or Home Agents asking for keys).
See recent "git". src/modules/rlm_wimax/rlm_wimax.c, and raddb/modules/wimax. The dynamic key generation has been done as part of ongoing WiMAX work. I'd like to thank the (un-named) sponsors for their efforts in helping to make this happen. :) The code has been tested with a number of vendor's equipment, but more testing would be useful.
I found it simpler at the beginning to write down a new module (please note that we started our development when the current version of FreeRADIUS was 2.0.4...i.e. no rlm_wimax module was present) instead of getting one of the other working properly. I think that youìre right when you say that the code of sql_init_socketpool is missing from my module and this can also explain why it works only in postauth.
IMHO, WiMAX key generation belongs in a separate module, and not in any existing module.
In my opinion when the sql module is called (for example during authentication) it creates the symbols it needs (among them sql_init_socketpool). But if I try to call my module before sql (i.e. at the beginning of authorize) the symbols are missing and the symbol lookup error occurs. Am i right?
Yes. You are relying on it *accidentally* working. There's no need to do this. Just use the rlm_sqlippool example to create custom behavior, without re-writing rlm-sql.
I'll try to follow your guideline and to look at the existent modules. My schema is the default one with a bunch of tables used for WiMAX dynamic keys. I mean that the original structure is conserved and that I'm using the header file and the conf.h file to "load" the queries. Anyway if you need the schema I'll mail to you.
See raddb/sql/mysql/wimax* in the recent "git" tree. There are example files to manage the WiMAX dynamic MIP keys.
Pasting the sql_init_socketpool() in my module simply shift the "symbol lookup error" on the following symbol. It seems I have to paste into my module half sql.c and I don't want to do that since you're right when u say that it is pointless to rewrite sql.c.
Stop fighting with it. The rlm_sqlippool module *already* leverages the SQL module, without copying half of that module. And rlm_sqlippool a LOT simpler than rlm_sql, too. Alan DeKok.
Il giorno 23/set/08, alle ore 16:59, Alan DeKok ha scritto:
See recent "git". src/modules/rlm_wimax/rlm_wimax.c, and raddb/modules/wimax. The dynamic key generation has been done as part of ongoing WiMAX work.
I'd like to thank the (un-named) sponsors for their efforts in helping to make this happen. :)
The code has been tested with a number of vendor's equipment, but more testing would be useful.
Thank you, I'll have a look at your "git" code tomorrow, and I'll see if it'll fit in my project. Thanks again you for your help with my issue. Luca
participants (2)
-
Alan DeKok -
Luca Adamo