[ovs-discuss] [SEND-MESSAGE] method send and receive

Alessandra Agosta alessandra.agosta at gmail.com
Wed Sep 11 15:01:39 UTC 2013


Dear all,

I have already implemented the sending of a new message type but I need to
know how it's better to place the cede about it.
I have this kind of solutions:
1. I modify vconn.c file writing two function
    static void vcs_send_mymessage(struct vconn *vconn)
and
    static void vcs_recv_mymessage(struct vconn *vconn)

but I'm afraid that to use my functions I have to add a case in switch in
vconn_connect(struct vconn *vconn). In this way, I send mymessage every
time that I realise a connection?

2. I create a new case in switch ofproto.c and I write this function

static enum ofperr
handle_mymessage(struct ofconn *ofconn, const struct ofp_header *oh)
{
    struct ofpbuf *buf;
    if (ofconn_has_pending_opgroups(ofconn)) {
        return OFPROTO_POSTPONE;
    }

    buf = ofpraw_alloc_reply(OFPRAW_OFPT10_MYMESSAGE, oh, 0);
    ofconn_send_reply(ofconn, buf);
    return 0;
}
 so I think in this way I could send a reply if a receive from my
controller the message that I expect.

Finally I think that the good way is the second, but if I want to only SEND
a message, where can I write the method?
Automatic sending are in othern point of the code?
thank you

-- 
Alessandra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20130911/607525be/attachment.html>


More information about the discuss mailing list