[Edited Message Follows]

Sorry for spamming, anyway, I found the problem.
I was sending wrong response structure causing the problem.
We supposed to use,
*vapi_msg_acl_add_replace_reply* *resp; but I was using 
*vapi_payload_acl_add_replace_reply* *resp;
Its working fine.
Just incase some one wants to use above example, providing working one below.
printf ("--- Basic acl addition- reply test ---\n");
vapi_msg_acl_add_replace *acl= vapi_alloc_acl_add_replace(ctx, 1);
if(acl==NULL)
{
printf("ACL retuns NULL %d\n",__LINE__);
exit(1);
}
acl->payload.acl_index=-1;
strncpy((char *)acl->payload.tag,"CheckIsWorking",12);
acl->payload.count=1;
vapi_type_prefix src_addr,dst_addr;
acl->payload.r[0].is_permit=1;
src_addr.address.af=0;
src_addr.len=24;//prefix len
inet_aton("172.1.1.0",(struct in_addr *)&(src_addr.address.un.ip4));
dst_addr.address.af=0;
dst_addr.len=24;//prefix len
inet_aton("111.1.1.0",(struct in_addr *)&(dst_addr.address.un.ip4));
acl->payload.r[0].src_prefix=src_addr;
acl->payload.r[0].dst_prefix=dst_addr;
vapi_msg_acl_add_replace_hton(acl);
rv = vapi_send (ctx, acl);
if(rv!=VAPI_OK)
{
printf("vapi_Send %d\n",__LINE__);
exit(1);

}
vapi_msg_acl_add_replace_reply *resp;
size_t size;
rv = vapi_recv (ctx, (void *) &resp, &size, 0, 0);
if(rv!=VAPI_OK)
{
printf("vapi_Send %d\n",__LINE__);
exit(1);
}
vapi_msg_acl_add_replace_reply_ntoh(resp);
printf("So the reply receivied ACL Index %d Retval 
%d\n",resp->payload.acl_index,resp->payload.retval);

vapi_msg_free (ctx, resp);
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#20049): https://lists.fd.io/g/vpp-dev/message/20049
Mute This Topic: https://lists.fd.io/mt/85263360/21656
Mute #vapi:https://lists.fd.io/g/vpp-dev/mutehashtag/vapi
Mute #acl_plugin:https://lists.fd.io/g/vpp-dev/mutehashtag/acl_plugin
Mute #acl:https://lists.fd.io/g/vpp-dev/mutehashtag/acl
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to