nettle-openflow-0.2.0: OpenFlow protocol messages, binary formats, and servers.



This module provides methods to connect to an OpenFlow control server, and send and receive messages to the server.



data ClientHandle Source

Abstract type representing the state of the connection to the control server.

connectToController :: HostName -> PortID -> IO ClientHandleSource

Established a connection to the control server with the given HostName and PortID and returns its ClientHandle.

connectToHandles :: Handle -> Handle -> IO ClientHandleSource

Creates a ClientHandle based on a handle to read from and one to write to.

closeClient :: ClientHandle -> IO ()Source

Close client, closing read and write handles.

receiveControlMessage :: ClientHandle -> IO (Maybe (TransactionID, CSMessage))Source

Blocks until a new control message arrives or the connection is terminated, in which the return value is Nothing.

sendMessage :: ClientHandle -> (TransactionID, SCMessage) -> IO ()Source

Sends a message to the controller.