#include <cat/boks.h>
int catboks_dbmap(const char *route, const char *user, catboks_dbinfo *dbinfo);
The route argument is the access route as returned by catboks_tcpmethod(). The user argument is the Keon user as obtained by a call to catboks_certtouser() or similar.
The parameter givenuser
, givenpsw
and givendbid
must be set in dbinfo before calling this function.
If the mapping is successful, the parameters user
, psw
and
dbid
will be set in dbinfo.
The catboks_dbinfo
structure looks as follows:
#define CATBOKS_DBITEMLEN 48
typedef struct catboks_dbinfo { const char *givenuser; const char *givenpsw; const char *givendbid; char user[CATBOKS_DBITEMLEN]; char psw[CATBOKS_DBITEMLEN]; char dbid[CATBOKS_DBITEMLEN]; } catboks_dbinfo;
The map operation searches the Security Server database until a record that matches the three input fields (givenuser, givenpsw and givendbid) is found. The corresponding user, psw and dbid are then read from that record.
If an input value is NULL
or "*"
, it will match any value in the database.