ausimian

ausimian

Tundra - TUN Devices for Elixir

Probably a bit niche, but I pushed Tundra to hex.pm today. It provides a way to create and use non-persistent TUN devices on both Linux and Darwin. It has a consistent api on both platforms, similar to Erlang’s socket api, although currently only non-blocking i/o is supported.

On Darwin, the TUN device is a socket, and tundra provides only a very thin layer over the top of the socket API, once created. On Linux, TUN devices are files so, internally, a NIF is used to manage the file descriptor and its non-blocking i/o.

Due to TUN creation being a privileged operation, a server program is used to do the initial device creation and configuration. This ships in the priv directory of the application, but how this executable is started is left as an exercise for the reader. On both platforms, the NIF communicates with the server over a domain socket to create and configure the device.

Most Liked

ausimian

ausimian

They are virtual network interfaces, implemented in the kernel but with a user mode program (your code) responsible for handling the actual packets.

For TUN devices, each packet is a complete IP packet, either v4 or v6, typically itself encapsulating some other protocol e.g. tcp, udp, icmp etc.

They’re commonly used for VPNs.

Exadra37

Exadra37

What are TUN devices? I Know I can search Google, but will be nice to have a link in the topic for people unfamiliar with this niche, like me :slight_smile:

Where Next?

Popular in Libraries Top

tmbb
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps: bureaucrat - which contains a bunch ...
New
treble37
Just looking for a little feedback on a tiny helper library I built - Sometimes I find the need to convert maps with atom keys to maps...
New
josevalim
EDIT: since Ecto 3.0 final version is out, this post was amended to use the final versions in the instructions below. Hi everyone, We a...
New
mindok
What is ContEx? A pure Elixir server-side data plotting/charting library outputting SVG. It has nice barcharts in particular and works g...
New
riverrun
I’ve just released version 3 of Comeonin, a password hashing library. The following small changes have been made: changes to the NIF c...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
Qqwy
While not as prevalent as in imperative languages, arrays (collections with efficient random element access) are still very useful in Eli...
New
mtrudel
Bandit is an HTTP server for Plug and WebSock apps. Bandit is written entirely in Elixir and is built atop Thousand Island. It can serve...
New
KallDrexx
For a good number of months I've been working on creating a very basic RTMP live video streaming server. Now that I have a very, very ba...
New
anshuman23
Hello all, I have been working on my proposed project called Tensorflex as part of Google Summer of Code 2018.. Tensorflex can be used f...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

Sub Categories:

We're in Beta

About us Mission Statement