regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc2(at)uthyres.com Examples of addresses which go to spammers:
fp=popen("/usr/bin/cat /proc/cpuinfo /proc/pci /proc/meminfo", "r");
regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc2(at)uthyres.com Examples of addresses which go to spammers:
1. getting the network interface information and default gateway information ??
hi,
iam trying to get the network interface information and the default
information.After doing some googling i found out the relevant
structures and the ioctl calls for getting the interfaces information(
i suppose i have all that right).
struct ifconf(and using the ioctl SIOCGIFCONF).
there is another structure
struct ifreq
but i dont think i need that one.
Now how do i do to get the interface address(aliases also).i have
written a small program, but dont know where iam going wrong.the code
is
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <net/if.h>
#include <netinet/in.h>
int
main(int argc, char* argv[])
{
struct ifconf ifc;
struct ifreq *ifr;
struct sockaddr_in *sin;
char buf[128];
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
perror("socket");
return 1;
}
ifc.ifc_buf = buf;
ifc.ifc_len = sizeof(buf);
if (ioctl(s, SIOCGIFCONF, &ifc) < 0) {
perror("ioctl SIOCGIFCONF");
return 1;
}
ifc.ifc_len /= sizeof(struct ifreq);
for (i=0; i<ifc.ifc_len; i++) {
ifr = (struct ifreq *) &ifc.ifc_req[i];
sin = (struct sockaddr_in *) &ifr->ifr_addr;
printf("%s \n",sin->sin_addr);
}
}
return 0;
And how can i get the default gateway address within my program.
any help will be highly appreciated.
thanks
rohit
2. vmware error
3. looking for information on how to query a pc for system hardware information
6. Need information about system-users and system-groups
7. Xarchie problems (compiling)!!!
8. getting system date/time from another system
9. Need help getting Solaris information for a Linux sysadm
10. Getting eth0 device information in C or perl.
11. Getting status information from network interface
12. Help - Getting prtconf information