]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/igmp.h
PM: introduce hibernation and suspend notifiers
[karo-tx-linux.git] / include / linux / igmp.h
index 03f43e2893a4a6110c55bd50372aeee716e9d113..f510e7e382a89f59c68ddc4e306bb32d8749d2ad 100644 (file)
@@ -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 <linux/skbuff.h>
+
+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 <linux/skbuff.h>
+#include <linux/timer.h>
 #include <linux/in.h>
 
 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