This file contains 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(hawk_uds). | |
%% API | |
-export([start_link/1, | |
init/1]). | |
-export([accept/1, handle/1]). | |
start_link(File) -> | |
{ok, spawn_link(?MODULE, init, [File])}. |
This file contains 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(xu). | |
-export([start/1,start/4]). | |
-export([connect/5]). | |
-define(RESPONSE_TIMEOUT, 20000). | |
-define(NUM_CLIENTS, 10). | |
-define(DELAY, 1000). | |
-define(NUM_REQUESTS, 100). |
This file contains 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(xecho). | |
-export([listen/0, listen/1]). | |
listen() -> | |
listen(0). | |
listen(Port) -> | |
{ok, S} = gen_tcp:listen(Port, [binary, inet, {reuseaddr,true}, {backlog,1024}]), | |
io:format("Listening on: ~p~n", [inet:port(S)]), | |
accept(S). |
This file contains 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(iecho). | |
-include_lib("procket/include/procket.hrl"). | |
-export([listen/0, listen/1]). | |
%%% | |
%%% Warning: error handling omitted, leaks fd's on error | |
%%% | |
listen() -> |
This file contains 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(xt). | |
-export([start/1,start/4]). | |
-export([connect/5]). | |
-define(RESPONSE_TIMEOUT, 20000). | |
-define(NUM_CLIENTS, 10). | |
-define(DELAY, 1000). | |
-define(NUM_REQUESTS, 100). |
This file contains 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(wastrel). | |
-export([start/5]). | |
start(Node, SrcIP, DstIP, Drop, Delay) -> | |
random:seed(now()), | |
Pid = peer(Node, addr(SrcIP), addr(DstIP), Drop, Delay), | |
{ok, Dev} = tuncer:create("wastrel", [tap, no_pi, {active, true}]), | |
ok = tuncer:up(Dev, SrcIP), | |
proxy(Dev, Pid, Drop, Delay). |
This file contains 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(br). | |
-export([start/0]). | |
% git clone https://github.com/msantos/tunctl | |
% sudo ./start.sh |
This file contains 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(sut). | |
%%% Erlang 6in4 tunnel (RFC 4213) | |
%%% | |
%%% Not RFC compliant yet and probably buggy, but works! | |
%%% | |
%%% * Dependencies: | |
%%% | |
%%% https://github.com/msantos/procket | |
%%% https://github.com/msantos/pkt |
This file contains 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
%% Copyright (c) 2011, Michael Santos <[email protected]> | |
%% All rights reserved. | |
%% | |
%% Redistribution and use in source and binary forms, with or without | |
%% modification, are permitted provided that the following conditions | |
%% are met: | |
%% | |
%% Redistributions of source code must retain the above copyright | |
%% notice, this list of conditions and the following disclaimer. | |
%% |
This file contains 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
/* Copyright (c) 2011, Michael Santos <[email protected]> | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* | |
* Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* |
NewerOlder