4 #include <linux/kernel.h>
5 #include <linux/spinlock.h>
6 #include <linux/types.h>
7 #include <linux/rcupdate.h>
10 #include "openvswitch/datapath-protocol.h"
14 struct sw_flow_actions {
16 unsigned int n_actions;
17 union odp_action actions[];
22 struct odp_flow_key key;
23 struct sw_flow_actions *sf_acts;
25 struct timespec used; /* Last used time. */
27 u8 ip_tos; /* IP TOS value. */
29 spinlock_t lock; /* Lock for values below. */
30 u64 packet_count; /* Number of packets matched. */
31 u64 byte_count; /* Number of bytes matched. */
32 u8 tcp_flags; /* Union of seen TCP flags. */
35 extern struct kmem_cache *flow_cache;
37 struct sw_flow_actions *flow_actions_alloc(size_t n_actions);
38 void flow_free(struct sw_flow *);
39 void flow_deferred_free(struct sw_flow *);
40 void flow_deferred_free_acts(struct sw_flow_actions *);
41 int flow_extract(struct sk_buff *, u16 in_port, struct odp_flow_key *);
42 void flow_used(struct sw_flow *, struct sk_buff *);
44 void print_flow(const struct odp_flow_key *);