FreeBSD/sys/netinet/ip_mroute.c
/*
 * Send the pending bandwidth-related upcalls
 */
Send the pending bandwidth-related upcalls
Send the pending bandwidth - related upcalls
static void
bw_upcalls_send(void)
{
    struct mbuf *m;
    int len = V_bw_upcalls_n * sizeof(V_bw_upcalls[0]);
    struct sockaddr_in k_igmpsrc = { sizeof k_igmpsrc, AF_INET };
    static struct igmpmsg igmpmsg = { 0,		
				      0,		
				      IGMPMSG_BW_UPCALL,
				      0,		
				      0,		
				      0,		
				      { 0 },		
				      { 0 } };		
    MFC_LOCK_ASSERT();
    if (V_bw_upcalls_n == 0)
	return;			
    V_bw_upcalls_n = 0;
    m = m_gethdr(M_NOWAIT, MT_DATA);
    if (m == NULL) {
	log(LOG_WARNING, "bw_upcalls_send: cannot allocate mbuf\n");
	return;
    }
    m_copyback(m, 0, sizeof(struct igmpmsg), (caddr_t)&igmpmsg);
    m_copyback(m, sizeof(struct igmpmsg), len, (caddr_t)&V_bw_upcalls[0]);
    MRTSTAT_INC(mrts_upcalls);
    if (socket_send(V_ip_mrouter, m, &k_igmpsrc) < 0) {
	log(LOG_WARNING, "bw_upcalls_send: ip_mrouter socket queue full\n");
	MRTSTAT_INC(mrts_upq_sockfull);
    }
}
static void bw_upcalls_send ( void ) { struct mbuf * m ; int len = V_bw_upcalls_n * sizeof ( V_bw_upcalls [ 0 ] ) ; struct sockaddr_in k_igmpsrc = { sizeof k_igmpsrc , AF_INET } ; static struct igmpmsg igmpmsg = { 0 , 0 , IGMPMSG_BW_UPCALL , 0 , 0 , 0 , { 0 } , { 0 } } ; MFC_LOCK_ASSERT ( ) ; if ( V_bw_upcalls_n == 0 ) return ; V_bw_upcalls_n = 0 ; m = m_gethdr ( M_NOWAIT , MT_DATA ) ; if ( m == NULL ) { log ( LOG_WARNING , " \n " ) ; return ; } m_copyback ( m , 0 , sizeof ( struct igmpmsg ) , ( caddr_t ) & igmpmsg ) ; m_copyback ( m , sizeof ( struct igmpmsg ) , len , ( caddr_t ) & V_bw_upcalls [ 0 ] ) ; MRTSTAT_INC ( mrts_upcalls ) ; if ( socket_send ( V_ip_mrouter , m , & k_igmpsrc ) < 0 ) { log ( LOG_WARNING , " \n " ) ; MRTSTAT_INC ( mrts_upq_sockfull ) ; } }
Send the pending bandwidth-related upcalls
Send the pending bandwidth - related upcalls
/* unused1 */ /* unused2 */ /* im_msgtype */ /* im_mbz  */ /* im_vif  */ /* unused3 */ /* im_src  */ /* im_dst  */ /* No pending upcalls */ /*
     * Allocate a new mbuf, initialize it with the header and
     * the payload for the pending calls.
     */ /*
     * Send the upcalls
     * XXX do we need to set the address in k_igmpsrc ?
     */