From: snodx@hotmail.com
To: gcc-help@gcc.gnu.org
Subject: Re: IP ADDRESS OF MACHINE
Date: Thu, 28 Feb 2002 03:25:00 -0000 [thread overview]
Message-ID: <-1315982412.1014892412831.JavaMail.root@naini.zyberway.com> (raw)
OK After reading Mr Rupert Wood's post I decided that enough is enough
and decided to test whether a NetWork Card is installed on my system or
not.
So I connected an Internet Router to my Linux computer. If there is a
NetWork Card installed on my computer then I should be able to access
the Internet.
And voila, there is a NetWork Card installed on my system.
I had already set the Computer's TCP/IP Address to 192.168.0.2. The
Internet router's address was set to 151.137.54.204
So by accessing the internet I was able to confirm that there is indeed a
NetWork Card on my computer.
But I decided to explore a bit further. I came across a command /bin/netstat
I ran this command /bin/netstat --route
This was the output that I got:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.2 * 255.255.255.255 UH 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 151.137.54.204 0.0.0.0 UG 0 0 0 eth0
I am now slowly able to understand some of the Jargon that Mr Rupert wood was using.
He talked about interfaces and I understand now that there is a EtherNet Interface
eth0 installed on my system.
So now this is the final-most-precise-version of my question:
I have a EtherNet Interface eth0 installed on my system. The TCP/IP Address of
my computer has been set to 192.168.0.2.
I wish to develop a C/C++ program that can retrieve the local computer's TCP/IP Address.
I DONT WANT THE PROGRAM TO SEARCH IN THE /etc/hosts FILE WHICH IS I BELIEVE USED FOR
A DIFFERENT PURPOSE.
In short I am looking for a program like /bin/netstat --route only this program is to be
much much much simpler. It just needs to retrieve the TCP/IP Address 192.168.0.2 and display
it.
Thanx for everybody's inputs here.
Awaiting a final reply.
SNODX
next reply other threads:[~2002-02-28 10:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-28 3:25 snodx [this message]
2002-02-28 3:55 ` Edmund Green
[not found] <616BE6A276E3714788D2AC35C40CD18D53345D@whale.softwire.co.uk>
2002-03-05 1:18 ` Rupert Wood
[not found] <616BE6A276E3714788D2AC35C40CD18D47C245@whale.softwire.co.uk>
2002-02-28 5:39 ` Rupert Wood
-- strict thread matches above, loose matches on Subject: below --
2002-02-28 4:04 snodx
2002-02-28 4:30 ` Michal Lipták
2002-02-28 3:56 snodx
[not found] <616BE6A276E3714788D2AC35C40CD18D47C203@whale.softwire.co.uk>
2002-02-28 2:43 ` Rupert Wood
2002-02-28 1:38 snodx
2002-02-27 9:17 snodx
2002-02-27 19:32 ` Andrea 'Fyre Wyzard' Bocci
2002-02-28 6:03 ` Nelson Guedes Paulo Junior
2002-02-28 6:49 ` John Love-Jensen
2002-02-28 10:15 ` Nelson Guedes Paulo Junior
2002-03-01 6:34 ` John Love-Jensen
2002-03-05 1:07 ` Bharathi S
2002-02-27 5:13 snodx
2002-02-26 18:29 Robert Lopez
2002-02-26 4:18 snodx
2002-02-26 5:46 ` Stephano Mariani
2002-02-28 14:02 ` Florian Weimer
2002-02-26 0:35 snodx
2002-02-26 1:29 ` Frank Schafer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=-1315982412.1014892412831.JavaMail.root@naini.zyberway.com \
--to=snodx@hotmail.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).