diff options
| author | David Stevens <dlstevens@us.ibm.com> | 2003-04-15 11:46:01 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2003-04-15 11:46:01 -0700 |
| commit | 06da9228364cafd7d5e8229a8f210f1151c32ef9 (patch) | |
| tree | 15024daa8b7148ed34ad91b7716191febc8b7508 /include | |
| parent | 98fab1e40cc093ab9ebb64aa6c4c1a0359b409ec (diff) | |
[IPV6]: Add MLDv2 support.
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/icmpv6.h | 13 | ||||
| -rw-r--r-- | include/linux/in.h | 33 | ||||
| -rw-r--r-- | include/linux/ip.h | 1 | ||||
| -rw-r--r-- | include/linux/tcp.h | 1 | ||||
| -rw-r--r-- | include/linux/udp.h | 1 | ||||
| -rw-r--r-- | include/net/addrconf.h | 67 | ||||
| -rw-r--r-- | include/net/icmp.h | 1 | ||||
| -rw-r--r-- | include/net/if_inet6.h | 42 |
8 files changed, 120 insertions, 39 deletions
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index 2e5fcb59b131..604cef611b6c 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h @@ -86,6 +86,19 @@ struct icmp6hdr { #define ICMPV6_MGM_REPORT 131 #define ICMPV6_MGM_REDUCTION 132 +/* definitions for MLDv2 */ + +#define MLD2_MODE_IS_INCLUDE 1 +#define MLD2_MODE_IS_EXCLUDE 2 +#define MLD2_CHANGE_TO_INCLUDE 3 +#define MLD2_CHANGE_TO_EXCLUDE 4 +#define MLD2_ALLOW_NEW_SOURCES 5 +#define MLD2_BLOCK_OLD_SOURCES 6 + +/* this must be an IANA-assigned value; 206 for testing only */ +#define ICMPV6_MLD2_REPORT 206 +#define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } } + /* * Codes for Destination Unreachable */ diff --git a/include/linux/in.h b/include/linux/in.h index bd2ec6c01f4f..5a5efb354b49 100644 --- a/include/linux/in.h +++ b/include/linux/in.h @@ -90,6 +90,13 @@ struct in_addr { #define IP_ADD_SOURCE_MEMBERSHIP 39 #define IP_DROP_SOURCE_MEMBERSHIP 40 #define IP_MSFILTER 41 +#define MCAST_JOIN_GROUP 42 +#define MCAST_BLOCK_SOURCE 43 +#define MCAST_UNBLOCK_SOURCE 44 +#define MCAST_LEAVE_GROUP 45 +#define MCAST_JOIN_SOURCE_GROUP 46 +#define MCAST_LEAVE_SOURCE_GROUP 47 +#define MCAST_MSFILTER 48 #define MCAST_EXCLUDE 0 #define MCAST_INCLUDE 1 @@ -131,6 +138,32 @@ struct ip_msfilter { (sizeof(struct ip_msfilter) - sizeof(__u32) \ + (numsrc) * sizeof(__u32)) +struct group_req +{ + __u32 gr_interface; /* interface index */ + struct sockaddr_storage gr_group; /* group address */ +}; + +struct group_source_req +{ + __u32 gsr_interface; /* interface index */ + struct sockaddr_storage gsr_group; /* group address */ + struct sockaddr_storage gsr_source; /* source address */ +}; + +struct group_filter +{ + __u32 gf_interface; /* interface index */ + struct sockaddr_storage gf_group; /* multicast address */ + __u32 gf_fmode; /* filter mode */ + __u32 gf_numsrc; /* number of sources */ + struct sockaddr_storage gf_slist[1]; /* interface index */ +}; + +#define GROUP_FILTER_SIZE(numsrc) \ + (sizeof(struct group_filter) - sizeof(struct sockaddr_storage) \ + + (numsrc) * sizeof(struct sockaddr_storage)) + struct in_pktinfo { int ipi_ifindex; diff --git a/include/linux/ip.h b/include/linux/ip.h index 5d3212a73ace..dca25a95d267 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h @@ -79,6 +79,7 @@ #define IPOPT_TS_PRESPEC 3 /* specified modules only */ #ifdef __KERNEL__ +#include <linux/config.h> #include <linux/types.h> #include <net/sock.h> #include <linux/igmp.h> diff --git a/include/linux/tcp.h b/include/linux/tcp.h index da4be9ce631d..f5d9de777530 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -17,6 +17,7 @@ #ifndef _LINUX_TCP_H #define _LINUX_TCP_H +#include <linux/config.h> #include <linux/skbuff.h> #include <asm/byteorder.h> #include <net/sock.h> diff --git a/include/linux/udp.h b/include/linux/udp.h index 2cd62b5b79f3..0d87073be1b4 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h @@ -17,6 +17,7 @@ #ifndef _LINUX_UDP_H #define _LINUX_UDP_H +#include <linux/config.h> #include <asm/byteorder.h> #include <net/sock.h> #include <linux/ip.h> diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 3a63c42022cf..ff3cf48bf7ee 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h @@ -76,49 +76,38 @@ extern void addrconf_leave_solict(struct net_device *dev, /* * multicast prototypes (mcast.c) */ -extern int ipv6_sock_mc_join(struct sock *sk, - int ifindex, - struct in6_addr *addr); -extern int ipv6_sock_mc_drop(struct sock *sk, - int ifindex, - struct in6_addr *addr); -extern void ipv6_sock_mc_close(struct sock *sk); -extern int inet6_mc_check(struct sock *sk, struct in6_addr *addr); - -extern int ipv6_dev_mc_inc(struct net_device *dev, - struct in6_addr *addr); -extern int ipv6_dev_mc_dec(struct net_device *dev, - struct in6_addr *addr); -extern void ipv6_mc_up(struct inet6_dev *idev); -extern void ipv6_mc_down(struct inet6_dev *idev); -extern void ipv6_mc_init_dev(struct inet6_dev *idev); -extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); -extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); - -extern int ipv6_chk_mcast_addr(struct net_device *dev, - struct in6_addr *addr); - -extern void addrconf_prefix_rcv(struct net_device *dev, - u8 *opt, int len); +extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, + struct in6_addr *addr); +extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, + struct in6_addr *addr); +extern void ipv6_sock_mc_close(struct sock *sk); +extern int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr, + struct in6_addr *src_addr); + +extern int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr); +extern int ipv6_dev_mc_dec(struct net_device *dev, struct in6_addr *addr); +extern void ipv6_mc_up(struct inet6_dev *idev); +extern void ipv6_mc_down(struct inet6_dev *idev); +extern void ipv6_mc_init_dev(struct inet6_dev *idev); +extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); +extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); + +extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, + struct in6_addr *src_addr); + +extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len); /* * anycast prototypes (anycast.c) */ -extern int ipv6_sock_ac_join(struct sock *sk, - int ifindex, - struct in6_addr *addr); -extern int ipv6_sock_ac_drop(struct sock *sk, - int ifindex, - struct in6_addr *addr); -extern void ipv6_sock_ac_close(struct sock *sk); -extern int inet6_ac_check(struct sock *sk, struct in6_addr *addr, int ifindex); - -extern int ipv6_dev_ac_inc(struct net_device *dev, - struct in6_addr *addr); -extern int ipv6_dev_ac_dec(struct net_device *dev, - struct in6_addr *addr); -extern int ipv6_chk_acast_addr(struct net_device *dev, - struct in6_addr *addr); +extern int ipv6_sock_ac_join(struct sock *sk,int ifindex,struct in6_addr *addr); +extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex,struct in6_addr *addr); +extern void ipv6_sock_ac_close(struct sock *sk); +extern int inet6_ac_check(struct sock *sk, struct in6_addr *addr, int ifindex); + +extern int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr); +extern int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr); +extern int ipv6_chk_acast_addr(struct net_device *dev, struct in6_addr *addr); /* Device notifier */ diff --git a/include/net/icmp.h b/include/net/icmp.h index 81c6a6c84e02..edefb1387c95 100644 --- a/include/net/icmp.h +++ b/include/net/icmp.h @@ -18,6 +18,7 @@ #ifndef _ICMP_H #define _ICMP_H +#include <linux/config.h> #include <linux/icmp.h> #include <linux/skbuff.h> diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index edf4185f9e7e..59d5a888c921 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h @@ -52,27 +52,58 @@ struct inet6_ifaddr int dead; }; +struct ip6_sf_socklist +{ + unsigned int sl_max; + unsigned int sl_count; + struct in6_addr sl_addr[0]; +}; + +#define IP6_SFLSIZE(count) (sizeof(struct ip6_sf_socklist) + \ + (count) * sizeof(struct in6_addr)) + +#define IP6_SFBLOCK 10 /* allocate this many at once */ + struct ipv6_mc_socklist { struct in6_addr addr; int ifindex; struct ipv6_mc_socklist *next; + unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ + struct ip6_sf_socklist *sflist; +}; + +struct ip6_sf_list +{ + struct ip6_sf_list *sf_next; + struct in6_addr sf_addr; + unsigned long sf_count[2]; /* include/exclude counts */ + unsigned char sf_gsresp; /* include in g & s response? */ + unsigned char sf_oldin; /* change state */ + unsigned char sf_crcount; /* retrans. left to send */ }; #define MAF_TIMER_RUNNING 0x01 #define MAF_LAST_REPORTER 0x02 #define MAF_LOADED 0x04 +#define MAF_NOREPORT 0x08 +#define MAF_GSQUERY 0x10 struct ifmcaddr6 { struct in6_addr mca_addr; struct inet6_dev *idev; struct ifmcaddr6 *next; + struct ip6_sf_list *mca_sources; + struct ip6_sf_list *mca_tomb; + unsigned int mca_sfmode; + unsigned long mca_sfcount[2]; struct timer_list mca_timer; unsigned mca_flags; int mca_users; atomic_t mca_refcnt; spinlock_t mca_lock; + unsigned char mca_crcount; }; /* Anycast stuff */ @@ -126,7 +157,18 @@ struct inet6_dev struct net_device *dev; struct inet6_ifaddr *addr_list; + struct ifmcaddr6 *mc_list; + struct ifmcaddr6 *mc_tomb; + rwlock_t mc_lock; + unsigned long mc_v1_seen; + unsigned long mc_maxdelay; + unsigned char mc_qrv; + unsigned char mc_gq_running; + unsigned char mc_ifc_count; + struct timer_list mc_gq_timer; /* general query timer */ + struct timer_list mc_ifc_timer; /* interface change timer */ + struct ifacaddr6 *ac_list; rwlock_t lock; atomic_t refcnt; |
