]> git.proxmox.com Git - mirror_iproute2.git/blame - lib/ll_types.c
cleanup debris from revert
[mirror_iproute2.git] / lib / ll_types.c
CommitLineData
aba5acdf
SH
1/*
2 * ll_types.c
3 *
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.
8 *
9 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
10 */
11
12#include <stdio.h>
13#include <stdlib.h>
14#include <unistd.h>
15#include <syslog.h>
16#include <fcntl.h>
17#include <sys/ioctl.h>
18#include <sys/socket.h>
19#include <sys/ioctl.h>
aba5acdf
SH
20#include <netinet/in.h>
21#include <arpa/inet.h>
22#include <string.h>
23
a7452b20
SH
24#include <linux/netdevice.h>
25#include <linux/if_arp.h>
26#include <linux/sockios.h>
27
28#include "rt_names.h"
29
30const char * ll_type_n2a(int type, char *buf, int len)
aba5acdf
SH
31{
32#define __PF(f,n) { ARPHRD_##f, #n },
4dbda0f4 33static const struct {
aba5acdf 34 int type;
a7452b20 35 const char *name;
aba5acdf
SH
36} arphrd_names[] = {
37{ 0, "generic" },
38__PF(ETHER,ether)
39__PF(EETHER,eether)
40__PF(AX25,ax25)
41__PF(PRONET,pronet)
42__PF(CHAOS,chaos)
aba5acdf 43__PF(IEEE802,ieee802)
aba5acdf
SH
44__PF(ARCNET,arcnet)
45__PF(APPLETLK,atalk)
46__PF(DLCI,dlci)
aba5acdf 47__PF(ATM,atm)
aba5acdf 48__PF(METRICOM,metricom)
aba5acdf 49__PF(IEEE1394,ieee1394)
1362865a 50__PF(INFINIBAND,infiniband)
aba5acdf
SH
51__PF(SLIP,slip)
52__PF(CSLIP,cslip)
53__PF(SLIP6,slip6)
54__PF(CSLIP6,cslip6)
55__PF(RSRVD,rsrvd)
56__PF(ADAPT,adapt)
57__PF(ROSE,rose)
58__PF(X25,x25)
aba5acdf 59__PF(HWX25,hwx25)
98f9a1d2 60__PF(CAN,can)
aba5acdf
SH
61__PF(PPP,ppp)
62__PF(HDLC,hdlc)
63__PF(LAPB,lapb)
aba5acdf 64__PF(DDCMP,ddcmp)
aba5acdf 65__PF(RAWHDLC,rawhdlc)
aba5acdf
SH
66__PF(TUNNEL,ipip)
67__PF(TUNNEL6,tunnel6)
68__PF(FRAD,frad)
69__PF(SKIP,skip)
70__PF(LOOPBACK,loopback)
71__PF(LOCALTLK,ltalk)
72__PF(FDDI,fddi)
73__PF(BIF,bif)
74__PF(SIT,sit)
75__PF(IPDDP,ip/ddp)
76__PF(IPGRE,gre)
77__PF(PIMREG,pimreg)
78__PF(HIPPI,hippi)
79__PF(ASH,ash)
80__PF(ECONET,econet)
81__PF(IRDA,irda)
82__PF(FCPP,fcpp)
83__PF(FCAL,fcal)
84__PF(FCPL,fcpl)
85__PF(FCFABRIC,fcfb0)
86__PF(FCFABRIC+1,fcfb1)
87__PF(FCFABRIC+2,fcfb2)
88__PF(FCFABRIC+3,fcfb3)
89__PF(FCFABRIC+4,fcfb4)
90__PF(FCFABRIC+5,fcfb5)
91__PF(FCFABRIC+6,fcfb6)
92__PF(FCFABRIC+7,fcfb7)
93__PF(FCFABRIC+8,fcfb8)
94__PF(FCFABRIC+9,fcfb9)
95__PF(FCFABRIC+10,fcfb10)
96__PF(FCFABRIC+11,fcfb11)
97__PF(FCFABRIC+12,fcfb12)
aba5acdf 98__PF(IEEE802_TR,tr)
aba5acdf 99__PF(IEEE80211,ieee802.11)
fc537c25 100__PF(IEEE80211_PRISM,ieee802.11/prism)
fc537c25 101__PF(IEEE80211_RADIOTAP,ieee802.11/radiotap)
4dbda0f4
SH
102__PF(IEEE802154, ieee802.15.4)
103__PF(PHONET, phonet)
104__PF(PHONET_PIPE, phonet_pipe)
105__PF(CAIF, caif)
4e20cc55 106__PF(IP6GRE, gre6)
19106180 107__PF(NETLINK, netlink)
4dbda0f4 108
800b4440 109__PF(NONE, none)
aba5acdf 110__PF(VOID,void)
aba5acdf
SH
111};
112#undef __PF
113
114 int i;
115 for (i=0; i<sizeof(arphrd_names)/sizeof(arphrd_names[0]); i++) {
116 if (arphrd_names[i].type == type)
117 return arphrd_names[i].name;
118 }
119 snprintf(buf, len, "[%d]", type);
120 return buf;
121}