Google Answers Logo
View Question
 
Q: [C Programming] Getting IP address of default interface under BSD ( No Answer,   1 Comment )
Question  
Subject: [C Programming] Getting IP address of default interface under BSD
Category: Computers > Programming
Asked by: triplef-ga
List Price: $4.00
Posted: 25 Oct 2002 16:28 PDT
Expires: 01 Nov 2002 04:10 PST
Question ID: 89931
I need the IP address of the network interface which by default is
used for outgoing network traffic. The code should work under Mac OS X
(which is mostly FreeBSD under the hood). Something like
char *defaultip() { ... }
would be very nice.
If it's easier to get the name of the interface (i.e. "ppp0"), that
would be fine.

Thanks!
Answer  
There is no answer at this time.

Comments  
Subject: Re: [C Programming] Getting IP address of default interface under BSD
From: enderwiggin-ga on 26 Oct 2002 11:43 PDT
 
i'd suggest looking at the source for the route command, and the
source for the -rn argument of netstat

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy