Advertisement

01.11.2003 at 12:01PM PST, ID: 20452808
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

how to get the MAC address of the network card

Tags: mac, address, get
Coding  for a Macromedia Director  app,
  i need to determine via a small C++ Xtra  the  famous  MAC network address,and also all data  i can recover from ATA disks and SCSI disks...

Some useful functions to do this are contained in  system.h and winio.h under Vc++ on Win

But i need to develope this for MacOs X  too..
And as a newbie.. i HAVE to use codewarrior 8.3 and os10.2
(the macromedia SDK is provided of a CodeWarrior template to communicate with Director)

Will be apprecied  all about this, the Classes name,the specific functions, the header i have to include...but especially some code sample  too from remote urls...i feels lost

Thanks!
Nc
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: nightcoder
Solution Provided By: orangehead911
Participating Experts: 3
Solution Grade: A
Views: 15
Translate:
Loading Advertisement...
01.14.2003 at 04:52PM PST, ID: 7728992

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.14.2003 at 05:13PM PST, ID: 7729121

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.23.2003 at 08:34PM PST, ID: 7797626

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.25.2003 at 05:40AM PST, ID: 7806835

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.29.2003 at 07:14AM PST, ID: 10010891

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • Automotive
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Displays / Monitors
  • Handhelds / PDAs
  • Components
  • Peripherals
  • Laptops/Notebooks
  • Servers
  • Misc
  • Apple
  • Embedded Hardware
  • Networking Hardware
  • Storage
  • Desktops
  • New Users
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMware
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Virtualization
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • Web Computing
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Consulting
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMware
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Automation
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Web Services
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Web Computing
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Lounge
  • Business Travel
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
  • Automotive
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
01.14.2003 at 04:52PM PST, ID: 7728992
The MAC address is available through the System Profiler utility.
 
01.14.2003 at 05:13PM PST, ID: 7729121
:)
would seems obvious i have to organize resulting data into my c++ code
actually i think my c++ Xtra really cannot  deal  with the system profiler app.
thanks anyway
 
01.23.2003 at 08:34PM PST, ID: 7797626
You should familiarise yourself with the Terminal application on Mac OS X and the neat utility 'man'. I got the following result when I did a search in the man pages useing 'man':

[myhost:~] orangehead911% man ethers
ETHERS(3)               System Library Functions Manual              ETHERS(3)

NAME
     ethers, ether_line, ether_aton, ether_ntoa, ether_ntohost, ether_hostton
     - Ethernet address conversion and lookup routines

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <sys/types.h>
     #include <sys/socket.h>
     #include <net/ethernet.h>

     int
     ether_line(const char *l, struct ether_addr *e, char *hostname);

     struct ether_addr *
     ether_aton(const char *a);

     char *
     ether_ntoa(const struct ether_addr *n);

     int
     ether_ntohost(char *hostname, const struct ether_addr *e);

     int
     ether_hostton(const char *hostname, struct ether_addr *e);

DESCRIPTION
     These functions operate on ethernet addresses using an ether_addr struc-
     ture, which is defined in the header file <netinet/if_ether.h>:

           /*
            * The number of bytes in an ethernet (MAC) address.
            */
           #define ETHER_ADDR_LEN          6
           /*
            * Structure of a 48-bit Ethernet address.
            */
           struct  ether_addr {
                   u_char octet[ETHER_ADDR_LEN];
           };

     The function ether_line() scans l, an ASCII string in ethers(5) format
     and sets e to the ethernet address specified in the string and h to the
     hostname.  This function is used to parse lines from /etc/ethers into
     their component parts.

     The ether_aton() function converts an ASCII representation of an ethernet
     address into an ether_addr structure.  Likewise, ether_ntoa() converts an
     ethernet address specified as an ether_addr structure into an ASCII
     string.

     The ether_ntohost() and ether_hostton() functions map ethernet addresses
     to their corresponding hostnames as specified in the /etc/ethers
     database.  ether_ntohost() converts from ethernet address to hostname,
     and ether_hostton() converts from hostname to ethernet address.

RETURN VALUES
     ether_line() returns zero on success and non-zero if it was unable to
     parse any part of the supplied line l.  It returns the extracted ethernet
     address in the supplied ether_addr structure e and the hostname in the
     supplied string h.

     On success, ether_ntoa() returns a pointer to a string containing an
     ASCII representation of an ethernet address.  If it is unable to convert
     the supplied ether_addr structure, it returns a NULL pointer.  Likewise,
     ether_aton() returns a pointer to an ether_addr structure on success and
     a NULL pointer on failure.

     The ether_ntohost() and ether_hostton() functions both return zero on
     success or non-zero if they were unable to find a match in the
     /etc/ethers database.

