]> git.proxmox.com Git - mirror_ovs.git/blame - lib/tun-metadata.h
ovsdb-idl: Fix iteration over tracked rows with no actual data.
[mirror_ovs.git] / lib / tun-metadata.h
CommitLineData
6159c531
JG
1/*
2 * Copyright (c) 2015 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 TUN_METADATA_H
18#define TUN_METADATA_H 1
19
9558d2a5
JG
20#include <stdint.h>
21
3e8a2ad1 22#include "openvswitch/dynamic-string.h"
9558d2a5 23#include "netlink.h"
64c96779 24#include "openvswitch/ofpbuf.h"
9558d2a5 25#include "openflow/openflow.h"
841b052a 26#include "openvswitch/tun-metadata.h"
9558d2a5 27
6728d578 28struct flow_tnl;
9558d2a5
JG
29struct match;
30struct mf_field;
31union mf_value;
4e548ad9
ML
32struct ofputil_tlv_table_mod;
33struct ofputil_tlv_table_reply;
9558d2a5
JG
34struct tun_table;
35
8d8ab6c2
JG
36struct tun_table *tun_metadata_alloc(const struct tun_table *old_map);
37void tun_metadata_free(struct tun_table *);
38void tun_metadata_postpone_free(struct tun_table *);
9558d2a5 39
8d8ab6c2
JG
40enum ofperr tun_metadata_table_mod(struct ofputil_tlv_table_mod *,
41 const struct tun_table *old_tab,
42 struct tun_table **new_tab);
43void tun_metadata_table_request(const struct tun_table *,
44 struct ofputil_tlv_table_reply *);
9558d2a5 45
6728d578 46void tun_metadata_read(const struct flow_tnl *,
9558d2a5 47 const struct mf_field *, union mf_value *);
6728d578 48void tun_metadata_write(struct flow_tnl *,
9558d2a5 49 const struct mf_field *, const union mf_value *);
81f71381 50void tun_metadata_delete(struct flow_tnl *, const struct mf_field *);
9558d2a5
JG
51void tun_metadata_set_match(const struct mf_field *,
52 const union mf_value *value,
4f7b100c
JG
53 const union mf_value *mask, struct match *,
54 char **err_str);
6728d578 55void tun_metadata_get_fmd(const struct flow_tnl *, struct match *flow_metadata);
9558d2a5 56
8d8ab6c2
JG
57void tun_metadata_from_geneve_nlattr(const struct nlattr *attr, bool is_mask,
58 struct flow_tnl *tun);
6728d578
JG
59void tun_metadata_to_geneve_nlattr(const struct flow_tnl *tun,
60 const struct flow_tnl *flow,
61 const struct ofpbuf *key,
62 struct ofpbuf *);
63
8d8ab6c2
JG
64int tun_metadata_from_geneve_udpif(const struct tun_table *,
65 const struct flow_tnl *flow,
6728d578
JG
66 const struct flow_tnl *src,
67 struct flow_tnl *dst);
68void tun_metadata_to_geneve_udpif_mask(const struct flow_tnl *flow_src,
69 const struct flow_tnl *mask_src,
70 const struct geneve_opt *flow_src_opt,
71 int opts_len, struct geneve_opt *dst);
72
73int tun_metadata_to_geneve_header(const struct flow_tnl *flow,
5bb08b0e
JG
74 struct geneve_opt *, bool *crit_opt);
75
9558d2a5
JG
76void tun_metadata_to_nx_match(struct ofpbuf *b, enum ofp_version oxm,
77 const struct match *);
78void tun_metadata_match_format(struct ds *, const struct match *);
6159c531
JG
79
80#endif /* tun-metadata.h */