• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Detecting ethernet cable plugged in
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting ethernet cable plugged in


  • Subject: Re: Detecting ethernet cable plugged in
  • From: Josh Graessley <email@hidden>
  • Date: Tue, 02 Oct 2007 08:31:43 -0700


I think you can use ioctls to get the interface media information. Look at the output from ifconfig. There is a media entry:
media: autoselect (1000baseT <full-duplex,flow-control>) status: active


If you see status: active, the link is up. You can look through the ifconfig sources to see how ifconfig gets this information.

System Configuration will publish the link state regardless of IP settings. There is a system configuration agent that monitors kernel events and publishes state about things like the link status of interfaces to the dynamic store.

You may see no active link status if there are no services using the interface. In this case, the interface may be powered down to save power. When the interface is powered down, the link is down whether or not the cable is connected.

-josh

On Oct 2, 2007, at 2:29 AM, Mark Thomas wrote:

Hi All,
I presently using the System Configuration Dynamic store Ethernet device
link status, to detect if users have plugged in the Ethernet cables and
while this works, there is a slight problem as this status is linked to the
tcp/ip stack being setup correctly.


Does anybody know of another way to detect whether that cable is plugged
in ?, which wouldn't have a dependency on the network stack ?


Thanks
Mark.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Detecting ethernet cable plugged in
      • From: Mark Thomas <email@hidden>
    • Keeping unconfigured Ethernet powered on [was Re: Detecting ethernet cable plugged in]
      • From: "Peter Sichel" <email@hidden>
References: 
 >Detecting ethernet cable plugged in (From: Mark Thomas <email@hidden>)

  • Prev by Date: Detecting ethernet cable plugged in
  • Next by Date: Keeping unconfigured Ethernet powered on [was Re: Detecting ethernet cable plugged in]
  • Previous by thread: Detecting ethernet cable plugged in
  • Next by thread: Keeping unconfigured Ethernet powered on [was Re: Detecting ethernet cable plugged in]
  • Index(es):
    • Date
    • Thread