Operating System - OpenVMS
1825801 Members
2603 Online
109687 Solutions
New Discussion

How to retrieve info on multiple IP ports?

 
Galen Tackett
Valued Contributor

How to retrieve info on multiple IP ports?

We're running HP TCP/IP Services V5.3 and V5.4. One of our developers would like to be able to retrieve some status information (in a C application) on all the open ports on the system.

What he wants to know is what the command "netstat -na" displays. I know that you can loop through the BGAn: devices with SYS$DEVICE_SCAN() and could get _some_ information with SYS$GETDVI().

But is there a documented way to get (from C code) the protocol (i.e. tcp or upd), receive and send queue lengths, local and remote addresses, and state, for a BG: device that belongs to another (or no) process?

I know VMS itself well enough and have written some simple code using the sockets API, but I'm not familiar enough with any of the TCP/IP APIs to be able to help him.
1 REPLY 1
Hoff
Honored Contributor

Re: How to retrieve info on multiple IP ports?

netstat -na? Probably.

I don't know that the queue lengths are available, I haven't looked for that. It does look like you can peek:
http://h71000.www7.hp.com/doc/82final/6529/6529pro_006.html#index_x_172

There's a fairly involved $qio interface documented in the TCP/IP programming documentation -- most of what the socket API does with TCP/IP, it does through the $qio interface. Much of the $qio API is documented.

There's also the typical socket library interface, and many of the ported tools use this interface. Somewhat confusingly, the socket interface has been documented over in the back of the C manual.

As for whether or not what you need is documented here via C API or via the $qio API (or if there is some kernel-mode or undocumented hackery underneath the OpenVMS port of netstat), I haven't looked.

You likely will end up using a combination of either sockets or sockets and $qio, and a wild-carded $device_scan and $getdvi.

For completeness:
http://www.hp.com/go/openvms/doc