1 /* Copyright (c) 2015, 2016 Nicira, Inc.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
23 struct sbrec_datapath_binding;
25 /* Logical port and multicast group indexes
26 * ========================================
28 * This data structure holds multiple indexes over logical ports, to allow for
29 * efficient searching for logical ports by name or number.
37 void lport_index_init(struct lport_index *, struct ovsdb_idl *);
38 void lport_index_destroy(struct lport_index *);
40 const struct sbrec_port_binding *lport_lookup_by_name(
41 const struct lport_index *, const char *name);
42 const struct sbrec_port_binding *lport_lookup_by_key(
43 const struct lport_index *, uint32_t dp_key, uint16_t port_key);
45 /* Multicast group index
46 * =====================
48 * This is separate from the logical port index because of namespace issues:
49 * logical port names are globally unique, but multicast group names are only
50 * unique within the scope of a logical datapath.
52 * Multicast groups could be indexed by number also, but so far the clients do
53 * not need this index. */
55 struct mcgroup_index {
56 struct hmap by_dp_name;
59 void mcgroup_index_init(struct mcgroup_index *, struct ovsdb_idl *);
60 void mcgroup_index_destroy(struct mcgroup_index *);
62 const struct sbrec_multicast_group *mcgroup_lookup_by_dp_name(
63 const struct mcgroup_index *,
64 const struct sbrec_datapath_binding *,
67 #endif /* ovn/lport.h */