Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Network card hardware sddress "C" function

Posted on 1997-06-01
7
236 Views
Last Modified: 2013-12-23
Where I can find a "C" function that will return the
hardware address of the network card on Solaris 2.5.1
that run on X86?
0
Comment
Question by:kaplan060197
  • 4
  • 2
7 Comments
 

Author Comment

by:kaplan060197
ID: 1582113
Adjusted points to 100
0
 
LVL 3

Expert Comment

by:dhm
ID: 1582114
There's no single function that can do this (afaik); in Solaris these days you have to send STREAMS messages to get the info.  I'm sure you've noticed that, if you run ifconfig(1M) as root, it prints out the ethernet hardware address.  Running truss(1) to trace the system calls ifconfig(1M) runs gives the output below; what it means is that you'll have to open the driver pseudo-device and do STREAMS I/O to get the hardware address.  The STREAMS message you'll need to send is DL_PHYS_ADDR_REQ; see the DLPI(7P) man page and the page for your particular network card.

Here's the relevant portion of my truss output.  "/dev/smc" is the name of the pseudo-device (I have an SMC ethernet card in my machine).

open("/dev/smc", O_RDWR)                        = 4
brk(0x080CBD78)                                 = 0
putmsg(4, 0x08047A10, 0x00000000, 0)            = 0
sigaction(SIGALRM, 0x080478B8, 0x080479B0)      = 0
sigprocmask(SIG_UNBLOCK, 0x080479E0, 0x080479D0) = 0
alarm(60)                                       = 0
getmsg(4, 0x08047A10, 0x00000000, 0x08047A0C)   = 0
alarm(0)                                        = 60
sigaction(SIGALRM, 0x080478B8, 0x080479B0)      = 0
sigprocmask(SIG_UNBLOCK, 0x080479E0, 0x080479D0) = 0
putmsg(4, 0x08047A90, 0x00000000, 0)            = 0
sigaction(SIGALRM, 0x08047938, 0x08047A30)      = 0
sigprocmask(SIG_UNBLOCK, 0x08047A60, 0x08047A50) = 0
alarm(60)                                       = 0
getmsg(4, 0x08047A90, 0x00000000, 0x08047A8C)   = 0
alarm(0)                                        = 60
sigaction(SIGALRM, 0x08047938, 0x08047A30)      = 0
sigprocmask(SIG_UNBLOCK, 0x08047A60, 0x08047A50) = 0
close(4)                                        = 0
write(1, "\t e t h e r   0 : 0 : c".., 24)      = 24

(Most of that is signal-handling stuff so that alarms can be set around functions that might hang.  The essentials are:

open("/dev/smc", O_RDWR)                        = 4
putmsg(4, 0x08047A10, 0x00000000, 0)            = 0
getmsg(4, 0x08047A10, 0x00000000, 0x08047A0C)   = 0
putmsg(4, 0x08047A90, 0x00000000, 0)            = 0
getmsg(4, 0x08047A90, 0x00000000, 0x08047A8C)   = 0
close(4)                                        = 0
write(1, "\t e t h e r   0 : 0 : c".., 24)      = 24

The last "write" statement prints out the hardware address detected by the getmsg/putmsg sequence.)
0
 

Author Comment

by:kaplan060197
ID: 1582115
I ask to FIND exsisting user function already written and
TESTED, not adivces how to write one by try and error.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 3

Expert Comment

by:dhm
ID: 1582116
You're welcome.
0
 

Author Comment

by:kaplan060197
ID: 1582117
Adjusted points to 150
0
 

Author Comment

by:kaplan060197
ID: 1582118
Adjusted points to 210
0
 
LVL 2

Accepted Solution

by:
red031197 earned 210 total points
ID: 1582119
just awk it out from 'prtconf' or arp -a
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Cisco 3650 switch 7 45
How to read network slash info 7 44
FreeRADIUS vs Windows NPS (server 2016) 2 125
Cisco WRVS4400N 11 37
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question