Thanks, that worked a treat!   I added the following patch to
fakeswitch.c, and now I'm able to get responses from my POX controller:

Index: cbench/fakeswitch.c
===================================================================
--- cbench/fakeswitch.c (revision 135)
+++ cbench/fakeswitch.c (working copy)
@@ -261,6 +261,7 @@
     int count;
     struct ofp_header * ofph;
     struct ofp_header echo;
+    struct ofp_header barrier;
     char buf[BUFLEN];
     count = msgbuf_read(fs->inbuf, fs->sock);   // read any queued data
     if (count <= 0)
@@ -357,6 +358,14 @@
                 echo.xid = ofph->xid;
                 msgbuf_push(fs->outbuf,(char *) &echo, sizeof(echo));
                 break;
+            case OFPT_BARRIER_REQUEST:
+                debug_msg(fs, "got barrier, sent barrier_resp");
+                barrier.version= OFP_VERSION;
+                barrier.length = htons(sizeof(barrier));
+                barrier.type   = OFPT_BARRIER_REPLY;
+                barrier.xid = ofph->xid;
+                msgbuf_push(fs->outbuf,(char *) &barrier, sizeof(barrier));
+                break;
             case OFPT_STATS_REQUEST:
                 stats_req  = (struct ofp_stats_request *) ofph;
                 if ( ntohs(stats_req->type) == OFPST_DESC ) {


On Thu, Oct 25, 2012 at 03:50:41PM -0700, Rob Sherwood wrote:
> On Thu, Oct 25, 2012 at 3:41 PM, Peter Fales
> <peter.fa...@alcatel-lucent.com> wrote:
> > On Thu, Oct 25, 2012 at 02:59:12PM -0700, Rob Sherwood wrote:
> >> 2) it would be pretty easy (~5 lines of code) to add a barrier reply
> >> handler to cbench if you were so inclined.
> >
> > Thanks!
> >
> > I would like to pursue that, but I don't know anything out the cbench
> > code.  Any suggestions on where to start looking?
> 
> In fakeswitch.c:259 or so, there is the function:
> 
> void fakeswitch_handle_read(struct fakeswitch *fs)
> 
> that has the openflow state machine.  It should be a matter of adding
> a case for a barrier request and creating and sending the barrier
> reply.  For the example for echo request.
> 
> Would love to get support for POX in place -- thanks!
> 
> - Rob
> .
> 
> 
> >
> > --
> > Peter Fales
> > Alcatel-Lucent
> > Member of Technical Staff
> > 1960 Lucent Lane
> > Room: 9H-505
> > Naperville, IL 60566-7033
> > Email: peter.fa...@alcatel-lucent.com
> > Phone: 630 979 8031

-- 
Peter Fales
Alcatel-Lucent
Member of Technical Staff
1960 Lucent Lane
Room: 9H-505
Naperville, IL 60566-7033
Email: peter.fa...@alcatel-lucent.com
Phone: 630 979 8031
_______________________________________________
openflow-discuss mailing list
openflow-discuss@lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

Reply via email to