Hi Experts,
We are trying to use VPP-API(VAPI) to create ACL rules.
We are using the VAPI in blocking mode to get response immediately.
We are getting the response back but the *ACL-INDEX is some other value*. Can 
you please see the below code, if I am doing something wrong.
Any pointers are big help.

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_payload_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);
}
printf("So the reply receivied ACL Index %d Retval 
%d\n",resp->acl_index,resp->retval);
vapi_msg_free (ctx, resp);

//Ravi.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#20048): https://lists.fd.io/g/vpp-dev/message/20048
Mute This Topic: https://lists.fd.io/mt/85263360/21656
Mute #acl_plugin:https://lists.fd.io/g/vpp-dev/mutehashtag/acl_plugin
Mute #vapi:https://lists.fd.io/g/vpp-dev/mutehashtag/vapi
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