|
|||||||
|
|
![]() |
|
|
|
|
||
|
Retrieving the Host Name from an IP Address Hey, Shannon: I am writing the world's greatest AS/400 utility. It will do everything except lock the door and turn the lights off when it's time to go home at night! I have it all figured out, except for one thing: I need my RPG program to be able to retrieve the Internet Protocol (IP) address of all the other AS/400's that have already been defined on our AS/400 in the TCP/IP host table. Is there some easy method of determining the IP address of the systems defined in the AS/400 host table, using an RPG program? --Roxie That sounds like some humdinger of a utility, Roxie. If you can figure out a way for your program to automatically ask for a pay raise, let me know. I might be interested in buying it. To retrieve the IP address of the systems defined in the AS/400 host table is actually pretty easy. IBM has conveniently created two physical files for you to CHAIN to in your RPG IV program. The first, QATOCHOST, contains the IP address and the user-defined host name of the remote systems. If you know the IP address, you can CHAIN directly to QATOCHOST by that address to retrieve the host name. If you know the host name, but need the IP address, CHAIN to logical file QATOCHLST1 by the host name and that will return the IP Address. If you need more information about that TCP/IP route, you can also CHAIN to a file named QATOCIFC by IP address. The QATOCIFC file contains such information as the type of AS/400 line (Ethernet or Token-Ring, for example) that this route has been defined for, as well the subnet mask, the size of the maximum transmission unit (MTU), and much more. All files can be found in library QUSRSYS. --Shannon
|
Editors
Contact the Editors |
| Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved. |