diff options
author | bms <bms@FreeBSD.org> | 2009-03-04 03:01:05 +0000 |
---|---|---|
committer | bms <bms@FreeBSD.org> | 2009-03-04 03:01:05 +0000 |
commit | 28b42e9e29e039295bbaeda2d239fac5eae5e894 (patch) | |
tree | 7f26fb7c4221d2f6a8a29e645841f40cbe07af76 /sys/netinet | |
parent | da364171714e283d7d17873aeb34a4e2b848654b (diff) | |
download | FreeBSD-src-28b42e9e29e039295bbaeda2d239fac5eae5e894.zip FreeBSD-src-28b42e9e29e039295bbaeda2d239fac5eae5e894.tar.gz |
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.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 591e766..ada44cd 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -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, struct sockaddr *, socklen_t, /* * 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)) |