Re: Talk to eth0 via ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

U can do ioctl by using code snippets of the following kind

-------------------------------------------------------
int sockfd;
struct ifreq ifreq_ioctl;

sockfd=socket(AF_INET, SOCK_DGRAM, 0);
strcpy(ifreq_ioctl.ifr_name,  "eth0");
ioctl(sockfd, SIOCGIFADDR, &ifreq_ioctl);
------------------------------------------------------


Hope this helps
Regards
KK






On Thursday 09 January 2003 03:23 pm, D Qi wrote:
> Hi,
>
> I am new to the network programing on Linux/Unix. How can I open or talk
> to a specific network driver/interface. For example, how can I make use
> of the ioctl of eth0?
>
> Thanks,
>
> David
>
> -
> : send the line "unsubscribe linux-net" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux