From c221978c9e591cf4aa4138ca465b0a8fe8269646 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Sun, 8 Mar 2009 18:04:58 -0700 Subject: [PATCH] Have secchan reply to OpenFlow echo requests. --- secchan/ofproto.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/secchan/ofproto.c b/secchan/ofproto.c index ef0f3d6b..a95a2ef0 100644 --- a/secchan/ofproto.c +++ b/secchan/ofproto.c @@ -1215,6 +1215,14 @@ hton_ofp_phy_port(struct ofp_phy_port *opp) opp->peer = htonl(opp->peer); } +static int +handle_echo_request(struct ofconn *ofconn, struct ofp_header *oh) +{ + struct ofp_header *rq = oh; + queue_tx(make_echo_reply(rq), ofconn); + return 0; +} + static int handle_features_request(struct ofproto *p, struct ofconn *ofconn, struct ofp_header *oh) @@ -2387,6 +2395,10 @@ handle_openflow(struct ofconn *ofconn, struct ofproto *p, int error; switch (oh->type) { + case OFPT_ECHO_REQUEST: + error = handle_echo_request(ofconn, oh); + break; + case OFPT_ECHO_REPLY: error = 0; break; -- 2.30.2