hans-2.4.0.0: IPv4 Network Stack

Safe HaskellNone
LanguageHaskell98

Hans.Layer.IP4.Routing

Contents

Synopsis

Routing Rules

data Rule mask addr Source

Constructors

Direct mask addr Mtu 
Indirect mask addr 

Instances

(Show mask, Show addr) => Show (Rule mask addr) 

type Mtu = Int Source

Routing Table

type RoutingTable addr = PrefixTree (Dest addr) Source

addRule :: Mask mask addr => Rule mask addr -> RoutingTable addr -> RoutingTable addr Source

Add a rule to the routing table.

route :: Address addr => addr -> RoutingTable addr -> Maybe (addr, addr, Mtu) Source

Discover the source and destination when trying to route an address.

localAddrs :: Address addr => RoutingTable addr -> [addr] Source

Dump all local addresses.

sourceMask :: Mask mask addr => addr -> RoutingTable addr -> Maybe mask Source

Find the mask that would be used to route an address.