hans-3.0.2: Network Stack

Safe HaskellNone
LanguageHaskell2010

Hans.Network

Synopsis

Documentation

class NetworkAddr addr => Network addr where Source #

Interaction with routing and message delivery for a network layer.

Minimal complete definition

pseudoHeader, lookupRoute, sendDatagram'

Methods

pseudoHeader :: addr -> addr -> NetworkProtocol -> Int -> PartialChecksum Source #

Calculate the pseudo-header for checksumming a packet at this layer of the network.

lookupRoute :: HasNetworkStack ns => ns -> addr -> IO (Maybe (RouteInfo addr)) Source #

Lookup a route to reach this destination address.

sendDatagram' :: HasNetworkStack ns => ns -> Device -> addr -> addr -> addr -> Bool -> NetworkProtocol -> ByteString -> IO () Source #

Send a single datagram to a destination.

sendDatagram :: (HasNetworkStack ns, Network addr) => ns -> RouteInfo addr -> addr -> Bool -> NetworkProtocol -> ByteString -> IO () Source #

routeDatagram :: (HasNetworkStack ns, Network addr) => ns -> addr -> Bool -> NetworkProtocol -> ByteString -> IO Bool Source #

Send a datagram and lookup routing information at the same time. Returns False if no route to the destination was known.

findNextHop Source #

Arguments

:: (HasNetworkStack ns, Network addr) 
=> ns 
-> Maybe Device

Desired output device

-> Maybe addr

Desired source address

-> addr

Destination

-> IO (Maybe (RouteInfo addr))