The struct hicn_name_t is defined in hicn/name.h. The struct contains some #ifdef excluding some members of the struct if it is included in the vpp plugin.
typedef struct { #ifndef HICN_VPP_PLUGIN hicn_name_type_t type; u8 len; #endif /* HICN_VPP_PLUGIN */ union { hicn_v4_name_t ip4; hicn_v6_name_t ip6; ip46_address_t ip46; #ifndef HICN_VPP_PLUGIN hicn_iov_name_t iov; u8 buffer[HICN_V6_NAME_LEN]; #endif /* HICN_VPP_PLUGIN */ } ;} hicn_name_t;
If libhicn is compiled standalone the struct will contain all the fields. If later an header is used inside VPP, the struct in the vpp binary will not contain the fields type and len, since HICN_VPP_PLUGIN is defined, resulting in a mismatch between the struct defined in the vpp binary and the struct known by the libhicn binary.
All the call to the API will then fail, because the offset of the names union is 0 in the VPP struct and sizeof(hicn_name_type_t) + sizeof (len) + eventual alignments in libhicn.