Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6502

How to simulate a tun device through a file descriptor? Which file to open?

$
0
0

I'm writing an app that uses OpenVPN library, which by default reads and writes to a tun device through a file descriptor. I want to create a file descriptor for my app and pass to OpenVPN so it can send IP packets through this file descriptor.

However, I don't know which type of file to open. If I open an IP socket, then all the data I send to this socket will go to the system, which is not what I want. If I open a simple file, it'll get written to the disk which is not what I want. Is there a 'virtual' file that can be opened by my app and written/read only from the app and no other apps can access?

If possible, this system call should be the same on all operating systems


Viewing all articles
Browse latest Browse all 6502

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>