LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 06-21-2004, 11:41 PM   #1
legolas_t
LQ Newbie
 
Registered: Jun 2004
Posts: 24

Rep: Reputation: 15
Question 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.
 
Old 06-22-2004, 12:29 AM   #2
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
It's not a file. To see which interfaces are currently up type /sbin/ifconfig.
 
Old 06-22-2004, 02:48 AM   #3
legolas_t
LQ Newbie
 
Registered: Jun 2004
Posts: 24

Original Poster
Rep: Reputation: 15
let's say I want to do ioctl on eth1. What file I should open?
 
Old 06-22-2004, 08:45 AM   #4
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
This would probably have been better asked in the programming forum. Or google.
 
Old 06-23-2004, 12:03 AM   #5
legolas_t
LQ Newbie
 
Registered: Jun 2004
Posts: 24

Original Poster
Rep: Reputation: 15
Can somebody help me by moving this thread to programming forum?
 
Old 06-23-2004, 12:19 AM   #6
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
You may be able to click on the "report this thread to a moderator" link. Or start a new one.
 
Old 06-24-2004, 02:47 PM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 06-24-2004, 03:00 PM   #8
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
You probably don't need to open a file for a ioctl() call. Which call are you trying to do?
 
Old 06-24-2004, 04:57 PM   #9
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
3c905C network card in docking station. Cannot activate network device eth0. pathelms Linux - Networking 4 04-12-2006 02:55 PM
Network card not working? Cannot activate network device eth0 lifeonitsown Linux - Networking 1 11-17-2005 06:30 AM
Assign one USB-storage device to one device file Misel Linux - Hardware 1 08-28-2004 03:52 AM
no network device?!?! sjefke37 Linux - Newbie 8 03-28-2004 12:58 PM
using old pc as device on network hiplainsdrifter Linux - Hardware 3 04-15-2003 07:55 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration