4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
9 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
17 #include <sys/ioctl.h>
18 #include <sys/socket.h>
19 #include <sys/ioctl.h>
20 #include <netinet/in.h>
21 #include <arpa/inet.h>
24 #include <linux/netdevice.h>
25 #include <linux/if_arp.h>
26 #include <linux/sockios.h>
30 const char * ll_type_n2a(int type, char *buf, int len)
32 #define __PF(f,n) { ARPHRD_##f, #n },
43 #ifdef ARPHRD_IEEE802_TR
54 __PF(METRICOM,metricom)
55 #ifdef ARPHRD_IEEE1394
56 __PF(IEEE1394,ieee1394)
58 #ifdef ARPHRD_INFINIBAND
59 __PF(INFINIBAND,infiniband)
87 __PF(LOOPBACK,loopback)
103 __PF(FCFABRIC+1,fcfb1)
104 __PF(FCFABRIC+2,fcfb2)
105 __PF(FCFABRIC+3,fcfb3)
106 __PF(FCFABRIC+4,fcfb4)
107 __PF(FCFABRIC+5,fcfb5)
108 __PF(FCFABRIC+6,fcfb6)
109 __PF(FCFABRIC+7,fcfb7)
110 __PF(FCFABRIC+8,fcfb8)
111 __PF(FCFABRIC+9,fcfb9)
112 __PF(FCFABRIC+10,fcfb10)
113 __PF(FCFABRIC+11,fcfb11)
114 __PF(FCFABRIC+12,fcfb12)
115 #ifdef ARPHRD_IEEE802_TR
118 #ifdef ARPHRD_IEEE80211
119 __PF(IEEE80211,ieee802.11)
128 for (i=0; i<sizeof(arphrd_names)/sizeof(arphrd_names[0]); i++) {
129 if (arphrd_names[i].type == type)
130 return arphrd_names[i].name;
132 snprintf(buf, len, "[%d]", type);