BTW, are there unique burned-in addresses for Tokenring cards only or do
Ethernet cards have the same feature?
I need the MAC to have a unique identifier for the PCs in the net (APPC
and TCP/IP).
Thanks in advance.
15.10.98 19:49, Wilfried Reinoehl wrote a message to All :
WR> Is there an OS/2 API to get the MAC address of the network
WR> interface card? I would like to have the world wide unique burned
WR> in address. But the actual used MAC address would be OK as well.
Use NetBIOS and command 0x33 (called NCB.STATUS or NCBASTAT), this returns a
buffer in the following format:
/* Returned by NCBASTAT */
typedef struct _PNB_STATUS {
UINT8 burned_in_addr[6]; /* Adapter's burned in addr */
UINT8 version; /* software release level */
UINT8 reserved1; /* RESERVED always X'0000' */
UINT16 software_level_number; /* X'FFnn' - nn is level num */
UINT16 reporting_period; /* reporting period (minutes) */
UINT16 frmr_frames_received; /* # FRMR received */
UINT16 frmr_frames_sent; /* # FRMR sent */
UINT16 bad_iframes_received; /* # bad Iframes received */
UINT16 aborted_transmissions; /* # aborted transmits */
UINT32 packets_transmitted; /* # Successfully transmitted*/
UINT32 packets_received; /* # Successfully received */
UINT16 bad_iframes_transmitted; /* # bad Iframes transmitted */
UINT16 lost_data_count; /* Lost SAP buffer data cnt */
UINT16 t1_expiration_count; /* Number of T1 expirations */
UINT16 ti_expiration_count; /* Number of Ti expirations */
UINT32 extended_status_table; /* Address of extended status
(in driver address-space!) */
UINT16 number_of_free_ncbs; /* Number of NCBs available */
UINT16 max_configured_ncbs; /* Configured NCB maximum */
UINT16 max_allowed_ncbs; /* Maximum NCBs (always 255) */
UINT16 busy_condition_count; /* Local station busy count */
UINT16 max_datagram_size; /* Maximum datagram packet */
UINT16 pending_sessions; /* Number of pending sessions */
UINT16 max_configured_sessions; /* Configured session maximum */
UINT16 max_allowed_sessions; /* Maximum sessions (254) */
UINT16 max_data_packet_size; /* Maximum session packet */
UINT16 number_of_names_present; /* Number of names in table */
char name_table[]; /* Table of names follows
(18 bytes each) */
} PNB_STATUS;
WR> BTW, are there unique burned-in addresses for Tokenring cards
WR> only or do Ethernet cards have the same feature?
They both have this feature but one of them uses it upside down.
WR> I need the MAC to have a unique identifier for the PCs in the
WR> net (APPC and TCP/IP).
Did the same for NetBIOS, works.
C-x C-s
Vitus
PS: read "LAN Technical Reference: 802.2 and NETBIOS APIs", DevCon.
Team OS/2 Germany #835, Fidonet, OS2Net, FAX/BBS: +49-05136-893003, ...
Hi Vitus,
UINT32 extended_status_table; /* Address of extended status
(in driver address-space!) */
Is it possible to access this extended status from application space and
if yes - what kind of information is stored there?
Thank you
Guenter
Guenter Kukkukk
Damaschkestr. 24
10711 Berlin (Germany)
Tel. +49 30 327 024 50
Fax: +49 30 327 024 52
EMail: ku...@berlin.snafu.de
>UINT32 extended_status_table; /* Address of extended status
> (in driver address-space!) */
>Is it possible to access this extended status from application space and if
>yes - what kind of information is stored there?
Well, you could give it a shot and find out. Since it's only a 32-bit
pointer, it's accessible from an app. The "in driver address-space" probably
means that the driver created and owns the memory, but OS/2 has given
you access to it.
--
Remove "nospam_" from my email address when replying
Timur "too sexy for my code" Tabi, ti...@tabi.org, http://www.tabi.org
OS/2 page: http://www.os2ss.com/Information/Newusers/index.html
OS/2 Programming page: http://www.edm2.com/common/links.html
Looking for the best OS/2 soundcard? http://www.tabi.org/timur/crystalos2.html