libvdeplug(3)
π libvdeplug β the manual, but make it cute π
okay so bestie, you know that library that lets clients join a VDE network? Yeah. That's this one. It's from the Linux Programmer's Manual, and it's literally the friendliest way to plug yourself into a virtual distributed ethernet. Let's get into it π
β¨ NAME β¨
vde_open, vde_recv, vde_send, vde_send, vde_recv, vde_close β connect clients to a VDE (virtual distributed ethernet) network.
no bc the wayvde_sendandvde_recvare each listed twice in hereβ¦ iconic, we don't question it, we just vibe π
π¦ SYNOPSIS π¦
#include <libvdeplug.h>
VDECONN *vde_open(char *vde_url,char *descr, struct vde_open_args *open_args);
ssize_t vde_recv(VDECONN *conn,void *buf,size_t len,int flags);
ssize_t vde_send(VDECONN *conn,const void *buf,size_t len,int flags);
int vde_datafd(VDECONN *conn);
int vde_ctlfd(VDECONN *conn);
int vde_close(VDECONN *conn);
These functions are provided by libvdeplug. Link with -lvdeplug.
Link with -lvdeplug or you're just out here calling ghosts, fr fr π»
π DESCRIPTION π
Libvdeplug is the library clients use to join a VDE network. It's a generic library, which means it can use several different implementations for virtual distributed networks. Like, it's not locked into one vibe, it's flexible β¨
In fact, vde_url has the syntax:
module://specific_address
for example vde:///home/user/myswitch or vxvde://239.0.0.1.
The default module is libvdeplug_vde(1) (connection to a vde_switch(1)) and it can be omitted β so for example /home/user/myswitch means vde:///home/user/myswitch. Slay, drop the module name, it's fine π
vde_openβ opens a VDE connection.vde_urlis the vde network identifier as described right up there, anddescris a description of this connection (which is genuinely useful for identifying this connection in the port list of a switch, bestie, use it).open_argshas been left in for backwards compatibility but can safely be set toNULL, because all the options that used to be fields ofstruct vde_open_argsare now parameters of the VDE modules (and you can define them using a module-specific syntax insidevde_url).vde_recvβ receives a packet from the VDE connection. π₯vde_sendβ sends a packet to the VDE connection. π€vde_datafdβ returns the data file descriptor of the connection. This descriptor can be used inpoll(2)orselect(2)(or similar) system calls. When this descriptor signals that data is available for reading,vde_recvwill not block. chef's kiss, that's the whole point π«Άvde_ctlfdβ returns the control file descriptor of the connection. Not all the modules support control descriptors, but when it is a valid descriptor (greater or equal than 0) it can be used to check if the remote endpoint (switch or peer) hung up. You can't send or receive any data using the control file descriptor β it returns an end-of-file condition when the connection gets closed (zero length on reading).vde_closeβ closes a vde connection. bye bestie π
π₯ RETURN VALUE π₯
vde_openreturns the descriptor of the VDE connection, which is then used as a parameter of all the other functions.NULLis returned in case of error.vde_recvreturns the length of the packet received. It should never be less than 14 bytes (the length of an ethernet header). It returns-1in case of error, and it may return1to notify that a packet has been received but it must be dropped (e.g. the sender was not allowed to send that packet). πvde_sendreturns the number of bytes sent. It returns-1in case of error.vde_datafdandvde_ctlfdreturns a file descriptor and-1in case of error.vde_datafdreturns0in case of success and-1in case of error.
β οΈ okay so yes, vde_datafd is the star of the last two bullets and the second one lowkey reads like it was meant for somebody else, but that's literally what the page says so I'm not touching it. Not me editorializing, I'm just the messenger π
π NOTICE π
Virtual Distributed Ethernet is not related in any way with www.vde.com ("Verband der Elektrotechnik, Elektronik und Informationstechnik" i.e. the German "Association for Electrical, Electronic & Information Technologies").
Like, completely different thing. Do not mix them up. Periodt. β
πΈ SEE ALSO πΈ
go read those too, iykyk π
π BUGS π
Bug reports should be addressed to <info@virtualsquare.org> β they're literally asking, so if you found something, tell them π«Ά
β AUTHOR β
Renzo Davoli <renzo@cs.unibo.it> β the main character of this whole library, we love to see it π
and that's the whole page, bestie π this little slice of the <b>VirtualSquare</b> world is dated <b>2017-05-21</b>, and if you ever need to look it up again it lives as <b>libvdeplug(3)</b> in the Linux Programmer's Manual. mwah π
π¦ where this page comes from
- debian bookworm: libvdeplug-dev 4.0.1-4 Β· LGPL-2.1-or-later
- debian trixie: libvdeplug-dev 4.0.1-5.1+b1 Β· LGPL-2.1-or-later
- ubuntu jammy: libvdeplug-dev 4.0.1-3 Β· LGPL-2.1-or-later
- ubuntu noble: libvdeplug-dev 4.0.1-5.1build1 Β· LGPL-2.1-or-later
- ubuntu questing: libvdeplug-dev 4.0.1-5.1build1
- ubuntu resolute: libvdeplug-dev 4.0.1-5.1build2 Β· LGPL-2.1-or-later
- ubuntu stonking: libvdeplug-dev 4.0.1-5.1build2 Β· LGPL-2.1-or-later
- Copyright (C) 2017 Renzo Davoli. University of Bologna. <renzo@cs.unibo.it>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms