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.

https://github.com/ausimian/tundra

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 Announcing Top

Qqwy
Hello everyone, I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map...
New
kelvinst
Hey everyone! Well, we made this lib a while ago and now we decided to finally go out and public with it! It’s a tool for creating and m...
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
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
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44778 311
New
benlime
LiveMotion enables high performance animations declared on the server and run on the client. As a follow up to my previous thread A libr...
New
markmark206
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 55125 245
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement