ausimian

ausimian

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

Showing Posts 1 to 2

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:

ausimian

ausimian OP

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.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
kip
I’ll shortly be launching Text, a nascent text analysis library. Current functionality In this early version (not ready for prime time) ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews