diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2013-01-18 18:03:15 -0800 |
---|---|---|
committer | Pravin B Shelar <pshelar@nicira.com> | 2013-01-18 18:03:15 -0800 |
commit | 26ff7bc963d50a65a65f87d1d0dc68fa15493a05 (patch) | |
tree | 008d2686f87bde70c14f40601a38565a33a27a19 /datapath/flow.h | |
parent | 465b6c7e352ff4950fb627d383467260b16d3d7f (diff) |
datapath: More flexible kernel/userspace tunneling attribute.
Following patch breaks down single ipv4_tunnel netlink attribute into
individual member attributes. It will help when we extend tunneling
parameters in future.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Bug #14611
Diffstat (limited to 'datapath/flow.h')
-rw-r--r-- | datapath/flow.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/datapath/flow.h b/datapath/flow.h index f97ec086..657d01ed 100644 --- a/datapath/flow.h +++ b/datapath/flow.h @@ -40,6 +40,20 @@ struct sw_flow_actions { struct nlattr actions[]; }; +/* Tunnel flow flags. */ +#define OVS_TNL_F_DONT_FRAGMENT (1 << 0) +#define OVS_TNL_F_CSUM (1 << 1) +#define OVS_TNL_F_KEY (1 << 2) + +struct ovs_key_ipv4_tunnel { + __be64 tun_id; + __be32 ipv4_src; + __be32 ipv4_dst; + u16 tun_flags; + u8 ipv4_tos; + u8 ipv4_ttl; +}; + struct sw_flow_key { struct { union { @@ -133,7 +147,7 @@ struct sw_flow *ovs_flow_alloc(void); void ovs_flow_deferred_free(struct sw_flow *); void ovs_flow_free(struct sw_flow *); -struct sw_flow_actions *ovs_flow_actions_alloc(const struct nlattr *); +struct sw_flow_actions *ovs_flow_actions_alloc(int actions_len); void ovs_flow_deferred_free_acts(struct sw_flow_actions *); int ovs_flow_extract(struct sk_buff *, u16 in_port, struct sw_flow_key *, @@ -205,5 +219,9 @@ void ovs_flow_tbl_remove(struct flow_table *table, struct sw_flow *flow); struct sw_flow *ovs_flow_tbl_next(struct flow_table *table, u32 *bucket, u32 *idx); extern const int ovs_key_lens[OVS_KEY_ATTR_MAX + 1]; +int ipv4_tun_from_nlattr(const struct nlattr *attr, + struct ovs_key_ipv4_tunnel *tun_key); +int ipv4_tun_to_nlattr(struct sk_buff *skb, + const struct ovs_key_ipv4_tunnel *tun_key); #endif /* flow.h */ |