[strongSwan-dev] How to print struct

Martin Willi martin at strongswan.org
Tue Jul 15 13:57:23 CEST 2014


Vyronas,

> How can I "convert" a struct (identification_t) to its char array 
> representation? 

The identification_t class has a get_encoding() getter method, which
returns a chunk_t. chunk_t is used in strongSwan for binary blobs,
having a pointer and a length.

> chunk_t data = id->get_encoding(id);
> printf("%zu bytes at %p\n", data.len, data.ptr);

Regards
Martin



More information about the Dev mailing list