X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fudp.h;h=0cf5c4c0ec81fe1afb8b8604241555b881144792;hb=8c363265d57d755e62053e9f69a1f2164e83f7ea;hp=4144664d69d92b645cba61a217eae7886312ec8b;hpb=255333c1db3ec63921de29b134418a4e56e5921e;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/udp.h b/include/linux/udp.h index 4144664d69d..0cf5c4c0ec8 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h @@ -26,15 +26,6 @@ struct udphdr { __sum16 check; }; -#ifdef __KERNEL__ -#include - -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 - #include +#include +#include + +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