Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rename dlt_atom to link_type and export

Use the name link_type like pcap-linktype(7) and export the function.
The underscore was added to make it similar to ether_type.
  • Loading branch information...
commit dc5e73913d7f91bfb14e1d6ac1d79c52f5c6193b 1 parent c7c7ec4
@msantos authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/pkt.erl
View
7 src/pkt.erl
@@ -47,6 +47,7 @@
valid/1,
ether/1,
ether_type/1,
+ link_type/1,
arp/1,
icmp/1,
ipv4/1,
@@ -61,7 +62,7 @@ decapsulate(Data) ->
decapsulate({ether, Data}, []).
decapsulate_dlt(Dlt, Data) ->
- decapsulate({dlt_atom(Dlt), Data}, []).
+ decapsulate({link_type(Dlt), Data}, []).
decapsulate(stop, Packet) ->
lists:reverse(Packet);
@@ -102,8 +103,8 @@ ether_type(?ETH_P_IPV6) -> ipv6;
ether_type(?ETH_P_ARP) -> arp;
ether_type(_) -> unsupported.
-dlt_atom(?DLT_EN10MB) -> ether;
-dlt_atom(?DLT_LINUX_SLL) -> linux_cooked.
+link_type(?DLT_EN10MB) -> ether;
+link_type(?DLT_LINUX_SLL) -> linux_cooked.
proto(?IPPROTO_ICMP) -> icmp;
Please sign in to comment.
Something went wrong with that request. Please try again.