X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fconnmgr.c;h=1a1ab6c193538ae453f72eb25f9a4825a1421b64;hb=67a2a536abc5af4ab350e1160c12d553f7a071f9;hp=29321d50f6bd462493f3852be3558315e7864e99;hpb=f4f1ea7eaca92e2ca44c9624b3bb7d6426b2ddea;p=sliver-openvswitch.git diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index 29321d50f..1a1ab6c19 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c @@ -823,6 +823,17 @@ ofconn_get_type(const struct ofconn *ofconn) return ofconn->type; } +/* If a master election id is defined, stores it into '*idp' and returns + * true. Otherwise, stores UINT64_MAX into '*idp' and returns false. */ +bool +ofconn_get_master_election_id(const struct ofconn *ofconn, uint64_t *idp) +{ + *idp = (ofconn->connmgr->master_election_id_defined + ? ofconn->connmgr->master_election_id + : UINT64_MAX); + return ofconn->connmgr->master_election_id_defined; +} + /* Sets the master election id. * * Returns true if successful, false if the id is stale @@ -1178,6 +1189,7 @@ ofconn_destroy(struct ofconn *ofconn) hmap_remove(&ofconn->connmgr->controllers, &ofconn->hmap_node); } + hmap_destroy(&ofconn->monitors); list_remove(&ofconn->node); rconn_destroy(ofconn->rconn); rconn_packet_counter_destroy(ofconn->packet_in_counter); @@ -1631,17 +1643,10 @@ any_extras_changed(const struct connmgr *mgr, /* In-band implementation. */ bool -connmgr_msg_in_hook(struct connmgr *mgr, const struct flow *flow, - const struct ofpbuf *packet) -{ - return mgr->in_band && in_band_msg_in_hook(mgr->in_band, flow, packet); -} - -bool -connmgr_may_set_up_flow(struct connmgr *mgr, const struct flow *flow, - uint32_t local_odp_port, - const struct nlattr *odp_actions, - size_t actions_len) +connmgr_must_output_local(struct connmgr *mgr, const struct flow *flow, + uint32_t local_odp_port, + const struct nlattr *odp_actions, + size_t actions_len) { return !mgr->in_band || in_band_rule_check(flow, local_odp_port, odp_actions, actions_len);