From 2e127848927d885fd42fb423665d8f674197f2fb Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 1 May 2008 18:26:21 -0700 Subject: [PATCH] Add max_idle field to flow stats messages. --- datapath/datapath.c | 1 + include/openflow.h | 1 + lib/ofp-print.c | 1 + switch/datapath.c | 1 + 4 files changed, 4 insertions(+) diff --git a/datapath/datapath.c b/datapath/datapath.c index 1f7d432e..e75aaa5b 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -858,6 +858,7 @@ fill_flow_stats(struct ofp_flow_stats *ofs, struct sw_flow *flow, ofs->packet_count = cpu_to_be64(flow->packet_count); ofs->byte_count = cpu_to_be64(flow->byte_count); ofs->priority = htons(flow->priority); + ofs->max_idle = htons(flow->max_idle); ofs->table_id = table_idx; memset(ofs->pad, 0, sizeof ofs->pad); } diff --git a/include/openflow.h b/include/openflow.h index 10eee8b0..e1dd9f57 100644 --- a/include/openflow.h +++ b/include/openflow.h @@ -426,6 +426,7 @@ struct ofp_flow_stats { uint64_t byte_count; /* Number of bytes in flow. */ uint16_t priority; /* Priority of the entry. Only meaningful when this is not an exact-match entry. */ + uint16_t max_idle; /* Only used for non-aggregated results. */ uint8_t table_id; /* ID of table flow came from. */ uint8_t pad[5]; /* Align to 64-bits. */ }; diff --git a/lib/ofp-print.c b/lib/ofp-print.c index d5dc0d87..ef4c1383 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -486,6 +486,7 @@ ofp_flow_stats_reply(struct ds *string, const void *body, size_t len, ds_put_format(string, "n_packets=%"PRIu64", ", ntohll(fs->packet_count)); ds_put_format(string, "n_bytes=%"PRIu64", ", ntohll(fs->byte_count)); + ds_put_format(string, "max_idle=%"PRIu16", ", ntohs(fs->max_idle)); ofp_print_match(string, &fs->match); } } diff --git a/switch/datapath.c b/switch/datapath.c index c1b124b2..8438b473 100644 --- a/switch/datapath.c +++ b/switch/datapath.c @@ -733,6 +733,7 @@ fill_flow_stats(struct ofp_flow_stats *ofs, struct sw_flow *flow, ofs->packet_count = htonll(flow->packet_count); ofs->byte_count = htonll(flow->byte_count); ofs->priority = htons(flow->priority); + ofs->max_idle = htons(flow->max_idle); ofs->table_id = table_idx; memset(ofs->pad, 0, sizeof ofs->pad); } -- 2.30.2