My outgoing rlm_cpp.cpp File was the *.c File I took.
Then I need to change every function of this file like this:
extern "C" {
static int cpp_authorize(void *instance, REQUEST *request)
{
...
}
}
Then I added two DEFINES at the TOP of my rlm_cpp.cpp File, because the two words are reserved names in in C.
#define operator op3578000
#define template tem34123At the end I needed to change the the struct. First I changed the struct in radiusd.conf
struct auth_req {
...
home_server_t *home_server
...
}
typedef struct radclient {
...
home_server_t *coa_server;
...
} RADCLIENT;
Also change the Typedef to:
typedef struct
home_server {
...
}home_server_t;Every struct in the Source of FreeRadius need to be changed to
home_server_t!
now you should made finallay the main make and see the all should be fine compiled! at the end run "make install " and implement the new C++ Module in an Section in the radiusd.conf and it will run!
Greetz