How to determine the process for an open port on AIX

To find the process which has a port opened on AIX you do the following:
( from http://www.ibmsystemsmag.com/aix/tipstechniques/6666p1.aspx )
netstat -Aan | grep


# netstat -Aan | grep 17458
f10006000c60c398 tcp4       0      0  127.0.0.1.17458    127.0.0.1.58037    ESTABLISHED
f10006000e15bb98 tcp4       0      0  127.0.0.1.58037    127.0.0.1.17458    ESTABLISHED
f10006000c61a398 tcp4       0      0  *.17458            *.*                LISTEN
root@aixhaspa:/home/vswfl/tmp

to determine the TCP Control block f10006000c61a398.

The Utility rmsock helps to find the process ( if you do not have lsof )
# rmsock f10006000c61a398 tcpcb
The socket 0xc61a008 is being held by proccess 741434 (vsopd).

The other way would be to use kdb.
At the end of the output you see also the process ID.

# kdb
The specified kernel file is a 64-bit kernel.
Preserving 1418178 bytes of symbol table
First symbol __mulh
           START              END
0000000000001000 0000000003E5C050 start+000FD8
F00000002FF47600 F00000002FFDC940 __ublock+000000
000000002FF22FF4 000000002FF22FF8 environ+000000
000000002FF22FF8 000000002FF22FFC errno+000000
F100070F00000000 F100070F10000000 pvproc+000000
F100070F10000000 F100070F18000000 pvthread+000000
PFT:
PVT:
id....................0002
raddr.....000000000A000000 eaddr.....F200800040000000
size..............00080000 align.............00001000
valid..1 ros....0 fixlmb.1 seg....0 wimg...2
(0)> sockinfo
sockinfo

[-d]
TypeOfAddress can be socket, inpcb, unpcb, rawcb, ripcb, or tcpcb.

(0)> sockinfo f10006000c61a398 tcpcb
---- TCPCB ----(@ F10006000C61A398)----
    seg_next......@F10006000C61A398  seg_prev......@F10006000C61A398 
    t_softerror... 00000000 t_state....... 00000001 (LISTEN)
    t_timer....... 00000000 (TCPT_REXMT)
    t_timer....... 00000000 (TCPT_PERSIST)
    t_timer....... 00000000 (TCPT_KEEP)
    t_timer....... 00000000 (TCPT_2MSL)
    t_rxtshift.... 00000000 t_rxtcur...... 00000006 t_dupacks..... 00000000
    t_maxseg...... 000005B4 t_force....... 00000000
    t_flags....... 00000000 ()
    t_oobflags.... 00000000 ()
    t_template....@0000000000000000  t_inpcb.......@F10006000C61A290 
    t_iobc........ 00000000 t_timestamp... FA99CA01 snd_una....... 00000000
    snd_nxt....... 00000000 snd_up........ 00000000 snd_wl1....... 00000000
    snd_wl2....... 00000000 iss........... 00000000
    snd_wnd....... 0000000000000000 rcv_wnd....... 0000000000000000
    rcv_nxt....... 00000000 rcv_up........ 00000000 irs........... 00000000
    snd_wnd_scale. 00000000 rcv_wnd_scale. 00000000 req_scale_sent 00000000
    req_scale_rcvd 00000000 last_ack_sent. 00000000 timestamp_rec. 00000000
    timestamp_age. 00000008 rcv_adv....... 00000000 snd_max....... 00000000
    snd_cwnd...... 000000003FFFC000        snd_ssthresh.. 000000003FFFC000
    t_idle........ 00000008 t_rtt......... 00000000 t_rtseq....... 00000000
    t_srtt........ 00000000 t_rttvar...... 00000006 t_rttmin...... 00000002
    max_rcvd...... 0000000000000000        max_sndwnd.... 0000000000000000
    t_peermaxseg.. 000005B4 snd_in_pipe... 00000000
    sack_data.....@0000000000000000         snd_recover... 00000000
    snd_high...... 00000000 snd_ecn_max... 00000000 snd_ecn_clear. 00000000
    t_splice_with.@0000000000000000         t_splice_flags 00000000


-------- TCB --------- INPCB  INFO ----(@ F10006000C61A290)----
    next........@0000000000000000  prev........@0000000000000000 
    head........@0000000004364900  faddr_6.....@F10006000C61A2B0 
    iflowinfo... 00000000 fport....... 00000000 fatype...... 00000000
    oflowinfo... 00000000 lport....... 00004432 latype...... 00000000
    laddr_6.....@F10006000C61A2C8  socket......@F10006000C61A008 
    ppcb........@F10006000C61A398  route_6.....@F10006000C61A2E8 
    ifa.........@0000000000000000  flags....... 00000400
    proto....... 00000000 tos......... 00000000 ttl......... 0000003C
    rcvttl...... 00000000 rcvif.......@0000000000000000 
    options.....@0000000000000000  refcnt...... 00000000
    lock........ 0000000000000000  rc_lock..... 0000000000000000
    moptions....@0000000000000000  hash.next...@F10001003E9654B0 
    hash.prev...@F10001003E9654B0  timewait.nxt@0000000000000000 
    timewait.prv@0000000000000000  inp_v6opts  @0000000000000000 
    inp_pmtu....@0000000000000000 

---- SOCKET INFO ----(@ F10006000C61A008)----
    type........ 0001 (STREAM)
    opts........ 0006 (ACCEPTCONN|REUSEADDR)
    linger...... 0000 state....... 0180 (PRIV|NBIO)
    pcb.....@F10006000C61A290  proto...@000000000435B288 
    lock....@F10006000E16E140  head....@0000000000000000 
    q0......@0000000000000000  q.......@0000000000000000 
    q0len....... 0000 qlen........ 0000 qlimit...... 0400
    timeo....... 0000 error....... 0000 special..... 0A08
    pgid.... 0000000000000000  oobmark. 0000000000000000

snd:cc...... 0000000000000000  hiwat... 0000000000004000
    mbcnt... 0000000000000000  mbmax... 0000000000010000
    lowat... 0000000000001000  mb......@0000000000000000 
    sel.....@0000000000000000  events...... 0000
    iodone.. 00000000          ioargs..@0000000000000000 
    lastpkt.@0000000000000000  wakeone. FFFFFFFFFFFFFFFF
    timer...@0000000000000000  timeo... 00000000
    flags....... 0000 ()
    wakeup.. 00000000          wakearg.@0000000000000000 
    lockwtg. FFFFFFFFFFFFFFFF

MBUF LIST

rcv:cc...... 0000000000000000  hiwat... 0000000000004000
    mbcnt... 0000000000000000  mbmax... 0000000000010000
    lowat... 0000000000000001  mb......@0000000000000000 
    sel.....@0000000000000000  events...... 0001
    iodone.. 00000000          ioargs..@0000000000000000 
    lastpkt.@0000000000000000  wakeone. FFFFFFFFFFFFFFFF
    timer...@0000000000000000  timeo... 00000000
    flags....... 0008 (SEL|NOTIFY)
    wakeup.. 00000000          wakearg.@0000000000000000 
    lockwtg. FFFFFFFFFFFFFFFF

MBUF LIST

    tpcb....@0000000000000000  fdev_ch.@F100010054710640 
    sec_info@0000000000000000  qos.....@0000000000000000 
    gidlist.@0000000000000000  private.@0000000000000000 
    uid..... 00000000 bufsize. 00000000 threadcnt00000000
    nextfree@0000000000000000 
    siguid.. 00000000 sigeuid. 00000000 sigpriv. 00000000
    sndtime. 0000000000000000  sec  0000000000000000  usec
    rcvtime. 0000000000000000  sec  0000000000000000  usec
    saioq...@0000000000000000  saioqhd.@0000000000000000 
    accept.. FFFFFFFFFFFFFFFF  frcatime 00000000
    isnoflgs 00000000 ()
    rcvlen.. 0000000000000000  frcaback@0000000000000000 
    frcassoc@0000000000000000  frcabckt 0000000000000000
    iodone.. 00000000          iodonefl 00000000 ()
    ioarg...@0000000000000000  refcnt.. 0000000000000001
    trclev........... 0001


proc/fd:  181/5


proc/fd: fd: 5
              SLOT NAME     STATE      PID    PPID          ADSPACE  CL #THS

pvproc+02D400  181*vsopd    ACTIVE 00B503A 0000001 00000001D8B1F480   0 0001