Safe Haskell | Safe-Infered |
---|
- inport :: Switch -> Port -> Predicate
- (<||>) :: Predicate -> Predicate -> Predicate
- (<&&>) :: Predicate -> Predicate -> Predicate
- matchAll :: Predicate
- matchNone :: Predicate
- neg :: Predicate -> Predicate
- prSubtract :: Predicate -> Predicate -> Predicate
- prOr :: [Predicate] -> Predicate
- prAnd :: [Predicate] -> Predicate
- dropPkt :: Action
- allPorts :: Modification -> Action
- forward :: [Port] -> Action
- modify :: [(Port, Modification)] -> Action
- (==>) :: Predicate -> Action -> Policy
- (<%>) :: Policy -> Predicate -> Policy
- (<+>) :: Monoid a => a -> a -> a
- onSwitch :: Switch -> Predicate
- dlSrc :: Word48 -> Predicate
- dlDst :: Word48 -> Predicate
- dlTyp :: Word16 -> Predicate
- dlVlan :: Word16 -> Predicate
- dlNoVlan :: Predicate
- dlVlanPcp :: Word8 -> Predicate
- nwSrc :: Word32 -> Predicate
- nwDst :: Word32 -> Predicate
- nwSrcPrefix :: Word32 -> Int -> Predicate
- nwDstPrefix :: Word32 -> Int -> Predicate
- nwProto :: Word8 -> Predicate
- nwTos :: Word8 -> Predicate
- tpSrc :: Word16 -> Predicate
- tpDst :: Word16 -> Predicate
- inPort :: Port -> Predicate
- data Modification = Modification {}
- unmodified :: Modification
- modDlSrc :: Word48 -> Modification
- modDlDst :: Word48 -> Modification
- modDlVlan :: Maybe Vlan -> Modification
- modDlVlanPcp :: Word8 -> Modification
- modNwSrc :: Word32 -> Modification
- modNwDst :: Word32 -> Modification
- modNwTos :: Word8 -> Modification
- modTpSrc :: Word16 -> Modification
- modTpDst :: Word16 -> Modification
Shorthand constructors
Predicates
inport :: Switch -> Port -> PredicateSource
Construct the predicate matching packets on this switch and port
prSubtract :: Predicate -> Predicate -> PredicateSource
Construct the set difference between p1 and p2
Actions
:: Modification | modifications to apply to the packet. Use 'allPorts unmodified' to make no modifications. |
-> Action |
Forward the packet out of all physical ports, except the packet's ingress port.
modify :: [(Port, Modification)] -> ActionSource
Forward the packet out of the specified physical ports with modifications.
Each port has its own record of modifications, so modifications at one port do not interfere with modifications at another port.
Policies
(==>) :: Predicate -> Action -> PolicySource
Abbreviation for constructing a basic policy from a predicate and an action.
(<%>) :: Policy -> Predicate -> PolicySource
Restrict a policy to act over packets matching the predicate.
(<+>) :: Monoid a => a -> a -> aSource
Join: overloaded to find the union of policies and the join of actions.
Exact match predicate constructors
nwSrc :: Word32 -> PredicateSource
Match source IP address.
This is only meaningful in combination with 'dlTyp 0x0800'.
nwSrcPrefix :: Word32 -> Int -> PredicateSource
Match a prefix of the source IP address.
nwDstPrefix :: Word32 -> Int -> PredicateSource
Match a prefix of the destination IP address.
Packet modifications
data Modification Source
For each fields with a value Just v, modify that field to be v. If the field is Nothing then there is no modification of that field.
Modification | |
|
modDlSrc :: Word48 -> ModificationSource
modDlDst :: Word48 -> ModificationSource
modDlVlan :: Maybe Vlan -> ModificationSource
modNwSrc :: Word32 -> ModificationSource
modNwDst :: Word32 -> ModificationSource
modNwTos :: Word8 -> ModificationSource
modTpSrc :: Word16 -> ModificationSource
modTpDst :: Word16 -> ModificationSource