in_mcast.c (fa8b3fcb4cbb145eebef6b05ccf96c737a1193f8) | in_mcast.c (f3245be3499b60e790f59f84ebe24f9cc91dd982) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-3-Clause 3 * 4 * Copyright (c) 2007-2009 Bruce Simpson. 5 * Copyright (c) 2005 Robert N. M. Watson. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 106 unchanged lines hidden (view full) --- 115SX_SYSINIT(in_multi_sx, &in_multi_sx, "in_multi_sx"); 116 117int ifma_restart; 118 119/* 120 * Functions with non-static linkage defined in this file should be 121 * declared in in_var.h: 122 * imo_multi_filter() | 1/*- 2 * SPDX-License-Identifier: BSD-3-Clause 3 * 4 * Copyright (c) 2007-2009 Bruce Simpson. 5 * Copyright (c) 2005 Robert N. M. Watson. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 106 unchanged lines hidden (view full) --- 115SX_SYSINIT(in_multi_sx, &in_multi_sx, "in_multi_sx"); 116 117int ifma_restart; 118 119/* 120 * Functions with non-static linkage defined in this file should be 121 * declared in in_var.h: 122 * imo_multi_filter() |
123 * in_addmulti() 124 * in_delmulti() | |
125 * in_joingroup() 126 * in_joingroup_locked() 127 * in_leavegroup() 128 * in_leavegroup_locked() 129 * and ip_var.h: 130 * inp_freemoptions() 131 * inp_getmoptions() 132 * inp_setmoptions() | 123 * in_joingroup() 124 * in_joingroup_locked() 125 * in_leavegroup() 126 * in_leavegroup_locked() 127 * and ip_var.h: 128 * inp_freemoptions() 129 * inp_getmoptions() 130 * inp_setmoptions() |
133 * 134 * XXX: Both carp and pf need to use the legacy (*,G) KPIs in_addmulti() 135 * and in_delmulti(). | |
136 */ 137static void imf_commit(struct in_mfilter *); 138static int imf_get_source(struct in_mfilter *imf, 139 const struct sockaddr_in *psin, 140 struct in_msource **); 141static struct in_msource * 142 imf_graft(struct in_mfilter *, const uint8_t, 143 const struct sockaddr_in *); --- 1218 unchanged lines hidden (view full) --- 1362 CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); 1363 1364 CTR2(KTR_IGMPV3, "%s: dropping ref on %p", __func__, inm); 1365 1366 return (error); 1367} 1368 1369/*#ifndef BURN_BRIDGES*/ | 131 */ 132static void imf_commit(struct in_mfilter *); 133static int imf_get_source(struct in_mfilter *imf, 134 const struct sockaddr_in *psin, 135 struct in_msource **); 136static struct in_msource * 137 imf_graft(struct in_mfilter *, const uint8_t, 138 const struct sockaddr_in *); --- 1218 unchanged lines hidden (view full) --- 1357 CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); 1358 1359 CTR2(KTR_IGMPV3, "%s: dropping ref on %p", __func__, inm); 1360 1361 return (error); 1362} 1363 1364/*#ifndef BURN_BRIDGES*/ |
1370/* 1371 * Join an IPv4 multicast group in (*,G) exclusive mode. 1372 * The group must be a 224.0.0.0/24 link-scope group. 1373 * This KPI is for legacy kernel consumers only. 1374 */ 1375struct in_multi * 1376in_addmulti(struct in_addr *ap, struct ifnet *ifp) 1377{ 1378 struct in_multi *pinm; 1379 int error; 1380#ifdef INVARIANTS 1381 char addrbuf[INET_ADDRSTRLEN]; 1382#endif | |
1383 | 1365 |
1384 KASSERT(IN_LOCAL_GROUP(ntohl(ap->s_addr)), 1385 ("%s: %s not in 224.0.0.0/24", __func__, 1386 inet_ntoa_r(*ap, addrbuf))); 1387 1388 error = in_joingroup(ifp, ap, NULL, &pinm); 1389 if (error != 0) 1390 pinm = NULL; 1391 1392 return (pinm); 1393} 1394 | |
1395/* 1396 * Block or unblock an ASM multicast source on an inpcb. 1397 * This implements the delta-based API described in RFC 3678. 1398 * 1399 * The delta-based API applies only to exclusive-mode memberships. 1400 * An IGMP downcall will be performed. 1401 * 1402 * SMPng: NOTE: Must take Giant as a join may create a new ifma. --- 1685 unchanged lines hidden --- | 1366/* 1367 * Block or unblock an ASM multicast source on an inpcb. 1368 * This implements the delta-based API described in RFC 3678. 1369 * 1370 * The delta-based API applies only to exclusive-mode memberships. 1371 * An IGMP downcall will be performed. 1372 * 1373 * SMPng: NOTE: Must take Giant as a join may create a new ifma. --- 1685 unchanged lines hidden --- |