The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::OpenFlow - Communicate with OpenFlow switches.

VERSION

Version 0.02

SYNOPSIS

This module allows communication with an OpenFlow compliant switch.

use Net::OpenFlow;

<create connection to switch>

my $of = Net::OpenFlow->new(io_socket => $fh);

$of->send($of_message);

my $of_message = $of->recv($xid);

my $of_message_type = $of_message->{'ofp_header'}{'of_type'};

FUNCTIONS

new

This is the constructor for the Net::OpenFlow module.

my $of = Net::OpenFlow->new;

protocol

This function will return an object of type Net::OpenFlow::Protocol so that messages can be constructed.

my $ofp = $of->protocol;

recv

This function will read the OpenFlow message from the file handle and return a decoded representation.

my $of_message = $of->recv($xid);

send

This function will send the message specified by $of_message to the file handle $fh. The file handle must have a send() function for this to work. The IO::Socket family are the most likely use case for this function.

my $of_message = $of->protocol->ofpt_encode(0x01, q{OFPT_HELLO}, 1);

$of->send($of_message);