~ubuntu-branches/ubuntu/wily/openvswitch/wily

« back to all changes in this revision

Viewing changes to datapath/linux/compat/include/net/stt.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-08-10 11:35:15 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20150810113515-575vj06oq29emxsn
Tags: 2.4.0~git20150810.97bab95-0ubuntu1
* New upstream snapshot from 2.4 branch:
  - d/*: Align any relevant packaging changes with upstream.
* d/*: wrap-and-sort.
* d/openvswitch-{common,vswitch}.install: Correct install location for
  bash completion files.
* d/tests/openflow.py: Explicitly use ovs-testcontroller as provided
  by 2.4.0 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __NET_STT_H
 
2
#define __NET_STT_H  1
 
3
 
 
4
#include <linux/kconfig.h>
 
5
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) && IS_ENABLED(CONFIG_NETFILTER)
 
6
#include <net/ip_tunnels.h>
 
7
#define OVS_STT
 
8
 
 
9
struct stthdr {
 
10
        __u8            version;
 
11
        __u8            flags;
 
12
        __u8            l4_offset;
 
13
        __u8            reserved;
 
14
        __be16          mss;
 
15
        __be16          vlan_tci;
 
16
        __be64          key;
 
17
};
 
18
 
 
19
/* Padding after the end of the tunnel headers to provide alignment
 
20
 * for inner packet IP header after 14 byte Ethernet header.
 
21
 */
 
22
#define STT_ETH_PAD 2
 
23
 
 
24
#define STT_BASE_HLEN   (sizeof(struct stthdr) + STT_ETH_PAD)
 
25
#define STT_HEADER_LEN  (sizeof(struct tcphdr) + STT_BASE_HLEN)
 
26
 
 
27
static inline struct stthdr *stt_hdr(const struct sk_buff *skb)
 
28
{
 
29
        return (struct stthdr *)(skb_transport_header(skb) +
 
30
                                 sizeof(struct tcphdr));
 
31
}
 
32
 
 
33
struct stt_sock;
 
34
typedef void (stt_rcv_t)(struct stt_sock *stt_sock, struct sk_buff *skb);
 
35
 
 
36
/* @list: Per-net list of STT ports.
 
37
 * @rcv: The callback is called on STT packet recv, STT reassembly can generate
 
38
 * multiple packets, in this case first packet has tunnel outer header, rest
 
39
 * of the packets are inner packet segments with no stt header.
 
40
 * @rcv_data: user data.
 
41
 * @sock: Fake TCP socket for the STT port.
 
42
 */
 
43
struct stt_sock {
 
44
        struct list_head        list;
 
45
        stt_rcv_t               *rcv;
 
46
        void                    *rcv_data;
 
47
        struct socket           *sock;
 
48
        struct rcu_head         rcu;
 
49
};
 
50
 
 
51
#define stt_sock_add rpl_stt_sock_add
 
52
struct stt_sock *rpl_stt_sock_add(struct net *net, __be16 port,
 
53
                              stt_rcv_t *rcv, void *data);
 
54
 
 
55
#define stt_sock_release rpl_stt_sock_release
 
56
void rpl_stt_sock_release(struct stt_sock *stt_sock);
 
57
 
 
58
#define stt_xmit_skb rpl_stt_xmit_skb
 
59
int rpl_stt_xmit_skb(struct sk_buff *skb, struct rtable *rt,
 
60
                 __be32 src, __be32 dst, __u8 tos,
 
61
                 __u8 ttl, __be16 df, __be16 src_port, __be16 dst_port,
 
62
                 __be64 tun_id);
 
63
 
 
64
#define stt_init_module ovs_stt_init_module
 
65
int ovs_stt_init_module(void);
 
66
 
 
67
#define stt_cleanup_module ovs_stt_cleanup_module
 
68
void ovs_stt_cleanup_module(void);
 
69
 
 
70
#endif
 
71
#endif /*ifdef__NET_STT_H */