Hi, 

Currently we only support setting of local ips for builtin applications, like 
the one you’ve built lower. VCL and the message queue api currently do not 
support this.

I guess we could add a VPPCOM_ATTR_SET_LCL_ADDR set attribute option and pass 
that over the api. But before that, could you explain in a bit more detail your 
use case?

Thanks,
Florin

> On Oct 17, 2019, at 7:58 AM, jiangxiaom...@outlook.com wrote:
> 
> In the Hoststack app, I use write the flowing function to set local addr to 
> connect remote socket server
> clib_error_t * vnet_connect_uri_with_local_addr(vlib_main_t *vm,
> 
>     vnet_connect_args_t *a, ip46_address_t *local_addr)
> 
> {
> 
>     session_endpoint_cfg_t sep = SESSION_ENDPOINT_CFG_NULL;
> 
>     int rv;
> 
>  
> 
>     if ((rv = parse_uri(a->uri, &sep))) {
> 
>         return clib_error_return(0, "uri format error(%d)!", rv);
> 
>     }
> 
>  
> 
>     ip46_address_copy(&sep.peer.ip, local_addr);
> 
>     clib_memcpy(&a->sep_ext, &sep, sizeof(sep));
> 
>     if ((rv = vnet_connect(a))) {
> 
>         return clib_error_return(0, "connect returned: %d", rv);
> 
>     }
> 
>  
> 
>     return 0;
> 
> }
> 
> and it work very well.
> But when I turn to VCL way, I found no way to set local connect IP.
> Anyone know how to solve the problem? -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> 
> View/Reply Online (#14198): https://lists.fd.io/g/vpp-dev/message/14198
> Mute This Topic: https://lists.fd.io/mt/34703357/675152
> Group Owner: vpp-dev+ow...@lists.fd.io
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [fcoras.li...@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#14200): https://lists.fd.io/g/vpp-dev/message/14200
Mute This Topic: https://lists.fd.io/mt/34703357/21656
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