ob->watch_group = htonl(bucket->watch_group);
}
-/* Appends a group stats reply that contains the data in 'gds' to those already
- * present in the list of ofpbufs in 'replies'. 'replies' should have been
- * initialized with ofpmp_init(). */
-void
-ofputil_append_group_desc_reply(const struct ofputil_group_desc *gds,
- struct list *buckets,
- struct list *replies)
+static void
+ofputil_append_ofp11_group_desc_reply(const struct ofputil_group_desc *gds,
+ struct list *buckets,
+ struct list *replies,
+ enum ofp_version version)
{
struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
- enum ofp_version version = ofpmp_version(replies);
struct ofp11_group_desc_stats *ogds;
struct ofputil_bucket *bucket;
size_t start_ogds;
ofpmp_postappend(replies, start_ogds);
}
+/* Appends a group stats reply that contains the data in 'gds' to those already
+ * present in the list of ofpbufs in 'replies'. 'replies' should have been
+ * initialized with ofpmp_init(). */
+void
+ofputil_append_group_desc_reply(const struct ofputil_group_desc *gds,
+ struct list *buckets,
+ struct list *replies)
+{
+ enum ofp_version version = ofpmp_version(replies);
+
+ switch (version)
+ {
+ case OFP11_VERSION:
+ case OFP12_VERSION:
+ case OFP13_VERSION:
+ case OFP14_VERSION:
+ case OFP15_VERSION:
+ ofputil_append_ofp11_group_desc_reply(gds, buckets, replies, version);
+ break;
+
+ case OFP10_VERSION:
+ default:
+ OVS_NOT_REACHED();
+ }
+}
+
static enum ofperr
ofputil_pull_ofp11_buckets(struct ofpbuf *msg, size_t buckets_length,
enum ofp_version version, struct list *buckets)