#include "ofp-print.h"
#include "ofp-util.h"
#include "ofpbuf.h"
+#include "ofproto-provider.h"
#include "openflow/nicira-ext.h"
#include "openflow/openflow.h"
#include "packets.h"
#include "pinsched.h"
#include "pktbuf.h"
#include "poll-loop.h"
-#include "private.h"
#include "shash.h"
#include "sset.h"
#include "timeval.h"
hmap_insert(&all_ofprotos, &ofproto->hmap_node,
hash_string(ofproto->name, 0));
ofproto->datapath_id = 0;
+ ofproto_set_flow_eviction_threshold(ofproto,
+ OFPROTO_FLOW_EVICTON_THRESHOLD_DEFAULT);
ofproto->fallback_dpid = pick_fallback_dpid();
ofproto->mfr_desc = xstrdup(DEFAULT_MFR_DESC);
ofproto->hw_desc = xstrdup(DEFAULT_HW_DESC);
connmgr_set_in_band_queue(ofproto->connmgr, queue_id);
}
+/* Sets the number of flows at which eviction from the kernel flow table
+ * will occur. */
+void
+ofproto_set_flow_eviction_threshold(struct ofproto *ofproto, unsigned threshold)
+{
+ if (threshold < OFPROTO_FLOW_EVICTION_THRESHOLD_MIN) {
+ ofproto->flow_eviction_threshold = OFPROTO_FLOW_EVICTION_THRESHOLD_MIN;
+ } else {
+ ofproto->flow_eviction_threshold = threshold;
+ }
+}
+
void
ofproto_set_desc(struct ofproto *p,
const char *mfr_desc, const char *hw_desc,
void
ofproto_free_ofproto_controller_info(struct shash *info)
{
- struct shash_node *node;
-
- SHASH_FOR_EACH (node, info) {
- struct ofproto_controller_info *cinfo = node->data;
- while (cinfo->pairs.n) {
- free((char *) cinfo->pairs.values[--cinfo->pairs.n]);
- }
- free(cinfo);
- }
- shash_destroy(info);
+ connmgr_free_controller_info(info);
}
/* Makes a deep copy of 'old' into 'port'. */
/* This function allows an ofproto implementation to destroy any rules that
* remain when its ->destruct() function is called. The caller must have
* already uninitialized any derived members of 'rule' (step 5 described in the
- * large comment in ofproto/private.h titled "Life Cycle"). This function
- * implements steps 6 and 7.
+ * large comment in ofproto/ofproto-provider.h titled "Life Cycle").
+ * This function implements steps 6 and 7.
*
* This function should only be called from an ofproto implementation's
* ->destruct() function. It is not suitable elsewhere. */
* If 'op' is a "delete flow" operation, 'error' must be 0. That is, flow
* deletions are not allowed to fail.
*
- * Please see the large comment in ofproto/private.h titled "Asynchronous
- * Operation Support" for more information. */
+ * Please see the large comment in ofproto/ofproto-provider.h titled
+ * "Asynchronous Operation Support" for more information. */
void
ofoperation_complete(struct ofoperation *op, int error)
{