gethostbyname() in multi-homed systems.

T

thammond

I am working with XP Embedded on a multi-homed single board computer
(target). Each of the two NICs on this target is assigned at least one
static IP address (not using DHCP). Only one of these NICs will
connect with an external computer (the other igoes to another internal
single board computer).

I have to run a 3rd-party application on this target that creates a set
of Windows sockets for users to interface with it. To connect to these
sockets, I must know (at compile time) what IP address those sockets
are going to bind to. Also, applications external to the target must
be able to connect to these sockets, so they too must know the IP
address in advnace.

It appears that the 3rd-party application is using gethostbyname() to
determine which IP Address it binds its sockets to. The troubling part
is that I have seen it bind to different IP addresses when run on
identical processor cards.

I know this is probably not a standard use of network facilities,
but it's what I'm stuck with.

Q: In a multi-homed system, how can I configure which IP address is
used to resolve the system's response to gethostbyname()?

I have tried re-adding the IP address in different order, adding an
entry in the HOSTS file (<IPAddress_I_want> <machine_name>), other bits
of voodoo. So far, nothing has worked. Nobody I have talked with hsa
been able to help me. Any ideas out there?

Thanks
- Tony H.
 
T

thammond

Does anybody have any idea about how to solve this one?

In a nutshell, I have a 3rd party application that is binding
its sockets to network card B in my multi-homed system. How
can I setup Windows so that it returns the IP address of
network card A in response to gethostbyname()?

Surely someone out there knows how to do this.
Thanks in advance!

- Tony H.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top