Skip to content

Commit

Permalink
Merge branch 'master' of github.com:msantos/epcap
Browse files Browse the repository at this point in the history
  • Loading branch information
msantos committed Mar 13, 2012
2 parents 9464fa2 + b4fc16d commit 7215526
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 20 deletions.
1 change: 0 additions & 1 deletion c_src/epcap.c
Expand Up @@ -210,7 +210,6 @@ epcap_loop(EPCAP_STATE *ep)
switch (pcap_next_ex(p, &hdr, &pkt)) {
case 0: /* timeout */
VERBOSE(1, "timeout reading packet");
epcap_ctrl("timeout");
break;
case 1: /* got packet */
epcap_response(hdr, pkt, datalink);
Expand Down
6 changes: 5 additions & 1 deletion c_src/epcap.h
Expand Up @@ -48,7 +48,11 @@

#define SNAPLEN 65535
#define PROMISC 1 /* true */
#define TIMEOUT 0 /* ms, 0 = block indefinitely */

/* On Linux, 0 will block until the next packet is received.
* On BSD, 0 will block until the snaplen buffer is full.
*/
#define TIMEOUT 500 /* ms, 0 = block indefinitely */

#define EPCAP_FILTER "tcp and port 80"

Expand Down
16 changes: 0 additions & 16 deletions ebin/epcap.app

This file was deleted.

3 changes: 3 additions & 0 deletions src/epcap.app.src
@@ -0,0 +1,3 @@
{application, epcap,
[{description, "libpcap port"},
{vsn, "0.05"}]}.
5 changes: 3 additions & 2 deletions src/epcap.erl
@@ -1,4 +1,4 @@
%% Copyright (c) 2009-2010, Michael Santos <michael.santos@gmail.com>
%% Copyright (c) 2009-2011, Michael Santos <michael.santos@gmail.com>
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -124,6 +124,7 @@ make_args(PL) ->
user,
snaplen,
timeout,
verbose,

filter
], proplists:lookup(Arg, PL) /= none ],
Expand All @@ -138,7 +139,7 @@ get_switch({promiscuous, true}) -> "-P";
get_switch({snaplen, Arg}) -> "-s " ++ integer_to_list(Arg);
get_switch({timeout, Arg}) -> "-t " ++ integer_to_list(Arg);
get_switch({user, Arg}) -> "-u " ++ Arg;
get_switch({verbose, _Arg}) -> "-v";
get_switch({verbose, Arg}) -> string:copies("-v ", Arg);
get_switch({filter, Arg}) -> "\"" ++ Arg ++ "\"".

progname() ->
Expand Down

0 comments on commit 7215526

Please sign in to comment.