Permalink
Browse files

move ARPHDR definition into gen_socket

  • Loading branch information...
1 parent 7fb981a commit a7097283e17648e3463d15dc79dd8d8f65f725f4 @RoadRunnr RoadRunnr committed Jun 30, 2011
Showing with 195 additions and 133 deletions.
  1. +67 −0 include/gen_socket.hrl
  2. +0 −69 include/netlink.hrl
  3. +127 −1 src/gen_socket.erl
  4. +1 −63 src/netlink.erl
@@ -60,4 +60,71 @@
-define(SO_SNDBUF, 7).
-define(SO_RCVBUF, 8).
+%% ifi_type
+%% taken from /usr/include/linux/if_arp.h
+%% ARP protocol HARDWARE identifiers.
+-define(ARPHRD_NETROM, 0). %% from KA9Q: NET/ROM pseudo
+-define(ARPHRD_ETHER , 1). %% Ethernet 10Mbps
+-define(ARPHRD_EETHER, 2). %% Experimental Ethernet
+-define(ARPHRD_AX25, 3). %% AX.25 Level 2
+-define(ARPHRD_PRONET, 4). %% PROnet token ring
+-define(ARPHRD_CHAOS, 5). %% Chaosnet
+-define(ARPHRD_IEEE802,6). %% IEEE 802.2 Ethernet/TR/TB
+-define(ARPHRD_ARCNET, 7). %% ARCnet
+-define(ARPHRD_APPLETLK, 8). %% APPLEtalk
+-define(ARPHRD_DLCI, 15). %% Frame Relay DLCI
+-define(ARPHRD_ATM, 19). %% ATM
+-define(ARPHRD_METRICOM, 23). %% Metricom STRIP (new IANA id)
+-define(ARPHRD_IEEE1394, 24). %% IEEE 1394 IPv4 - RFC 2734
+-define(ARPHRD_EUI64, 27). %% EUI-64
+-define(ARPHRD_INFINIBAND, 32). %% InfiniBand
+%% Dummy types for non ARP hardware
+-define(ARPHRD_SLIP, 256).
+-define(ARPHRD_CSLIP, 257).
+-define(ARPHRD_SLIP6, 258).
+-define(ARPHRD_CSLIP6, 259).
+-define(ARPHRD_RSRVD, 260). %% Notional KISS type
+-define(ARPHRD_ADAPT, 264).
+-define(ARPHRD_ROSE, 270).
+-define(ARPHRD_X25, 271). %% CCITT X.25
+-define(ARPHRD_HWX25, 272). %% Boards with X.25 in firmware
+-define(ARPHRD_CAN, 280). %% Controller Area Network
+-define(ARPHRD_PPP, 512).
+-define(ARPHRD_CISCO, 513). %% Cisco HDLC
+-define(ARPHRD_HDLC, 513).
+-define(ARPHRD_LAPB, 516). %% LAPB
+-define(ARPHRD_DDCMP, 517). %% Digitals DDCMP protocol
+-define(ARPHRD_RAWHDLC, 518). %% Raw HDLC
+-define(ARPHRD_TUNNEL, 768). %% IPIP tunnel
+-define(ARPHRD_TUNNEL6, 769). %% IP6IP6 tunnel
+-define(ARPHRD_FRAD, 770). %% Frame Relay Access Device
+-define(ARPHRD_SKIP, 771). %% SKIP vif
+-define(ARPHRD_LOOPBACK, 772). %% Loopback device
+-define(ARPHRD_LOCALTLK, 773). %% Localtalk device
+-define(ARPHRD_FDDI, 774). %% Fiber Distributed Data Interface
+-define(ARPHRD_BIF, 775). %% AP1000 BIF
+-define(ARPHRD_SIT, 776). %% sit0 device - IPv6-in-IPv4
+-define(ARPHRD_IPDDP, 777). %% IP over DDP tunneller
+-define(ARPHRD_IPGRE, 778). %% GRE over IP
+-define(ARPHRD_PIMREG, 779). %% PIMSM register interface
+-define(ARPHRD_HIPPI, 780). %% High Performance Parallel Interface
+-define(ARPHRD_ASH, 781). %% Nexus 64Mbps Ash
+-define(ARPHRD_ECONET, 782). %% Acorn Econet
+-define(ARPHRD_IRDA, 783). %% Linux-IrDA
+%% ARP works differently on different FC media .. so
+-define(ARPHRD_FCPP, 784). %% Point to point fibrechannel
+-define(ARPHRD_FCAL, 785). %% Fibrechannel arbitrated loop
+-define(ARPHRD_FCPL, 786). %% Fibrechannel public loop
+-define(ARPHRD_FCFABRIC, 787). %% Fibrechannel fabric
+ %% 787->799 reserved for fibrechannel media types
+-define(ARPHRD_IEEE802_TR, 800). %% Magic type ident for TR
+-define(ARPHRD_IEEE80211, 801). %% IEEE 802.11
+-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_PHONET, 820). %% PhoNet media type
+-define(ARPHRD_PHONET_PIPE, 821). %% PhoNet pipe header
+-define(ARPHRD_CAIF, 822). %% CAIF media type
+-define(ARPHRD_VOID, 65535). %% Void type, nothing is known
+-define(ARPHRD_NONE, 65534). %% zero header length
View
@@ -21,72 +21,3 @@
-define(NETLINK_GENERIC, 16).
-define(NETLINK_SCSITRANSPORT, 18).
-define(NETLINK_ECRYPTFS, 19).
-
-%% ifi_type
-%% taken from /usr/include/linux/if_arp.h
-%% ARP protocol HARDWARE identifiers.
--define(ARPHRD_NETROM, 0). %% from KA9Q: NET/ROM pseudo
--define(ARPHRD_ETHER , 1). %% Ethernet 10Mbps
--define(ARPHRD_EETHER, 2). %% Experimental Ethernet
--define(ARPHRD_AX25, 3). %% AX.25 Level 2
--define(ARPHRD_PRONET, 4). %% PROnet token ring
--define(ARPHRD_CHAOS, 5). %% Chaosnet
--define(ARPHRD_IEEE802,6). %% IEEE 802.2 Ethernet/TR/TB
--define(ARPHRD_ARCNET, 7). %% ARCnet
--define(ARPHRD_APPLETLK, 8). %% APPLEtalk
--define(ARPHRD_DLCI, 15). %% Frame Relay DLCI
--define(ARPHRD_ATM, 19). %% ATM
--define(ARPHRD_METRICOM, 23). %% Metricom STRIP (new IANA id)
--define(ARPHRD_IEEE1394, 24). %% IEEE 1394 IPv4 - RFC 2734
--define(ARPHRD_EUI64, 27). %% EUI-64
--define(ARPHRD_INFINIBAND, 32). %% InfiniBand
-%% Dummy types for non ARP hardware
--define(ARPHRD_SLIP, 256).
--define(ARPHRD_CSLIP, 257).
--define(ARPHRD_SLIP6, 258).
--define(ARPHRD_CSLIP6, 259).
--define(ARPHRD_RSRVD, 260). %% Notional KISS type
--define(ARPHRD_ADAPT, 264).
--define(ARPHRD_ROSE, 270).
--define(ARPHRD_X25, 271). %% CCITT X.25
--define(ARPHRD_HWX25, 272). %% Boards with X.25 in firmware
--define(ARPHRD_CAN, 280). %% Controller Area Network
--define(ARPHRD_PPP, 512).
--define(ARPHRD_CISCO, 513). %% Cisco HDLC
--define(ARPHRD_HDLC, 513).
--define(ARPHRD_LAPB, 516). %% LAPB
--define(ARPHRD_DDCMP, 517). %% Digitals DDCMP protocol
--define(ARPHRD_RAWHDLC, 518). %% Raw HDLC
--define(ARPHRD_TUNNEL, 768). %% IPIP tunnel
--define(ARPHRD_TUNNEL6, 769). %% IP6IP6 tunnel
--define(ARPHRD_FRAD, 770). %% Frame Relay Access Device
--define(ARPHRD_SKIP, 771). %% SKIP vif
--define(ARPHRD_LOOPBACK, 772). %% Loopback device
--define(ARPHRD_LOCALTLK, 773). %% Localtalk device
--define(ARPHRD_FDDI, 774). %% Fiber Distributed Data Interface
--define(ARPHRD_BIF, 775). %% AP1000 BIF
--define(ARPHRD_SIT, 776). %% sit0 device - IPv6-in-IPv4
--define(ARPHRD_IPDDP, 777). %% IP over DDP tunneller
--define(ARPHRD_IPGRE, 778). %% GRE over IP
--define(ARPHRD_PIMREG, 779). %% PIMSM register interface
--define(ARPHRD_HIPPI, 780). %% High Performance Parallel Interface
--define(ARPHRD_ASH, 781). %% Nexus 64Mbps Ash
--define(ARPHRD_ECONET, 782). %% Acorn Econet
--define(ARPHRD_IRDA, 783). %% Linux-IrDA
-%% ARP works differently on different FC media .. so
--define(ARPHRD_FCPP, 784). %% Point to point fibrechannel
--define(ARPHRD_FCAL, 785). %% Fibrechannel arbitrated loop
--define(ARPHRD_FCPL, 786). %% Fibrechannel public loop
--define(ARPHRD_FCFABRIC, 787). %% Fibrechannel fabric
- %% 787->799 reserved for fibrechannel media types
--define(ARPHRD_IEEE802_TR, 800). %% Magic type ident for TR
--define(ARPHRD_IEEE80211, 801). %% IEEE 802.11
--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_PHONET, 820). %% PhoNet media type
--define(ARPHRD_PHONET_PIPE, 821). %% PhoNet pipe header
--define(ARPHRD_CAIF, 822). %% CAIF media type
-
--define(ARPHRD_VOID, 65535). %% Void type, nothing is known
--define(ARPHRD_NONE, 65534). %% zero header length
View
@@ -52,7 +52,7 @@
setsockoption/4
]).
-export([progname/0]).
--export([family/1, type/1, protocol/1]).
+-export([family/1, type/1, protocol/1, arphdr/1]).
-on_load(on_load/0).
@@ -292,4 +292,130 @@ protocol(136) -> udplite;
protocol(255) -> raw;
protocol(X) -> X.
+arphdr(?ARPHRD_NETROM) -> arphrd_netrom;
+arphdr(?ARPHRD_ETHER) -> arphrd_ether;
+arphdr(?ARPHRD_EETHER) -> arphrd_eether;
+arphdr(?ARPHRD_AX25) -> arphrd_ax25;
+arphdr(?ARPHRD_PRONET) -> arphrd_pronet;
+arphdr(?ARPHRD_CHAOS) -> arphrd_chaos;
+arphdr(?ARPHRD_IEEE802) -> arphrd_ieee802;
+arphdr(?ARPHRD_ARCNET) -> arphrd_arcnet;
+arphdr(?ARPHRD_APPLETLK) -> arphrd_appletlk;
+arphdr(?ARPHRD_DLCI) -> arphrd_dlci;
+arphdr(?ARPHRD_ATM) -> arphrd_atm;
+arphdr(?ARPHRD_METRICOM) -> arphrd_metricom;
+arphdr(?ARPHRD_IEEE1394) -> arphrd_ieee1394;
+arphdr(?ARPHRD_EUI64) -> arphrd_eui64;
+arphdr(?ARPHRD_INFINIBAND) -> arphrd_infiniband;
+arphdr(?ARPHRD_SLIP) -> arphrd_slip;
+arphdr(?ARPHRD_CSLIP) -> arphrd_cslip;
+arphdr(?ARPHRD_SLIP6) -> arphrd_slip6;
+arphdr(?ARPHRD_CSLIP6) -> arphrd_cslip6;
+arphdr(?ARPHRD_RSRVD) -> arphrd_rsrvd;
+arphdr(?ARPHRD_ADAPT) -> arphrd_adapt;
+arphdr(?ARPHRD_ROSE) -> arphrd_rose;
+arphdr(?ARPHRD_X25) -> arphrd_x25;
+arphdr(?ARPHRD_HWX25) -> arphrd_hwx25;
+arphdr(?ARPHRD_CAN) -> arphrd_can;
+arphdr(?ARPHRD_PPP) -> arphrd_ppp;
+arphdr(?ARPHRD_CISCO) -> arphrd_cisco;
+arphdr(?ARPHRD_HDLC) -> arphrd_hdlc;
+arphdr(?ARPHRD_LAPB) -> arphrd_lapb;
+arphdr(?ARPHRD_DDCMP) -> arphrd_ddcmp;
+arphdr(?ARPHRD_RAWHDLC) -> arphrd_rawhdlc;
+arphdr(?ARPHRD_TUNNEL) -> arphrd_tunnel;
+arphdr(?ARPHRD_TUNNEL6) -> arphrd_tunnel6;
+arphdr(?ARPHRD_FRAD) -> arphrd_frad;
+arphdr(?ARPHRD_SKIP) -> arphrd_skip;
+arphdr(?ARPHRD_LOOPBACK) -> arphrd_loopback;
+arphdr(?ARPHRD_LOCALTLK) -> arphrd_localtlk;
+arphdr(?ARPHRD_FDDI) -> arphrd_fddi;
+arphdr(?ARPHRD_BIF) -> arphrd_bif;
+arphdr(?ARPHRD_SIT) -> arphrd_sit;
+arphdr(?ARPHRD_IPDDP) -> arphrd_ipddp;
+arphdr(?ARPHRD_IPGRE) -> arphrd_ipgre;
+arphdr(?ARPHRD_PIMREG) -> arphrd_pimreg;
+arphdr(?ARPHRD_HIPPI) -> arphrd_hippi;
+arphdr(?ARPHRD_ASH) -> arphrd_ash;
+arphdr(?ARPHRD_ECONET) -> arphrd_econet;
+arphdr(?ARPHRD_IRDA) -> arphrd_irda;
+arphdr(?ARPHRD_FCPP) -> arphrd_fcpp;
+arphdr(?ARPHRD_FCAL) -> arphrd_fcal;
+arphdr(?ARPHRD_FCPL) -> arphrd_fcpl;
+arphdr(?ARPHRD_FCFABRIC) -> arphrd_fcfabric;
+arphdr(?ARPHRD_IEEE802_TR) -> arphrd_ieee802_tr;
+arphdr(?ARPHRD_IEEE80211) -> arphrd_ieee80211;
+arphdr(?ARPHRD_IEEE80211_PRISM) -> arphrd_ieee80211_prism;
+arphdr(?ARPHRD_IEEE80211_RADIOTAP) -> arphrd_ieee80211_radiotap;
+arphdr(?ARPHRD_IEEE802154) -> arphrd_ieee802154;
+arphdr(?ARPHRD_PHONET) -> arphrd_phonet;
+arphdr(?ARPHRD_PHONET_PIPE) -> arphrd_phonet_pipe;
+arphdr(?ARPHRD_CAIF) -> arphrd_caif;
+arphdr(?ARPHRD_VOID) -> arphrd_void;
+arphdr(?ARPHRD_NONE) -> arphrd_none;
+
+arphdr(arphrd_netrom) -> ?ARPHRD_NETROM;
+arphdr(arphrd_ether) -> ?ARPHRD_ETHER;
+arphdr(arphrd_eether) -> ?ARPHRD_EETHER;
+arphdr(arphrd_ax25) -> ?ARPHRD_AX25;
+arphdr(arphrd_pronet) -> ?ARPHRD_PRONET;
+arphdr(arphrd_chaos) -> ?ARPHRD_CHAOS;
+arphdr(arphrd_ieee802) -> ?ARPHRD_IEEE802;
+arphdr(arphrd_arcnet) -> ?ARPHRD_ARCNET;
+arphdr(arphrd_appletlk) -> ?ARPHRD_APPLETLK;
+arphdr(arphrd_dlci) -> ?ARPHRD_DLCI;
+arphdr(arphrd_atm) -> ?ARPHRD_ATM;
+arphdr(arphrd_metricom) -> ?ARPHRD_METRICOM;
+arphdr(arphrd_ieee1394) -> ?ARPHRD_IEEE1394;
+arphdr(arphrd_eui64) -> ?ARPHRD_EUI64;
+arphdr(arphrd_infiniband) -> ?ARPHRD_INFINIBAND;
+arphdr(arphrd_slip) -> ?ARPHRD_SLIP;
+arphdr(arphrd_cslip) -> ?ARPHRD_CSLIP;
+arphdr(arphrd_slip6) -> ?ARPHRD_SLIP6;
+arphdr(arphrd_cslip6) -> ?ARPHRD_CSLIP6;
+arphdr(arphrd_rsrvd) -> ?ARPHRD_RSRVD;
+arphdr(arphrd_adapt) -> ?ARPHRD_ADAPT;
+arphdr(arphrd_rose) -> ?ARPHRD_ROSE;
+arphdr(arphrd_x25) -> ?ARPHRD_X25;
+arphdr(arphrd_hwx25) -> ?ARPHRD_HWX25;
+arphdr(arphrd_can) -> ?ARPHRD_CAN;
+arphdr(arphrd_ppp) -> ?ARPHRD_PPP;
+arphdr(arphrd_cisco) -> ?ARPHRD_CISCO;
+arphdr(arphrd_hdlc) -> ?ARPHRD_HDLC;
+arphdr(arphrd_lapb) -> ?ARPHRD_LAPB;
+arphdr(arphrd_ddcmp) -> ?ARPHRD_DDCMP;
+arphdr(arphrd_rawhdlc) -> ?ARPHRD_RAWHDLC;
+arphdr(arphrd_tunnel) -> ?ARPHRD_TUNNEL;
+arphdr(arphrd_tunnel6) -> ?ARPHRD_TUNNEL6;
+arphdr(arphrd_frad) -> ?ARPHRD_FRAD;
+arphdr(arphrd_skip) -> ?ARPHRD_SKIP;
+arphdr(arphrd_loopback) -> ?ARPHRD_LOOPBACK;
+arphdr(arphrd_localtlk) -> ?ARPHRD_LOCALTLK;
+arphdr(arphrd_fddi) -> ?ARPHRD_FDDI;
+arphdr(arphrd_bif) -> ?ARPHRD_BIF;
+arphdr(arphrd_sit) -> ?ARPHRD_SIT;
+arphdr(arphrd_ipddp) -> ?ARPHRD_IPDDP;
+arphdr(arphrd_ipgre) -> ?ARPHRD_IPGRE;
+arphdr(arphrd_pimreg) -> ?ARPHRD_PIMREG;
+arphdr(arphrd_hippi) -> ?ARPHRD_HIPPI;
+arphdr(arphrd_ash) -> ?ARPHRD_ASH;
+arphdr(arphrd_econet) -> ?ARPHRD_ECONET;
+arphdr(arphrd_irda) -> ?ARPHRD_IRDA;
+arphdr(arphrd_fcpp) -> ?ARPHRD_FCPP;
+arphdr(arphrd_fcal) -> ?ARPHRD_FCAL;
+arphdr(arphrd_fcpl) -> ?ARPHRD_FCPL;
+arphdr(arphrd_fcfabric) -> ?ARPHRD_FCFABRIC;
+arphdr(arphrd_ieee802_tr) -> ?ARPHRD_IEEE802_TR;
+arphdr(arphrd_ieee80211) -> ?ARPHRD_IEEE80211;
+arphdr(arphrd_ieee80211_prism) -> ?ARPHRD_IEEE80211_PRISM;
+arphdr(arphrd_ieee80211_radiotap) -> ?ARPHRD_IEEE80211_RADIOTAP;
+arphdr(arphrd_ieee802154) -> ?ARPHRD_IEEE802154;
+arphdr(arphrd_phonet) -> ?ARPHRD_PHONET;
+arphdr(arphrd_phonet_pipe) -> ?ARPHRD_PHONET_PIPE;
+arphdr(arphrd_caif) -> ?ARPHRD_CAIF;
+arphdr(arphrd_void) -> ?ARPHRD_VOID;
+arphdr(arphrd_none) -> ?ARPHRD_NONE;
+
+arphdr(X) -> X.
+
View
@@ -216,68 +216,6 @@ dec_nfnl_subsys(SubSys) when is_integer(SubSys) -> SubSys.
-define(RTM_GETDCB, 78).
-define(RTM_SETDCB, 79).
-dec_ifi_type(?ARPHRD_NETROM) -> arphrd_netrom;
-dec_ifi_type(?ARPHRD_ETHER ) -> arphrd_ether ;
-dec_ifi_type(?ARPHRD_EETHER) -> arphrd_eether;
-dec_ifi_type(?ARPHRD_AX25) -> arphrd_ax25;
-dec_ifi_type(?ARPHRD_PRONET) -> arphrd_pronet;
-dec_ifi_type(?ARPHRD_CHAOS) -> arphrd_chaos;
-dec_ifi_type(?ARPHRD_IEEE802) -> arphrd_ieee802;
-dec_ifi_type(?ARPHRD_ARCNET) -> arphrd_arcnet;
-dec_ifi_type(?ARPHRD_APPLETLK) -> arphrd_appletlk;
-dec_ifi_type(?ARPHRD_DLCI) -> arphrd_dlci;
-dec_ifi_type(?ARPHRD_ATM) -> arphrd_atm;
-dec_ifi_type(?ARPHRD_METRICOM) -> arphrd_metricom;
-dec_ifi_type(?ARPHRD_IEEE1394) -> arphrd_ieee1394;
-dec_ifi_type(?ARPHRD_EUI64) -> arphrd_eui64;
-dec_ifi_type(?ARPHRD_INFINIBAND) -> arphrd_infiniband;
-dec_ifi_type(?ARPHRD_SLIP) -> arphrd_slip;
-dec_ifi_type(?ARPHRD_CSLIP) -> arphrd_cslip;
-dec_ifi_type(?ARPHRD_SLIP6) -> arphrd_slip6;
-dec_ifi_type(?ARPHRD_CSLIP6) -> arphrd_cslip6;
-dec_ifi_type(?ARPHRD_RSRVD) -> arphrd_rsrvd;
-dec_ifi_type(?ARPHRD_ADAPT) -> arphrd_adapt;
-dec_ifi_type(?ARPHRD_ROSE) -> arphrd_rose;
-dec_ifi_type(?ARPHRD_X25) -> arphrd_x25;
-dec_ifi_type(?ARPHRD_HWX25) -> arphrd_hwx25;
-dec_ifi_type(?ARPHRD_CAN) -> arphrd_can;
-dec_ifi_type(?ARPHRD_PPP) -> arphrd_ppp;
-dec_ifi_type(?ARPHRD_CISCO) -> arphrd_cisco;
-dec_ifi_type(?ARPHRD_HDLC) -> arphrd_hdlc;
-dec_ifi_type(?ARPHRD_LAPB) -> arphrd_lapb;
-dec_ifi_type(?ARPHRD_DDCMP) -> arphrd_ddcmp;
-dec_ifi_type(?ARPHRD_RAWHDLC) -> arphrd_rawhdlc;
-dec_ifi_type(?ARPHRD_TUNNEL) -> arphrd_tunnel;
-dec_ifi_type(?ARPHRD_TUNNEL6) -> arphrd_tunnel6;
-dec_ifi_type(?ARPHRD_FRAD) -> arphrd_frad;
-dec_ifi_type(?ARPHRD_SKIP) -> arphrd_skip;
-dec_ifi_type(?ARPHRD_LOOPBACK) -> arphrd_loopback;
-dec_ifi_type(?ARPHRD_LOCALTLK) -> arphrd_localtlk;
-dec_ifi_type(?ARPHRD_FDDI) -> arphrd_fddi;
-dec_ifi_type(?ARPHRD_BIF) -> arphrd_bif;
-dec_ifi_type(?ARPHRD_SIT) -> arphrd_sit;
-dec_ifi_type(?ARPHRD_IPDDP) -> arphrd_ipddp;
-dec_ifi_type(?ARPHRD_IPGRE) -> arphrd_ipgre;
-dec_ifi_type(?ARPHRD_PIMREG) -> arphrd_pimreg;
-dec_ifi_type(?ARPHRD_HIPPI) -> arphrd_hippi;
-dec_ifi_type(?ARPHRD_ASH) -> arphrd_ash;
-dec_ifi_type(?ARPHRD_ECONET) -> arphrd_econet;
-dec_ifi_type(?ARPHRD_IRDA) -> arphrd_irda;
-dec_ifi_type(?ARPHRD_FCPP) -> arphrd_fcpp;
-dec_ifi_type(?ARPHRD_FCAL) -> arphrd_fcal;
-dec_ifi_type(?ARPHRD_FCPL) -> arphrd_fcpl;
-dec_ifi_type(?ARPHRD_FCFABRIC) -> arphrd_fcfabric;
-dec_ifi_type(?ARPHRD_IEEE802_TR) -> arphrd_ieee802_tr;
-dec_ifi_type(?ARPHRD_IEEE80211) -> arphrd_ieee80211;
-dec_ifi_type(?ARPHRD_IEEE80211_PRISM) -> arphrd_ieee80211_prism;
-dec_ifi_type(?ARPHRD_IEEE80211_RADIOTAP) -> arphrd_ieee80211_radiotap;
-dec_ifi_type(?ARPHRD_IEEE802154) -> arphrd_ieee802154;
-dec_ifi_type(?ARPHRD_PHONET) -> arphrd_phonet;
-dec_ifi_type(?ARPHRD_PHONET_PIPE) -> arphrd_phonet_pipe;
-dec_ifi_type(?ARPHRD_CAIF) -> arphrd_caif;
-dec_ifi_type(?ARPHRD_VOID) -> arphrd_void;
-dec_ifi_type(?ARPHRD_NONE) -> arphrd_none.
-
create_table() ->
ets:new(?TAB, [named_table, public]).
@@ -778,7 +716,7 @@ nl_dec_payload({rtnetlink}, MsgType, << Family:8, PrefixLen:8, Flags:8, Scope:8,
nl_dec_payload({rtnetlink}, MsgType, << Family:8, _Pad:8, Type:16/native-integer, Index:32/native-integer, Flags:32/native-integer, Change:32/native-integer, Data/binary >>)
when MsgType == newlink; MsgType == dellink ->
Fam = gen_socket:family(Family),
- { Fam, dec_ifi_type(Type), Index, dec_iff_flags(Flags), dec_iff_flags(Change), nl_dec_nla(Fam, {rtnetlink,link}, Data) };
+ { Fam, gen_socket:arphdr(Type), Index, dec_iff_flags(Flags), dec_iff_flags(Change), nl_dec_nla(Fam, {rtnetlink,link}, Data) };
nl_dec_payload({rtnetlink}, MsgType, << Family:8, _Pad1:8, _Pad2:16, IfIndex:32/native-signed-integer, PfxType:8, PfxLen:8, Flags:8, _Pad3:8, Data/binary >>)
when MsgType == newprefix; MsgType == delprefix ->

0 comments on commit a709728

Please sign in to comment.