• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Getting your Gateway IP Address
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting your Gateway IP Address


  • Subject: Getting your Gateway IP Address
  • From: Mark Thomas <email@hidden>
  • Date: Wed, 25 Oct 2006 12:33:17 +0100
  • Organization: Coderus Ltd

Hi All,
  Does any know how you would get your Gateway/Router IP address. As getting
this previously using Open Transport was pretty easy as you would use.

InetInterfaceInfo info;
OTInetGetInterfaceInfo ( &info, kDefaultInetInterface );

And then looking at the 'fDefaultGatewayAddr' which would give this
information. But as Open Transport is slowly going away, I'm looking to how
you do this in the bsd layer.

  Usually the OTInetGetInterfaceInfo equivalent searching archives is using
'getifaddrs' which does return

         struct ifaddrs   *ifa_next;         /* Pointer to next struct */
         char             *ifa_name;         /* Interface name */
         u_int             ifa_flags;        /* Interface flags */
         struct sockaddr  *ifa_addr;         /* Interface address */
         struct sockaddr  *ifa_netmask;      /* Interface netmask */
         struct sockaddr  *ifa_broadaddr;    /* Interface broadcast address
*/
         struct sockaddr  *ifa_dstaddr;      /* P2P interface destination */
         void             *ifa_data;         /* Address specific data */

  Which covers most IP information but there's nothing for gateway/router
address, also running ifconfig, which I assume using this information and
displaying doesn't show what I need.

Any idea's

Thanks
Mark.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Getting your Gateway IP Address
      • From: "Peter Sichel" <email@hidden>
  • Prev by Date: Preferred Airport wireless networks
  • Next by Date: Re: Getting your Gateway IP Address
  • Previous by thread: Preferred Airport wireless networks
  • Next by thread: Re: Getting your Gateway IP Address
  • Index(es):
    • Date
    • Thread