Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[pandora-kernel.git] / include / linux / udp.h
index 4144664..0cf5c4c 100644 (file)
@@ -26,15 +26,6 @@ struct udphdr {
        __sum16 check;
 };
 
-#ifdef __KERNEL__
-#include <linux/skbuff.h>
-
-static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
-{
-       return (struct udphdr *)skb_transport_header(skb);
-}
-#endif
-
 /* UDP socket options */
 #define UDP_CORK       1       /* Never send partially complete segments */
 #define UDP_ENCAP      100     /* Set the socket to accept encapsulated packets */
@@ -45,11 +36,22 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
 #define UDP_ENCAP_L2TPINUDP    3 /* rfc2661 */
 
 #ifdef __KERNEL__
-#include <linux/types.h>
-
 #include <net/inet_sock.h>
+#include <linux/skbuff.h>
+#include <net/netns/hash.h>
+
+static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
+{
+       return (struct udphdr *)skb_transport_header(skb);
+}
+
 #define UDP_HTABLE_SIZE                128
 
+static inline int udp_hashfn(struct net *net, const unsigned num)
+{
+       return (num + net_hash_mix(net)) & (UDP_HTABLE_SIZE - 1);
+}
+
 struct udp_sock {
        /* inet_sock has to be the first member */
        struct inet_sock inet;
@@ -70,10 +72,8 @@ struct udp_sock {
 #define UDPLITE_BIT      0x1           /* set by udplite proto init function */
 #define UDPLITE_SEND_CC  0x2           /* set via udplite setsockopt         */
 #define UDPLITE_RECV_CC  0x4           /* set via udplite setsocktopt        */
-#ifdef CONFIG_IP_UDPLITE
        __u8             pcflag;        /* marks socket as UDP-Lite if > 0    */
        __u8             unused[3];
-#endif
        /*
         * For encapsulation sockets.
         */
@@ -85,15 +85,7 @@ static inline struct udp_sock *udp_sk(const struct sock *sk)
        return (struct udp_sock *)sk;
 }
 
-#ifdef CONFIG_IP_UDPLITE
 #define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag)
-#define IS_PROTO_UDPLITE(__proto) ((__proto) == IPPROTO_UDPLITE)
-#define IS_SOL_UDPFAMILY(level) ((level) == SOL_UDP || (level) == SOL_UDPLITE)
-#else
-#define IS_UDPLITE(__sk) 0
-#define IS_PROTO_UDPLITE(__proto) 0
-#define IS_SOL_UDPFAMILY(level) ((level) == SOL_UDP)
-#endif
 
 #endif