Permalink
Browse files

Change the ethernet types to match naming in if_ether.h

  • Loading branch information...
1 parent 8c38b59 commit f9441d2c8633c788965e118d358c51aae634b72b @msantos committed Jun 6, 2010
Showing with 4 additions and 4 deletions.
  1. +2 −2 include/epcap_net.hrl
  2. +2 −2 src/epcap_net.erl
@@ -1,6 +1,6 @@
%% From http://en.wikipedia.org/wiki/EtherType
--define(ETHTYPE_IPV4, 16#0800).
--define(ETHTYPE_IPV6, 16#86DD).
+-define(ETH_P_IP, 16#0800).
+-define(ETH_P_IPV6, 16#86DD).
-define(IPPROTO_IP, 0).
-define(IPPROTO_ICMP, 1).
View
@@ -89,8 +89,8 @@ decapsulate({icmp, Data}, Packet) when byte_size(Data) >= ?ICMPHDRLEN ->
decapsulate({_, Data}, Packet) ->
decapsulate(stop, [{truncated, Data}|Packet]).
-ether_type(?ETHTYPE_IPV4) -> ipv4;
-ether_type(?ETHTYPE_IPV6) -> ipv6;
+ether_type(?ETH_P_IP) -> ipv4;
+ether_type(?ETH_P_IPV6) -> ipv6;
ether_type(_) -> unsupported.
proto(?IPPROTO_ICMP) -> icmp;

0 comments on commit f9441d2

Please sign in to comment.