NOTES
     The user must insure that the hostname strings passed to the
     ether_line(), ether_ntohost() and ether_hostton() functions are large
     enough to contain the returned hostnames.

NIS INTERACTION
     If the /etc/ethers contains a line with a single + in it, the
     ether_ntohost() and ether_hostton() functions will attempt to consult the
     NIS ethers.byname and ethers.byaddr maps in addition to the data in the
     /etc/ethers file.

SEE ALSO
     yp(4), ethers(5)

BUGS
     The ether_aton() and ether_ntoa() functions returns values that are
     stored in static memory areas which may be overwritten the next time they
     are called.

HISTORY
     This particular implementation of the ethers library functions were writ-
     ten for and first appeared in FreeBSD 2.1.

BSD                             April 12, 1995                             BSD
Accepted Solution
 
01.25.2003 at 05:40AM PST, ID: 7806835
Really a great !  thanks for tips on man...
i'm a newbie on mac os x .....
sometime a silly thing maybe a big rock
 
12.29.2003 at 07:14AM PST, ID: 10010891
I have written an Xtra that does exactly this. Here is the piece of code from mine to do it. Adapted from code available on Apples developer web site. So, it's only fair I pass it on.

Cheers.

#include <string.h>
#include <stdlib.h>

#if TARGET_API_MAC_CARBON
      #include <Carbon.h>
#else
      #include <NameRegistry.h>
#endif

#if TARGET_API_MAC_CARBON
OSStatus       GetPCIBuiltInEnetAddr(UInt8 *enetaddr)
{
      OSStatus                  err = noErr;
      InetInterfaceInfo      myInetInterfaceInfo;
      int                              i;
      
      OTInetGetInterfaceInfo(&myInetInterfaceInfo,kDefaultInetInterface);
      
      for(i=0;i<myInetInterfaceInfo.fHWAddrLen;i++)
        enetaddr[i] = myInetInterfaceInfo.fHWAddr[i];
      
      return noErr;
}
#else
OSStatus       GetPCIBuiltInEnetAddr(UInt8 *enetaddr)
{
      OSStatus                        err = noErr;
    RegEntryIter            cookie;
    RegEntryID              theFoundEntry;
    unsigned char                enetAddrStr[32] = "\plocal-mac-address";
    RegCStrEntryNamePtr     enetAddrCStr = p2cstr( enetAddrStr );
    RegEntryIterationOp     iterOp;
    UInt8                              enetAddr[6];
    Boolean                 done = false;
    RegPropertyValueSize      theSize;
      
    err = RegistryEntryIDInit( &theFoundEntry );
      if (err != noErr)
      {
            return err;
      }

    err = RegistryEntryIterateCreate( &cookie );
      if (err != noErr)
      {
            return err;
      }

    iterOp = kRegIterDescendants;

    err = RegistryEntrySearch( &cookie, iterOp, &theFoundEntry, &done, enetAddrCStr, nil, 0);
   
    if (err == noErr)
    {
          theSize = sizeof(enetAddr);;
          err = RegistryPropertyGet(&theFoundEntry, enetAddrCStr, &enetAddr, &theSize );
          if (err == noErr)
                BlockMove(enetAddr, enetaddr, sizeof(enetAddr));
      }

    RegistryEntryIterateDispose( &cookie );

      return noErr;
}
#endif

MoaError GetENetAddrScript_IMoaMmXScript::XX_GetStringAddress(PMoaDrCallInfo callPtr)
{
      /* variable declarations */
      MoaError      err = kMoaErr_NoErr;
      OSStatus      osErr;
      UInt8            enetaddr[6];
      
      MoaChar            buf[256] = "";
      MoaLong            i = 0;

      osErr = GetPCIBuiltInEnetAddr((UInt8*)enetaddr);
      if (osErr == noErr)
      {
            sprintf(buf, "%02X %02X %02X %02X %02X %02X", (int)enetaddr[0], (int)enetaddr[1], (int)enetaddr[2], (int)enetaddr[3], (int)enetaddr[4], (int)enetaddr[5]);
      }
      else
      {
            goto exit_gracefully;
      }

      pObj->pValueInterface->StringToValue(buf, &callPtr->resultValue);

exit_gracefully:
      return(err);
}

 
 
20080236-EE-VQP-29