Nettle.FRPControl.NettleSF
Description
Nettle signal functions and drivers. These drivers take care of low level details, such as message numbering, correlation of stats requests and replies, translation of higher level flow rules expressed using packet predicates to low level flow rules expressed in terms of matches.
- runNettleSF :: SF (Event (SwitchID, SwitchMessage), i) (Event SwitchCommand, o) -> SF (Event SwitchMessage, i) (SwitchOutput, o)
- simpleNettleDriver :: ServerPortNumber -> SF (Event (SwitchID, SwitchMessage)) (Event SwitchCommand, Event String) -> IO ()
- data SwitchMessage
- arrivalE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, SwitchFeatures)
- departureE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, IOException)
- featureUpdateE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, SwitchFeatures)
- portUpdateE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, PortStatus)
- switchErrorE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, SwitchError)
- packetInE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, PacketInfo)
- filteredPacketInE :: PacketPredicate -> Event (SwitchID, SwitchMessage) -> Event (SwitchID, PacketInfo)
- flowRemovedE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, FlowRemoved)
- portStatReplyE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, [(PortID, PortStats)])
- flowStatReplyE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, [FlowStats])
- data SwitchCommand
- sendPacket :: SwitchID -> PacketOut -> SwitchCommand
- modifyFlowTable :: SwitchID -> FlowMod -> SwitchCommand
- deleteFlowRules :: SwitchID -> PacketPredicate -> SwitchCommand
- clearTables :: SwitchID -> SwitchCommand
- configurePort :: SwitchID -> PortMod -> SwitchCommand
- requestStats :: SwitchID -> StatsRequest -> SwitchCommand
- requestFeatures :: SwitchID -> SwitchCommand
- type FlowRule = (PacketPredicate, ActionSequence, TimeOut, TimeOut)
- type PrioritizedFlowRule = (Priority, FlowRule)
- addFlowRule :: PrioritizedFlowRule -> SwitchID -> SwitchCommand
- addFlowRule' :: PrioritizedFlowRule -> BufferID -> SwitchID -> SwitchCommand
- addFlowRules :: [(Priority, (PacketPredicate, ActionSequence, TimeOut, TimeOut))] -> SwitchID -> SwitchCommand
- (<+>) :: Monoid o => o -> o -> o
- noOp :: Monoid o => o
- (==>) :: PacketPredicate -> ActionSequence -> FlowRule
- expiringAfter :: FlowRule -> Word16 -> FlowRule
- expiringAfterInactive :: FlowRule -> Word16 -> FlowRule
- withPriority :: FlowRule -> Priority -> PrioritizedFlowRule
- module Nettle.FRPControl.AFRP
- module Nettle.FRPControl.PacketPredicate
- module Nettle.Ethernet.EthernetAddress
- module Data.Monoid
Nettle Signal Functions
runNettleSF :: SF (Event (SwitchID, SwitchMessage), i) (Event SwitchCommand, o) -> SF (Event SwitchMessage, i) (SwitchOutput, o)Source
Runs a signal function carrying messages and commands as defined in this module,
converting it into a signal function in terms of basic switch messages and switch output,
which can be run using the switch driver provided in SwitchInterface
.
simpleNettleDriver :: ServerPortNumber -> SF (Event (SwitchID, SwitchMessage)) (Event SwitchCommand, Event String) -> IO ()Source
Runs a signal function with a single input stream of switch messages and two output streams, one for switch commands and one for messages to the standard output device; starts a switch server at the specified port.
Switch event sources
data SwitchMessage Source
Constructors
Instances
arrivalE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, SwitchFeatures)Source
Outputs an event whenever a switch connects with the controller.
The event carries the SwitchID
of the switch.
departureE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, IOException)Source
Outputs an event whenever the switch disconnects from the controller.
The event carries the SwitchID
of the switch and
an IOException
value indicating the reason for the disconnection.
featureUpdateE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, SwitchFeatures)Source
Outputs an event whenever a switch sends a switch features update.
The event carries the SwitchID
of the sending switch and the SwitchFeatures
data.
portUpdateE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, PortStatus)Source
Outputs an event whenever a switch sends a port status update.
The event carries the SwitchID
of the sending switch and the PortStatus
.
switchErrorE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, SwitchError)Source
Outputs an event whenever a switch sends an error message.
The event carries the SwitchID
of the sending switch and the SwitchError
.
packetInE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, PacketInfo)Source
Outputs an event whenever a switch sends a packet in message.
The event carries the SwitchID
of the sending switch and the PacketInfo
.
filteredPacketInE :: PacketPredicate -> Event (SwitchID, SwitchMessage) -> Event (SwitchID, PacketInfo)Source
Packet-in events, filtered by a packet predicate applied to the packet carried by the packet-in event. The output stream will only include Packet-in messages that satisfy the filter criteria.
flowRemovedE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, FlowRemoved)Source
Outputs an event whenever a switch notifies the controller of a flow removal.
portStatReplyE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, [(PortID, PortStats)])Source
Outputs an event whenever a switch sends a port statistics information to the controller. This information may be communicated with several messages; the statistics from several messages related to the same statistics request are aggregated and output in one event from this signal function.
flowStatReplyE :: Event (SwitchID, SwitchMessage) -> Event (SwitchID, [FlowStats])Source
Outputs an event whenever a switch sends a flow statistics information to the controller. This information may be communicated with several messages; the statistics from several messages related to the same statistics request are aggregated and output in one event from this signal function.
Switch commands
sendPacket :: SwitchID -> PacketOut -> SwitchCommandSource
Send a packet
modifyFlowTable :: SwitchID -> FlowMod -> SwitchCommandSource
Modify a flow table
deleteFlowRules :: SwitchID -> PacketPredicate -> SwitchCommandSource
Delete all flow entries whose match conditions fall inside a given packet predicate.
clearTables :: SwitchID -> SwitchCommandSource
Clear the flow table of a switch. clearTables switch = deleteFlowRules switch anyPacket
.
configurePort :: SwitchID -> PortMod -> SwitchCommandSource
Configure a port
requestStats :: SwitchID -> StatsRequest -> SwitchCommandSource
Request statistics
requestFeatures :: SwitchID -> SwitchCommandSource
Request switch features
type FlowRule = (PacketPredicate, ActionSequence, TimeOut, TimeOut)Source
type PrioritizedFlowRule = (Priority, FlowRule)Source
addFlowRules :: [(Priority, (PacketPredicate, ActionSequence, TimeOut, TimeOut))] -> SwitchID -> SwitchCommandSource
Add a collection of flow rules to a switch.
Another name for the unit element of a Monoid, specialized to the HasSwitchCommands class.
(==>) :: PacketPredicate -> ActionSequence -> FlowRuleSource
A synonym for the tupling operator, specialized to packet predicates. Provides suggestive infix syntax useful in writing addFlowRule commands.
expiringAfter :: FlowRule -> Word16 -> FlowRuleSource
module Nettle.FRPControl.AFRP
module Data.Monoid