Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in_mcast.c
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | |||||
SX_SYSINIT(in_multi_sx, &in_multi_sx, "in_multi_sx"); | SX_SYSINIT(in_multi_sx, &in_multi_sx, "in_multi_sx"); | ||||
int ifma_restart; | int ifma_restart; | ||||
/* | /* | ||||
* Functions with non-static linkage defined in this file should be | * Functions with non-static linkage defined in this file should be | ||||
* declared in in_var.h: | * declared in in_var.h: | ||||
* imo_multi_filter() | * imo_multi_filter() | ||||
* in_addmulti() | |||||
* in_delmulti() | |||||
* in_joingroup() | * in_joingroup() | ||||
* in_joingroup_locked() | * in_joingroup_locked() | ||||
* in_leavegroup() | * in_leavegroup() | ||||
* in_leavegroup_locked() | * in_leavegroup_locked() | ||||
* and ip_var.h: | * and ip_var.h: | ||||
* inp_freemoptions() | * inp_freemoptions() | ||||
* inp_getmoptions() | * inp_getmoptions() | ||||
* inp_setmoptions() | * inp_setmoptions() | ||||
* | |||||
* XXX: Both carp and pf need to use the legacy (*,G) KPIs in_addmulti() | |||||
* and in_delmulti(). | |||||
*/ | */ | ||||
static void imf_commit(struct in_mfilter *); | static void imf_commit(struct in_mfilter *); | ||||
static int imf_get_source(struct in_mfilter *imf, | static int imf_get_source(struct in_mfilter *imf, | ||||
const struct sockaddr_in *psin, | const struct sockaddr_in *psin, | ||||
struct in_msource **); | struct in_msource **); | ||||
static struct in_msource * | static struct in_msource * | ||||
imf_graft(struct in_mfilter *, const uint8_t, | imf_graft(struct in_mfilter *, const uint8_t, | ||||
const struct sockaddr_in *); | const struct sockaddr_in *); | ||||
▲ Show 20 Lines • Show All 1,218 Lines • ▼ Show 20 Lines | if (error) | ||||
CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); | CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); | ||||
CTR2(KTR_IGMPV3, "%s: dropping ref on %p", __func__, inm); | CTR2(KTR_IGMPV3, "%s: dropping ref on %p", __func__, inm); | ||||
return (error); | return (error); | ||||
} | } | ||||
/*#ifndef BURN_BRIDGES*/ | /*#ifndef BURN_BRIDGES*/ | ||||
/* | |||||
* Join an IPv4 multicast group in (*,G) exclusive mode. | |||||
* The group must be a 224.0.0.0/24 link-scope group. | |||||
* This KPI is for legacy kernel consumers only. | |||||
*/ | |||||
struct in_multi * | |||||
in_addmulti(struct in_addr *ap, struct ifnet *ifp) | |||||
{ | |||||
struct in_multi *pinm; | |||||
int error; | |||||
#ifdef INVARIANTS | |||||
char addrbuf[INET_ADDRSTRLEN]; | |||||
#endif | |||||
KASSERT(IN_LOCAL_GROUP(ntohl(ap->s_addr)), | |||||
("%s: %s not in 224.0.0.0/24", __func__, | |||||
inet_ntoa_r(*ap, addrbuf))); | |||||
error = in_joingroup(ifp, ap, NULL, &pinm); | |||||
if (error != 0) | |||||
pinm = NULL; | |||||
return (pinm); | |||||
} | |||||
/* | /* | ||||
* Block or unblock an ASM multicast source on an inpcb. | * Block or unblock an ASM multicast source on an inpcb. | ||||
* This implements the delta-based API described in RFC 3678. | * This implements the delta-based API described in RFC 3678. | ||||
* | * | ||||
* The delta-based API applies only to exclusive-mode memberships. | * The delta-based API applies only to exclusive-mode memberships. | ||||
* An IGMP downcall will be performed. | * An IGMP downcall will be performed. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 1,686 Lines • Show Last 20 Lines |