Have secchan reply to OpenFlow echo requests.
authorJustin Pettit <jpettit@nicira.com>
Mon, 9 Mar 2009 01:04:58 +0000 (18:04 -0700)
committerJustin Pettit <jpettit@nicira.com>
Mon, 9 Mar 2009 01:04:58 +0000 (18:04 -0700)
secchan/ofproto.c

index ef0f3d6b40f6063c505a5cdfa75e42835f25fa67..a95a2ef0e8e514ba68dd03440cbe37593bbc20ff 100644 (file)
@@ -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;