Local IP Addresses, multiple NICs

Hello,

I'm trying to get the IP addresses of a local PC and I'm
having trouble if the PC has more than one NIC card.

I've tried using MSWINSCK.OCX and the LocalIP property and
I've tried using pbsw32.dll and the GetHost function but
both only seem to report back the first IP address found.

Besides redirecting the output of an IPCONFIG /all to a file
and reading it, does anyone know how to find out the IP
addresses of a PC with more than one NIC?

Thanks.
0
Steve
11/2/2007 4:04:16 PM
sybase.powerbuilder.general 62418 articles. 16 followers. Follow

3 Replies
741 Views

Similar Articles

[PageSpeed] 40

Most routines that grab the IP address do so by calling gethostbyname
and then examining the hostent structure that is returned.  The
h_addr_list attribute of that structure is actually a list of IP
addresses for the machine.  What most of these utilities do is simply
return the first address on the list.  What you want to do is modify
the routines to return all addresses found:

http://www.rgagnon.com/pbdetails/pb-0132.html

http://eric.aling.tripod.com/PB/tips/pbtip14.htm

If I'm not mistaken, PBNI PowerPack and PBNI utilities DLL both supply
IP address info:

https://powerbuilder.codexchange.sybase.com/servlets/ProjectDocumentList?folderID=454&expandFolder=454&folderID=245



On 2 Nov 2007 08:04:16 -0800, Steve Woitkowski wrote:

>Hello,
>
>I'm trying to get the IP addresses of a local PC and I'm
>having trouble if the PC has more than one NIC card.
>
>I've tried using MSWINSCK.OCX and the LocalIP property and
>I've tried using pbsw32.dll and the GetHost function but
>both only seem to report back the first IP address found.
>
>Besides redirecting the output of an IPCONFIG /all to a file
>and reading it, does anyone know how to find out the IP
>addresses of a PC with more than one NIC?
>
>Thanks.

0
Bruce
11/3/2007 3:16:41 AM
Try my example http://www.topwizprogramming.com/freecode_adapter.html

The function of_GetAdapterInfo will return string arrays of mac address & ip

<Steve Woitkowski> wrote in message 
news:472b4a80.2922.1681692777@sybase.com...
> Hello,
>
> I'm trying to get the IP addresses of a local PC and I'm
> having trouble if the PC has more than one NIC card.
>
> I've tried using MSWINSCK.OCX and the LocalIP property and
> I've tried using pbsw32.dll and the GetHost function but
> both only seem to report back the first IP address found.
>
> Besides redirecting the output of an IPCONFIG /all to a file
> and reading it, does anyone know how to find out the IP
> addresses of a PC with more than one NIC?
>
> Thanks. 


0
Roland
11/3/2007 11:13:25 PM
adapter10.pbl look perfect -- thanks Roland.
0
Steve
11/5/2007 2:34:03 PM
Reply:

Similar Artilces:

