]>
git.proxmox.com Git - mirror_ovs.git/blob - lib/tun-metadata.h
2 * Copyright (c) 2015 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.
17 #ifndef TUN_METADATA_H
18 #define TUN_METADATA_H 1
22 #include "openvswitch/dynamic-string.h"
24 #include "openvswitch/ofpbuf.h"
25 #include "openflow/openflow.h"
26 #include "openvswitch/tun-metadata.h"
32 struct ofputil_tlv_table_mod
;
33 struct ofputil_tlv_table_reply
;
36 struct tun_table
*tun_metadata_alloc(const struct tun_table
*old_map
);
37 void tun_metadata_free(struct tun_table
*);
38 void tun_metadata_postpone_free(struct tun_table
*);
40 enum ofperr
tun_metadata_table_mod(struct ofputil_tlv_table_mod
*,
41 const struct tun_table
*old_tab
,
42 struct tun_table
**new_tab
);
43 void tun_metadata_table_request(const struct tun_table
*,
44 struct ofputil_tlv_table_reply
*);
46 void tun_metadata_read(const struct flow_tnl
*,
47 const struct mf_field
*, union mf_value
*);
48 void tun_metadata_write(struct flow_tnl
*,
49 const struct mf_field
*, const union mf_value
*);
50 void tun_metadata_set_match(const struct mf_field
*,
51 const union mf_value
*value
,
52 const union mf_value
*mask
, struct match
*,
54 void tun_metadata_get_fmd(const struct flow_tnl
*, struct match
*flow_metadata
);
56 void tun_metadata_from_geneve_nlattr(const struct nlattr
*attr
, bool is_mask
,
57 struct flow_tnl
*tun
);
58 void tun_metadata_to_geneve_nlattr(const struct flow_tnl
*tun
,
59 const struct flow_tnl
*flow
,
60 const struct ofpbuf
*key
,
63 int tun_metadata_from_geneve_udpif(const struct tun_table
*,
64 const struct flow_tnl
*flow
,
65 const struct flow_tnl
*src
,
66 struct flow_tnl
*dst
);
67 void tun_metadata_to_geneve_udpif_mask(const struct flow_tnl
*flow_src
,
68 const struct flow_tnl
*mask_src
,
69 const struct geneve_opt
*flow_src_opt
,
70 int opts_len
, struct geneve_opt
*dst
);
72 int tun_metadata_to_geneve_header(const struct flow_tnl
*flow
,
73 struct geneve_opt
*, bool *crit_opt
);
75 void tun_metadata_to_nx_match(struct ofpbuf
*b
, enum ofp_version oxm
,
76 const struct match
*);
77 void tun_metadata_match_format(struct ds
*, const struct match
*);
79 #endif /* tun-metadata.h */