tuntap-0.0.2: Interface to TUN/TAP drivers.




start :: IO TAPSource

Allocate a TAP resource

finish :: TAP -> IO CIntSource

Deallocate a TAP resource

openTAP :: TAP -> String -> IO CIntSource

Open the TAP device

closeTAP :: TAP -> IO CIntSource

Close the TAP device

bringUp :: TAP -> IO CIntSource

Bring up the TAP device

setMTU :: TAP -> Int -> IO CIntSource

Set the MTU of the TAP device

setIP :: TAP -> Word32 -> IO CIntSource

Set the IPv4 address of the TAP device

setMask :: TAP -> Word32 -> IO CIntSource

Set the network mask of the TAP device

getMAC :: TAP -> IO DevMACSource

Get the MAC address assigned to the TAP device

data TAP Source


type Packet = ByteStringSource

ReadWritten to the TUNTAP device.

type DevMAC = [Word8]Source

A DevMAC is a hardware address 48 bits long.

readTAP :: TAP -> IO PacketSource

Read a packet from the TAP device

writeTAP :: TAP -> Packet -> IO CIntSource

Write a packet to the TAP device

withTAP :: Int -> (TAP -> IO a) -> IO ()Source

Accept an action and an MTU. Allocate a TAP and pass it to the action. Clean up when finished with the action.