?? mac_addr_dlpi.c
字號:
/* * mac_addr_dlpi.c * * Return the MAC (ie, ethernet hardware) address by using the dlpi api. * * compile with: gcc -c -D "OS" mac_addr_dlpi.c * with "OS" is one of AIX, SunOS, HPUX *//***********************************************************************//* this section defines a list of the dlpi capable devices * this depends on the operating system */#undef DLPI_DEV#ifdef HPUXstatic char *dlpi_dev[] = {"/dev/dlpi", ""};#define DLPI_DEV#endif#ifdef AIXstatic char *dlpi_dev[] = {"/dev/dlpi/et", "/dev/dlpi/en", "/dev/dlpi/tr", "/dev/dlpi/fddi", ""};#define DLPI_DEV/* AIX: remember to set up /etc/pse.conf or /etc/dlpi.conf */#endif#ifdef SunOSstatic char *dlpi_dev[] = {"/dev/eri", "/dev/hme", "/dev/ie", "/dev/le", ""};#define DLPI_DEV#endif#ifndef DLPI_DEVstatic char *dlpi_dev[] = {"/dev/dlpi", ""};/* unknown OS - hope that this will work ??? */#define DLPI_DEV#endif/***********************************************************************//* * implementation */#define INSAP 22 #define OUTSAP 24 #include <sys/types.h>#include <fcntl.h>#include <errno.h>#include <stdio.h>#include <string.h>#include <signal.h>#include <ctype.h>#include <sys/stropts.h>#include <sys/poll.h>#include <sys/dlpi.h>#define bcopy(source, destination, length) memcpy(destination, source, length)#define AREA_SZ 5000 /*
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -