Setting tag sliver-openvswitch-2.2.90-1
[sliver-openvswitch.git] / ofproto / ofproto-dpif-rid.h
1 /*
2  * Copyright (c) 2014 Nicira, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef OFPROTO_DPIF_RID_H
18 #define OFPROTO_DPIF_RID_H
19
20 #include <stddef.h>
21 #include <stdint.h>
22
23 struct recirc_id_pool;
24
25 /*
26  * Recirculation ID pool.
27  * ======================
28  *
29  * Recirculation ID needs to be unique for each datapath. Recirculation
30  * ID pool keeps track recirculation ids.
31  *
32  * Typically, there is one recirculation ID pool for each backer.
33  *
34  * In theory, Recirculation ID can be any uint32_t value, except 0.
35  * The implementation usually limits it to a smaller range to ease
36  * debugging.
37  *
38  * Thread-safety
39  * =============
40  *
41  * All APIs are thread safe.
42  *
43  */
44 struct recirc_id_pool *recirc_id_pool_create(void);
45 void  recirc_id_pool_destroy(struct recirc_id_pool *pool);
46 uint32_t recirc_id_alloc(struct recirc_id_pool *pool);
47 void recirc_id_free(struct recirc_id_pool *pool, uint32_t recirc_id);
48 #endif