This is a discussion on ethernet cable state recognition within the Linux Networking forums, part of the Linux Forums category; Hi to everyone. I need to write a little application to recognize if the ethernet cable is up or down. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi to everyone.
I need to write a little application to recognize if the ethernet cable is up or down. Not ethernet interface but really ethernet cable. Someone can tell me where I will start? I try to see some files in /proc/ directory but everithing "speak" about interface state. I also tryed to start to write a simple C program. In this program I read the infos in the ifreq structure like ifr_flags but I didn't find the infos that I want. I want to say that my kernel doesn's recognize cable state when I put in/out it. I must insert something in my kernel configuration? I hope in some help... Claudio Melis |
|
|||
|
Claudio Melis wrote:
> Hi to everyone. > I need to write a little application to recognize if the ethernet > cable is up or down. Not ethernet interface but really ethernet cable. > Someone can tell me where I will start? I try to see some files in > /proc/ directory but everithing "speak" about interface state. > I also tryed to start to write a simple C program. In this program I > read the infos in the ifreq structure like ifr_flags but I didn't find > the infos that I want. > I want to say that my kernel doesn's recognize cable state when I put > in/out it. > I must insert something in my kernel configuration? Have a look at the source code of 'mii-tool' or just call it from shell. It's about - cable connected or not - Half- or FullDuplex - 10 or 100 MBit/sec - ... Toni |
|
|||
|
On Thu, 29 Apr 2004 07:57:25 -0700, Claudio Melis wrote:
> I need to write a little application to recognize if the ethernet > cable is up or down. Not ethernet interface but really ethernet cable. > Someone can tell me where I will start? I try to see some files in http://www.scyld.com/ - it might already be written. -- /dev/rob0 - preferred_email=i$((28*28+28))@softhome.net or put "not-spam" or "/dev/rob0" in Subject header to reply |
|
|||
|
Claudio Melis wrote:
> Hi to everyone. > I need to write a little application to recognize if the ethernet > cable is up or down. Not ethernet interface but really ethernet cable. > Someone can tell me where I will start? I try to see some files in > /proc/ directory but everithing "speak" about interface state. > I also tryed to start to write a simple C program. In this program I > read the infos in the ifreq structure like ifr_flags but I didn't find > the infos that I want. > I want to say that my kernel doesn's recognize cable state when I put > in/out it. > I must insert something in my kernel configuration? > > I hope in some help... > > Claudio Melis Have a look at ifplugd: <http://www.stud.uni-hamburg.de/users/lennart/projects/ifplugd/>. The interfaces with 100 Mbits/s capability have a standard connection to the physical level, called MII (Media Independent Interface). With 10 Mbits/s only, it's dependent whether the driver is capable and willing to give the information. Tauno Voipio tauno voipio @ iki fi |
|
|||
|
"/dev/rob0" <rob0@gmx.co.uk> wrote in message news:pan.2004.04.29.20.12.18.421639@gmx.co.uk... > On Thu, 29 Apr 2004 07:57:25 -0700, Claudio Melis wrote: > > I need to write a little application to recognize if the ethernet > > cable is up or down. Not ethernet interface but really ethernet cable. > > Someone can tell me where I will start? I try to see some files in > > http://www.scyld.com/ - it might already be written. > -- > /dev/rob0 - preferred_email=i$((28*28+28))@softhome.net > or put "not-spam" or "/dev/rob0" in Subject header to reply > Hi, If you want the physical cable status you have a problem 'cos this will be hardware specific. Are you sure this is what you need? Or do you want to know if the device is sending/receiving IP packets? |