Hi,
Suppose I have a linux network device driver based on a character
device. It is possible to use Socket I/O Control in order to
configure (at layer 3, i.e. ip_addr ...) and bring up the respective
interface ? Or is my approach totally wrong ?
Thanks a lot
-istvan
ps: I've tried to run the following code but it does not work well:
sockfd=socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
if (sockfd < 0) {
printf("[sock_op] Unable to open socket.\n");
} else {
printf("[sock_op] Completed open socket operation.\n");
}
strcpy(ifr.ifr_name, ifname); /* or memcpy */
opRez=ioctl(sockfd, SIOCGIFHWADDR, &ifr);
if (opRez == -1) {
printf("*ioctl* Unable to complete SIOCGIFHWADDR\n");
} else {
printf("*ioctl* Completed SIOCGIFHWADDR\n");
}
_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
Please visit the above address for information on this list.