|
Marty, I looked at using the QtocLstNetIfc Api and also reading QATOCIFC in QUSRSYS. However, like you say, these just give me a list of the defined IP address and not just the one I'm looking for. In the end, I went with Rob's suggestion of using PING and RCVMSG. It's not very pretty, but it works. I have never heard of gethostbyname, but after doing a little preliminary research, it looks like it may be a better solution. Thanks for pointing me in that direction! As far as why I need to do this, one of the divisions has a third party time and attendance system that runs on a wintel box. I need to get this information to the iSeries for payroll processing. They export the file to a mapped folder on the IFS. When we are role swapped, the file needs to go to the DR iSeries. In order to know where to send the file, I need to know which iSeries they are running on. Terry Anderson
message: 2 date: Tue, 18 Jul 2006 21:20:14 -0400 from: "Urbanek, Marty" <Marty_Urbanek@xxxxxxxxxxxx> subject: RE: Programmatically Pull the IP Address of The iSeries Terry, Since the iSeries could have multiple interfaces, it could have more than one IP address. You can use the QtocLstNetIfc API to retrieve a list of the interfaces and then go through the list and check each interface's status to see if it is active. The subset of active interfaces would represent all the IP addresses that the iSeries could respond to. I'm not sure what happens in the case of PPP (dialup) connections. But maybe you're more interested in a function such gethostbyname to see what DNS and/or host table thinks your IP address is supposed to be. Maybe you could tell us a little more about what your program needs to do. -Marty -----------------------
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.