X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=include%2Flinux%2Figmp.h;h=f510e7e382a89f59c68ddc4e306bb32d8749d2ad;hb=a77df5cd1cde203ef11c8e5a3ca47def5f5a1687;hp=03f43e2893a4a6110c55bd50372aeee716e9d113;hpb=5a3e3b2230980cf2ce6e5e56b816dde19b993939;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 03f43e2893a..f510e7e382a 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h @@ -30,7 +30,7 @@ struct igmphdr { __u8 type; __u8 code; /* For newer IGMP */ - __be16 csum; + __sum16 csum; __be32 group; }; @@ -80,6 +80,27 @@ struct igmpv3_query { __be32 srcs[0]; }; +#ifdef __KERNEL__ +#include + +static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb) +{ + return (struct igmphdr *)skb_transport_header(skb); +} + +static inline struct igmpv3_report * + igmpv3_report_hdr(const struct sk_buff *skb) +{ + return (struct igmpv3_report *)skb_transport_header(skb); +} + +static inline struct igmpv3_query * + igmpv3_query_hdr(const struct sk_buff *skb) +{ + return (struct igmpv3_query *)skb_transport_header(skb); +} +#endif + #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ #define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */ #define IGMP_DVMRP 0x13 /* DVMRP routing */ @@ -127,6 +148,7 @@ struct igmpv3_query { #ifdef __KERNEL__ #include +#include #include extern int sysctl_igmp_max_memberships; @@ -191,7 +213,7 @@ struct ip_mc_list #define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value)) #define IGMPV3_EXP(thresh, nbmant, nbexp, value) \ ((value) < (thresh) ? (value) : \ - ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant+nbexp))) << \ + ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant))) << \ (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp)))) #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value) @@ -217,5 +239,7 @@ extern void ip_mc_up(struct in_device *); extern void ip_mc_down(struct in_device *); extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); +extern void ip_mc_rejoin_group(struct ip_mc_list *im); + #endif #endif