Bind to a veth interface

Trying to bind my code to a veth interface . I need to create a RAW_SOCKET for this.

Creating my veth interface using

ip link add veth10 type veth peer veth10p

Can someone help me with the code for connecting to one end of the veth connection (i.e. veth10 in my example).

Answers


You need to get interface index first - under linux you can use struct ifreq and ioctl. I have written my own ARP request which is not actually what you need but you can observe the code to understand working with interfaces (name -> index)

https://github.com/petrbel/pvu2/blob/master/arp-request/arp.c#L59

Hope it helped a little


Need Your Help

3rd party frameworks vs private frameworks?

ios frameworks

I heard that apps that use private frameworks can not be submitted to Apple's App Store. So, just to help clear this up for someone new to iOS programming (have never submitted an app for approval ...

gen already exists but is not a source folder

android android-layout android-intent android-emulator android-widget

I am developing my Android project, After I removed a unused library, I got the error: