]>
Commit | Line | Data |
---|---|---|
717c7fc5 JP |
1 | /* Copyright (c) 2015 Nicira, Inc. |
2 | * | |
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: | |
6 | * | |
7 | * http://www.apache.org/licenses/LICENSE-2.0 | |
8 | * | |
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. | |
14 | */ | |
15 | ||
16 | ||
17 | #ifndef OVN_CONTROLLER_H | |
18 | #define OVN_CONTROLLER_H 1 | |
19 | ||
71332231 AW |
20 | #include "ovn/lib/ovn-sb-idl.h" |
21 | ||
717c7fc5 | 22 | struct controller_ctx { |
717c7fc5 | 23 | struct ovsdb_idl *ovnsb_idl; |
f1fd7657 BP |
24 | struct ovsdb_idl_txn *ovnsb_idl_txn; |
25 | ||
717c7fc5 | 26 | struct ovsdb_idl *ovs_idl; |
f1fd7657 | 27 | struct ovsdb_idl_txn *ovs_idl_txn; |
717c7fc5 JP |
28 | }; |
29 | ||
71332231 | 30 | static inline const struct sbrec_chassis * |
422a9f73 | 31 | get_chassis_by_name(struct ovsdb_idl *ovnsb_idl, const char *chassis_id) |
71332231 AW |
32 | { |
33 | const struct sbrec_chassis *chassis_rec; | |
34 | ||
35 | SBREC_CHASSIS_FOR_EACH(chassis_rec, ovnsb_idl) { | |
36 | if (!strcmp(chassis_rec->name, chassis_id)) { | |
37 | break; | |
38 | } | |
39 | } | |
40 | ||
41 | return chassis_rec; | |
42 | } | |
43 | ||
717c7fc5 | 44 | #endif /* ovn/ovn-controller.h */ |