netcore-1.0.0: The NetCore compiler and runtime system for OpenFlow networks.

Safe HaskellSafe-Infered

Frenetic.NetCore.Short

Contents

Synopsis

Shorthand constructors

Predicates

inport :: Switch -> Port -> PredicateSource

Construct the predicate matching packets on this switch and port

(<||>) :: Predicate -> Predicate -> PredicateSource

Abbreviation for predicate union.

(<&&>) :: Predicate -> Predicate -> PredicateSource

Abbreviation for predicate intersection.

matchAll :: PredicateSource

Matches all packets.

matchNone :: PredicateSource

Matches no packets.

neg :: Predicate -> PredicateSource

Abbreviation for predicate negation.

prSubtract :: Predicate -> Predicate -> PredicateSource

Construct the set difference between p1 and p2

prOr :: [Predicate] -> PredicateSource

Construct nary union of a list of predicates

prAnd :: [Predicate] -> PredicateSource

Construct nary intersection of a list of predicates

Actions

allPortsSource

Arguments

:: 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.

forward :: [Port] -> ActionSource

Forward the packet out of the specified physical ports.

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

onSwitch :: Switch -> PredicateSource

Match switch identifier.

dlSrc :: Word48 -> PredicateSource

Match ethernet source address.

dlDst :: Word48 -> PredicateSource

Match ethernet destination address.

dlTyp :: Word16 -> PredicateSource

Match ethernet type code (e.g., 0x0800 for IP packets).

dlVlan :: Word16 -> PredicateSource

Match VLAN tag.

dlNoVlan :: PredicateSource

Match Vlan untagged

dlVlanPcp :: Word8 -> PredicateSource

Match VLAN priority

nwSrc :: Word32 -> PredicateSource

Match source IP address.

This is only meaningful in combination with 'dlTyp 0x0800'.

nwDst :: Word32 -> PredicateSource

Match destination IP address.

nwSrcPrefix :: Word32 -> Int -> PredicateSource

Match a prefix of the source IP address.

nwDstPrefix :: Word32 -> Int -> PredicateSource

Match a prefix of the destination IP address.

nwProto :: Word8 -> PredicateSource

Match IP protocol code (e.g., 0x6 indicates TCP segments).

nwTos :: Word8 -> PredicateSource

Match IP TOS field.

tpSrc :: Word16 -> PredicateSource

Match IP source port.

tpDst :: Word16 -> PredicateSource

Match IP destination port.

inPort :: Port -> PredicateSource

Match the ingress port on which packets arrive.

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.