: xpppcon dev: Fetching my IP Address with C code?

: xpppcon dev: Fetching my IP Address with C code?

Post by root » Sat, 29 Nov 1997 04:00:00



I'm currently writing a program for Linux/X which displays
various ppp statistics, one problem I've encountered is
fetching the IP address of the host the program is running
on, in /proc/net/rt_cache there is the IP but it is in hex
and in host byte order.

Is there a simpler way to fetch my IP address?
I'm not very good with string handling, and I'm new to
network programming, I've mostly done a lot of X stuff,
I'd appreciate any help, thanks! :)

If anyone would like to test the beta of xpppcon, please let
me know, I'll give you a copy of the source.

Sincerely,
-Taura

 
 
 

1. : Propery way to fetch my IP with C code?

What is the proper way to fetch my IP (0.0.0.0 and 127.0.0.1 are
not acceptable) with C code?

I'm currently working on xpppcon and I'd like it to be checking
for the IP address correctly, much like ifconfig does.

Note I'm using Linux kernel 2.0.30 and I already read ifconfig.c
and many other networking books already, none of them ever
mentioned to do this.

I'd appreciate any help, thanks in advance! :)

Sincerely,
-Taura

2. 100BaseTX NIC recommendations?

3. How to fetch the dynamic IP address?

4. painfully slow logins

5. : Standard way to fetch my IP address for Linux?

6. How to get hostid from HP/UX 710?

7. Problems using Netfilter to NAT secondary IPs (ip addr add IP dev DEV)

8. Splitting logfiles by requests

9. Changing IP address on Solaris 9 with multiple virtual IP addresses

10. WANTED: pingmac <IP ADDR> which returns <MAC ADDRESS of IP ADDRESS>

11. dynamic ip address - how to get to know my ip address?

12. IP Masquerading with IP Address and Mac Address Restrictions

13. need to mod IP/TCP / dev code