]>
git.proxmox.com Git - mirror_ovs.git/blob - lib/vl-mff-map.h
2 * Copyright (c) 2017 Nicira, Inc.
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:
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #define VL_MFF_MAP_H 1
21 #include "openvswitch/thread.h"
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. */
27 struct cmap cmap
; /* Contains 'struct mf_field' */
28 struct ovs_mutex mutex
;
31 /* Variable length fields. */
32 enum ofperr
mf_vl_mff_map_clear(struct vl_mff_map
*vl_mff_map
, bool)
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
*);
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
);
54 #endif /* vl-mff-map.h */