home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Education Sampler 1992 [NeXTSTEP]
/
Education_1992_Sampler.iso
/
NeXT
/
Misc
/
HigherEducationMailbox.mbox
/
Archives_provide_val_.attach
/
May_91
/
os.261
< prev
next >
Wrap
Text File
|
1991-05-21
|
641b
|
33 lines
{\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fswiss Helvetica;\f2\fmodern Courier;}
\paperw11440
\paperh9000
\margl120
\margr120
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ul0\fs28 os ethernet address hostid gethostid\
\
Q: How do I convert a hostid into an Ethernet address?\
\
A: Here is the code to decode a hostid:\
\f1\fs24 \
\f2 main()\
\{\
long hostid;\
long en_address;\
\
hostid = gethostid();\
en_address = (hostid & 0xffffff) + 0x00000f000000;\
\
printf("hostid = 0x%x; en_address = 0x%x.\\n", hostid, en_address);\
\}\
\
\f0\fs28 \
QA261\
\
Valid for 1.0 \
Valid for 2.0\
\