This is a discussion on Testing if an IP address is local to my machine within the AIX Operating System forums, part of the Unix Operating Systems category; --> I have 4 multi-homed machine, which have 3 nc and various ip address per nc. This is done because ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have 4 multi-homed machine, which have 3 nc and various ip address per nc. This is done because of HACMP and different service running on this machines. I have on each machine a daemon giving some information, listening on all IPs. This daemon is pretty slow. I like to speed it up reading directly the local info, without running through the network. I have the service hostname so i can get the ip address with gethostbyname. How can i test if this address is local to this machine ? The only way i found is running "ifconfig -a" and parsing the output, but i hope there is a function that gives the same result. Does Anyone know it ? Thank you MP |
| ||||
| Two options come to mind... You can look into the kernel's network structures via /dev/kmem and knlist (not that bad, actually), or since you mentioned HACMP, you might have more interesting and useful results by looking at the API used by clstat. That way, you could determine if the HACMP resource group you wanted was local to the machine... -Chris On Tue, 12 Jun 2007 16:22:47 +0000, piccinini.massimiliano wrote: > I have 4 multi-homed machine, which have 3 nc and various ip address > per nc. This is done because of HACMP and different service running on > this machines. > > I have on each machine a daemon giving some information, listening on > all IPs. This daemon is pretty slow. I like to speed it up reading > directly the local info, without running through the network. > > I have the service hostname so i can get the ip address with > gethostbyname. How can i test if this address is local to this > machine ? > > The only way i found is running "ifconfig -a" and parsing the output, > but i hope there is a function that gives the same result. > > Does Anyone know it ? > > Thank you > MP |
| Thread Tools | |
| Display Modes | |
|
|