get mac address via c++ program - ifreq (hwaddr) and ioctl
Posted: Tue Dec 24, 2013 6:28 am
I am working on a sample c++ program to get mac address for a v1.13 system. The same program worked on other *nix OSes. My question was - what I am am missing here to be able to port same functionality to z/os env. The compilation(xlC) issue I am facing is w.r.t (1) missing member ifr_hwaddr for structure ifreq (present on other *nix platforms) in header under /usr/include . (2) Also, I am unable to find SIOCGIFHWADDR in ioctl header (present on other *nix platforms) under /usr/include for which I am getting compilation error.
The sample program basically loops through available interfaces and uses SIOCGIFHWADDR to be able to get mac address - ignoring any loopback address while iterating.
This leads me to believe that there is different route to obtain mac address via c++ program for z/os. Can somebody please point to any z/os specific macros or markers that I am missing here - or point me to a z/os compatible route - via c++ calls. Thanks...
The sample program basically loops through available interfaces and uses SIOCGIFHWADDR to be able to get mac address - ignoring any loopback address while iterating.
This leads me to believe that there is different route to obtain mac address via c++ program for z/os. Can somebody please point to any z/os specific macros or markers that I am missing here - or point me to a z/os compatible route - via c++ calls. Thanks...