[Mac OS X] How to detect media status of a network interface?

Hi
I'm looking for a way to see the status of a network interface, both wire and wireless, in Mac OS X. The older OS X version to support it the better.
I'm not any experienced Mac developer so forgive me for not knowing my way around in development for this platform.
In plain English I want to detect in programming (language is C) if the cable is plugged in or not. In wireless environment it means if the computer is associated to a wireless network.
It should not depend on if the computer has an IP-address, just the media status.
It would be good to see how many interfaces that are connected but just getting the answer to question if there is any (real, not loopback) interface connected would be good enough.
When searching on internet I found people using 'grep' on the output from 'ifconfig'. As I'm not doing a shell script I don't like a solution where I would call 'ifconfig' and take the output back into my program.
The most promising part I've found is in Core Foundation, the CFNetDiagnostics. But it seems to operate on a higher level (streams?), which is not what I want.
If any of you are familiar with windows development I found the IsNetworkAlive function in SENS API, http://msdn.microsoft.com/en-us/library/aa377522.aspx
It is something similar to that is what I'm looking for.
The program in question is a Java application but Java is very bad at low level network programming so I have to use native interface to windows and OS X.
Thanks in advance
Christer

Update:
I found SCNetworkConfiguration.h
http://developer.apple.com/documentation/Networking/Reference/SysConfig/SCNetwor kConfiguration/index.html
Seems to fit the description, do anyone agree?
Basically I have to get all the interfaces, then for each one list its active media options and see what I find.

