Check what the name of the system interface is:

ip -o a

We don't create the veth pair for you, so once you do this with "ip link"
and ostensibly move one end into a netns, the other end is the one you add
to VPP.



On Mar 21, 2017 2:06 PM, "Shravan Ambati" <shravan.amb...@calix.com> wrote:

> Thanks Ole!
> I did try it before. I ran into issues when I invoke the API.
>
> >>> r = vpp.af_packet_create(veth0-craft0)
> Traceback (most recent call last):
>         File "<stdin>", line 1, in <module>
>         NameError: name 'veth0' is not defined
>
> >>> r = vpp.af_packet_create('veth0-craft0')
> Traceback (most recent call last):
>         File "<stdin>", line 1, in <module>
>         TypeError: <lambda>() takes exactly 0 arguments (1 given)
>
> >>> r = vpp.af_packet_create(1)
> Traceback (most recent call last):
>         File "<stdin>", line 1, in <module>
>         TypeError: <lambda>() takes exactly 0 arguments (1 given)
>
> I am a python newbie, so please excuse my naïve question.
> This is probably not a vpp issue. I must be invoking the Api wrong way.
> Do you happen to know by any chance what is the right way to invoke it?
>
>
> Thanks
> Shravan
>
>
> -----Original Message-----
> From: otr...@employees.org [mailto:otr...@employees.org]
> Sent: Tuesday, March 21, 2017 5:33 AM
> To: Shravan Ambati <shravan.amb...@calix.com>
> Cc: vpp-dev@lists.fd.io
> Subject: Re: [vpp-dev] VPP Python API for create host-interface ?
>
> Hi there,
>
> > I am running the latest vpp code from master branch.
> > I am looking at the python APIs that vpp provides.
> > I am specifically trying to find the API for the following cli command
> > - create host-interface <interface-name> []
> >
> > I could not find where exactly this is defined in the json files in
> > /usr/shar/vpp/api/ Or is this not supported through API ?
>
> Looks like we're not quite consistent on naming.
> It is this API you are looking for I think:
>
> /** \brief Create host-interface
>     @param client_index - opaque cookie to identify the sender
>     @param context - sender context, to match reply w/ request
>     @param host_if_name - interface name
>     @param hw_addr - interface MAC
>     @param use_random_hw_addr - use random generated MAC */ define
> af_packet_create {
>   u32 client_index;
>   u32 context;
>
>   u8 host_if_name[64];
>   u8 hw_addr[6];
>   u8 use_random_hw_addr;
> };
>
>
> Best regards,
> Ole
> _______________________________________________
> vpp-dev mailing list
> vpp-dev@lists.fd.io
> https://lists.fd.io/mailman/listinfo/vpp-dev
>
_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Reply via email to