diff options
Diffstat (limited to 'include/linux/udp.h')
-rw-r--r-- | include/linux/udp.h | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/include/linux/udp.h b/include/linux/udp.h index 03f72a2ba02..9d81de123c9 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -17,34 +17,21 @@ | |||
17 | #ifndef _LINUX_UDP_H | 17 | #ifndef _LINUX_UDP_H |
18 | #define _LINUX_UDP_H | 18 | #define _LINUX_UDP_H |
19 | 19 | ||
20 | #include <linux/types.h> | ||
21 | |||
22 | struct udphdr { | ||
23 | __be16 source; | ||
24 | __be16 dest; | ||
25 | __be16 len; | ||
26 | __sum16 check; | ||
27 | }; | ||
28 | |||
29 | /* UDP socket options */ | ||
30 | #define UDP_CORK 1 /* Never send partially complete segments */ | ||
31 | #define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */ | ||
32 | |||
33 | /* UDP encapsulation types */ | ||
34 | #define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */ | ||
35 | #define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ | ||
36 | #define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */ | ||
37 | |||
38 | #ifdef __KERNEL__ | ||
39 | #include <net/inet_sock.h> | 20 | #include <net/inet_sock.h> |
40 | #include <linux/skbuff.h> | 21 | #include <linux/skbuff.h> |
41 | #include <net/netns/hash.h> | 22 | #include <net/netns/hash.h> |
23 | #include <uapi/linux/udp.h> | ||
42 | 24 | ||
43 | static inline struct udphdr *udp_hdr(const struct sk_buff *skb) | 25 | static inline struct udphdr *udp_hdr(const struct sk_buff *skb) |
44 | { | 26 | { |
45 | return (struct udphdr *)skb_transport_header(skb); | 27 | return (struct udphdr *)skb_transport_header(skb); |
46 | } | 28 | } |
47 | 29 | ||
30 | static inline struct udphdr *inner_udp_hdr(const struct sk_buff *skb) | ||
31 | { | ||
32 | return (struct udphdr *)skb_inner_transport_header(skb); | ||
33 | } | ||
34 | |||
48 | #define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256) | 35 | #define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256) |
49 | 36 | ||
50 | static inline int udp_hashfn(struct net *net, unsigned num, unsigned mask) | 37 | static inline int udp_hashfn(struct net *net, unsigned num, unsigned mask) |
@@ -96,6 +83,4 @@ static inline struct udp_sock *udp_sk(const struct sock *sk) | |||
96 | 83 | ||
97 | #define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) | 84 | #define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) |
98 | 85 | ||
99 | #endif | ||
100 | |||
101 | #endif /* _LINUX_UDP_H */ | 86 | #endif /* _LINUX_UDP_H */ |