hans-pcap: PCAP driver for HaNS

[ bsd3, library, networking ] [ Propose Tags ]
This version is deprecated.

Network ethernet device for HaNS(Currently requires hans-2.4 from the github), which can tap into a real ethernet interface, all using pcap library and preform raw packet reads & writes. This is a very simple. But requires: root - to be able to use PCAP.


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2 (info)
Change log CHANGES
Dependencies base (>=4 && <4.8), bytestring, hans (>=2.4), pcap [details]
License BSD-3-Clause
Author Marcin Tolysz
Maintainer tolysz@gmail.com
Category Network
Home page https://github.com/tolysz/hans-pcap
Source repo head: git clone https://github.com/tolysz/hans-pcap
Uploaded by tolysz at 2014-09-06T01:17:26Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1904 total (8 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for hans-pcap-0.1.0.0

[back to package description]

hans-pcap

Network ethernet device for HaNS hans-2.4, which can tap into a real ethernet interface, all using pcap library and preform raw packet reads & writes. It is using ghc 7.8, thus the high dependencies. This is a very naive implementation, however not much more can be squeezed from PCAP. Top run requires: root - all because we need to use PCAP

example use:

import Hans.NetworkStack
import Hans.Device.Pcap

main :: IO ()
main = do
  ns  <- newNetworkStack
  -- MAC we want to have; make it unique
  let mac = Mac 1 2 3 4 5 6

  -- device we attach to
  dev <- pcapOpen "eth0" 
  addDevice ns mac (pcapSend dev) (pcapReceiveLoop dev)
  deviceUp ns mac

And we can continue using HaNS as normal. See example/gal.hs for a working example.