hans-pcap: PCAP driver for HaNS

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

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]

Properties

Versions 0.1.0.0, 0.1.0.0, 0.1.0.1, 0.1.0.2
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:15:53Z

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


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.