]>
Commit | Line | Data |
---|---|---|
aafee638 YHW |
1 | /* |
2 | * Copyright (c) 2017 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 VL_MFF_MAP_H | |
18 | #define VL_MFF_MAP_H 1 | |
19 | ||
20 | #include "cmap.h" | |
21 | #include "openvswitch/thread.h" | |
22 | ||
23 | /* Variable length mf_fields mapping map. This is a single writer, | |
24 | * multiple-reader hash table that a writer must hold the following mutex | |
25 | * to access this map. */ | |
26 | struct vl_mff_map { | |
27 | struct cmap cmap; /* Contains 'struct mf_field' */ | |
28 | struct ovs_mutex mutex; | |
29 | }; | |
30 | ||
31 | /* Variable length fields. */ | |
5c7c16d8 | 32 | enum ofperr mf_vl_mff_map_clear(struct vl_mff_map *vl_mff_map, bool) |
aafee638 YHW |
33 | OVS_REQUIRES(vl_mff_map->mutex); |
34 | enum ofperr mf_vl_mff_map_mod_from_tun_metadata( | |
35 | struct vl_mff_map *vl_mff_map, const struct ofputil_tlv_table_mod *) | |
36 | OVS_REQUIRES(vl_mff_map->mutex); | |
37 | const struct mf_field * mf_get_vl_mff(const struct mf_field *, | |
38 | const struct vl_mff_map *); | |
39 | bool mf_vl_mff_invalid(const struct mf_field *, const struct vl_mff_map *); | |
5c7c16d8 YHW |
40 | void mf_vl_mff_set_tlv_bitmap(const struct mf_field *, uint64_t *tlv_bitmap); |
41 | void mf_vl_mff_ref(const struct vl_mff_map *, uint64_t tlv_bitmap); | |
42 | void mf_vl_mff_unref(const struct vl_mff_map *, uint64_t tlv_bitmap); | |
43 | enum ofperr mf_vl_mff_nx_pull_header(struct ofpbuf *, | |
44 | const struct vl_mff_map *, | |
45 | const struct mf_field **, bool *masked, | |
46 | uint64_t *tlv_bitmap); | |
47 | enum ofperr mf_vl_mff_nx_pull_entry(struct ofpbuf *, const struct vl_mff_map *, | |
48 | const struct mf_field **, union mf_value *, | |
49 | union mf_value *, uint64_t *tlv_bitmap); | |
50 | enum ofperr mf_vl_mff_mf_from_nxm_header(uint32_t header, | |
51 | const struct vl_mff_map *, | |
52 | const struct mf_field **, | |
53 | uint64_t *tlv_bitmap); | |
aafee638 | 54 | #endif /* vl-mff-map.h */ |