Sorry. The last mail is incomplete, please ignore it!!

Hi all,

I am wondering where is the framing code for the OpenFlow protocol messages.
I mean the OpenFlow switch talks to NOX through a reliable byte stream
channel (e.i. TCP or SSL).
So, there must be a model to buffer the received bytes from a OpenFlow
Switch, and returns a completed OpenFlow message when it has received enough
bytes.

Please see the comments, [1] [2] [3], I added into the source code below:

in the file "noxcore/src/builtin":
bool
Conn::do_poll()
{
    int error;

    //[1] the framing job must be done in the oconn->recv_openflow()
    std::auto_ptr<Buffer> b(oconn->recv_openflow(error, false));
    switch (error) {
    case 0: {
        datapathid dp_id = oconn->get_datapath_id();

        //[2] here, the Buffer b contains a completed OpenFlow message
        std::auto_ptr<Event> event(openflow_packet_to_event(dp_id, b));
        if (event.get()) {
            event_dispatcher.dispatch(*event);
        }
        return true;
    }
... ...
}

in the file "noxcore/src/lib"
//[3] the framing job is actually done here implicitly?
std::auto_ptr<Buffer>
Datapath::do_recv_openflow(int& error) //this is called by
oconn->recv_openflow()
{ ... ... }


Deng





On Tue, Jan 20, 2009 at 12:00 AM, Ye Deng <[email protected]> wrote:

> Hi all,
>
> I am wondering where is the framing code for the OpenFlow protocol.
> I mean the OpenFlow talks to NOX through a reliable byte stream channel
> (e.i. TCP or SSL).
> So, there must be a model to buffer the received bytes from a OpenFlow
> Switch, and returns a completed OpenFlow message when it has received enough
> bytes.
>
> Please see the comments, [1] [2], I added into the source code below:
>
> in the file "noxcore/src/builtin":
> bool
> Conn::do_poll()
> {
>     int error;
>     std::auto_ptr<Buffer> b(oconn->recv_openflow(error, false));
>     switch (error) {
>     case 0: {
>         datapathid dp_id = oconn->get_datapath_id();
>
> // [2]
>         std::auto_ptr<Event> event(openflow_packet_to_event(dp_id, b));
>         if (event.get()) {
>             event_dispatcher.dispatch(*event);
>         }
>         return true;
>     }
> ... ...
> }
>
>
>
>
_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to