+
+ rconn_packet_counter_destroy(ofconn->packet_in_counter);
+ ofconn->packet_in_counter = rconn_packet_counter_create();
+ for (i = 0; i < N_SCHEDULERS; i++) {
+ if (ofconn->schedulers[i]) {
+ int rate, burst;
+
+ pinsched_get_limits(ofconn->schedulers[i], &rate, &burst);
+ pinsched_destroy(ofconn->schedulers[i]);
+ ofconn->schedulers[i] = pinsched_create(rate, burst);
+ }
+ }
+ if (ofconn->pktbuf) {
+ pktbuf_destroy(ofconn->pktbuf);
+ ofconn->pktbuf = pktbuf_create();
+ }
+ ofconn->miss_send_len = (ofconn->type == OFCONN_PRIMARY
+ ? OFP_DEFAULT_MISS_SEND_LEN
+ : 0);
+ ofconn->controller_id = 0;
+
+ rconn_packet_counter_destroy(ofconn->reply_counter);
+ ofconn->reply_counter = rconn_packet_counter_create();
+
+ if (ofconn->enable_async_msgs) {
+ uint32_t *master = ofconn->master_async_config;
+ uint32_t *slave = ofconn->slave_async_config;
+
+ /* "master" and "other" roles get all asynchronous messages by default,
+ * except that the controller needs to enable nonstandard "packet-in"
+ * reasons itself. */
+ master[OAM_PACKET_IN] = (1u << OFPR_NO_MATCH) | (1u << OFPR_ACTION);
+ master[OAM_PORT_STATUS] = ((1u << OFPPR_ADD)
+ | (1u << OFPPR_DELETE)
+ | (1u << OFPPR_MODIFY));
+ master[OAM_FLOW_REMOVED] = ((1u << OFPRR_IDLE_TIMEOUT)
+ | (1u << OFPRR_HARD_TIMEOUT)
+ | (1u << OFPRR_DELETE));
+
+ /* "slave" role gets port status updates by default. */
+ slave[OAM_PACKET_IN] = 0;
+ slave[OAM_PORT_STATUS] = ((1u << OFPPR_ADD)
+ | (1u << OFPPR_DELETE)
+ | (1u << OFPPR_MODIFY));
+ slave[OAM_FLOW_REMOVED] = 0;
+ } else {
+ memset(ofconn->master_async_config, 0,
+ sizeof ofconn->master_async_config);
+ memset(ofconn->slave_async_config, 0,
+ sizeof ofconn->slave_async_config);
+ }