• Stars
    star
    120
  • Rank 285,538 (Top 6 %)
  • Language
    Erlang
  • License
    Other
  • Created over 14 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Pure Erlang network stack

ENet - A pure-Erlang network stack

ENet is a pure Erlang network stack that can be used to encode and decode a variety of common packet formats.

The project includes a port program that can be used to send and receive ethernet frames via the /dev/tap0 device.

Requirements

Mac OS X
libevent, OS X 10.6.1 (probably compatible with other versions), the tuntaposx driver ( http://tuntaposx.sourceforge.net ) loaded, sudo.
Linux
libevent, the tun module loaded, the tunctl program (usually in the uml-utilities package``), sudo.

Drivers

Mac OS X
The enet_tap port program. Takes a mandatory option -f to specify which tap device to use. (normally "/dev/tap0")
Linux
The enet_tap port program. Takes a mandatory -i argument that specifies which tap device to use. (normally "tap0")

Building the Driver

You'll need to edit the Makefile to set the appropriate CFLAGS and LDFLAGS for your machine and erts (32 or 64 bit build, location of libevent headers and libraries, ...).

Setting up the tap device

Mac OS X

For ease of use, you should probably change the ownership of /dev/tapN to yourself.

Linux

You should create a tap device that you can open as your user. The easiest way to do this is to install the tunctl program (in the uml-utilities package on debian systems), and then create the device:

tunctl -u yourusername -t tap0

Setup sudo

Enet currently uses the ifconfig command to configure the operating system side of the tap device. This is usually a privileged operation, so we need to configure sudo to allow erlang to do this without a password.

Add the following lines to /etc/sudoers:

Cmnd_Alias  ENET = /sbin/ifconfig tap0 *
yourusername ALL=(ALL) NOPASSWD: ENET

Starting Enet

From an erlang shell (erl -boot start_sasl -pa ebin):

1> {ok, Arp} = enet_arp_responder:start(),
   enet_arp_responder:publish(Arp, enet_eth_iface:default_mac(),
                              <<192,168,2,2>>),
   {ok, Eth} = enet_eth_iface:start("tap0", "192.168.2.1/24 up"),
   {ok, Dumper} = enet_if_dump:attach(Eth),
   enet_arp_responder:attach(Arp, Eth).

You should now see decoded traffic in the erlang shell. If you ping the IP address of the erlang interface 192.168.2.2 in the example, you should see ping replies and an arp entry (arp -na):

? (192.168.2.2) at 0:0:0:aa:bb:cc on tap0 ifscope [ethernet]

More Repositories

1

esmtp

Erlang SMTP library
Erlang
75
star
2

erlirc

Erlang IRC client/server framework
Erlang
64
star
3

edump

Erlang Crashdump Analysis Suite
Erlang
58
star
4

eshellcode

Erlang Shellcode snippets
Erlang
46
star
5

tsung

An open source multi-protocol distributed load testing tool
Erlang
32
star
6

errd

Erlang RRDTool library
Erlang
22
star
7

erlmail

A fork of Stuart Jackson's erlmail library with some additions
Erlang
21
star
8

edbi

DEAD PROJECT: Database independent interface for Erlang
Erlang
19
star
9

erms

Catalyst IT Ltd's Erlang SMS Routing and Messaging system
Erlang
19
star
10

ejango

A Django-ish web framework for Erlang
Erlang
18
star
11

erlydtl

Django Template for Erlang
Erlang
16
star
12

teensyr

Teensy 3.1/3.2 LED Blink example in Rust with Zinc
Rust
12
star
13

oserl

Enrique Marcote Peña's SMPP for Erlang (mirrored from sourceforge with minor patches)
10
star
14

egc_examples

Escript - Game Changing Examples
10
star
15

rvre

Robert Virding's Regular Expression library in pure erlang
Erlang
9
star
16

common_lib

Enrique Marcote Peña's Common Library for Erlang (mirrored from sourceforge with minor patches)
8
star
17

webmachine

A git repository of the webmachine codebase - A REST-based system for building web applications.
Erlang
8
star
18

erlang-factory-2012-example

Erlang on Heroku example for Erlang Factory 2012
Erlang
7
star
19

rabbitmq-erlang-client

Erlang distribution based client for RabbitMQ
Erlang
7
star
20

erlaws

Erlang Amazon Web Servicess library
6
star
21

libdnet

Mirror of libdnet from SourceForge's CVS
C
4
star
22

math_example

An example of developing an OTP style gen_server with hot code update
Erlang
4
star
23

catmachine

My first Heroku Erlang app. With httpcats.
Erlang
4
star
24

nemports

My local macports repository (including usually up-to-date erlang ports)
Erlang
4
star
25

ruspirate

Buspirate Crate for Rust
Rust
3
star
26

bitzn

Zinc.rs blink example for the 1bitsy
Rust
3
star
27

plists

Parallel list operations module for Erlang
3
star
28

erl_thrift

The Erlang library extracted from the Thrift project. (Rebarized)
Erlang
3
star
29

ehttp2

An erlang library for HTTP/2.0
Erlang
3
star
30

remplates

Omakase rebar templates :p
Erlang
2
star
31

archaelus.github.com

My Homepage
2
star
32

emak

erl -make only more so
2
star
33

eroku

Heroku Erlang API
Erlang
2
star
34

mskel

Archaelus' idiosyncratic mochiweb project skeleton
Erlang
2
star
35

teensyds

Teensy 3.1/Zinc.rs/Dotstar strip example firmware
Rust
1
star
36

herdverb

Cowboy test app - reflects requests as text/plain responses.
Erlang
1
star
37

gpt

Erlang GUID Partition Table code
Erlang
1
star