[strongSwan-dev] Working of format specifiers in DBG

Andreas Steffen andreas.steffen at strongswan.org
Fri Jan 13 15:01:09 CET 2017

Hi Anand,

strongswan uses standard libc printf hooks if they are available.
Otherwise vstr is used to emulate printf hooks. The strongSwan
printf_hook_t framework is defined here:


E.g. the printf_hook handler for %N (printing of enum_name_t types) is
defined here:


and the all hooks used by libstrongswan are assigned here:


Hope this helps


On 13.01.2017 13:46, Anand Murali wrote:
> Hi,
> I have been going through the source code of strongswan.
> I came across lots of custom format specifiers like:
> DBG1(DBG_ENC, "U_INT Type *%N* is not supported",
> encoding_type_names, int_type);
> DBG2(DBG_CFG, "received proposals: *%#P*", proposals);
> I'm new to this. Have been going through this code for a week. I'm not
> able to figure out how these are evaluated.
> Any help to understand how these are evaluated?
> If there is an internal code that does this parsing, can you point me to
> that file?
> Thanks
Andreas Steffen                         andreas.steffen at strongswan.org
strongSwan - the Open Source VPN Solution!          www.strongswan.org
Institute for Internet Technologies and Applications
University of Applied Sciences Rapperswil
CH-8640 Rapperswil (Switzerland)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3859 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.strongswan.org/pipermail/dev/attachments/20170113/68ce7e06/attachment.bin>

More information about the Dev mailing list