Similar Messages

  • How to access media files on home network?

    Hi there,
    How do I browse my home network files from the N900.
    On a windows computer, I am familiar with network neighbourhood or my network places and it's easy to find files on other computer.
    But with N900 and linux I don't know where to look.
    Anyone have any hints ?
    Thanks
    Fred

    Hi fhumbert
    As primarily Mac user I'm sure others will have better solution for you but you would need to install SSH Server on your N900:http://maemo.org/downloads/product/Maemo5/openssh-server/
    On your Windows PC you would need to install WinSCP or FileZilla client to allow SFTP connection to your N900. You might find this link of use:http://talk.maemo.org/showthread.php?t=41490&page=2
    Happy to have helped forum in a small way with a Support Ratio = 37.0

  • How to view history status of a Network activity of a WBS element

    Hi,
    Which transaction can I use to view history of a Network Activity on a WBS element? I want to know when were changes made on an activity, e.g. when it was REL or TECO etc, and by whom.
    Thanks.
    PS_PS01

    YOu can get the same in all the PS Transaction where you can get the disply of user & system status. The prerequisite as Ahmed Pointed out you must have ticked on change document and atleast ordstatchange and opstatchange ticket ( for the ordertype and Plant  combination )
    If the same is done than you can check as below,
    check in CJ20n > Click on any of activity> click on Blue ( Status Icon )>Extra>Change Document -->All.
    System will disply the status( User  & System ) change history of that activity.
    With Regards
    Nitin P.

  • How should I add a new physical network interface to the system?

    Hello:
    I am about to test my own NIC driver.
    I have used add_drv to add my driver.
    I have assigned an IP address to the sytem in the /etc/hosts file and corresponding network mask in the /etc/netmasks file, too.
    But when I tried to ping this IP address, it reported an error message saying"ICMP Host Unreachable from gateway localhost .....".
    I wonder if the system knows this physical network address.
    Does this have something to do with the /etc/hostname.* file?
    If this is the case, what should I name the "*" part of this file?
    Any advice will be appreciated.
    Steven

    Hello Shridhar:
    Thanks for your kindly reply.
    I just noticed that the system would try to plumb the interface during the booting process but failed with a error saying "ifconfig:plumb:XXXX:Bad file number", where XXXX is the * part of /etc/hostname.*
    Does not mean I have assigned a illegal interface name to this interface?
    It seems that man page doesn't contain any information about error messages.
    I use the form XXX0, where XXX is the name of the NIC driver.
    Any advice will be appreciated.
    Steven
    You should plumb the interface and bring it up with
    the ifconfig command. Do a man on ifconfig for more
    details. What was the add_drv command used ? Based on
    your driver's name, you can setup the hostname.*
    file's name to automatically setup and initialize the
    NIC inetrface everytime the system boots up.
    HTH
    shridhar

  • How to play media to tv from mac

    Hi all, this is my first time (only my third ever) on apple support communities, so please excuse my ignorancel
    I have spent hours online trying to figure out how to veiw media content on my Panasonic Viera 42" hdtv from my imac , with out any real luck.
    I have figured out how to watch Panasonics own content through the Viera connect feature on the tv.
    The thing im having most trouble with is connecting my 27"imac to the tv to play content downloaded from the internet such as avi files, camera movies and the like.
    Someone suggested a free open source set up called xbmc which i have installed but i dont know how to configure it to connect to the tv. Or am i trying to be too adventurous as a first timer and need to concentrate on a simpler option.
    And finally if i do take the latter option, do i need to configure the imac to act as a server and if so how do i do that?
    Thank you in advance to anybody taking the time to read this.

    Hi, thanks for replying.
    Im not exacly sure what year the imac is i cant seem to find it anywhere.
    I bought the machine last year on apples refurbished site. Someone at Apple support suggested once that it maybe a 2010 model. In system profiler there is a thunderbolt tab in the left hand pane but it says there are no drivers  loaded. Does that mean that thunderbolt is on the mac but i must install the drivers? If so, is it all plug and play after that or do i need to configure it all manually? If so coyuld you please point me in the right direction for instructions on how to do it. My tv for instance is saying that it cant find a server. As for vlc player, i use it all the time.Dont know what ide do without it !

  • I have Iphone 5 and mac pro, and i want to transfer pics through idrop. but my iphone not detect the mac pro. How i can turn the idrop on my computer?

    I have Iphone 5 and mac pro, and i want to transfer pics through idrop. but my iphone not detect the mac pro. How i can turn the idrop on my computer?

    The Mac Pro - the desktop computer - does not support Airdrop, if that's what you mean.
    Matt

  • Does anyone how to detect a cherry G84-4100 keyboard on mac os lion?

    does anyone how to detect a cherry G84-4100 keyboard on mac os lion? Mine is not detected and the keyboard is working

    Found a partial solution by connecting another usb device and then connect the keyboard. The problem seems to be whitin the detection of the usb keyboard.

  • How to detect MAC address and IP address

    Hi,
    I'm still student. I have my holiday project which i need to build a program to monitor the usage of instant messenger in a LAN system. I need to know how to detect the MAC address and IP address of a pc(no wireless using). Besides, i also need to find out the IM port. Please help me to improve my skill in java. (if ladies and gentlemen have any book. Please recomment to me).
    Thanks
    From,
    lwfoon

    http://onesearch.sun.com/search/onesearch/index.jsp?qt=get+mac+address&subCat=siteforumid%3Ajava31&site=dev&dftab=siteforumid%3Ajava31&chooseCat=javaall&col=developer-forums
    http://onesearch.sun.com/search/onesearch/index.jsp?qt=get+IP+address&subCat=siteforumid%3Ajava31&site=dev&dftab=siteforumid%3Ajava31&chooseCat=javaall&col=developer-forums
    You get the idea.

  • I just bought an airport express and I am in the process of configuring but my mac does not detect any airport devise. internet is working wirelessly and the airport is plugged next to the mac. any clue how can I fix this?

    I just bought an airport express but when trying to configure it my mac is not capable of detecting the devise. The airport is plugged right next to the modem and the wireless internet is running perfectly. does any one experience this before?

    You don't mention what function you want the AirPort Express to accomplish.
    If you are trying to configure it to "join" your existing wireless network, you need to know the exact type of security that your wireless network is using fo you can use that same information to provide the correct settings to the AirPort Express.
    You may be getting a message that the settings have been stored successfully, but unfortunately the settings that you have provided to the Express are likely the wrong settings.
    The only way that you really know if the settings that you entered were correct is if you get a green light 20-30 seconds after you click Update.  If you don't get a green light on the Express, the settings that you provided were not the correct settings.
    When you click Update, the Express will "disappear". This is normal. Up until the time that you click update, AirPort Utility is communicating to the Express on a wireless network with a name like Apple Network xxxxxxx. As soon as you click Update, the Express switches (or tries to switch) to another network, so of course it will disappear from the AirPort Utility window.
    As soon as you click Update, close AirPort Utility. There is no reason to keep watching a window when the Express will never appear.

  • Mac Mini Airport Extreme - Cannot detect any wireless networks

    Hello,
    Last week my Mac Mini (Power PC)'s hard disk crashed. So I did a DIY replacement. I managed to re-install all the software, and installed all the latest updates.
    However, for some reason, the Airport Extreme is not detecting any wireless network after the re-install.
    My own wireless network router is a third-party, which has been working well for the last 2 years. My Window PC and laptop still connects to it fine.
    I can see the Airport icon but it doesn't how any detected networks (and there are quite a few in my neighbourhood). I did Apple Hardware Test and it shows the Airport card to be working ok.
    Any help would be wonderful!
    Regards,
    Leng
    Mac Mini G4   Mac OS X (10.4.9)  

    It still may be possible that the antenna wire is not placed properly within the Mini. Here are an excerpt of the DIY instructions for installing the wireless antenna. Hope it helps...
    - Make sure that the antenna cables are firmly seated in the mezzanine board.
    - Pass the antenna cables through the gap at the rear of the internal frame.
    - Carefully lower the internal frame down onto the motherboard. Make sure that the wires are routed to the right of the interconnect board.
    - Snap the AirPort antenna onto the black plastic column next to the rear port panel.
    - Tape the AirPort antenna wire to the edge of the DVD drive.

  • Mac Mini Airport Extreme - Cannot Detect Any Networks

    Hello,
    Last week my Mac Mini (Power PC)'s hard disk crashed. So I did a DIY replacement. I managed to re-install all the software, and installed all the latest updates.
    However, for some reason, the Airport Extreme is not detecting any wireless network after the re-install.
    My own wireless network router is a third-party, which has been working well for the last 2 years. My Window PC and laptop still connects to it fine.
    I can see the Airport icon but it doesn't how any detected networks (and there are quite a few in my neighbourhood). I did Apple Hardware Test and it shows the Airport card to be working ok.
    Any help would be wonderful!
    Regards,
    Leng
    Mac Mini G4   Mac OS X (10.4.8)   Sorry for the cross-post. I posted wrongly in Airport Express previously.

    Hi,
    Thanks for the reply. I saw the thread before I posted and I'm hoping this will be solved soon.
    The main thing that worries me is that in my case, the Mac Mini is not even seeing any networks - zero in an apartment block where there is at least 5 network on the air at any time
    Leng

  • Install Windows 7 on a Mid 2010 Mac mini using USB or SD media?

    Is is possible to install Windows 7 on a Mid 2010 Mac mini using USB or SD media?  I have not figured this out.  Here's what I have observed:
    I can install OS X Lion using USB or SD media. Both are detected in the boot menu, and will boot.
    An SD card with Windows 7 installation files formatted MBR/FAT32 using diskpart appears (with an SD card icon) in the boot menu but when selected as a boot device, the boot fails and the existing OS X instance on the Macintosh HD starts.  A USB stick formatted as described does not appear in th boot menu at all.
    An SD card or a USB stick formatted as described will boot on a Mid 2011 MacBook Air, and can be used to install Windows 7.
    Is this due to EFI differences between a Mid 2010 Mac mini and a Mid 2011 MacBook Air?
    Thanks.

    The Mac Mini Mid 2010 has a DVD player built in, you can startup and install from a Windows 7 DVD. The Mac Mini Mid 2011 does not have a DVD player built in. I am happy that in new computers I can make use of an USB-stick to install Windows 7. Windows 7 uses MBR and Mac OS X uses EFI and that is why it was not possible on a Mac Mini Mid 2010. I think the EFI on a Mac Mini Mid 2011 is different.
    I should like a firmware update on my Mac Mini Mid 2010 if possible. In that case I could choose between DVD or USB stick if I want to install Windows 7.
    I also have a FireWire CF Card Reader. I think it is not possible to install Windows 7 via FireWire too.
    I do have an external USB HD with 2 partitions: Mac OS X 10.6.8 and Windows 7, but is is not possible to start up Windows 7 from the external HD.  It is possible to start up Mac OS X 10.6.8 from the external HD on a Mac Mini Mid 2010.

  • UML290 & Mac: A new network interface has been detected

    I have a MacBook Pro running Snow Leopard, and I just purchased a Pantech UML290 4G modem, live in an area with good 4G coverage, and I get a good 4G signal.  I am running VZAccess Manager version 7.2.5, and in general it connects to the 4G network fine and stays connected.  Every time I connect the modem to my laptop, Mac OS generates a "A new network interface has been detected" pop up with the option to Cancel or go to Network Preferences.  Canceling makes it go away.  
    I also see 4 devices under System Preferences > Network: 
    1. Verizon UM290 (which shows connected, not sure why it's missing the L in UML)
    2. Pantech UML290 USB Modem
    3. Pantech UML290 USB Serial
    4. Pantech UML290 USB CM
    Does anyone know how to get rid of the annoying message every time I connect the modem? Thanks.

    I have the same set up.  Get the same messages almost everytime I start up the UML290.  Not sure why I occasionally don't get it.  Many others on the forum have reported this as well.  For now, we live with it.
    Sandy

  • Detect key status of '*', '#' & '0' of using getKeyStates() method

    Any know the how to get key status if using getKeyStates() method of GameCanvas object in pressing keys "*", '0' & '#' (as I know, the method just can detect key pressing of number 1~9)? If no, is there any method able to do so (similar function of getKeyStates() but not keyPressed()) or how to modify the method able to function it ?

    Hello,
    Sorry for the confusion... let me try to be more clear...
    So, my test campaign for a specific UUT is composed of about a dozen sequences, which can be run independently. But I created another sequence, to work as a "batch", calling all these dozen sequences.
    Pretty much what it does is:
    1) Call first sequence in new execution
    2) Wait for execution to finish
    3) Check results of execution
    4) Add results to report
    5) Wait 10 seconds
    6) Call second sequence in new execution
    7) So on...
    So, for each new execution, I have a dedicated report, which is exaclty what I want. But for my "batch" sequence, I would like to be able to get a report saying which executions passed or failed, so I don't have to open the reports for each execution individually.
    The way I'm doing this (in step 3 above) is with the following expression:
    ( Find( RunState.PreviousStep.ResultStatus, "Passed", 0, True, False ) >= 0 ) ) ? "Passed" : "Failed"
    This way, anything different than "Passed" would give me a "Failed" result for that execution, and that's fine. The problem is that when one of the executions is terminated before it's finished, the PreviousStep.ResultStatus is giving me "Passed".
    I didn't know about the GetStates() method... Looks promissing! I'll give it a try.

  • HT203254 my desktop is not working when i open it all it does is show the color weal and it never gos away on my mac book pro how do i fix it?

    my desktop is not working when i open it all it does is show the color weal and it never gos away on my mac book pro how do i fix it?

    It means, tentatively, that system files are missing or damaged and you will have to reinstall Snow Leopard. See the following:
    Reinstall OS X without erasing the drive
    Do the following:
    1. Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Reinstall Snow Leopard
    If the drive is OK then quit DU and return to the installer.  Proceed with reinstalling OS X.  Note that the Snow Leopard installer will not erase your drive or disturb your files.  After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.
    Download and install the Combo Updater for the version you prefer from support.apple.com/downloads/.

Maybe you are looking for