}
}
+void
+connmgr_free_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);
+}
+
/* Changes 'mgr''s set of controllers to the 'n_controllers' controllers in
* 'controllers'. */
void
/* OpenFlow configuration. */
bool connmgr_has_controllers(const struct connmgr *);
void connmgr_get_controller_info(struct connmgr *, struct shash *);
+void connmgr_free_controller_info(struct shash *);
void connmgr_set_controllers(struct connmgr *,
const struct ofproto_controller[], size_t n);
void connmgr_reconnect(const struct connmgr *);
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'. */