+static void
+query_table_desc__(struct ofputil_table_desc *td,
+ struct ofproto *ofproto, uint8_t table_id)
+{
+ unsigned int count = ofproto->tables[table_id].n_flows;
+ unsigned int max_flows = ofproto->tables[table_id].max_flows;
+
+ td->table_id = table_id;
+ td->eviction = (ofproto->tables[table_id].eviction & EVICTION_OPENFLOW
+ ? OFPUTIL_TABLE_EVICTION_ON
+ : OFPUTIL_TABLE_EVICTION_OFF);
+ td->eviction_flags = OFPROTO_EVICTION_FLAGS;
+ td->vacancy = (ofproto->tables[table_id].vacancy_enabled
+ ? OFPUTIL_TABLE_VACANCY_ON
+ : OFPUTIL_TABLE_VACANCY_OFF);
+ td->table_vacancy.vacancy_down = ofproto->tables[table_id].vacancy_down;
+ td->table_vacancy.vacancy_up = ofproto->tables[table_id].vacancy_up;
+ td->table_vacancy.vacancy = max_flows ? (count * 100) / max_flows : 0;
+}
+