[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I find out the list of active network objects?



> 
> Hi Reinhard,
> 
> Thanks ... that looks like it would be probably what I was looking for,
> if only the file looked like that in Linux 2.3.39 ... I have:
> 
> Local                             Remote
>  1.2/2189 0001:0001 0000:0000 2  1.5/0000 0000:0000 0000:0000 2  CI 
> IMMED
>  0.0/2188 0001:0001 0000:0000 2  0.0/0000 0000:0000 0000:0000 2 
> OPENIMMED

Yes, the above line is the listening socket. Listening sockets are in the
open state, as are all sockets after socket() has been called to create
them and before connect() has been called.

The fields in this listening are divided into 3 section, Local, Remote
and the last two entries being state (from DECnet specs) and the immediate
of deferred acceptance flag.

The Local and Remote sections are divided as follows:

DECnetAddress/PortNumber NextDataSeqNum:NextOtherDataSeqNum 
                                     NextAckNum:NextOtherDataAckNum flowsw

Sockets have local port numbers assigned upon bind() (Yes, you are right
listening sockets don't need them, but its simpler to do it this way).
You might not have actually called bind() itself though, because it is
implict in some other commands.

Remote ports of course are set upon connect, so all sockets which are not
yet connected will have zero remote ports. If its the local socket doing the
connecting, you'll see a filled in remote address, but the port won't be
assigned until connection is made. (e.g. the top line in your file here)

The other fields are more or less for debugging only. The flowsw field
can take the following values:

2 = Can send data
1 = Cannot send data

The value 0 is used in some DECnet messages meaning "no change" to the
send/don't send status.

The Local DataSeqNum and OtherDataSeqNum fields are the numbers which will be
placed into the next outgoing data/other data messages respectively. 
The Local Ack fields contain the last Ack sent for data/other data to
the remote host.

The Remote DataSeqNum and OtherDataSeqNum fields are the last message
numbers heard from the remote host. The Remote Ack fields are the last
received Ack numbers from the remote host.

If you want to find out more details about the connection, and get at things
such as connect/disconnect data, then you'll need to use the set/getsockopt()
functions. With them you should be able to set/get any/all of the connect
and disconnect data and access control fields in the messages.

I did consider putting the socket addresses to which sockets were bound in
the /proc/net/decnet files. I deceided in the end that it was possibly
a security risk, to allow people to read things this way.

Its probably not a good idea to write programs to parse the data from the
/proc/net/decnet file directly. Its format will change and I consider that
the main purpose of it is to provide debugging information at the moment.

Certainly when we start to support flow control with methods other than
the flowsw switch, I'm intending to add some more fields to allow debuging
of that.

Sorry this message turned out so long - I hope it answers your questions.
I put the rest of the explanation in since the formst of the file is
rather cryptic and probably needs some explanation :-)

Steve.

-----------------------------------------------------------------------------
To unsubscribe from this list, send a mail to majordomo@dreamtime.org
containing the line "unsubscribe linux-decnet"
-----------------------------------------------------------------------------