Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#162 nodeId returns the MAC address of the first active NIC

open
nobody
Foundation (22)
5
2012-09-14
2012-08-14
Anonymous
No

On a laptop, depending on if I'm using the wired network adapter or wireless network adapter, I get varying results with nodeId.
Could the be extended to return a list of MAC addresses, even for non-active NICs?

Discussion

  • Actually, with the new version of NetworkInterface that Alex and I worked on last week, this should be really easy to do.

    You can do:

        NetworkInterface::Map m = NetworkInterface::map(false, false);
        for (NetworkInterface::Map::const_iterator it = m.begin(); it != m.end(); ++it)
        {
                NetworkInterface::MACAddress mac(it->second.macAddress());
                ... do something here with the mac address
        }
    
     
  • Alex Fabijanic
    Alex Fabijanic
    2012-08-15

    The problem with the proposed solution, though, is that Foundation would have to be dependent on Net.

    I'm moving this item to feature requests.

     
  • Alex Fabijanic
    Alex Fabijanic
    2012-08-16

    patch from Philip Prindeville

     
    Attachments