We have FreeRadius, which is used to authorize PPPoE sessions on Cisco NAS. User database is stored in Postgres database.
We are migrating to a new billing system, and therefore we have to alter FreeRadius logic, so it can get required data from the new sql structure. This kind of alteration can't be done via config, therefore we need minor modifications to postgresql module of free radius.
New structure is very simple:
We have a view called "radius_view", which consists of 10 columns:
blocked (this one is boolean)
We need FreeRadius to perform one single query per Access-Request packet.
If zero result set returned Access-Reject should be generated.
If result set is not zero, then first it should check for blocked boolean, if it's true, then Access-Accept from template is issued.
Otherwise it should form Access-Accept response with Framed-IP-Address from framed_ip column (if it's not NULL) and with up to 6 Cisco-AVPair attributes from corresponding columns.
You will be provided with SSH access to the existing test installation to perform work. We will need compiled module and also diff file for future installations.