Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove functions used by epcap/sniff

  • Loading branch information...
commit 0950c8b396ca6e14b0201348ea53efe4c1904e75 1 parent 2cb7bd5
Michael Santos authored
Showing with 0 additions and 22 deletions.
  1. +0 −22 src/pkt.erl
22 src/pkt.erl
View
@@ -45,21 +45,16 @@
makesum/1,
valid/1,
ether/1,
- ether_addr/1,
ether_type/1,
arp/1,
icmp/1,
ipv4/1,
ipv6/1,
- payload/1,
proto/1,
tcp/1,
- tcp_flags/1,
udp/1
]).
--define(is_print(C), C >= $ , C =< $~).
-
decapsulate(Data) ->
decapsulate({ether, Data}, []).
@@ -414,9 +409,6 @@ icmp(#icmp{type = Type, code = Code, checksum = Checksum, un = Un}) ->
%%
%% Utility functions
%%
-payload(Payload) ->
- [ to_ascii(C) || <<C:8>> <= Payload ].
-
% TCP pseudoheader checksum
checksum([#ipv4{
@@ -485,17 +477,3 @@ compl(N,S) -> compl(N+S).
valid(16#FFFF) -> true;
valid(_) -> false.
-to_ascii(C) when ?is_print(C) -> C;
-to_ascii(_) -> $..
-
-ether_addr(B) when is_binary(B) ->
- ether_addr(binary_to_list(B));
-ether_addr(L) when is_list(L) ->
- [ hd(io_lib:format("~.16B", [N])) || N <- L ].
-
-tcp_flags(#tcp{cwr = CWR, ece = ECE, urg = URG, ack = ACK,
- psh = PSH, rst = RST, syn = SYN, fin = FIN}) ->
- [ atom_to_list(F) || {F,V} <-
- [{cwr,CWR}, {ece,ECE}, {urg,URG}, {ack,ACK}, {psh,PSH}, {rst,RST}, {syn,SYN}, {fin,FIN}], V =:= 1 ].
-
-
Please sign in to comment.
Something went wrong with that request. Please try again.