FreeBSD/sys/netinet/in_mcast.c
/*
 * Function for looking up an in_multi record for an IPv4 multicast address
 * on a given interface. ifp must be valid. If no record found, return NULL.
 * The IN_MULTI_LOCK and IF_ADDR_LOCK on ifp must be held.
 */
Function for looking up an in_multi record for an IPv4 multicast address
on a given interface. ifp must be valid. If no record found, return NULL.
The IN_MULTI_LOCK and IF_ADDR_LOCK on ifp must be held.
Function for looking up an in_multi record for an IPv4 multicast address on a given interface . ifp must be valid . If no record found return NULL . The IN_MULTI_LOCK and IF_ADDR_LOCK on ifp must be held .
struct in_multi *
inm_lookup_locked(struct ifnet *ifp, const struct in_addr ina)
{
	struct ifmultiaddr *ifma;
	struct in_multi *inm;
	IN_MULTI_LOCK_ASSERT();
	IF_ADDR_LOCK_ASSERT(ifp);
	inm = NULL;
	TAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) {
		if (ifma->ifma_addr->sa_family == AF_INET) {
			inm = (struct in_multi *)ifma->ifma_protospec;
			if (inm->inm_addr.s_addr == ina.s_addr)
				break;
			inm = NULL;
		}
	}
	return (inm);
}
struct in_multi * inm_lookup_locked ( struct ifnet * ifp , const struct in_addr ina ) { struct ifmultiaddr * ifma ; struct in_multi * inm ; IN_MULTI_LOCK_ASSERT ( ) ; IF_ADDR_LOCK_ASSERT ( ifp ) ; inm = NULL ; TAILQ_FOREACH ( ifma , & ( ( ifp ) -> if_multiaddrs ) , ifma_link ) { if ( ifma -> ifma_addr -> sa_family == AF_INET ) { inm = ( struct in_multi * ) ifma -> ifma_protospec ; if ( inm -> inm_addr . s_addr == ina . s_addr ) break ; inm = NULL ; } } return ( inm ) ; }
Function for looking up an in_multi record for an IPv4 multicast address
 on a given interface.
Function for looking up an in_multi record for an IPv4 multicast address on a given interface .