Re: Is tun(4) a cloning device?

2015-12-27 Thread Rhialto
On Fri 25 Dec 2015 at 13:57:30 -0500, Christos Zoulas wrote:
> Well, we could factor out the common code for these kinds of cloners
> from tap and use it for both tap and tun from the look of it. Why
> don't you give it a try?

I'll give it a go! It will be a few days before I can actually try it
out though but there is no hurry.

> christos
-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl-- 'this bath is too hot.'


signature.asc
Description: PGP signature


Re: Is tun(4) a cloning device?

2015-12-25 Thread Rhialto
On Fri 25 Dec 2015 at 16:02:57 +, Christos Zoulas wrote:
> Exactly, it depends if it makes sense to have a magic minor device like
> that... Does it?

Well, it seems that Linux has it. In fact, it has a single file for both
tap en tun (/dev/net/tun) and an ioctl to change it between tun and
tap.

I don't propose to go that far (I think needing to use an ioctl to
choose mode is inconvenient), but having the same facilities for tun and
tap would be nicely symmetrical.

(I'm looking at this because I'm reworking the networking part of the
klh10 PDP-10 emulator, at https://github.com/Rhialto/klh10/tree/libpcap,
and the more symmetrical I can make stuff the happier it makes me. Tun
is used for the KS10 with ITS, to make its IMP communicate with the
world.)

> christos
-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl-- 'this bath is too hot.'


signature.asc
Description: PGP signature


Re: Is tun(4) a cloning device?

2015-12-25 Thread Christos Zoulas
In article <22169.1451036...@andromeda.noi.kre.to>,
Robert Elz   wrote:
>Date:Fri, 25 Dec 2015 00:20:56 +0100
>From:Rhialto 
>Message-ID:  <20151224232056.gf5...@falu.nl>
>
>  | Grom reading the source, net/if_tun.c, I get the impression that tun is
>  | a cloning device. Like tap. 
>
>It is a cloning device, but not quite like tap.
>
>It is a cloning device, in the sense that there is no magic number of
>tunnel devices configured into the kernel, which you cannot exceed at
>run time - if you want tap999 just ifconfig it (ifconfig tun999 create)
>and it exists.   This is how most cloning pseudo-devices work, and it
>means that when you use it, you know in advance which interface number
>you're getting (you choose).
>
>However, it does not have the magic minor device that creates a new
>interface every time it is opened (the /dev/tap equivalent).

Exactly, it depends if it makes sense to have a magic minor device like
that... Does it?

christos



Re: Is tun(4) a cloning device?

2015-12-25 Thread Christos Zoulas
On Dec 25,  5:19pm, rhia...@falu.nl (Rhialto) wrote:
-- Subject: Re: Is tun(4) a cloning device?

| Well, it seems that Linux has it. In fact, it has a single file for both
| tap en tun (/dev/net/tun) and an ioctl to change it between tun and
| tap.
| 
| I don't propose to go that far (I think needing to use an ioctl to
| choose mode is inconvenient), but having the same facilities for tun and
| tap would be nicely symmetrical.
| 
| (I'm looking at this because I'm reworking the networking part of the
| klh10 PDP-10 emulator, at https://github.com/Rhialto/klh10/tree/libpcap,
| and the more symmetrical I can make stuff the happier it makes me. Tun
| is used for the KS10 with ITS, to make its IMP communicate with the
| world.)

Well, we could factor out the common code for these kinds of cloners
from tap and use it for both tap and tun from the look of it. Why
don't you give it a try?

christos


Re: Is tun(4) a cloning device?

2015-12-25 Thread Robert Swindells

Rhialto  wrote:
>On Fri 25 Dec 2015 at 16:02:57 +, Christos Zoulas wrote:
>> Exactly, it depends if it makes sense to have a magic minor device like
>> that... Does it?
>
>Well, it seems that Linux has it. In fact, it has a single file for both
>tap en tun (/dev/net/tun) and an ioctl to change it between tun and
>tap.
>
>I don't propose to go that far (I think needing to use an ioctl to
>choose mode is inconvenient), but having the same facilities for tun and
>tap would be nicely symmetrical.
>
>(I'm looking at this because I'm reworking the networking part of the
>klh10 PDP-10 emulator, at https://github.com/Rhialto/klh10/tree/libpcap,
>and the more symmetrical I can make stuff the happier it makes me. Tun
>is used for the KS10 with ITS, to make its IMP communicate with the
>world.)

Why not use tap(4) ?

I have used it in emulators for machines of the same vintage and it works
well.

Robert Swindells


Re: Is tun(4) a cloning device?

2015-12-25 Thread Rhialto
On Fri 25 Dec 2015 at 17:26:04 +, Robert Swindells wrote:
> Why not use tap(4) ?

Yes, I use that too as an option. That's why I like tun and tap to be as
similar as possible (barring their fundamental differences of course).
If both can just open  /dev/xxx that is nicer than one use case just
opening /dev/tap and the other needing to probe /dev/tun0, tun1, etc.

> I have used it in emulators for machines of the same vintage and it works
> well.

Indeed it does. Especially when bridged to another, real, interface.

> Robert Swindells
-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl-- 'this bath is too hot.'


signature.asc
Description: PGP signature


Is tun(4) a cloning device?

2015-12-24 Thread Rhialto
From reading the source, net/if_tun.c, I get the impression that tun is
a cloning device. Like tap. (The word clone appears several times)

But for tap this is mentioned in the manual, and MAKEDEV creates a
/dev/tap (next to /dev/tap[0-3]). But not for tun, when it  seems it
could be.

Any particular reason for this? If they were both cloning it would
remove a nagging inconsistency and be much nicer for virtual machine
emulators.

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl-- 'this bath is too hot.'


signature.asc
Description: PGP signature