]> git.proxmox.com Git - mirror_ovs.git/commitdiff
Log more rconn status.
authorBen Pfaff <blp@nicira.com>
Fri, 26 Jun 2009 23:00:07 +0000 (16:00 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 26 Jun 2009 23:00:07 +0000 (16:00 -0700)
lib/rconn.c
lib/rconn.h
secchan/status.c

index deb95195deac5ffd93225716ca3f3a6d1974fa27..b18a2e59e918c3d4373b3a4e19a0bcf55b6e6af6 100644 (file)
@@ -698,6 +698,15 @@ rconn_get_last_connection(const struct rconn *rc)
     return rc->last_connected;
 }
 
+/* Returns the time at which the last OpenFlow message was received by 'rc'.
+ * If no packets have been received on 'rc', returns the time at which 'rc'
+ * was created. */
+time_t
+rconn_get_last_received(const struct rconn *rc)
+{
+    return rc->last_received;
+}
+
 /* Returns the time at which 'rc' was created. */
 time_t
 rconn_get_creation_time(const struct rconn *rc)
index f9cbe706781e9a34bebdad06c5537282e56e6c71..1249b844fbdc32b6b9fdde28bd45bd6365c0cdbf 100644 (file)
@@ -78,6 +78,7 @@ const char *rconn_get_state(const struct rconn *);
 unsigned int rconn_get_attempted_connections(const struct rconn *);
 unsigned int rconn_get_successful_connections(const struct rconn *);
 time_t rconn_get_last_connection(const struct rconn *);
+time_t rconn_get_last_received(const struct rconn *);
 time_t rconn_get_creation_time(const struct rconn *);
 unsigned long int rconn_get_total_time_connected(const struct rconn *);
 int rconn_get_backoff(const struct rconn *);
index 4d3f4113505fc7ea4269c431822b101b06459c45..1dedb8dfe28d52a30f01ce4f8df18595ef8184a8 100644 (file)
@@ -106,6 +106,8 @@ rconn_status_cb(struct status_reply *sr, void *rconn_)
                      rconn_get_successful_connections(rconn));
     status_reply_put(sr, "last-connection=%ld",
                      (long int) (now - rconn_get_last_connection(rconn)));
+    status_reply_put(sr, "last-received=%ld",
+                     (long int) (now - rconn_get_last_received(rconn)));
     status_reply_put(sr, "time-connected=%lu",
                      rconn_get_total_time_connected(rconn));
     status_reply_put(sr, "state-elapsed=%u", rconn_get_state_elapsed(rconn));