Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-21-2004, 11:41 PM
|
#1
|
LQ Newbie
Registered: Jun 2004
Posts: 24
Rep:
|
network device file
Anybody knows where can we find the network device file like eth0,eth1,... ? I had a look at /dev but it seems that they are not there.
|
|
|
06-22-2004, 12:29 AM
|
#2
|
Senior Member
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Rep:
|
It's not a file. To see which interfaces are currently up type /sbin/ifconfig.
|
|
|
06-22-2004, 02:48 AM
|
#3
|
LQ Newbie
Registered: Jun 2004
Posts: 24
Original Poster
Rep:
|
let's say I want to do ioctl on eth1. What file I should open?
|
|
|
06-22-2004, 08:45 AM
|
#4
|
Senior Member
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Rep:
|
This would probably have been better asked in the programming forum. Or google.
|
|
|
06-23-2004, 12:03 AM
|
#5
|
LQ Newbie
Registered: Jun 2004
Posts: 24
Original Poster
Rep:
|
Can somebody help me by moving this thread to programming forum?
|
|
|
06-23-2004, 12:19 AM
|
#6
|
Senior Member
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Rep:
|
You may be able to click on the "report this thread to a moderator" link. Or start a new one.
|
|
|
06-24-2004, 02:47 PM
|
#7
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
|
|
|
06-24-2004, 03:00 PM
|
#8
|
Senior Member
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246
Rep:
|
You probably don't need to open a file for a ioctl() call. Which call are you trying to do?
|
|
|
06-24-2004, 04:57 PM
|
#9
|
Member
Registered: Mar 2003
Posts: 804
Rep:
|
network device ioctl's are abstracted thru the socket layer. you need to open up a socket, and fill in an ifreq structure for the interface u want to manipulate. for the ifreq structure, look in /usr/include/net/if.h . you fill in the ifrname member w/ the interface name, ie "eth0", and then depending on the ioctl u are using use the appropriate member of the union in the structure. have a loook at :
http://www.kohala.com/start/unpv12e.html
source tarball. the ioctl directory
Last edited by infamous41md; 06-24-2004 at 05:02 PM.
|
|
|
All times are GMT -5. The time now is 09:05 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|