Subject: Re: PCB question
To: None <tech-kern@NetBSD.org>
From: Rui Paulo <phlox-netbsd-kern@fnop.net>
List: tech-kern
Date: 10/26/2004 13:30:04
On 2004.10.26 13:05:15 +0000, Rui Paulo wrote:
> In userland, how can I detect if a given PCB relates to TCP or TCP6 ? 
> I intend to change netstat(1) to try autodecting the protocol when
> dumping the PCB information (netstat's -P flag).

A correction: what I really want is netstat(1) to detect the protocol and
dump information about it. If the protocol doesn't support that,
netstat should output a message (like it currently does when the user
specifies -p udp or -p icmp). This is to avoid invalid information 
if we use -P in, for example a UDP protocol. Of course, we can still 
bypass this check if -p was specified.

This way, netstat would do something similar to:
# netstat -A -n -f inet | grep 138
c097021c udp        0      0 10.0.0.2.138          *.*                  
# netstat -P c097021c
udp: no PCB dump routine

But netstat -P c097021c -p tcp would also be vaild (it doesn't output
only TCP related information).

-- 
Rui Paulo                          "Simplicity is the ultimate sophistication."
                                      -- Leonardo da Vinci