Device IP address Directory

Directory .ZIP

objects?





These CL programs are examples of using the Retrieve Device Description (QDCRDEVD) API to get the IP address associated with a device. Both CLPs have associated command shells.

Please read the @GENERAL DISCLAIMER document for any items you should be aware of if you download any of these items.


CLPs

RTNIPADDR -- Return IP Address:

Note: The CL here is derived from an example I saw shortly after the API was enabled to return an IP address. It's fairly generic code, but I'd like to credit the original author. If you recognize the code and can put a name or other source with it, I'd appreciate a note about it. I made a few changes to allow it to work well with a CMD shell and for other minor reasons; but I can't really improve on the original. I've seen no reason to write it fresh from scratch; it works just as it is.
This program accepts a device name and returns the associated IP address. The QDCRDEVD API is called directly from this program. The IP address is initialized to the value <*BLANK>; this value will be returned if the device is not a TCP/IP device.

SHOIPADDR -- Show IP Address:

This program shows a trivial example usage of RTNIPADDR. It accepts a device name and uses SNDPGMMSG to display the associated IP address. Rather than using SNDPGMMSG, you might use the UIM Display Long Text (QUILNGTX) API or my DSPLNGTXT command.

CMDs

RTNIPADDR -- Return IP Address:

The command definition object source for RTNIPADDR. This encapsulates the RTNIPADDR CLP and defines the attributes of the DEVD() and IPADDR() parameters. This command is suitable for general use in any CLP that needs to get a device's IP address or determine if a device is a TCP/IP device.

SHOIPADDR -- Show IP Address:

The command definition object source for SHOIPADDR. This encapsulates the SHOIPADDR CLP and defines the attributes of the DEVD() parameter. While this can be a handy command-line command for general trouble-shooting, it has very limited use. It is included here only to show a usage of RTNIPADDR.