utils: update link layer protocol translations

Update the private copy of linux/if_arp.h and hook up the not yet
defined ARPHRD_* types in the llprotos translation table. Reorder the
entries such that they correspond to the order they're defined in
linux/if_arp.h. Also remove the #ifdef guards since these are
unnecessary given that the private copy of the kernel header is used.

http://lists.infradead.org/pipermail/libnl/2015-May/001883.html

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Tobias Klauser 2015-05-19 13:40:24 +02:00 committed by Thomas Haller
parent 75dcd01756
commit 1dbe738e1e
2 changed files with 13 additions and 14 deletions

View file

@ -87,10 +87,14 @@
#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */
#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */
#define ARPHRD_IEEE802154 804
#define ARPHRD_IEEE802154_MONITOR 805 /* IEEE 802.15.4 network monitor */
#define ARPHRD_PHONET 820 /* PhoNet media type */
#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */
#define ARPHRD_CAIF 822 /* CAIF media type */
#define ARPHRD_IP6GRE 823 /* GRE over IPv6 */
#define ARPHRD_NETLINK 824 /* Netlink header */
#define ARPHRD_6LOWPAN 825 /* IPv6 over LoWPAN */
#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
#define ARPHRD_NONE 0xFFFE /* zero header length */

View file

@ -641,9 +641,7 @@ static const struct trans_tbl llprotos[] = {
__ADD(ARPHRD_ATM,atm),
__ADD(ARPHRD_METRICOM,metricom),
__ADD(ARPHRD_IEEE1394,ieee1394),
#ifdef ARPHRD_EUI64
__ADD(ARPHRD_EUI64,eui64),
#endif
__ADD(ARPHRD_INFINIBAND,infiniband),
__ADD(ARPHRD_SLIP,slip),
__ADD(ARPHRD_CSLIP,cslip),
@ -653,9 +651,7 @@ static const struct trans_tbl llprotos[] = {
__ADD(ARPHRD_ADAPT,adapt),
__ADD(ARPHRD_ROSE,rose),
__ADD(ARPHRD_X25,x25),
#ifdef ARPHRD_HWX25
__ADD(ARPHRD_HWX25,hwx25),
#endif
__ADD(ARPHRD_CAN,can),
__ADD(ARPHRD_PPP,ppp),
__ADD(ARPHRD_HDLC,hdlc),
@ -696,19 +692,18 @@ static const struct trans_tbl llprotos[] = {
__ADD(ARPHRD_FCFABRIC+12,fcfb_12),
__ADD(ARPHRD_IEEE802_TR,tr),
__ADD(ARPHRD_IEEE80211,ieee802.11),
__ADD(ARPHRD_IEEE80211_PRISM,ieee802.11_prism),
__ADD(ARPHRD_IEEE80211_RADIOTAP,ieee802.11_radiotap),
__ADD(ARPHRD_IEEE802154,ieee802.15.4),
__ADD(ARPHRD_IEEE802154_MONITOR,ieee802.15.4_monitor),
__ADD(ARPHRD_PHONET,phonet),
#ifdef ARPHRD_CAIF
__ADD(ARPHRD_CAIF, caif),
#endif
#ifdef ARPHRD_IEEE80211_PRISM
__ADD(ARPHRD_IEEE80211_PRISM, ieee802.11_prism),
#endif
#ifdef ARPHRD_VOID
__ADD(ARPHRD_PHONET_PIPE,phonet_pipe),
__ADD(ARPHRD_CAIF,caif),
__ADD(ARPHRD_IP6GRE,ip6gre),
__ADD(ARPHRD_NETLINK,netlink),
__ADD(ARPHRD_6LOWPAN,6lowpan),
__ADD(ARPHRD_VOID,void),
#endif
#ifdef ARPHRD_NONE
__ADD(ARPHRD_NONE,nohdr),
#endif
};
char * nl_llproto2str(int llproto, char *buf, size_t len)