[strongSwan] Adding extra logs in strongswan-4.3.6/src/libfreeswan

divya mohan m.divya.mohan at zoho.com
Fri Nov 9 09:06:53 CET 2012


I am debugging something, and I wanted to add some extra logs in
starter code for this.

I am trying to add logs in starter/*.c and libfreeswan/*.c.
In starter/*.c, I added the logs using DBG(DBG_CONTROL,
DBG_log("...")); and I can view these logs (as shown below) while
running the binary.

# ipsec start --debug-all  --nofork
Starting strongSwan 4.3.6 IPsec [starter]...
| Loading config setup
|   charonstart=yes
|   plutostart=no
|   uniqueids=no
|   charondebug=knl 0,enc 0,net 0
| Loading conn %default
|   auto=route
|   keyexchange=ikev2
|   reauth=no
| Loading conn 'rule0~vpn0'
|   rekeymargin=720
|   rekeyfuzz=100%
|   left=
|   right=
|   leftsubnet=
|   rightsubnet=
|   leftprotoport=%any
| ### divya: in load_conn, value of string is %any
| ### divya: in load_conn has_port_wildcard is 0
|   rightprotoport=%any

However, I tried to add logs in libfreeswan/ttoprotoport.c by
including required headers & using DBG_log, and this does not seem to
work. Also I tried adding printf, hoping the logs would come when I
run ipsec (with --no-fork) from console, but that too did not work.

Could someone help to find out how to do this.

Thanks & Regards,

More information about the Users mailing list