svn commit: r189346 - head/sys/netinet

Bruce M Simpson bms at FreeBSD.org
Tue Mar 3 19:01:06 PST 2009


Author: bms
Date: Wed Mar  4 03:01:05 2009
New Revision: 189346
URL: http://svn.freebsd.org/changeset/base/189346

Log:
  Add various defines/macros required by IGMPv3:
   * MCAST_UNDEFINED state.
   * in_allhosts() macro (group is 224.0.0.1).
     This uses a const endian comparison.
   * IP_MAX_GROUP_SRC_FILTER, IP_MAX_SOCK_SRC_FILTER
     default resource limits.

Modified:
  head/sys/netinet/in.h

Modified: head/sys/netinet/in.h
==============================================================================
--- head/sys/netinet/in.h	Wed Mar  4 02:55:04 2009	(r189345)
+++ head/sys/netinet/in.h	Wed Mar  4 03:01:05 2009	(r189346)
@@ -501,7 +501,14 @@ __END_DECLS
  */
 #define	IP_MIN_MEMBERSHIPS	31
 #define	IP_MAX_MEMBERSHIPS	4095
-#define	IP_MAX_SOURCE_FILTER	1024	/* # of filters per socket, per group */
+#define	IP_MAX_SOURCE_FILTER	1024	/* XXX to be unused */
+
+/*
+ * Default resource limits for IPv4 multicast source filtering.
+ * These may be modified by sysctl.
+ */
+#define	IP_MAX_GROUP_SRC_FILTER		512	/* sources per group */
+#define	IP_MAX_SOCK_SRC_FILTER		128	/* sources per socket/group */
 
 /*
  * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
@@ -584,6 +591,7 @@ int	getsourcefilter(int, uint32_t, struc
 /*
  * Filter modes; also used to represent per-socket filter mode internally.
  */
+#define	MCAST_UNDEFINED	0	/* fmode: not yet defined */
 #define	MCAST_INCLUDE	1	/* fmode: include these source(s) */
 #define	MCAST_EXCLUDE	2	/* fmode: exclude these source(s) */
 
@@ -731,6 +739,7 @@ void	 in_ifdetach(struct ifnet *);
 
 #define	in_hosteq(s, t)	((s).s_addr == (t).s_addr)
 #define	in_nullhost(x)	((x).s_addr == INADDR_ANY)
+#define	in_allhosts(x)	((x).s_addr == htonl(INADDR_ALLHOSTS_GROUP))
 
 #define	satosin(sa)	((struct sockaddr_in *)(sa))
 #define	sintosa(sin)	((struct sockaddr *)(sin))


More information about the svn-src-all mailing list