libfluid
The ONF OpenFlow driver
Public Member Functions | List of all members
fluid_base::OFHandler Class Referenceabstract

#include <OFConnection.hh>

Inheritance diagram for fluid_base::OFHandler:
fluid_base::OFServer

Public Member Functions

virtual void connection_callback (OFConnection *conn, OFConnection::Event event_type)=0
 
virtual void message_callback (OFConnection *conn, uint8_t type, void *data, size_t len)=0
 
virtual void free_data (void *data)=0
 

Detailed Description

OFHandler is an abstract class. Its methods must be implemented by classes that deal with OFConnection events (usually classes that manage one or more OFConnection objects).

Member Function Documentation

virtual void fluid_base::OFHandler::connection_callback ( OFConnection conn,
OFConnection::Event  event_type 
)
pure virtual

Callback for connection events.

This method blocks the event loop on which the connection is running, preventing other connection's events from being handled. If you want to perform a very long operation, try to queue it and return.

The implementation must be thread-safe, because it will possibly be called from several threads (on which connection events are being created).

Parameters
connthe OFConnection on which the message was received
event_typethe event type (see #Event)

Implemented in fluid_base::OFServer.

virtual void fluid_base::OFHandler::message_callback ( OFConnection conn,
uint8_t  type,
void *  data,
size_t  len 
)
pure virtual

Callback for new messages.

This method blocks the event loop on which the connection is running, preventing other connection's events from being handled. If you want to perform a very long operation, try to queue it and return.

The implementation must be thread-safe, because it will possibly be called from several threads (on which message events are being created).

By default, the message data will managed (freed) for you. If you want a zero-copy behavior, see OFServerSettings::keep_data_ownership.

Parameters
connthe OFConnection on which the message was received
typeOpenFlow message type
databinary message data
lenmessage length

Implemented in fluid_base::OFServer.

virtual void fluid_base::OFHandler::free_data ( void *  data)
pure virtual

Free the data passed to OFHandler::message_callback.

Implemented in fluid_base::OFServer.


The documentation for this class was generated from the following file: