hi all i have a query and problem that my open flow switch can send the echo request and echo receive the echo reply. But the switch is not able to respond to the echo request that come from the controller. Can someone help me????????????????

asked 2015-12-09 20:37:29 -0700

neeraj gravatar image

In the normal case my switch can send the echo request to the controller and it can respond accurately, but i want to send the echo request from the controller side and want response from the switch side

here is the code

doswitching(struct switch *sw) {

if DEBUG

    printf("function = %s and file = %s\n", __func__, __FILE__);

endif

    unsigned int packets_sent;
    struct ofpbuf *msg;
    int retval = 0;
    int n_queued =NULL ;  // added by neeraj

    packets_sent = rconn_packets_sent(sw->rconn);

if DEBUG_PACKET

    printf("Packet sent  = %d\n", packets_sent);

endif

    msg = rconn_recv(sw->rconn);
    if (msg) {
            retval =1;
            lswitch_process_packet(sw->lswitch, sw->rconn, msg);
            ofpbuf_delete(msg);
    }
    rconn_run(sw->rconn);
    //addded by neeraj  : function for the send echo request
    if(retval == 1)
    {
            struct ofpbuf *msg1  = make_echo_request();
            retval = rconn_send(sw->rconn, msg1, &n_queued);
            if(!retval)
            {
                    printf("retval = %d\n", retval);
            }
            msg = rconn_recv(sw->rconn);
            if (msg) {
                    lswitch_process_packet(sw->lswitch, sw->rconn, msg);
                    ofpbuf_delete(msg);
            }
    }
    return (!rconn_is_alive(sw->rconn) ? EOF
                    : rconn_packets_sent(sw->rconn) != packets_sent ? 0
edit retag flag offensive close merge delete