]>
Commit | Line | Data |
---|---|---|
b4e8d170 | 1 | /* Copyright (c) 2009, 2011, 2012 Nicira, Inc. |
f85f8ebb BP |
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 | #ifndef OVSDB_TRIGGER_H | |
17 | #define OVSDB_TRIGGER_H 1 | |
18 | ||
b19bab5b | 19 | #include "openvswitch/list.h" |
f85f8ebb BP |
20 | |
21 | struct ovsdb; | |
22 | ||
23 | struct ovsdb_trigger { | |
e317253b | 24 | struct ovsdb_session *session; /* Session that owns this trigger. */ |
b4e8d170 | 25 | struct ovsdb *db; /* Database on which trigger acts. */ |
ca6ba700 | 26 | struct ovs_list node; /* !result: in db->triggers; |
e317253b | 27 | * result: in session->completions. */ |
f85f8ebb BP |
28 | struct json *request; /* Database request. */ |
29 | struct json *result; /* Result (null if none yet). */ | |
30 | long long int created; /* Time created. */ | |
31 | long long int timeout_msec; /* Max wait duration. */ | |
e51879e9 | 32 | bool read_only; /* Database is in read only mode. */ |
d6db7b3c LR |
33 | char *role; /* Role, for role-based access controls. */ |
34 | char *id; /* ID, for role-based access controls. */ | |
f85f8ebb BP |
35 | }; |
36 | ||
b4e8d170 BP |
37 | void ovsdb_trigger_init(struct ovsdb_session *, struct ovsdb *, |
38 | struct ovsdb_trigger *, | |
e51879e9 | 39 | struct json *request, long long int now, |
d6db7b3c LR |
40 | bool read_only, const char *role, |
41 | const char *id); | |
f85f8ebb BP |
42 | void ovsdb_trigger_destroy(struct ovsdb_trigger *); |
43 | ||
44 | bool ovsdb_trigger_is_complete(const struct ovsdb_trigger *); | |
45 | struct json *ovsdb_trigger_steal_result(struct ovsdb_trigger *); | |
46 | ||
47 | void ovsdb_trigger_run(struct ovsdb *, long long int now); | |
48 | void ovsdb_trigger_wait(struct ovsdb *, long long int now); | |
49 | ||
50 | #endif /* ovsdb/trigger.h */ |