NAME
Net::OpenFlow - Communicate with OpenFlow switches.
VERSION
Version 0.01
SYNOPSIS
This module allows communication with an OpenFlow compliant switch.
use Net::OpenFlow;
my $of = Net::OpenFlow->new;
<create connection to switch>
$of->send($fh, $of_message);
my $of_message = $of->recv($fd, $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($fh, $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($fh, $of_message);