Subject: Re: scsi-ethernet again
To: Mattias Sandstrom <mattias@beauty.se>
From: Antti Kantee <pooka@iki.fi>
List: port-mac68k
Date: 09/17/2002 01:17:33
On Mon Sep 16 2002 at 23:36:57 +0200, Mattias Sandstrom wrote:
> ok, i'm ready to start working on that driver, or userland daemon for 
> now, for the dayna ether/link. i have the docs for the protocol it uses 
> and i know how to code, but i don't really know how to start since i 
> come from programming games and embedded apps and never did any real os 
> programming. anyway, i found this, regarding the cabletron device:
> 
> "After cajoling NetBSD to deal with it on the bus (it returns extra
> data on INQUIRY) and adding the uk (Unknown SCSI) driver to the pc532
> conf.c and files.pc532 file I was able to speak to it.  I then added
> the tun (tunnel interface) driver to my kernel and wrote a bad program
> to shuttle data between them (hardwired addresses, no ARP), and was
> able to ping."
> 
> (http://mail-index.netbsd.org/port-pc532/1996/07/01/0000.html)
> 
> sound like exactly what i want to do, but how exactly do i set up 
> networking to use the tun interface and how do i make my program listen 
> to it? i guess i'm supposed to set up the network to use tun0 and then 
> listen to tun1 and somehow create the actual tunnel between these two 
> devices? or can i just use the same tun* for both? am i making sense?

Well basically you ifconfig create tun0, ifconfig a set of addresses to it
(it's a point-to-point link), and then whatever you write to /dev/tun0
in your userspace program gets delivered to the networking code and
vice versa.

so I'm guessing the big picture would be something like this:
network stack <-> if tun <-> /dev/tun <-> "driver", ie. your program
  <-> /dev/uk <-> device <-> actual network

Configuring the tun0 interface and pinging it while reading /dev/tun0
should give you a pretty clear idea on how tun works.

btw, anyone working on the Asante SCSI ethernet? ;)

-- 
Antti Kantee <pooka@iki.fi>                     Of course he runs NetBSD
http://www.iki.fi/pooka/                          http://www.NetBSD.org/
                 "connoisseurs do not chill their malts."