]>
git.proxmox.com Git - mirror_iproute2.git/blob - lib/ll_types.c
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>
16 #include <sys/ioctl.h>
17 #include <sys/socket.h>
18 #include <netinet/in.h>
19 #include <arpa/inet.h>
22 #include <linux/netdevice.h>
23 #include <linux/if_arp.h>
24 #include <linux/sockios.h>
29 const char * ll_type_n2a(int type
, char *buf
, int len
)
31 #define __PF(f,n) { ARPHRD_##f, #n },
47 __PF(METRICOM
,metricom
)
48 __PF(IEEE1394
,ieee1394
)
49 __PF(INFINIBAND
,infiniband
)
69 __PF(LOOPBACK
,loopback
)
85 __PF(FCFABRIC
+1,fcfb1
)
86 __PF(FCFABRIC
+2,fcfb2
)
87 __PF(FCFABRIC
+3,fcfb3
)
88 __PF(FCFABRIC
+4,fcfb4
)
89 __PF(FCFABRIC
+5,fcfb5
)
90 __PF(FCFABRIC
+6,fcfb6
)
91 __PF(FCFABRIC
+7,fcfb7
)
92 __PF(FCFABRIC
+8,fcfb8
)
93 __PF(FCFABRIC
+9,fcfb9
)
94 __PF(FCFABRIC
+10,fcfb10
)
95 __PF(FCFABRIC
+11,fcfb11
)
96 __PF(FCFABRIC
+12,fcfb12
)
98 __PF(IEEE80211
,ieee802
.11
)
99 __PF(IEEE80211_PRISM
,ieee802
.11
/prism
)
100 __PF(IEEE80211_RADIOTAP
,ieee802
.11
/radiotap
)
101 __PF(IEEE802154
, ieee802
.15
.4)
102 __PF(IEEE802154_MONITOR
, ieee802
.15
.4/monitor
)
104 __PF(PHONET_PIPE
, phonet_pipe
)
107 __PF(NETLINK
, netlink
)
108 __PF(6LOWPAN
, 6lowpan
)
116 for (i
=0; !numeric
&& i
<sizeof(arphrd_names
)/sizeof(arphrd_names
[0]); i
++) {
117 if (arphrd_names
[i
].type
== type
)
118 return arphrd_names
[i
].name
;
120 snprintf(buf
, len
, "[%d]", type
);