Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Be polite and namespace the modules

  • Loading branch information...
commit d61889d398ffdfe9d4c149e180a38122873dc371 1 parent 1444451
@msantos authored
View
8 src/snuff.erl
@@ -1,4 +1,4 @@
-%% Copyright (c) 2010, Michael Santos <michael.santos@gmail.com>
+%% Copyright (c) 2010-2012, Michael Santos <michael.santos@gmail.com>
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
@@ -28,11 +28,10 @@
%% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
%% ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
%% POSSIBILITY OF SUCH DAMAGE.
-
-module(snuff).
-export([service/2]).
--include("pkt.hrl").
+-include_lib("pkt/include/pkt.hrl").
service(Dev, NS) ->
@@ -67,8 +66,7 @@ filter(NS, [
},
Payload
]) when Len > 0, Len < 512 ->
- dns:send(Port, Payload),
+ spood_dns:send(Port, Payload),
spoof:source(IP);
filter(_,_) ->
ok.
-
View
6 src/spood.erl
@@ -1,4 +1,4 @@
-%% Copyright (c) 2010, Michael Santos <michael.santos@gmail.com>
+%% Copyright (c) 2010-2012, Michael Santos <michael.santos@gmail.com>
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
@@ -28,7 +28,6 @@
%% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
%% ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
%% POSSIBILITY OF SUCH DAMAGE.
-
-module(spood).
-export([start/0,start/1]).
-export([nameserver/0, macaddr/1]).
@@ -46,7 +45,7 @@ start(Options) ->
Dmac = proplists:get_value(dstmac, Options, macaddr({server, Daddr})),
spoof:start_link(Dev, {Smac,Saddr}, {Dmac, Daddr}),
- dns:start_link(),
+ spood_dns:start_link(),
spawn(snuff, service, [Dev, Daddr]).
nameserver() ->
@@ -64,4 +63,3 @@ macaddr({server, IPAddr}) ->
ok = gen_udp:close(Socket),
packet:arplookup(IPAddr).
-
View
6 src/dns.erl → src/spood_dns.erl
@@ -1,4 +1,4 @@
-%% Copyright (c) 2010, Michael Santos <michael.santos@gmail.com>
+%% Copyright (c) 2010-2012, Michael Santos <michael.santos@gmail.com>
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
@@ -28,7 +28,7 @@
%% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
%% ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
%% POSSIBILITY OF SUCH DAMAGE.
--module(dns).
+-module(spood_dns).
-behaviour(gen_server).
-include_lib("kernel/src/inet_dns.hrl").
@@ -97,5 +97,3 @@ terminate(_Reason, _State) ->
ok.
code_change(_OldVsn, State, _Extra) ->
{ok, State}.
-
-
View
6 src/spoof.erl
@@ -1,4 +1,4 @@
-%% Copyright (c) 2010, Michael Santos <michael.santos@gmail.com>
+%% Copyright (c) 2010-2012, Michael Santos <michael.santos@gmail.com>
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
@@ -31,7 +31,7 @@
-module(spoof).
-behaviour(gen_server).
--include("pkt.hrl").
+-include_lib("pkt/include/pkt.hrl").
-define(SERVER, ?MODULE).
-export([start_link/3, send/2, source/1]).
@@ -182,5 +182,3 @@ strategy({list, IPList}) when is_list(IPList) ->
strategy({learn , IPList}) when is_list(IPList) ->
error_logger:info_report([{discovered, IPList}]),
lists:nth(crypto:rand_uniform(1, length(IPList)+1), IPList).
-
-
Please sign in to comment.
Something went wrong with that request. Please try again.