### Build and Install libfluid_base Source: https://github.com/opennetworkingfoundation/libfluid_base/blob/master/doc/Intro.md These commands compile and install the libfluid_base library. The `configure` script prepares the build system, `make` compiles the source, and `sudo make install` installs the compiled binaries and headers system-wide. TLS support can be optionally disabled during configuration. ```sh ./configure make sudo make install ``` -------------------------------- ### Install libfluid_base Dependencies on Ubuntu Source: https://github.com/opennetworkingfoundation/libfluid_base/blob/master/doc/Intro.md This snippet provides commands to install the necessary build tools and library dependencies (libevent, OpenSSL) for libfluid_base on Ubuntu 12.04. These packages are required before compiling the library. ```sh sudo apt-get install autoconf libtool build-essential pkg-config sudo apt-get install libevent-dev libssl-dev ``` -------------------------------- ### Install libfluid_base Dependencies on Fedora Source: https://github.com/opennetworkingfoundation/libfluid_base/blob/master/doc/Intro.md This snippet provides commands to install the necessary build tools and library dependencies (libevent, OpenSSL) for libfluid_base on Fedora 19. These packages are required before compiling the library. ```sh sudo yum install autoconf automake gcc-g++ libtool sudo yum install libevent-devel openssl-devel ``` -------------------------------- ### Configure libfluid_base Library Path Source: https://github.com/opennetworkingfoundation/libfluid_base/blob/master/doc/Intro.md This snippet adds `/usr/local/lib` to the system's dynamic linker search path, ensuring that applications can find the installed libfluid_base libraries. `ldconfig` updates the linker cache. This step can be skipped if the library is installed directly to `/usr/lib`. ```sh sudo sh -c "echo /usr/local/lib > /etc/ld.so.conf.d/libfluid.conf" sudo ldconfig ``` -------------------------------- ### libfluid_base OFServer Class and Callback API Source: https://github.com/opennetworkingfoundation/libfluid_base/blob/master/doc/Intro.md Documentation for the `fluid_base::OFServer` class, which forms the core of a libfluid_base controller, and its essential callback methods. It details how to configure the server with port, worker count, and optional TLS, and how to handle connection events and messages. ```APIDOC fluid_base::OFServer: __init__(port: int, workers: int, tls_enabled: bool = False, settings: fluid_base::OFServerSettings = None) - Description: Initializes the OFServer instance. - Parameters: - port (int): The port number for the server to listen on. - workers (int): The number of worker threads to use for handling connections. - tls_enabled (bool, optional): Enable or disable TLS support. Defaults to False. - settings (fluid_base::OFServerSettings, optional): Configuration parameters for OpenFlow features. - Behavior: - Each worker runs in its own thread and handles a certain number of connections in a round-robin fashion. - Connections are typically presented as fluid_base::OFConnection objects in callbacks. Callbacks to implement: - message_callback(connection: fluid_base::OFConnection, message: OpenFlowMessage): - Description: Called when a new OpenFlow message arrives from a connected switch. - Parameters: - connection (fluid_base::OFConnection): The connection object from which the message was received. - message (OpenFlowMessage): The received OpenFlow message. - Constraints: Must be thread-safe and return as quickly as possible to avoid starving other connections. - Recommendation: Process events asynchronously (e.g., by queuing them). - connection_callback(connection: fluid_base::OFConnection, event_type: ConnectionEventType): - Description: Called when a connection event occurs (e.g., establishment, disconnection). - Parameters: - connection (fluid_base::OFConnection): The connection object involved in the event. - event_type (ConnectionEventType): The type of connection event (e.g., CONNECTED, DISCONNECTED). - Constraints: Must be thread-safe and return as quickly as possible. - Recommendation: Process events asynchronously. ``` -------------------------------- ### Include libfluid_base OFServer Header in C++ Source: https://github.com/opennetworkingfoundation/libfluid_base/blob/master/doc/Intro.md This C++ include statement is required to use the `fluid_base::OFServer` class, which is the base class for building OpenFlow controllers with libfluid_base. It provides access to the core server functionalities. ```cc #include ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.