* hostid under OSF/1 @ 1995-04-04 4:00 Thomas Leitner 1995-04-04 4:00 ` oberman 1995-04-06 4:00 ` Thomas Leitner 0 siblings, 2 replies; 4+ messages in thread From: Thomas Leitner @ 1995-04-04 4:00 UTC (permalink / raw) Hi, I found that neither in the FAQ nor in the recent postings here so: I need to get the hardware serial number under OSF/1. Apparently the hostid command can not be used for that. The sysinfo system call won't help either. Question: Can someone please post me a short code fragment how to get the hardware serial number under OSF/1? Thanks -- Tom -- Tom Leitner, tom@finwds01.tu-graz.ac.at |\ _,,,---,,_ Dept. of Communications zzz. /,`.-'`' -. ;-;;,_. Graz University of Technology |,4- ) )-,_. ,\ ( `'-' Phone: +43-316-873-7455 '---''(_/--' `-'\_) Fax: +43-316-463-697 WWW home page: http://wiis.tu-graz.ac.at/people/tom.html ^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: hostid under OSF/1 1995-04-04 4:00 hostid under OSF/1 Thomas Leitner @ 1995-04-04 4:00 ` oberman 1995-04-06 4:00 ` Thomas Leitner 1 sibling, 0 replies; 4+ messages in thread From: oberman @ 1995-04-04 4:00 UTC (permalink / raw) In Article <3lrbu0$nn1@fstgds15.tu-graz.ac.at> tom@finwds01.tu-graz.ac.at (Thomas Leitner) writes: >Hi, > >I found that neither in the FAQ nor in the recent postings here so: >I need to get the hardware serial number under OSF/1. Apparently the >hostid command can not be used for that. The sysinfo system call >won't help either. > >Question: Can someone please post me a short code fragment how to >get the hardware serial number under OSF/1? goTo (backOfUnit); Read (label); extractField (sN); To the best of my knowledge, Digital does not put serial numbers in hardware in their systems. If they do, it's a very recent change. The above is the only procedure I am aware of for obtaining a serial number. R. Kevin Oberman Energy Sciences Network (ESnet) National Energy Research Supercomputer Center (NERSC) Lawrence Livermore National Laboratory (LLNL) Internet: koberman@llnl.gov +1 510-422-6955 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: hostid under OSF/1 1995-04-04 4:00 hostid under OSF/1 Thomas Leitner 1995-04-04 4:00 ` oberman @ 1995-04-06 4:00 ` Thomas Leitner 1995-04-06 4:00 ` SOLVED: " Thomas Leitner 1 sibling, 1 reply; 4+ messages in thread From: Thomas Leitner @ 1995-04-06 4:00 UTC (permalink / raw) Thomas Leitner (tom@finwds01.tu-graz.ac.at) wrote: : I found that neither in the FAQ nor in the recent postings here so: : I need to get the hardware serial number under OSF/1. Apparently the : hostid command can not be used for that. The sysinfo system call : won't help either. : Question: Can someone please post me a short code fragment how to : get the hardware serial number under OSF/1? Aehmm, well. Am I touching some secret here or is there really no way to get the CPU (or system) serial number somehow? I, as well could use the ethernet address for my purposes. How can I get out the ethernet address of the machine from a C program (if possible a non-priviledged)? Tom -- Tom Leitner, tom@finwds01.tu-graz.ac.at |\ _,,,---,,_ Dept. of Communications zzz. /,`.-'`' -. ;-;;,_. Graz University of Technology |,4- ) )-,_. ,\ ( `'-' Phone: +43-316-873-7455 '---''(_/--' `-'\_) Fax: +43-316-463-697 WWW home page: http://wiis.tu-graz.ac.at/people/tom.html ^ permalink raw reply [flat|nested] 4+ messages in thread
* SOLVED: hostid under OSF/1 1995-04-06 4:00 ` Thomas Leitner @ 1995-04-06 4:00 ` Thomas Leitner 0 siblings, 0 replies; 4+ messages in thread From: Thomas Leitner @ 1995-04-06 4:00 UTC (permalink / raw) Thomas Leitner (tom@finwds01.tu-graz.ac.at) wrote: : Thomas Leitner (tom@finwds01.tu-graz.ac.at) wrote: : : I found that neither in the FAQ nor in the recent postings here so: : : I need to get the hardware serial number under OSF/1. Apparently the : : hostid command can not be used for that. The sysinfo system call : : won't help either. : : Question: Can someone please post me a short code fragment how to : : get the hardware serial number under OSF/1? : Aehmm, well. Am I touching some secret here or is there really no way : to get the CPU (or system) serial number somehow? I, as well could : use the ethernet address for my purposes. How can I get out the : ethernet address of the machine from a C program (if possible : a non-priviledged)? Thanks to John Kohl <jtk@atria.com>. He mailed me the following routine for getting the ethernet addr. (slightly modified by me). It even works under a non-priviledged account: #include <stdio.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <net/if.h> main() { int s; struct ifreq *ifrq, ifreqs[32]; struct ifdevea eaddr; struct ifconf ifc; long l1, l2; memset((char *)ifreqs, 0, sizeof(ifreqs)); s = socket(AF_INET, SOCK_STREAM, 0); ifc.ifc_req = ifreqs; ifc.ifc_len = sizeof(ifreqs); ioctl(s, SIOCGIFCONF, &ifc); for (ifrq = ifreqs; ifc.ifc_len > 0; ifrq++, ifc.ifc_len -= sizeof(*ifrq)) { /* for each known interface, try to get a physaddr. */ strncpy(eaddr.ifr_name, ifrq->ifr_name, IFNAMSIZ); if (ioctl(s, SIOCRPHYSADDR, &eaddr) == 0) { /* eaddr now has address. */ break; /* from for loop */ } } close(s); printf("name='%s'\n", eaddr.ifr_name); printf("def_pa='%02x:%02x:%02x:%02x:%02x:%02x'\n", eaddr.default_pa[0], eaddr.default_pa[1], eaddr.default_pa[2], eaddr.default_pa[3], eaddr.default_pa[4], eaddr.default_pa[5]); printf("cur_pa='%02x:%02x:%02x:%02x:%02x:%02x'\n", eaddr.current_pa[0], eaddr.current_pa[1], eaddr.current_pa[2], eaddr.current_pa[3], eaddr.current_pa[4], eaddr.current_pa[5]); } Thanks again -- Tom -- Tom Leitner, tom@finwds01.tu-graz.ac.at |\ _,,,---,,_ Dept. of Communications zzz. /,`.-'`' -. ;-;;,_. Graz University of Technology |,4- ) )-,_. ,\ ( `'-' Phone: +43-316-873-7455 '---''(_/--' `-'\_) Fax: +43-316-463-697 WWW home page: http://wiis.tu-graz.ac.at/people/tom.html ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1995-04-06 4:00 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 1995-04-04 4:00 hostid under OSF/1 Thomas Leitner 1995-04-04 4:00 ` oberman 1995-04-06 4:00 ` Thomas Leitner 1995-04-06 4:00 ` SOLVED: " Thomas Leitner
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox