STREAMS MODULE PROBLEMS

STREAMS MODULE PROBLEMS

Post by Fergus Dunc » Mon, 15 Apr 1996 04:00:00



I've written a steams module which does protocol packaging on data
packets - I have implemented a simple DLPI interface so that I can
link it into the IP multiplexer and have managed to link (I_PLINK) the
ip device to the module containing the stream.

HOWEVER when I try to use SIOCSIFNAME or SIOCSIFADDR ioctls I get
unknown device or filepath and unknown device or address errors - I've
scoped all the info in the DDK and SDK and can't see any problem with
what I'm doing. I've got debug code on the module (cmn_err logs) and
the only service routine called in the _init routine (when i modload
the module).

Other than this the module runs fine (when I intercept M_DATA messages
instead of DL_UNITDATA DLPI messages).

Has anybody out there tried this sort of thing ? - Has anybody out
there got any tips ?

I'm running Solaris 2.5 on an intel platform using sun proworks cc
compiler.

Any help would be greatly appreciated

Cheers

 
 
 

1. STREAMS module problem in Solaris

I have a STREAMS problem in Solaris. I get a
socket file descriptor with the socket command:
fd = socket(...);
The STREAMS stack then looks like this:
sockmod
tcp
ip

I then have a self made STREAMS module called
filter, which I insert between sockmod and
tcp. filter is supposed to encrypt the STREAM. I
then use "netcat" to test the module. I
modified the code of netcat so it load filter into
the stack (by poping sockmod and then
push filter and repush sockmod). If I simply start
2 netcats and use it as a chat, filter
sniffs this traffic:

host1: nc -l -p 1234

host2: nc -w 3 <otherhost> 1234

filter_wput: DB_TYPE=M_PROTO
filter_rput: DB_TYPE=M_PCPROTO
filter_wput: DB_TYPE=M_PROTO
filter_rput: DB_TYPE=M_PCPROTO
filter_wput: DB_TYPE=M_PROTO
filter_rput: DB_TYPE=M_PCPROTO
filter_wput: DB_TYPE=M_PROTO
filter_rput: DB_TYPE=M_PCPROTO
filter_wput: DB_TYPE=M_PROTO
filter_rput: DB_TYPE=M_PROTO
filter_rput: DB_TYPE=M_SETOPTS
filter_rput: DB_TYPE=M_SETOPTS
filter_rput: DB_TYPE=M_PCPROTO
filter_rput: DB_TYPE=M_SETOPTS
filter_rput: DB_TYPE=M_PROTO
filter_wput: DB_TYPE=M_PROTO
filter_rput: DB_TYPE=M_PCPROTO
filter_wput: DB_TYPE=M_CTL

I dont know what this traffic is, but after this,
my module seems to work as intended.

When I instead start netcat whith redirect for
stdin and stdout like this:

host1: nc -l -p 1234 > outfile

host2: nc -w 3 <otherhost> 1234 < infile

M_DATA blocks beeing sent before this initial
traffic is done. The last 3 messages:

filter_wput: DB_TYPE=M_PROTO
filter_rput: DB_TYPE=M_PCPROTO
filter_wput: DB_TYPE=M_CTL

havn't occured. The data blocks seems to disappear
between putnext at the write side and the
rput procedure att the other side. Not until the 3
control(?) messages has occured, the data
is beeing received. The result is a file with the
beginning cut.

Is there someone who know whats happening here?
How can it be fixed?

Is there anyway to load my STREAMS module when I
connect to a socket (without any other
command than socket())?

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

2. Can't do an importvg on Standby node because PV is marked as missing.

3. What happens if a stream module is pushed onto multiple stream driver?

4. usb mass storage on a non-usb sparc system?

5. Solaris x86 failure to push streams module into network stream

6. Dual Boot Win95 & Linux

7. How to push STREAMS module into socket stream

8. Boot Disk Doesn't Boot

9. STREAM module read+write queue problem

10. SysV.4 Streams and Modules programming problem: 2

11. SysV.4 Streams and Modules programming problem: 1

12. Problem unloading streams module: device busy

13. SysV.4 Streams and Modules programming problem: 1