Let's say I'm running a program called IpAddresses.c I want that program to get all IP addresses this device has according to each interface. Just like ifconfig. How can I do that.
I don't know much about ioctl but I read it might help me
2
1
|
Let's say I'm running a program called IpAddresses.c I want that program to get all IP addresses this device has according to each interface. Just like ifconfig. How can I do that. I don't know much about ioctl but I read it might help me | ||||||
|
3
|
Just use getifaddrs(). Here's an example:
And here's the output I get on my machine:
| ||||
|
0
|
Check out the (Windows specific) IP Helper API - fortunately you don't need | ||
0
|
You could try something like that:
| ||||
|
1
|
See this other SO question. In summary, you can use:
| ||
1
|
Here's some Linux sample code that might help you out.
| ||
2
1
|
Let's say I'm running a program called IpAddresses.c I want that program to get all IP addresses this device has according to each interface. Just like ifconfig. How can I do that. I don't know much about ioctl but I read it might help me | ||||||
|
3
|
Just use getifaddrs(). Here's an example:
And here's the output I get on my machine:
| ||||
|
0
|
Check out the (Windows specific) IP Helper API - fortunately you don't need | ||
0
|
You could try something like that:
| ||||
|
1
|
See this other SO question. In summary, you can use:
| ||
1
|
Here's some Linux sample code that might help you out.
| ||
2
1
|
Let's say I'm running a program called IpAddresses.c I want that program to get all IP addresses this device has according to each interface. Just like ifconfig. How can I do that. I don't know much about ioctl but I read it might help me | ||||||
|
3
|
Just use getifaddrs(). Here's an example:
And here's the output I get on my machine:
| ||||
|
0
|
Check out the (Windows specific) IP Helper API - fortunately you don't need | ||
0
|
You could try something like that:
| ||||
|
1
|
See this other SO question. In summary, you can use:
| ||
1
|
Here's some Linux sample code that might help you out.
| ||
2
1
|
Let's say I'm running a program called IpAddresses.c I want that program to get all IP addresses this device has according to each interface. Just like ifconfig. How can I do that. I don't know much about ioctl but I read it might help me | ||||||
|
3
|
Just use getifaddrs(). Here's an example:
And here's the output I get on my machine:
| ||||
|
0
|
Check out the (Windows specific) IP Helper API - fortunately you don't need | ||
0
|
You could try something like that:
| ||||
|
1
|
See this other SO question. In summary, you can use:
| ||
1
|
Here's some Linux sample code that might help you out.
| ||
2
1
|
Let's say I'm running a program called IpAddresses.c I want that program to get all IP addresses this device has according to each interface. Just like ifconfig. How can I do that. I don't know much about ioctl but I read it might help me | ||||||
|
3
|
Just use getifaddrs(). Here's an example:
And here's the output I get on my machine:
| ||||
|
0
|
Check out the (Windows specific) IP Helper API - fortunately you don't need | ||
0
|
You could try something like that:
| ||||
|
1
|
See this other SO question. In summary, you can use:
| ||
1
|
Here's some Linux sample code that might help you out.
| ||
2
1
|
Let's say I'm running a program called IpAddresses.c I want that program to get all IP addresses this device has according to each interface. Just like ifconfig. How can I do that. I don't know much about ioctl but I read it might help me | ||||||
|
3
|
Just use getifaddrs(). Here's an example:
And here's the output I get on my machine:
| ||||
|
0
|
Check out the (Windows specific) IP Helper API - fortunately you don't need | ||
0
|
You could try something like that:
| ||||
|
1
|
See this other SO question. In summary, you can use:
| ||
1
|
Here's some Linux sample code that might help you out.
| ||