ip_mroute.c (27529) | ip_mroute.c (29681) |
---|---|
1/* 2 * IP multicast forwarding procedures 3 * 4 * Written by David Waitzman, BBN Labs, August 1988. 5 * Modified by Steve Deering, Stanford, February 1989. 6 * Modified by Mark J. Steiglitz, Stanford, May, 1991 7 * Modified by Van Jacobson, LBL, January 1993 8 * Modified by Ajit Thyagarajan, PARC, August 1993 9 * Modified by Bill Fenner, PARC, April 1995 10 * 11 * MROUTING Revision: 3.5 | 1/* 2 * IP multicast forwarding procedures 3 * 4 * Written by David Waitzman, BBN Labs, August 1988. 5 * Modified by Steve Deering, Stanford, February 1989. 6 * Modified by Mark J. Steiglitz, Stanford, May, 1991 7 * Modified by Van Jacobson, LBL, January 1993 8 * Modified by Ajit Thyagarajan, PARC, August 1993 9 * Modified by Bill Fenner, PARC, April 1995 10 * 11 * MROUTING Revision: 3.5 |
12 * $Id: ip_mroute.c,v 1.39 1997/03/24 11:33:28 bde Exp $ | 12 * $Id: ip_mroute.c,v 1.40 1997/07/19 20:07:07 fenner Exp $ |
13 */ 14 15#include "opt_mrouting.h" 16 17#include <sys/param.h> 18#include <sys/queue.h> 19#include <sys/systm.h> 20#include <sys/mbuf.h> --- 200 unchanged lines hidden (view full) --- 221static u_int mrtdebug = 0; /* debug level */ 222#define DEBUG_MFC 0x02 223#define DEBUG_FORWARD 0x04 224#define DEBUG_EXPIRE 0x08 225#define DEBUG_XMIT 0x10 226static u_int tbfdebug = 0; /* tbf debug level */ 227static u_int rsvpdebug = 0; /* rsvp debug level */ 228 | 13 */ 14 15#include "opt_mrouting.h" 16 17#include <sys/param.h> 18#include <sys/queue.h> 19#include <sys/systm.h> 20#include <sys/mbuf.h> --- 200 unchanged lines hidden (view full) --- 221static u_int mrtdebug = 0; /* debug level */ 222#define DEBUG_MFC 0x02 223#define DEBUG_FORWARD 0x04 224#define DEBUG_EXPIRE 0x08 225#define DEBUG_XMIT 0x10 226static u_int tbfdebug = 0; /* tbf debug level */ 227static u_int rsvpdebug = 0; /* rsvp debug level */ 228 |
229static struct callout_handle expire_upcalls_ch; 230 |
|
229#define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */ 230#define UPCALL_EXPIRE 6 /* number of timeouts */ 231 232/* 233 * Define the token bucket filter structures 234 * tbftable -> each vif has one of these for storing info 235 */ 236 --- 298 unchanged lines hidden (view full) --- 535 536 ip_mrouter = so; 537 538 bzero((caddr_t)mfctable, sizeof(mfctable)); 539 bzero((caddr_t)nexpire, sizeof(nexpire)); 540 541 pim_assert = 0; 542 | 231#define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */ 232#define UPCALL_EXPIRE 6 /* number of timeouts */ 233 234/* 235 * Define the token bucket filter structures 236 * tbftable -> each vif has one of these for storing info 237 */ 238 --- 298 unchanged lines hidden (view full) --- 537 538 ip_mrouter = so; 539 540 bzero((caddr_t)mfctable, sizeof(mfctable)); 541 bzero((caddr_t)nexpire, sizeof(nexpire)); 542 543 pim_assert = 0; 544 |
543 timeout(expire_upcalls, (caddr_t)NULL, EXPIRE_TIMEOUT); | 545 expire_upcalls_ch = timeout(expire_upcalls, (caddr_t)NULL, EXPIRE_TIMEOUT); |
544 545 if (mrtdebug) 546 log(LOG_DEBUG, "ip_mrouter_init\n"); 547 548 return 0; 549} 550 551/* --- 27 unchanged lines hidden (view full) --- 579 if_allmulti(ifp, 0); 580 } 581 } 582 bzero((caddr_t)tbftable, sizeof(tbftable)); 583 bzero((caddr_t)viftable, sizeof(viftable)); 584 numvifs = 0; 585 pim_assert = 0; 586 | 546 547 if (mrtdebug) 548 log(LOG_DEBUG, "ip_mrouter_init\n"); 549 550 return 0; 551} 552 553/* --- 27 unchanged lines hidden (view full) --- 581 if_allmulti(ifp, 0); 582 } 583 } 584 bzero((caddr_t)tbftable, sizeof(tbftable)); 585 bzero((caddr_t)viftable, sizeof(viftable)); 586 numvifs = 0; 587 pim_assert = 0; 588 |
587 untimeout(expire_upcalls, (caddr_t)NULL); | 589 untimeout(expire_upcalls, (caddr_t)NULL, expire_upcalls_ch); |
588 589 /* 590 * Free all multicast forwarding cache entries. 591 */ 592 for (i = 0; i < MFCTBLSIZ; i++) { 593 mb_rt = mfctable[i]; 594 while (mb_rt) { 595 if (mb_rt->m_act != NULL) { --- 775 unchanged lines hidden (view full) --- 1371 1372 MFREE(mb_rt, *nptr); 1373 } else { 1374 nptr = &mb_rt->m_next; 1375 } 1376 } 1377 } 1378 splx(s); | 590 591 /* 592 * Free all multicast forwarding cache entries. 593 */ 594 for (i = 0; i < MFCTBLSIZ; i++) { 595 mb_rt = mfctable[i]; 596 while (mb_rt) { 597 if (mb_rt->m_act != NULL) { --- 775 unchanged lines hidden (view full) --- 1373 1374 MFREE(mb_rt, *nptr); 1375 } else { 1376 nptr = &mb_rt->m_next; 1377 } 1378 } 1379 } 1380 splx(s); |
1379 timeout(expire_upcalls, (caddr_t)NULL, EXPIRE_TIMEOUT); | 1381 expire_upcalls_ch = timeout(expire_upcalls, (caddr_t)NULL, EXPIRE_TIMEOUT); |
1380} 1381 1382/* 1383 * Packet forwarding routine once entry in the cache is made 1384 */ 1385static int 1386ip_mdq(m, ifp, rt, xmt_vif) 1387 register struct mbuf *m; --- 913 unchanged lines hidden --- | 1382} 1383 1384/* 1385 * Packet forwarding routine once entry in the cache is made 1386 */ 1387static int 1388ip_mdq(m, ifp, rt, xmt_vif) 1389 register struct mbuf *m; --- 913 unchanged lines hidden --- |