473,507 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting local IP address

1 New Member
Hi,

I'm trying to figure how I can programatically get the the IP addresses of all interfaces. That is, I'm in a Linux machine, and I want a C program to find out the IP adderess that the machine has (like I can get with /sbin/ifconfig). One way I'm aware of, is to parse /proc/net/if_inet6, but this seems to be connected to IPv6, I want to support also IPv4. What other ways exists to find this info ?

thanks in advance,
Megatron
Jan 19 '08 #1
1 3979
gpraghuram
1,275 Recognized Expert Top Contributor
Hi,

I'm trying to figure how I can programatically get the the IP addresses of all interfaces. That is, I'm in a Linux machine, and I want a C program to find out the IP adderess that the machine has (like I can get with /sbin/ifconfig). One way I'm aware of, is to parse /proc/net/if_inet6, but this seems to be connected to IPv6, I want to support also IPv4. What other ways exists to find this info ?

thanks in advance,
Megatron

Trty to do more research on gethostinfo and gethostbyname....and similar functions.
One of the functions will help u to achieve what u want

Raghuram
Jan 23 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
16251
by: Snuffy2 | last post by:
I'm looking to try to get a users MAC and/or NetBIOS name when they visit my website. It somehow can be done, I'm not sure with PHP, but it can be done. Does anyone have any idea how? As an...
14
4427
by: Ankit Aneja | last post by:
The code of classes given below is for server to which clients connect i want to get ip address of client which has connected pls help how can i get //listen class public class listen {
3
15717
by: Dan | last post by:
Hi Does anyone know how to get the Mac address of a remote PC, using C#? I believe it's possible by deconstructing the packet received from a ping but I don't know how to do it. TIA Dan
0
1156
kaleeswaran
by: kaleeswaran | last post by:
hi!!! i was getting ip address of my local machine in my network using jsp. can i get all of my local machine address which is connected in the network...? if so give me some idea about...
5
13166
by: Michael Howes | last post by:
I'm writing a utility to manage a machines *local* accounts in c# I am getting all the users in a specific Group just fine but when I want to get some of the information on each user from their...
0
7111
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7031
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7485
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1542
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.