Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
rofl::crofconn Class Reference

A single OpenFlow control connection. More...

#include <crofconn.h>

Public Types

enum  crofconn_flavour_t { FLAVOUR_UNSPECIFIED = 0, FLAVOUR_CTL = 1, FLAVOUR_DPT = 2 }
 

Public Member Functions

 crofconn (crofconn_env *env, const rofl::openflow::cofhello_elem_versionbitmap &versionbitmap)
 
enum crofconn_flavour_t get_flavour () const
 
void accept (enum rofl::csocket::socket_type_t socket_type, const cparams &socket_params, int newsd, enum crofconn_flavour_t flavour)
 
void connect (const cauxid &aux_id, enum rofl::csocket::socket_type_t socket_type, const cparams &socket_params)
 Instruct crofsock instance to connect to peer using specified parameters.
 
void reconnect (bool reset_backoff_timer=false)
 Instruct crofsock instance to reconnect to previously connected peer.
 
void close ()
 Instruct crofsock instance to close connection to peer.
 
bool is_established () const
 Returns whether this connection is established.
 
bool is_actively_established () const
 Returns true when this connection has been actively established.
 
bool is_congested () const
 Returns true, when the underlying TCP connection is congested.
 
rofl::openflow::cofhello_elem_versionbitmapget_versionbitmap ()
 Returns a reference to the versionbitmap announced by this entity.
 
rofl::openflow::cofhello_elem_versionbitmapget_versionbitmap_peer ()
 Returns a reference to the versionbitmap seen from the peer.
 
uint8_t get_version () const
 Returns the negotiated OFP version (or OFP_UNKNOWN)
 
uint64_t get_dpid () const
 Returns data path id assigned to this connection.
 
cauxid const & get_aux_id () const
 Return auxialiary_id.
 
crofsock const & get_rofsocket () const
 
unsigned int send_message (rofl::openflow::cofmsg *msg)
 Send OFP message via socket.
 
void set_env (crofconn_env *env)
 
void set_max_backoff (const ctimespec &timespec)
 
std::string str () const
 
- Public Member Functions inherited from rofl::ciosrv
 ciosrv (pthread_t tid=0)
 Initializes all structures for this ciosrv object.
 
virtual ~ciosrv ()
 Deallocates resources for this ciosrv object.
 
 ciosrv (const ciosrv &iosrv)
 Initializes all structures for this ciosrv object.
 
ciosrvoperator= (const ciosrv &iosrv)
 
void notify (const cevent &event)
 Sends a notification to this ciosrv instance. More...
 
pthread_t get_thread_id () const
 Returns thread-id of local thread. More...
 

Public Attributes

unsigned int hello_timeout
 
unsigned int echo_timeout
 
unsigned int echo_interval
 

Protected Member Functions

virtual void init_thread ()
 
virtual void release_thread ()
 
- Protected Member Functions inherited from rofl::ciosrv
ctimer get_next_timer ()
 
virtual void handle_revent (int fd)
 Handler for read events on file descriptors. More...
 
virtual void handle_wevent (int fd)
 Handler for write events on file descriptors. More...
 
virtual void handle_xevent (int fd)
 Handler for exceptions on file descriptors. More...
 
void register_filedesc_r (int fd)
 Registers a file descriptor for read events. More...
 
void deregister_filedesc_r (int fd)
 Deregisters a file descriptor from read events. More...
 
void register_filedesc_w (int fd)
 Registers a file descriptor for write events. More...
 
void deregister_filedesc_w (int fd)
 Deregisters a file descriptor from write events. More...
 
const rofl::ctimeridregister_timer (int opaque, const rofl::ctimespec &timespec)
 Installs a new timer to fire in t seconds. More...
 
const rofl::ctimeridreset_timer (const rofl::ctimerid &timer_id, const rofl::ctimespec &timespec)
 Resets a running timer of type opaque. More...
 
ctimeridrestart_timer (rofl::ctimerid &timer_id, int opaque, const rofl::ctimespec &timespec)
 Resets an existing or creates a new timer. More...
 
bool pending_timer (const rofl::ctimerid &timer_id)
 Checks for a pending timer of type opaque. More...
 
void cancel_timer (const rofl::ctimerid &timer_id)
 Cancels a pending timer. More...
 
void cancel_all_timers ()
 Cancels all pending timers of this instance.
 
void cancel_all_events ()
 Cancels all pending events of this instance.
 
- Protected Member Functions inherited from rofl::common::cthread
bool is_running () const
 
void set_thread_id (pthread_t tid)
 
pthread_t get_thread_id () const
 
void set_result (int result)
 
const int & get_result () const
 
void start (const pthread_attr_t *attr=(const pthread_attr_t *) 0)
 
void stop ()
 

Friends

std::ostream & operator<< (std::ostream &os, const crofconn &conn)
 

Additional Inherited Members

- Protected Attributes inherited from rofl::common::cthread
std::bitset< 32 > flags
 
pthread_t tid
 
int result
 

Detailed Description

A single OpenFlow control connection.

Inheritance diagram for rofl::crofconn:
rofl::crofsock_env rofl::ciosrv rofl::common::cthread rofl::ctimer_env

Constructor & Destructor Documentation

crofconn::crofconn ( crofconn_env env,
const rofl::openflow::cofhello_elem_versionbitmap versionbitmap 
)

controller mode


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