Alexander Kolbasov ??:
>> Hi,
>>
>> I got this problem in the closed source Solaris 5.10 127128-11. I need to 
>> dump out the tcp_t of a process, here is what I do:
>>
>> 1. do " ::pid2proc | ::pfiles" to get the file descritpor of the tcp 
>> connection
>> 2. do " ::pid2prod | ::fd | ::print file_t f_vnode | ::print vnode_t 
>> v_stream | ::stream" to get the "tail" of the stream:
>>> 0t6701 ::pid2proc | ::fd 5 | ::print file_t f_vnode| ::print vnode_t 
>>> v_stream

I got these:

> 00000600205aec58::pfiles
FD   TYPE            VNODE INFO
   0 SOCK 000006002144a680 socket: AF_INET6 ::ffff:10.13.30.66 23 remote:
AF_INET6 ::ffff:129.158.215.196 63106
   1 SOCK 000006002144a680 socket: AF_INET6 ::ffff:10.13.30.66 23 remote:
AF_INET6 ::ffff:129.158.215.196 63106
   2 SOCK 000006002144a680 socket: AF_INET6 ::ffff:10.13.30.66 23 remote:
AF_INET6 ::ffff:129.158.215.196 63106
   3  CHR 0000060021559d00 /devices/pseudo/clone at 0:ptm
   4 DOOR 0000060020612180 /var/run/name_service_door [door to 'nscd' (proc=
6002055c4b0)]
   5  CHR 00000600215e4800 /dev/pts/1
   6  CHR 00000600211a3740 /devices/pseudo/random at 0:urandom
   7  CHR 000006002152eb80 /devices/pseudo/clone at 0:logindmux
   8  CHR 00000600215fbe00 /devices/pseudo/clone at 0:logindmux

FD 0, 1 and 2 are exactly the same. Does it mean the stdin, stdout and
stderr for a tcp connection is actually the same (the connection)?


>> | ::stream
>>
>> +-----------------------+-----------------------+
>> | 0xffffffff854efde0 | 0xffffffff854efce8 |
>> | strwhead | strrhead |
>> | | |
>> | cnt = 0t0 | cnt = 0t0 |
>> | flg = 0x00004022 | flg = 0x00044030 |
>> +-----------------------+-----------------------+
>> | ^
>> v |
>> +-----------------------+-----------------------+
>> | 0xffffffff8a650638 | 0xffffffff8a650540 |
>> | tcp | tcp |
>> | | |
>> | cnt = 0t0 | cnt = 0t0 |
>> | flg = 0x20244022 | flg = 0x20204032 |
>> +-----------------------+-----------------------+
>>
>> In opensolaris, this would be a 'conn_t' structure (0xffffffff8a650638) and 
>> I can get tcp_t from conn_t->conn_proto_priv.cp_tcp.
>>
>> In regular Solaris, the tcp_t points to NULL and is no conn_proto_priv in 
>> conn_t. So the question is how do I get tcp_t in regular Solaris?
>
> Look at the box that says 'tcp' - this is the queue of the tcp module. In your
> case it is 0xffffffff8a650638. You should be able to print
>
> 0xffffffff8a650638::print queue_t q_ptr
>
> This will show you the conn_t pointer. From here you can get conn_tcp field
> which is the address of tcp_t structure. Note that conn_tcp structure is not
> present in OpenSolaris and you need to use  conn_proto_priv.cp_tcp instead.

I got:

> 000006002144a680::print vnode_t v_stream | ::stream

+-----------------------+-----------------------+
| 0x60021462bb0         | 0x60021462ab8         | peer wq    : 6002116c908
| logindmux             | logindmux             | upper rq   : 60021529540
|                       |                       |
| cnt = 0t0             | cnt = 0t0             |
| flg = 0x00201022      | flg = 0x00241032      |
+-----------------------+-----------------------+
            |                       ^

What is "peer wq" and "upper rq"?


BTW, is there a method to list all conn_t in the system? Thanks.

--
Tuma

Reply via email to