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...
get mac address via c++ program - ifreq (hwaddr) and ioctl
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: get mac address via c++ program - ifreq (hwaddr) and ioc
googling with zos communication server mac address
will return the links to the IBM REDBOOKS dealing with some of the internals of the communication server TCP/IP component
will return the links to the IBM REDBOOKS dealing with some of the internals of the communication server TCP/IP component
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: get mac address via c++ program - ifreq (hwaddr) and ioc
follow on ...
and start looking at the XL C/C++ manuals starting from
http://publibz.boulder.ibm.com/cgi-bin/ ... s/CBCBS1D0
proceeding to the
z/OS V1R13.0 XL C/C++ Programming Guide
( which unfortunately gives an error)
here the same roadmap for zOS 1.12
http://publibz.boulder.ibm.com/cgi-bin/ ... s/cbcbs1b0
http://publibz.boulder.ibm.com/cgi-bin/ ... 0625173249
and chapter 4.9 which deals with TCP/IP
http://publibz.boulder.ibm.com/cgi-bin/ ... 0625173249
and start looking at the XL C/C++ manuals starting from
http://publibz.boulder.ibm.com/cgi-bin/ ... s/CBCBS1D0
proceeding to the
z/OS V1R13.0 XL C/C++ Programming Guide
( which unfortunately gives an error)
here the same roadmap for zOS 1.12
http://publibz.boulder.ibm.com/cgi-bin/ ... s/cbcbs1b0
http://publibz.boulder.ibm.com/cgi-bin/ ... 0625173249
and chapter 4.9 which deals with TCP/IP
http://publibz.boulder.ibm.com/cgi-bin/ ... 0625173249
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
Re: get mac address via c++ program - ifreq (hwaddr) and ioc
Hi Enrico
Thanks for your reply as well as mentioning various URLs. Yes, ibm doc. has been immensely helpful previously to work with sockets on z/os. I have been relying on comm. server ip sockets api guide and reference under http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.halx001%2Ff1a1d3b1.htm n/w communications section under http://pic.dhe.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.cbcpx01/cbcpg1a0.htm , header file sections under http://pic.dhe.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.bpxbd00/edclb1a0.htm. I will also look at URLs you mentioned.
However, with the limited reading i have done w.r.t this issue in general until now, i haven't come across a clear path specially in 1st url(where i expected to get some info). Some of the non-prg (as in admin guides) mention about osa interface to display mac address - however, i am not sure if that is the right route to take to get mac address via a c++ program and if it is - i am not sure on how do i interface with those commands or if it is possible via c++ program through spawn or exec etc and if that is the preferred route.
Thanks for your reply as well as mentioning various URLs. Yes, ibm doc. has been immensely helpful previously to work with sockets on z/os. I have been relying on comm. server ip sockets api guide and reference under http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.halx001%2Ff1a1d3b1.htm n/w communications section under http://pic.dhe.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.cbcpx01/cbcpg1a0.htm , header file sections under http://pic.dhe.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.bpxbd00/edclb1a0.htm. I will also look at URLs you mentioned.
However, with the limited reading i have done w.r.t this issue in general until now, i haven't come across a clear path specially in 1st url(where i expected to get some info). Some of the non-prg (as in admin guides) mention about osa interface to display mac address - however, i am not sure if that is the right route to take to get mac address via a c++ program and if it is - i am not sure on how do i interface with those commands or if it is possible via c++ program through spawn or exec etc and if that is the preferred route.
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: get mac address via c++ program - ifreq (hwaddr) and ioc
in the *nix world configure.ac after having been processed by the auto tool chain is used to check if a facility is available
if a SIOC****** is not declared in some header then the functionality/facility is not available
AC_CHECK_DECLS( SIOCGIFHWADDR, [hc_cv_have_siocgifhwaddr=yes], [hc_cv_have_siocgifhwaddr=no], [#include <sys/sockio.h>] )
the header where the SIOC**** are defined depends on the *nix flavor ( the above works on APPLE )
on the other side seems that the MAC address of the OSA interface is available only the the HMC or thru some OSA management commands
for some details see here
http://pic.dhe.ibm.com/infocenter/zos/v ... 0/maca.htm
I got there googling for ibm zseries mac address
I guess that You cannot have programmatically what You are looking for
if a SIOC****** is not declared in some header then the functionality/facility is not available
AC_CHECK_DECLS( SIOCGIFHWADDR, [hc_cv_have_siocgifhwaddr=yes], [hc_cv_have_siocgifhwaddr=no], [#include <sys/sockio.h>] )
the header where the SIOC**** are defined depends on the *nix flavor ( the above works on APPLE )
on the other side seems that the MAC address of the OSA interface is available only the the HMC or thru some OSA management commands
for some details see here
http://pic.dhe.ibm.com/infocenter/zos/v ... 0/maca.htm
I got there googling for ibm zseries mac address
I guess that You cannot have programmatically what You are looking for
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
Re: get mac address via c++ program - ifreq (hwaddr) and ioc
Enrico - Thanks for the link on osa. Not having that capability via a prg.- that might be an issue - i will check if i can spawn these commands - not sure if its gonna work or if that is the preferred/only route. On other hand certain(as an alternative to SIOCGIFHWADDR) alternate BSD based calls/structure getifaddrs , sockaddr_dl seems to be also not present/missing-certain-members in headers under /usr/include
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Calling Java program on UNIX/USS from a COBOL CICS program?
by zbius » Tue Nov 05, 2024 2:37 pm » in IBM Cobol - 2
- 2597
-
by zbius
View the latest post
Wed Nov 06, 2024 6:02 pm
-
-
-
RC16 upon subsequent calls "Address LINKMVS ICEMAN"
by golemis » Thu May 27, 2021 6:07 pm » in CLIST & REXX - 2
- 2162
-
by golemis
View the latest post
Thu May 27, 2021 8:30 pm
-
-
- 2
- 3166
-
by enrico-sorichetti
View the latest post
Mon Oct 30, 2023 6:25 pm
-
- 4
- 3089
-
by sergeyken
View the latest post
Mon May 22, 2023 12:52 am
-
- 1
- 1673
-
by enrico-sorichetti
View the latest post
Sat Jun 12, 2021 12:18 pm