Unix Technical Forum

Testing if an IP address is local to my machine

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 ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 11:49 AM
piccinini.massimiliano@gmail.com
 
Posts: n/a
Default Testing if an IP address is local to my machine

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 11:49 AM
Christopher Petersen
 
Posts: n/a
Default Re: Testing if an IP address is local to my machine

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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:20 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com