[strongSwan] How to avoid the parsing of strongswan.conf file and set the configuration options programmatically?

Chinmaya Dwibedy ckdwibedy at yahoo.com
Wed Apr 22 15:15:20 CEST 2015

  Hi,I want toget rid of strongswan.conf file (which is installed /etc directory). Instead I wantto set the values programmatically. I have removed the /etc/strongswan.conf ,which is read by libstrongswan during library initialization. Furthermore Ihave written set_strongswan_conf_options() function to set the few strongswanconfiguration options and then invoking the Charon. The library is getting initializedand Charon is getting started up. But there is no charon.log file created at/var/log/. Can anyone please suggest what might be the wrong?  Thank you in advance for your support andhelp. #define  IPSEC_DEBUG_LEVEL 3void set_strongswan_conf_options(char*logfile){        if (!library_init(NULL, "cli"))        {               library_deinit();               return FALSE;        }        lib->settings->set_str(lib->settings,"charon.filelog.%s",logfile);       lib->settings->set_str(lib->settings,"charon.filelog.%s.time_format","%b %e %T", logfile);        lib->settings->set_bool(lib->settings,"charon.filelog.%s.append",FALSE, logfile);       lib->settings->set_bool(lib->settings,"charon.filelog.%s.flush_line",TRUE, logfile);       lib->settings->set_int(lib->settings,"charon.filelog.%s.default",IPSEC_DEBUG_LEVEL, logfile);} StartCharon(){         bool ret = TRUE;                char*lfile="/var/log/charon.log";        set_strongswan_conf_options(lfile);         system("starter --daemoncharon");         usleep(500000);     return ret;}Regards,Chinmaya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strongswan.org/pipermail/users/attachments/20150422/b29b2f4b/attachment.html>

More information about the Users mailing list