Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Switch to pkt from epcap_net

  • Loading branch information...
commit 27a7fccc1a9478cc981a870c33e36dff37ed2da1 1 parent dd6738f
@msantos authored
Showing with 10 additions and 10 deletions.
  1. +2 −2 rebar.config
  2. +2 −2 src/snuff.erl
  3. +6 −6 src/spoof.erl
View
4 rebar.config
@@ -1,5 +1,5 @@
{deps, [
{procket, ".*", {git, "git://github.com/msantos/procket.git", "master"}},
- {epcap, ".*", {git, "git://github.com/msantos/epcap.git", "master"}}
+ {pkt, ".*", {git, "git://github.com/msantos/pkt.git", "master"}}
]}.
-{erl_opts, [{i, "deps/epcap/include"}]}.
+{erl_opts, [{i, "deps/pkt/include"}]}.
View
4 src/snuff.erl
@@ -32,7 +32,7 @@
-module(snuff).
-export([service/2]).
--include("epcap_net.hrl").
+-include("pkt.hrl").
service(Dev, NS) ->
@@ -47,7 +47,7 @@ loop(Socket, NS) ->
timer:sleep(10),
loop(Socket, NS);
{ok, Data} ->
- P = epcap_net:decapsulate(Data),
+ P = pkt:decapsulate(Data),
filter(NS, P),
loop(Socket, NS);
Error ->
View
12 src/spoof.erl
@@ -31,7 +31,7 @@
-module(spoof).
-behaviour(gen_server).
--include("epcap_net.hrl").
+-include("pkt.hrl").
-define(SERVER, ?MODULE).
-export([start_link/3, send/2, source/1]).
@@ -153,12 +153,12 @@ dns_query(SourcePort, Data, #state{
ulen = UDPlen
},
- IPsum = epcap_net:makesum(IP),
- UDPsum = epcap_net:makesum([IP, UDP, Data]),
+ IPsum = pkt:makesum(IP),
+ UDPsum = pkt:makesum([IP, UDP, Data]),
- <<(epcap_net:ether(Ether))/bits,
- (epcap_net:ipv4(IP#ipv4{sum = IPsum}))/bits,
- (epcap_net:udp(UDP#udp{sum = UDPsum}))/bits,
+ <<(pkt:ether(Ether))/bits,
+ (pkt:ipv4(IP#ipv4{sum = IPsum}))/bits,
+ (pkt:udp(UDP#udp{sum = UDPsum}))/bits,
Data/bits>>.
%%
Please sign in to comment.
Something went wrong with that request. Please try again.