Single IP address to Multiple NICs
My servers Netbios name is BGRSVR-X, it currently has one IP address 192.168.1.224. There are several shares on the machine (it's running Suse 11.0 KDE3.5 by the way). My Linux "clients" connect to it using fstab and the IP address of the machine (for some reason i can't "find" it when i look for the netbios name?) example fstab would be something like:- \\192.168.1.224\music \home\badger_fruit\lan\music .... The problem is, as I get more content and the kids grow, there is more demand on the poor network card (the pc is good enough as it's 3ghz...

Multiple NIC/Single IP address
Is it possible to load balance a Netware 5.1 server by simply assigning two NIC's the same IP address? It looks possible in NW6 but we haven't upgraded yet. Thanks Warren I have done this frequently with a special NLM/Driver from Intel/Compaq. IANS.LAN i belive is the driver that is used by either Compaq is Intel. It ships right on the driver disk for the Intel Server Nics. > Is it possible to load balance a Netware 5.1 server by simply assigning > two NIC's the same IP address? It looks possible in NW6 but we haven't > upgraded yet....

Catch IP Address of Local Machine Insted of Server IP Address where the application is deployed at
Hai ,  I have a survey that will be sent to all the users across a group, This survey application is deployed on webserver and that link will be sent to all the group members.Right now it was capturing the IP  Address of server for all members in group , insted i need each members Local machine IP Address to be sent the database via server.  I tried using the following two requests but all they are doing is capturing the server ip address:  String clientName = Request.ServerVariables["LOGON_USER"]; String clientName = Request.ServerVariables["REMOTE_ADD...

NetStorage on OES-Linux and multiple nics
Situation: Dual P3-1Ghz 1Gb RAM 200Gb RAID5 config and 2 logical volumes, (recycled nw4.x file server) OES/Linux new install of SP2 into existing OES/NW 6.5 tree. Got it right on the 4th retry. 2 logical drives are sda and sdb sda sda1 38Gb reiser as / sda2 1Gb swap sdb sdb1 160Gb NSS pool/volume All mount fine and are accessible on the inside network. A couple of NFS mount points are also exported as Netware volumes and these are also working fine. (1 from an Ingrasys NAS device and 1 from a Vax6000-440 via VMS-Vax 6.0 & Multinet.) 2 nics. We have 2 ...

Bind EAServer to a given IP address on server with multiple IPs
Hello, The systems guy at my client has set up a new W2K3 server. He has assigned multiple IP addresses to this machine. He wants Jaguar to listen on port 80 on a single specific IP address, but not the others. Can/How do I accomplish this with EAS 5.3 ? Is it as simple as setting the listener.hostname to be the IP rather than ${JAGUAR_HOST_NAME} ? Thanks, D yep. -- Dean Jones CEO PowerObjects http://www.powerobjects.com (612) 339-3355 Ext. 112 TeamSybase * * Think Sybase * * "Daniel Coppersmith" <coppersmith2002_A_T_hotmail_D_O_T_N0SPA...

How can I get IP Address & NetCard Address Using PowerBuilder?
Hello,All: How can I get IP Address and NetCard Address Using PowerBuilder? Please give me a hand??Thanks for your help... Jim look at : http://utopia.knoware.nl/users/cypr115/ Jean-Paul "Jim" <jim@turnkey.com.tw> wrote in message news:25f#ZzO1$GA.203@forums.sybase.com... > Hello,All: > How can I get IP Address and NetCard Address Using PowerBuilder? > Please give me a hand??Thanks for your help... > > Jim > > Is it Arguments??? I can't understand Arguments... Would anyone tell me!!Thanks! jpf <jpf@basc....

multiple IP addresses
Newbie question: I ran Steve's port check yesterday and it found two IP addresses on my machine, one in with all ports in stealth and one with all closed. Today there are three addresses: two in stealth and the same one closed. Any comments? (running WIN98+; Zone Alarm freeware; Finjan Surfinguard; Norton Systemworks; Limeware uninstalled) Tritone Exactly what IPs are you seeing? -Andy (CEO, Dynamic Bits) http://dynamicbits.com "tritone" <tritone@hushmail.com> wrote in message news:a43v3d$u8q$1@news.grc.com... > Newbie question...

Multiple IP Addresses
Windows XP SP2: How do I assign more than one IP address to a single NIC? Torrance On Wed, 06 Feb 2008 19:20:51 -0600, Torrance Bell <starlite528@yahoo.com> wrote: >Windows XP SP2: >How do I assign more than one IP address to a single NIC? Same as in Windows 2000. Set 1 static IP. After that, add as many more as you like in the ADVANCED section. AFAIK, you cannot add a second IP (at least not as easily) if the first one is auto (DHCP). HTH, Bill -- Expert Opinions $5 I Shut-Up $10 In grc.techtalk, on Wed, 6 Feb 2008 19:20:51, Torrance Bell wrote: ...

Multiple IP addresses
Question: I have a server with two NICs -> 2 IP addresses. Now when I log on to the network as user1, and I ping the server, I always get response from IP address 1. When I log on as user2, I always get a reply from IP address 2. Can anyone tell me if this is a (strange) coincidence, or is this normal behaviour?!? BTW: user1 and user2 are in different contexts. user1 has admin rights, user2 has normal user rights. I tested this on several PCs on my network, but always get the same results as described above. (user1 -> IP address 1, user2 -> IP address 2) If it is norm...

IP address in Powerbuilder
I need to get IP address of a workstation or the computer name from Powerbuilder application. Is there any way to do that in Powerbuilder or I need to call some API functions? Thanks Mikahil Smirnov See Eric Aling's homepage for a solution: http://utopia.knoware.nl/users/cypr115/ -- Terry Dykstra (TeamSybase) Canadian Forest Oil Ltd. MikhailSmirnov wrote in message <377A6130.995A8F6E@Alliant-Energy.com>... >I need to get IP address of a workstation or the computer name from >Powerbuilder application. Is there any way to do that in Powerbuilder or >I nee...

multiple ip addresses
netware 6.5 sp3 cluster 2 nodes i need to add a secondary ip address for clients accessing via what we will call a strange route multi homing the server is ok but is it possible to add a secondary ip address to the virtual server that represents the volume Terry, Yes, just add the extra commands to the volume resource load/unload scripts. Add secondary ipaddres= Del secondary ipaddress= Keep in mind though that all sec ip addresses must be in the same subnet. -- Peter vd Woude --------- Novell Support Forums SysOp --------- > netware 6.5 sp3 cluster 2 nodes &...

Problem the IP address showing is NOT my IP address I am at.
host217-35-99-250.in-addr.btopenworld.com or 217.35.99.250 is someone else's IP address, not my IP address (12.98.80.XXX a Dynamic IP address range) when I test my ports with the NanoProbe system. In message <b6i8f8$tp1$1@news.grc.com>, abcministoragellc <abcministoragellc@netzero.net> kicked in with > >host217-35-99-250.in-addr.btopenworld.com >or 217.35.99.250 >is someone else's IP address, not my IP address (12.98.80.XXX a Dynamic >IP address range) >when I test my ports with the NanoProbe system. Had the same here, a couple of minute...

Server 2007 difference between 2 NIC's and 1 NIC w/ 2 IP addresses?
What is the difference between using two NIC's in a server, one on a 192.x.x.x and one on a 10.x.x.x and using one NIC and assigning two addresses to it? TIA BillP On 12/20/2009 05:26, Bill Pomeroy wrote: > What is the difference between using two NIC's in a server, one on a > 192.x.x.x and one on a 10.x.x.x and using one NIC and assigning two > addresses to it? > TIA > BillP The obvious one is that one method uses the one physical network and the other uses two. Maybe describe what you are trying to do? Bill Pomeroy wrote: > What is the differ...

get the local IP Address
Hi! I just want to ask if there is any way to get the local ip ( not 127.0.0.1) using the dns-service service eg var dnsService = Components.classes["@mozilla.org/network/dns-service;1"].getService( Components.interfaces.nsIDNSService ); MachineName = dnsService.myHostName; var dnsRecord = dnsService.resolve( dnsService.myHostName, false ); IPAddress = dnsRecord.getNextAddrAsString(); the IPAddress here always returns as 127.0.0.1, is there any way to get the actual local ip (ie 172.16.1.10) Thanks dyodyo wrote: > Hi! > I just want to ask if there is any...

Web resources about - Local IP Addresses, multiple NICs - sybase.powerbuilder.general

Postal addresses in the Republic of Ireland - Wikipedia, the free encyclopedia
Ireland is one of the few countries in the world, and the only EU country, that does not have a Postal code system. As of 2012, the Irish Government ...

How To: (Possibly) Restore Your Contacts After The Switch To Facebook.com Email Addresses
Still having issues with lost contacts following Facebook’s recent controversial move to make Facebook.com email addresses the default emails ...

Facebook Users Can Now Opt Into Letting Friends Export Their Email Addresses via Download Your Information ...
Previously, Facebook's Download Your Information tool let users export an archive of their status updates, photos, as well as a list of friends' ...

IPCC Chair Addresses Summit on Climate Change - Flickr - Photo Sharing!
Rajendra Pachauri, Chair of the Intergovernmental Panel on Climate Change (IPCC), addresses the opening plenary session of the Summit on Climate ...

YouTube - Joss Whedon Addresses 181st (2013) Wesleyan University Commencement
Veröffentlicht am 27.05.2013 Wesleyan Class of 1987 alumnus Joss Weadon receives an honorary doctorate and the privilege of delivering the commencement ...

Skype for iOS updated with data detectors for phone numbers, addresses, and more
Skype updated its iOS client today with support for several different data detectors in text chats. Now whenever someone sends you a phone number, ...

Amid Protests On Campus, Yale Law Journal Addresses Its Own Diversity Challenges
By openly and directly confronting their diversity challenges, the Journal hopes to spark the difficult reflection and dialogue necessary for ...

President Obama Addresses Veterans - Al Jazeera America
On Veterans Day, the president discusses the need to continue honoring those who served by safeguarding them

Microsoft’s new Windows 10 privacy policy addresses some of our biggest concerns
Although the furor has subsided in the months since the launch of Windows 10 , PC owners still have plenty of valid concerns about how Microsoft ...


Resources last updated: 11/23/2015 10:15:55 PM