This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(apscan). | |
-include("include/wierl_frame.hrl"). | |
-export([start/0, start/3]). | |
start() -> | |
start(<<"wlan0">>, 1, 11). | |
start(Ifname, Min, Max) when is_binary(Ifname), Min =< Max, Min > 0, Max < 12 -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(vpwn). | |
-export([start/3]). | |
start(Node, SrcIP, DstIP) -> | |
Pid = peer(Node, SrcIP, DstIP), | |
{ok, Dev} = tuncer:create(), | |
ok = tuncer:up(Dev, SrcIP), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(dump). | |
-export([start/0,start/2]). | |
start() -> | |
start("en1", []). | |
start(Dev, Filter) when is_list(Dev), is_list(Filter) -> | |
{ok, Socket, Length} = bpf:open(Dev), | |
filter(Socket, Length, Filter). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(filt). | |
-include("bpf.hrl"). | |
-export([ | |
rarp/0, | |
ip/0, | |
finger/0, | |
ip/1, | |
tcp/2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(annoy). | |
-export([er/3, arp/2]). | |
-include("pkt.hrl"). | |
-include("bpf.hrl"). | |
-record(state, { | |
arp, | |
fd, | |
len = 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <err.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(wierl). | |
-export([start/1]). | |
-define(UINT16, 2/native-unsigned-integer-unit:8). | |
-define(UINT32, 4/native-unsigned-integer-unit:8). | |
-define(UINT64, 8/native-unsigned-integer-unit:8). | |
-define(IFNAMSIZ, 16). | |
-define(SIOCSIWSCAN, 16#8B18). % Trigger a scan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(mem). | |
-export([ | |
alloc/1, | |
free/1 | |
]). | |
-on_load(on_load/0). | |
on_load() -> | |
erlang:load_nif("./mem", []). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* gcc -fPIC -shared -o mem.so mem.c -I /usr/local/lib/erlang/usr/include */ | |
#include <stdio.h> | |
#include <string.h> | |
#include "erl_nif.h" | |
static ERL_NIF_TERM atom_ok; | |
static ERL_NIF_TERM atom_error; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(unix_stream). | |
-export([client/1, server/0]). | |
-define(PF_LOCAL, 1). | |
-define(SOCK_STREAM, 1). | |
-define(UNIX_PATH_MAX, 108). | |
-define(BACKLOG, 5). | |
-define(PATH, <<"/tmp/unix_stream.sock">>). |