HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to read the MAC address under HPUX 11
Operating System - HP-UX
1834137
Members
2278
Online
110064
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2001 05:45 AM
02-28-2001 05:45 AM
The following code works under HPUX 10.20 and 9.0x
and produce an error: No such device on HPUX11
int main(argc,argv)
int argc;
char *argv[];
{ int fd;
struct fis fis;
if((fd=open("/dev/lan0",O_RDONLY))<0)
{ printf("Unable to open /dev/lan0 for reading [%s].\n",strerror(errno));
return(-1);
}
fis.reqtype=LOCAL_ADDRESS;
if (ioctl(fd,NETSTAT,&fis) < 0)
{ close(fd); printf("Error ioctl.\n"); return(-1); }
close(fd);
printf("0x%02x%02x",(unsigned char)fis.value.s[0], (unsigned char)fis.value.s[1]);
printf("%02x%02x",(unsigned char)fis.value.s[2], (unsigned char)fis.value.s[3]);
printf("%02x%02x",(unsigned char)fis.value.s[4], (unsigned char)fis.value.s[5]);
printf("\n");
return(0);
}
and produce an error: No such device on HPUX11
int main(argc,argv)
int argc;
char *argv[];
{ int fd;
struct fis fis;
if((fd=open("/dev/lan0",O_RDONLY))<0)
{ printf("Unable to open /dev/lan0 for reading [%s].\n",strerror(errno));
return(-1);
}
fis.reqtype=LOCAL_ADDRESS;
if (ioctl(fd,NETSTAT,&fis) < 0)
{ close(fd); printf("Error ioctl.\n"); return(-1); }
close(fd);
printf("0x%02x%02x",(unsigned char)fis.value.s[0], (unsigned char)fis.value.s[1]);
printf("%02x%02x",(unsigned char)fis.value.s[2], (unsigned char)fis.value.s[3]);
printf("%02x%02x",(unsigned char)fis.value.s[4], (unsigned char)fis.value.s[5]);
printf("\n");
return(0);
}
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2001 08:01 AM
02-28-2001 08:01 AM
Re: How to read the MAC address under HPUX 11
Take a look through chapter 8 of the HP-UX 11.00 Driver Development Guide. It covers the new DLPI implementation. You probably need to make some modifications to your code.
http://docs.hp.com/hpux/pdf/B2355-90669.pdf
http://docs.hp.com/hpux/pdf/B2355-90669.pdf
Remember, wherever you go, there you are...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2001 08:33 AM
02-28-2001 08:33 AM
Re: How to read the MAC address under HPUX 11
I'm in agreement with Jim. The LAN device files dissapeared when DLPI was introduced.
The manual pages in section 7 about "lan" explains:
--> WARNING
--> The Link Level Access (LLA) interface is obsolete.
Those same manual pages reports a doc list. The firs doc listed is:
"DLPI Programmer's Guide", 1995, Hewlett-Packard
I hope this be useful
The manual pages in section 7 about "lan" explains:
--> WARNING
--> The Link Level Access (LLA) interface is obsolete.
Those same manual pages reports a doc list. The firs doc listed is:
"DLPI Programmer's Guide", 1995, Hewlett-Packard
I hope this be useful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2001 09:02 AM
02-28-2001 09:02 AM
Solution
Here is a program that uses DLPI to get the Physical MAC address.
I presume you are attempting to use this for licensing. LLA was obsoleted in 9.04. You might want to check for a "Logical" MAC address rather than the physical, if the software is going to be used in a switchover environment.
Regards
I presume you are attempting to use this for licensing. LLA was obsoleted in 9.04. You might want to check for a "Logical" MAC address rather than the physical, if the software is going to be used in a switchover environment.
Regards
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP